[TD]add static routine for default line weights

This commit is contained in:
wandererfan
2019-12-23 15:03:41 -05:00
committed by WandererFan
parent b5f12376a9
commit f252aaff68
2 changed files with 21 additions and 0 deletions

View File

@@ -197,3 +197,20 @@ LineGroup* LineGroup::lineGroupFactory(std::string groupName)
}
return lg;
}
//valid weight names: Thick, Thin, Graphic, Extra
double LineGroup::getDefaultWidth(std::string weightName, std::string groupName)
{
//default line weights
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
std::string lgName = groupName;
if (groupName.empty()) {
lgName = hGrp->GetASCII("LineGroup","FC 0.70mm");
}
auto lg = TechDraw::LineGroup::lineGroupFactory(lgName);
double weight = lg->getWeight(weightName);
delete lg;
return weight;
}

View File

@@ -55,6 +55,10 @@ public:
//static LineGroup maker
static LineGroup* lineGroupFactory(std::string groupName);
static double getDefaultWidth(std::string weightName,
std::string groupName = std::string());
protected:
void init(void);