Dimension Graphic Properties to Gui side

This commit is contained in:
WandererFan
2018-02-14 15:39:51 -05:00
parent 99fcba4992
commit 679f26af58
6 changed files with 95 additions and 77 deletions

View File

@@ -87,30 +87,13 @@ enum RefType{
DrawViewDimension::DrawViewDimension(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Labels");
std::string fontName = hGrp->GetASCII("LabelFont", "osifont");
hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
double fontSize = hGrp->GetFloat("FontSize", 3.5);
ADD_PROPERTY_TYPE(References2D,(0,0),"",(App::PropertyType)(App::Prop_None),"Projected Geometry References");
References2D.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(References3D,(0,0),"",(App::PropertyType)(App::Prop_None),"3D Geometry References");
References3D.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(Font ,(fontName.c_str()),"Format",App::Prop_None, "The name of the font to use");
ADD_PROPERTY_TYPE(Fontsize,(fontSize) ,"Format",(App::PropertyType)(App::Prop_None),"Dimension text size in mm");
ADD_PROPERTY_TYPE(FormatSpec,(getDefaultFormatSpec().c_str()) ,
"Format",(App::PropertyType)(App::Prop_None),"Dimension Format");
hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm");
auto lg = LineGroup::lineGroupFactory(lgName);
double weight = lg->getWeight("Graphic");
delete lg; //Coverity CID 169507
ADD_PROPERTY_TYPE(LineWidth,(weight) ,"Format",(App::PropertyType)(App::Prop_None),"Dimension line weight");
//ADD_PROPERTY_TYPE(CentreLines,(0) ,"Format",(App::PropertyType)(App::Prop_None),"Arc Dimension Center Mark");
Type.setEnums(TypeEnums); //dimension type: length, radius etc
ADD_PROPERTY(Type,((long)0));
MeasureType.setEnums(MeasureTypeEnums);
@@ -178,6 +161,7 @@ short DrawViewDimension::mustExecute() const
if (!isRestoring()) {
result = (References2D.isTouched() ||
Type.isTouched() ||
FormatSpec.isTouched() ||
MeasureType.isTouched());
}
if (result) {