double QGIView::getPrefFontSize() { Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Labels"); double fontSize = hGrp->GetFloat("LabelSize", 3.5); return Rez::guiX(fontSize); }
ViewProviderDimension::ViewProviderDimension() { sPixmap = "TechDraw_Dimension"; static const char *group = "Dim Format"; 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(Font ,(fontName.c_str()),group,App::Prop_None, "The name of the font to use"); ADD_PROPERTY_TYPE(Fontsize,(fontSize) ,group,(App::PropertyType)(App::Prop_None),"Dimension text size in units"); hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations"); std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm"); auto lg = TechDraw::LineGroup::lineGroupFactory(lgName); double weight = lg->getWeight("Thin"); delete lg; //Coverity CID 174670 ADD_PROPERTY_TYPE(LineWidth,(weight) ,group,(App::PropertyType)(App::Prop_None),"Dimension line weight"); hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions"); App::Color fcColor; fcColor.setPackedValue(hGrp->GetUnsigned("Color", 0x00000000)); ADD_PROPERTY_TYPE(Color,(fcColor),group,App::Prop_None,"The color of the Dimension"); }
Py::Object ParameterGrpPy::getFloat(const Py::Tuple& args) { char *pstr; double Float=0.0; if (!PyArg_ParseTuple(args.ptr(), "s|d", &pstr,&Float)) throw Py::Exception(); return Py::Float(_cParamGrp->GetFloat(pstr,Float)); }
PyObject *ParameterGrpPy::PyGetFloat(PyObject *args) { char *pstr; double Float=0.0; if (!PyArg_ParseTuple(args, "s|d", &pstr,&Float)) // convert args: Python->C return NULL; // NULL triggers exception PY_TRY { return Py_BuildValue("d",_cParamGrp->GetFloat(pstr,Float)); }PY_CATCH; }