[TechDraw] Simplify retrievement of user preferences

for all TechDraw files
This commit is contained in:
Benjamin Bræstrup Sayoc
2023-04-09 16:18:55 +02:00
committed by WandererFan
parent 50c2b7e9d8
commit 5d05acc87e
36 changed files with 101 additions and 355 deletions

View File

@@ -96,9 +96,7 @@ App::Color LineFormat::getDefEdgeColor()
int LineFormat::getDefEdgeStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
int style = hGrp->GetInt("CosmoCLStyle", 2); //dashed
int style = Preferences::getPreferenceGroup("Decorations")->GetInt("CosmoCLStyle", 2); //dashed
return style;
}
@@ -507,8 +505,6 @@ PyObject* GeomFormat::getPyObject()
bool CosmeticVertex::restoreCosmetic()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
return hGrp->GetBool("restoreCosmetic", true);
return Preferences::getPreferenceGroup("General")->GetBool("restoreCosmetic", true);
}

View File

@@ -594,10 +594,8 @@ std::string DrawGeomHatch::prefGeomHatchFile()
std::string DrawGeomHatch::prefGeomHatchName()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT");
std::string defaultNamePattern = "Diamond";
std::string result = hGrp->GetASCII("NamePattern", defaultNamePattern.c_str());
std::string result = Preferences::getPreferenceGroup("PAT")->GetASCII("NamePattern", defaultNamePattern.c_str());
if (result.empty()) {
return defaultNamePattern;
}
@@ -606,10 +604,8 @@ std::string DrawGeomHatch::prefGeomHatchName()
App::Color DrawGeomHatch::prefGeomHatchColor()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("GeomHatch", 0x00FF0000));
fcColor.setPackedValue(Preferences::getPreferenceGroup("Colors")->GetUnsigned("GeomHatch", 0x00FF0000));
return fcColor;
}

View File

@@ -223,10 +223,8 @@ std::string DrawHatch::prefSvgHatch(void)
App::Color DrawHatch::prefSvgHatchColor(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("Hatch", 0x00FF0000));
fcColor.setPackedValue(Preferences::getPreferenceGroup("Colors")->GetUnsigned("Hatch", 0x00FF0000));
return fcColor;
}

View File

@@ -22,7 +22,6 @@
#include "PreCompiled.h"
#include <App/Application.h>
#include <Base/Console.h>
#include <Base/Parameter.h>
@@ -30,6 +29,7 @@
#include "DrawLeaderLinePy.h" // generated from DrawLeaderLinePy.xml
#include "ArrowPropEnum.h"
#include "DrawView.h"
#include "Preferences.h"
using namespace TechDraw;
@@ -247,9 +247,7 @@ Base::Vector3d DrawLeaderLine::getTailPoint() const
bool DrawLeaderLine::getDefAuto() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/LeaderLine");
return hGrp->GetBool("AutoHorizontal", true);
return Preferences::getPreferenceGroup("LeaderLine")->GetBool("AutoHorizontal", true);
}

View File

@@ -75,12 +75,7 @@ DrawPage::DrawPage(void)
ProjectionType.setEnums(ProjectionTypeEnums);
ADD_PROPERTY(ProjectionType, ((long)Preferences::projectionAngle()));
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
double defScale = hGrp->GetFloat("DefaultScale", 1.0);
double defScale = Preferences::getPreferenceGroup("General")->GetFloat("DefaultScale", 1.0);
ADD_PROPERTY_TYPE(Scale, (defScale), group, (App::PropertyType)(App::Prop_None),
"Scale factor for this Page");
@@ -464,23 +459,13 @@ bool DrawPage::hasObject(App::DocumentObject* obj)
//allow/prevent drawing updates for all Pages
bool DrawPage::GlobalUpdateDrawings(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
return hGrp->GetBool("GlobalUpdateDrawings", true);
return Preferences::getPreferenceGroup("General")->GetBool("GlobalUpdateDrawings", true);
}
//allow/prevent a single page to update despite GlobalUpdateDrawings setting
bool DrawPage::AllowPageOverride(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
return hGrp->GetBool("AllowPageOverride", true);
return Preferences::getPreferenceGroup("General")->GetBool("AllowPageOverride", true);
}

View File

@@ -61,12 +61,7 @@ DrawProjGroup::DrawProjGroup()
static const char* group = "Base";
static const char* agroup = "Distribute";
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
bool autoDist = hGrp->GetBool("AutoDist", true);
bool autoDist = Preferences::getPreferenceGroup("General")->GetBool("AutoDist", true);
ADD_PROPERTY_TYPE(Source, (nullptr), group, App::Prop_None, "Shape to view");
Source.setScope(App::LinkScope::Global);

View File

@@ -57,7 +57,6 @@
#include <gp_Vec.hxx>
#endif
#include <App/Application.h>
#include <Base/Console.h>
#include <Base/FileInfo.h>
#include <Base/Parameter.h>
@@ -68,6 +67,7 @@
#include "DrawUtil.h"
#include "GeometryObject.h"
#include "LineGroup.h"
#include "Preferences.h"
using namespace TechDraw;
@@ -979,12 +979,7 @@ bool DrawUtil::isCrazy(TopoDS_Edge e)
return true;
}
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/debug");
bool crazyOK = hGrp->GetBool("allowCrazyEdge", false);
bool crazyOK = Preferences::getPreferenceGroup("debug")->GetBool("allowCrazyEdge", false);
if (crazyOK) {
return false;
}

View File

@@ -571,17 +571,13 @@ void DrawView::setScaleAttribute()
int DrawView::prefScaleType()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
int result = hGrp->GetInt("DefaultScaleType", 0);
int result = Preferences::getPreferenceGroup("General")->GetInt("DefaultScaleType", 0);
return result;
}
double DrawView::prefScale()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
double result = hGrp->GetFloat("DefaultViewScale", 1.0);
double result = Preferences::getPreferenceGroup("General")->GetFloat("DefaultViewScale", 1.0);
if (ScaleType.isValue("Page")) {
auto page = findParentPage();
if (page) {

View File

@@ -450,13 +450,7 @@ double DrawViewDetail::getFudgeRadius() { return Radius.getValue() * m_fudge; }
bool DrawViewDetail::debugDetail() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/debug");
return hGrp->GetBool("debugDetail", false);
return Preferences::getPreferenceGroup("debug")->GetBool("debugDetail", false);
}
void DrawViewDetail::unsetupObject()

View File

@@ -1817,12 +1817,7 @@ bool DrawViewDimension::hasOverUnderTolerance() const
bool DrawViewDimension::showUnits() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/Dimensions");
return hGrp->GetBool("ShowUnits", false);
return Preferences::getPreferenceGroup("Dimensions")->GetBool("ShowUnits", false);
}
bool DrawViewDimension::useDecimals() const { return Preferences::useGlobalDecimals(); }
@@ -1833,12 +1828,7 @@ std::string DrawViewDimension::getPrefixForDimType() const
return "R";
}
else if (Type.isValue("Diameter")) {
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/Dimensions");
return std::string(hGrp->GetASCII("DiameterSymbol", "\xe2\x8c\x80"));// Diameter symbol
return std::string(Preferences::getPreferenceGroup("Dimensions")->GetASCII("DiameterSymbol", "\xe2\x8c\x80"));// Diameter symbol
}
return "";

View File

@@ -53,7 +53,6 @@
#include <sstream>
#endif
#include <App/Application.h>
#include <App/Document.h>
#include <Base/BoundBox.h>
#include <Base/Console.h>
@@ -77,6 +76,7 @@
#include "Geometry.h"
#include "GeometryObject.h"
#include "ShapeExtractor.h"
#include "Preferences.h"
using namespace TechDraw;
@@ -101,12 +101,7 @@ DrawViewPart::DrawViewPart(void)
CosmeticExtension::initExtension(this);
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
double defDist = hGrp->GetFloat("FocusDistance", 100.0);
double defDist = Preferences::getPreferenceGroup("General")->GetFloat("FocusDistance", 100.0);
//properties that affect Geometry
ADD_PROPERTY_TYPE(Source, (nullptr), group, App::Prop_None, "3D Shape to view");
@@ -124,7 +119,7 @@ DrawViewPart::DrawViewPart(void)
ADD_PROPERTY_TYPE(Focus, (defDist), group, App::Prop_None, "Perspective view focus distance");
//properties that control HLR algo
bool coarseView = hGrp->GetBool("CoarseView", false);
bool coarseView = Preferences::getPreferenceGroup("General")->GetBool("CoarseView", false);
ADD_PROPERTY_TYPE(CoarseView, (coarseView), sgroup, App::Prop_None, "Coarse View on/off");
ADD_PROPERTY_TYPE(SmoothVisible, (prefSmoothViz()), sgroup, App::Prop_None,
"Show Visible Smooth lines");
@@ -1220,22 +1215,12 @@ const BaseGeomPtrVector DrawViewPart::getVisibleFaceEdges() const
bool DrawViewPart::handleFaces()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
return hGrp->GetBool("HandleFaces", 1l);
return Preferences::getPreferenceGroup("General")->GetBool("HandleFaces", 1l);
}
bool DrawViewPart::newFaceFinder(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
return hGrp->GetBool("NewFaceFinder", 0l);
return Preferences::getPreferenceGroup("General")->GetBool("NewFaceFinder", 0l);
}
//! remove features that are useless without this DVP
@@ -1674,92 +1659,47 @@ void DrawViewPart::handleChangedPropertyName(Base::XMLReader& reader, const char
bool DrawViewPart::prefHardViz()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/HLR");
return hGrp->GetBool("HardViz", true);
return Preferences::getPreferenceGroup("HLR")->GetBool("HardViz", true);
}
bool DrawViewPart::prefSeamViz()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/HLR");
return hGrp->GetBool("SeamViz", true);
return Preferences::getPreferenceGroup("HLR")->GetBool("SeamViz", true);
}
bool DrawViewPart::prefSmoothViz()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/HLR");
return hGrp->GetBool("SmoothViz", true);
return Preferences::getPreferenceGroup("HLR")->GetBool("SmoothViz", true);
}
bool DrawViewPart::prefIsoViz()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/HLR");
return hGrp->GetBool("IsoViz", false);
return Preferences::getPreferenceGroup("HLR")->GetBool("IsoViz", false);
}
bool DrawViewPart::prefHardHid()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/HLR");
return hGrp->GetBool("HardHid", false);
return Preferences::getPreferenceGroup("HLR")->GetBool("HardHid", false);
}
bool DrawViewPart::prefSeamHid()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/HLR");
return hGrp->GetBool("SeamHid", false);
return Preferences::getPreferenceGroup("HLR")->GetBool("SeamHid", false);
}
bool DrawViewPart::prefSmoothHid()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/HLR");
return hGrp->GetBool("SmoothHid", false);
return Preferences::getPreferenceGroup("HLR")->GetBool("SmoothHid", false);
}
bool DrawViewPart::prefIsoHid()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/HLR");
return hGrp->GetBool("IsoHid", false);
return Preferences::getPreferenceGroup("HLR")->GetBool("IsoHid", false);
}
int DrawViewPart::prefIsoCount()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/HLR");
return hGrp->GetBool("IsoCount", 0);
return Preferences::getPreferenceGroup("HLR")->GetBool("IsoCount", 0);
}
// Python Drawing feature ---------------------------------------------------------

View File

@@ -75,7 +75,6 @@
#include <QtConcurrentRun>
#endif
#include <App/Application.h>
#include <App/Document.h>
#include <Base/BoundBox.h>
#include <Base/Console.h>
@@ -90,6 +89,7 @@
#include "DrawUtil.h"
#include "EdgeWalker.h"
#include "GeometryObject.h"
#include "Preferences.h"
#include "DrawViewSection.h"
@@ -1174,47 +1174,25 @@ void DrawViewSection::replacePatIncluded(std::string newPatFile)
void DrawViewSection::getParameters()
{
// Base::Console().Message("DVS::getParameters()\n");
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
bool fuseFirst = hGrp->GetBool("SectionFuseFirst", false);
bool fuseFirst = Preferences::getPreferenceGroup("General")->GetBool("SectionFuseFirst", false);
FuseBeforeCut.setValue(fuseFirst);
}
bool DrawViewSection::debugSection(void) const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/debug");
return hGrp->GetBool("debugSection", false);
return Preferences::getPreferenceGroup("debug")->GetBool("debugSection", false);
}
int DrawViewSection::prefCutSurface(void) const
{
// Base::Console().Message("DVS::prefCutSurface()\n");
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/Decorations");
return hGrp->GetInt("CutSurfaceDisplay", 2);//default to SvgHatch
return Preferences::getPreferenceGroup("Decorations")->GetInt("CutSurfaceDisplay", 2);//default to SvgHatch
}
bool DrawViewSection::showSectionEdges(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
return (hGrp->GetBool("ShowSectionEdges", true));
return (Preferences::getPreferenceGroup("General")->GetBool("ShowSectionEdges", true));
}
bool DrawViewSection::trimAfterCut() const { return TrimAfterCut.getValue(); }

View File

@@ -32,7 +32,6 @@
# include <TopoDS_Vertex.hxx>
#endif
#include <App/Application.h>
#include <App/Document.h>
#include <App/GroupExtension.h>
#include <App/Link.h>
@@ -45,6 +44,7 @@
#include "ShapeExtractor.h"
#include "DrawUtil.h"
#include "Preferences.h"
using namespace TechDraw;
@@ -425,9 +425,7 @@ Base::Vector3d ShapeExtractor::getLocation3dFromFeat(App::DocumentObject* obj)
bool ShapeExtractor::prefAdd2d()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
bool result = hGrp->GetBool("ShowLoose2d", false);
bool result = Preferences::getPreferenceGroup("General")->GetBool("ShowLoose2d", false);
return result;
}

View File

@@ -81,20 +81,16 @@ QColor PreferencesGui::preselectQColor()
App::Color PreferencesGui::sectionLineColor()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("SectionColor", 0x000000FF));
fcColor.setPackedValue(Preferences::getPreferenceGroup("Decorations")->GetUnsigned("SectionColor", 0x000000FF));
return fcColor;
}
QColor PreferencesGui::sectionLineQColor()
{
//if the App::Color version has already lightened the color, we don't want to do it again
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("SectionColor", 0x000000FF));
fcColor.setPackedValue(Preferences::getPreferenceGroup("Decorations")->GetUnsigned("SectionColor", 0x000000FF));
return fcColor.asValue<QColor>();
}

View File

@@ -30,16 +30,16 @@
# include <QStyleOptionGraphicsItem>
#endif
#include <App/Application.h>
#include <Base/Console.h>
#include <Base/Parameter.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "QGCustomText.h"
#include "PreferencesGui.h"
#include "QGICMark.h"
#include "ZVALUE.h"
using namespace TechDraw;
using namespace TechDrawGui;
QGCustomText::QGCustomText(QGraphicsItem* parent) :
@@ -235,9 +235,7 @@ QColor QGCustomText::getSelectColor()
Base::Reference<ParameterGrp> QGCustomText::getParmGroup()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
return hGrp;
return Preferences::getPreferenceGroup("Colors");
}
void QGCustomText::makeMark(double x, double y)

View File

@@ -29,13 +29,14 @@
# include <QStyleOptionGraphicsItem>
#endif
#include <App/Application.h>
#include <App/Material.h>
#include <Base/Parameter.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "QGICMark.h"
#include "PreferencesGui.h"
using namespace TechDraw;
using namespace TechDrawGui;
QGICMark::QGICMark(int index) : QGIVertex(index)
@@ -100,9 +101,7 @@ QPainterPath QGICMark::shape() const
double QGICMark::getMarkFuzz() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
double result = hGrp->GetFloat("MarkFuzz", 5.0);
double result = Preferences::getPreferenceGroup("General")->GetFloat("MarkFuzz", 5.0);
return result;
}

View File

@@ -29,13 +29,14 @@
# include <QStyleOptionGraphicsItem>
#endif
#include <App/Application.h>
#include <Base/Parameter.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "QGICenterLine.h"
#include "PreferencesGui.h"
using namespace TechDraw;
using namespace TechDrawGui;
QGICenterLine::QGICenterLine()
@@ -77,9 +78,7 @@ QColor QGICenterLine::getCenterColor()
Qt::PenStyle QGICenterLine::getCenterStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
Qt::PenStyle centerStyle = static_cast<Qt::PenStyle> (hGrp->GetInt("CenterLine", 2));
Qt::PenStyle centerStyle = static_cast<Qt::PenStyle> (Preferences::getPreferenceGroup("Decorations")->GetInt("CenterLine", 2));
return centerStyle;
}

View File

@@ -82,19 +82,15 @@ void QGIEdge::setPrettyNormal() {
QColor QGIEdge::getHiddenColor()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("HiddenColor", 0x000000FF));
App::Color fcColor = App::Color((uint32_t) Preferences::getPreferenceGroup("Colors")->GetUnsigned("HiddenColor", 0x000000FF));
return PreferencesGui::getAccessibleQColor(fcColor.asValue<QColor>());
}
Qt::PenStyle QGIEdge::getHiddenStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
//Qt::PenStyle - NoPen, Solid, Dashed, ...
//Preferences::General - Solid, Dashed
Qt::PenStyle hidStyle = static_cast<Qt::PenStyle> (hGrp->GetInt("HiddenLine", 0) + 1);
Qt::PenStyle hidStyle = static_cast<Qt::PenStyle> (Preferences::getPreferenceGroup("General")->GetInt("HiddenLine", 0) + 1);
return hidStyle;
}

View File

@@ -704,23 +704,13 @@ void QGIFace::setLineWeight(double w) {
void QGIFace::getParameters()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT");
m_maxSeg = Preferences::getPreferenceGroup("PAT")->GetInt("MaxSeg", 10000l);
m_maxTile = Preferences::getPreferenceGroup("Decorations")->GetInt("MaxSVGTile", 10000l);
m_maxSeg = hGrp->GetInt("MaxSeg", 10000l);
hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
m_maxTile = hGrp->GetInt("MaxSVGTile", 10000l);
hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color temp {static_cast<uint32_t>(hGrp->GetUnsigned("FaceColor",0xffffffff))};
App::Color temp {static_cast<uint32_t>(Preferences::getPreferenceGroup("Colors")->GetUnsigned("FaceColor",0xffffffff))};
setFillColor(temp.asValue<QColor>());
hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
m_defClearFace = hGrp->GetBool("ClearFace", false);
m_defClearFace = Preferences::getPreferenceGroup("Colors")->GetBool("ClearFace", false);
}
QRectF QGIFace::boundingRect() const

View File

@@ -243,19 +243,15 @@ void QGIPrimPath::setCapStyle(Qt::PenCapStyle c)
Base::Reference<ParameterGrp> QGIPrimPath::getParmGroup()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
return hGrp;
return Preferences::getPreferenceGroup("Colors");
}
//EdgeCapStyle param changed from UInt (Qt::PenCapStyle) to Int (QComboBox index)
Qt::PenCapStyle QGIPrimPath::prefCapStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
Qt::PenCapStyle result;
int newStyle;
newStyle = hGrp->GetInt("EdgeCapStyle", 32); //0x00 FlatCap, 0x10 SquareCap, 0x20 RoundCap
newStyle = Preferences::getPreferenceGroup("General")->GetInt("EdgeCapStyle", 32); //0x00 FlatCap, 0x10 SquareCap, 0x20 RoundCap
switch (newStyle) {
case 0:
result = static_cast<Qt::PenCapStyle>(0x20); //round;

View File

@@ -165,12 +165,7 @@ void QGISVGTemplate::createClickHandles()
//TODO: Find location of special fields (first/third angle) and make graphics items for them
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
double editClickBoxSize = Rez::guiX(hGrp->GetFloat("TemplateDotSize", 3.0));
double editClickBoxSize = Rez::guiX(Preferences::getPreferenceGroup("General")->GetFloat("TemplateDotSize", 3.0));
QColor editClickBoxColor = Qt::green;
editClickBoxColor.setAlpha(128);//semi-transparent

View File

@@ -487,9 +487,7 @@ Qt::PenStyle QGISectionLine::getSectionStyle()
//ASME("traditional") vs ISO("reference arrow method") arrows
int QGISectionLine::getPrefSectionStandard()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Standards");
int format = hGrp->GetInt("SectionLineStandard", ISOSTANDARD);
int format = Preferences::getPreferenceGroup("Standards")->GetInt("SectionLineStandard", ISOSTANDARD);
return format;
}

View File

@@ -322,17 +322,13 @@ bool QGITile::getAltWeld()
//TODO: this is Pen, not Brush. sb Brush to colour background
QColor QGITile::getTileColor() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("TileColor", 0x00000000));
App::Color fcColor = App::Color((uint32_t) Preferences::getPreferenceGroup("Colors")->GetUnsigned("TileColor", 0x00000000));
return PreferencesGui::getAccessibleQColor( fcColor.asValue<QColor>());
}
double QGITile::getSymbolWidth() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
double w = hGrp->GetFloat("SymbolSize", 64);
double w = Preferences::getPreferenceGroup("Dimensions")->GetFloat("SymbolSize", 64);
// symbols are only nominally 64x64. they actually have a "border" of 4 - 0.5*stroke(0.5)
// so we'll say effectively 62x62? 60 x 60
// double w = 64.0;
@@ -344,9 +340,7 @@ double QGITile::getSymbolWidth() const
double QGITile::getSymbolHeight() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
double h = hGrp->GetFloat("SymbolSize", 64);
double h = Preferences::getPreferenceGroup("Dimensions")->GetFloat("SymbolSize", 64);
double fudge = 4.0;
h = h - fudge;
// double h = 60.0;
@@ -357,17 +351,14 @@ double QGITile::getSymbolHeight() const
//make symbols larger or smaller than standard
double QGITile::getSymbolFactor() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
double s = hGrp->GetFloat("SymbolFactor", 1.25);
double s = Preferences::getPreferenceGroup("Decorations")->GetFloat("SymbolFactor", 1.25);
// double s = 1.25;
return s;
}
double QGITile::prefFontSize() const
{
// Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
// GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
// Base::Reference<ParameterGrp> hGrp = Preferences::getPreferenceGroup("Dimensions");
return Preferences::dimFontSizeMM();
}

View File

@@ -942,12 +942,7 @@ int QGIViewBalloon::prefDefaultArrow() const { return Preferences::balloonArrow(
//when would you want a crooked pyramid?
bool QGIViewBalloon::prefOrthoPyramid() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/Decorations");
bool ortho = hGrp->GetBool("PyramidOrtho", true);
bool ortho = Preferences::getPreferenceGroup("Decorations")->GetBool("PyramidOrtho", true);
return ortho;
}

View File

@@ -407,12 +407,7 @@ int QGIDatumLabel::getPrecision()
precision = Base::UnitsApi::getDecimals();
}
else {
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/Dimensions");
precision = hGrp->GetInt("AltDecimals", 2);
precision = Preferences::getPreferenceGroup("Dimensions")->GetInt("AltDecimals", 2);
}
return precision;
}
@@ -420,12 +415,7 @@ int QGIDatumLabel::getPrecision()
double QGIDatumLabel::getTolAdjust()
{
double adjust;
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/Dimensions");
adjust = hGrp->GetFloat("TolSizeAdjust", 0.50);
adjust = Preferences::getPreferenceGroup("Dimensions")->GetFloat("TolSizeAdjust", 0.50);
return adjust;
}

View File

@@ -566,12 +566,7 @@ void QGIViewPart::drawViewPart()
// Draw Vertexs:
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
double vertexScaleFactor = hGrp->GetFloat("VertexScale", 3.0);
double vertexScaleFactor = Preferences::getPreferenceGroup("General")->GetFloat("VertexScale", 3.0);
QColor vertexColor = PreferencesGui::getAccessibleQColor(PreferencesGui::vertexQColor());
bool showVertices = true;
bool showCenterMarks = true;
@@ -1285,22 +1280,12 @@ void QGIViewPart::rotateView() {}
bool QGIViewPart::prefFaceEdges()
{
bool result = false;
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
result = hGrp->GetBool("DrawFaceEdges", 0l);
result = Preferences::getPreferenceGroup("General")->GetBool("DrawFaceEdges", 0l);
return result;
}
bool QGIViewPart::prefPrintCenters()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/Decorations");
bool printCenters = hGrp->GetBool("PrintCenterMarks", false);//true matches v0.18 behaviour
bool printCenters = Preferences::getPreferenceGroup("Decorations")->GetBool("PrintCenterMarks", false);//true matches v0.18 behaviour
return printCenters;
}

View File

@@ -32,7 +32,6 @@
#include <QTextStream>
#endif
#include <App/Application.h>
#include <App/Document.h>
#include <Base/Console.h>
#include <Base/Parameter.h>
@@ -60,6 +59,7 @@
#include <Mod/TechDraw/App/DrawViewSpreadsheet.h>
#include <Mod/TechDraw/App/DrawViewSymbol.h>
#include <Mod/TechDraw/App/DrawWeldSymbol.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "MDIViewPage.h"
#include "QGIDrawingTemplate.h"
@@ -1271,13 +1271,8 @@ TechDraw::DrawPage* QGSPage::getDrawPage() { return m_vpPage->getDrawPage(); }
QColor QGSPage::getBackgroundColor()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("Background", 0x70707000));
fcColor.setPackedValue(Preferences::getPreferenceGroup("Colors")->GetUnsigned("Background", 0x70707000));
return fcColor.asValue<QColor>();
}

View File

@@ -35,9 +35,9 @@
# include <QTransform>
#endif
#include <App/Application.h>
#include <Base/Console.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "PreferencesGui.h"
#include "QGTracker.h"
@@ -47,6 +47,7 @@
#include "ZVALUE.h"
using namespace TechDraw;
using namespace TechDrawGui;
QGTracker::QGTracker(QGSPage* inScene, TrackerMode m):
@@ -475,9 +476,7 @@ void QGTracker::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QColor QGTracker::getTrackerColor()
{
QColor result;
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Tracker");
App::Color trackColor = App::Color((uint32_t) hGrp->GetUnsigned("TrackerColor", 0xFF000000));
App::Color trackColor = App::Color((uint32_t) Preferences::getPreferenceGroup("Tracker")->GetUnsigned("TrackerColor", 0xFF000000));
result = PreferencesGui::getAccessibleQColor(trackColor.asValue<QColor>());
return result;
}
@@ -485,9 +484,7 @@ QColor QGTracker::getTrackerColor()
double QGTracker::getTrackerWeight()
{
double result = 1.0;
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Tracker");
result = hGrp->GetFloat("TrackerWeight", 4.0);
result = Preferences::getPreferenceGroup("Tracker")->GetFloat("TrackerWeight", 4.0);
return result;
}

View File

@@ -30,12 +30,14 @@
#include <App/Application.h>
#include <Base/Parameter.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "QGSPage.h"
#include "QGVNavStyle.h"
#include "QGVPage.h"
using namespace TechDraw;
using namespace TechDrawGui;
namespace TechDrawGui
@@ -63,13 +65,8 @@ void QGVNavStyle::initialize()
.GetParameterGroupByPath("User parameter:BaseApp/Preferences/View")
->GetFloat("ZoomStep", 0.2f);
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
m_reversePan = hGrp->GetInt("KbPan", 1);
m_reverseScroll = hGrp->GetInt("KbScroll", 1);
m_reversePan = Preferences::getPreferenceGroup("General")->GetInt("KbPan", 1);
m_reverseScroll = Preferences::getPreferenceGroup("General")->GetInt("KbScroll", 1);
panningActive = false;
zoomingActive = false;

View File

@@ -126,13 +126,8 @@ public:
page->m_invertZoom = hGrp->GetBool("InvertZoom", 0l);
page->m_zoomIncrement = hGrp->GetFloat("ZoomStep", 0.02);
auto hTDPref = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/General");
page->m_reversePan = hTDPref->GetInt("KbPan", 1);
page->m_reverseScroll = hTDPref->GetInt("KbScroll", 1);
page->m_reversePan = Preferences::getPreferenceGroup("General")->GetInt("KbPan", 1);
page->m_reverseScroll = Preferences::getPreferenceGroup("General")->GetInt("KbScroll", 1);
}
/// Observer message from the ParameterGrp
void OnChange(ParameterGrp::SubjectType& rCaller, ParameterGrp::MessageType Reason) override
@@ -504,13 +499,8 @@ TechDraw::DrawPage* QGVPage::getDrawPage() { return m_vpPage->getDrawPage(); }
QColor QGVPage::getBackgroundColor()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("Background", 0x70707000));
fcColor.setPackedValue(Preferences::getPreferenceGroup("Colors")->GetUnsigned("Background", 0x70707000));
return fcColor.asValue<QColor>();
}

View File

@@ -22,12 +22,12 @@
#include "PreCompiled.h"
#include <App/Application.h>
#include <Base/Parameter.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "Rez.h"
using namespace TechDraw;
using namespace TechDrawGui;
//*** initial static var outside methods!
@@ -123,9 +123,7 @@ QSize Rez::appSize(QSize s)
double Rez::getParameter()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Rez");
double rezFactor = hGrp->GetFloat("Resolution", 10.0);
double rezFactor = Preferences::getPreferenceGroup("Rez")->GetFloat("Resolution", 10.0);
return rezFactor;
}

View File

@@ -417,9 +417,7 @@ double TaskCenterLine::getCenterWidth()
Qt::PenStyle TaskCenterLine::getCenterStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
Qt::PenStyle centerStyle = static_cast<Qt::PenStyle> (hGrp->GetInt("CenterLine", 2));
Qt::PenStyle centerStyle = static_cast<Qt::PenStyle> (Preferences::getPreferenceGroup("Decorations")->GetInt("CenterLine", 2));
return centerStyle;
}
@@ -430,9 +428,7 @@ QColor TaskCenterLine::getCenterColor()
double TaskCenterLine::getExtendBy()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
double ext = hGrp->GetFloat("CosmoCLExtend", 3.0);
double ext = Preferences::getPreferenceGroup("Decorations")->GetFloat("CosmoCLExtend", 3.0);
return ext;
}

View File

@@ -244,10 +244,7 @@ double ViewProviderDimension::prefWeight() const
int ViewProviderDimension::prefStandardAndStyle() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->
GetGroup("Mod/TechDraw/Dimensions");
int standardStyle = hGrp->GetInt("StandardAndStyle", STD_STYLE_ISO_ORIENTED);
int standardStyle = Preferences::getPreferenceGroup("Dimensions")->GetInt("StandardAndStyle", STD_STYLE_ISO_ORIENTED);
return standardStyle;
}

View File

@@ -92,11 +92,8 @@ ViewProviderViewPart::ViewProviderViewPart()
weight = TechDraw::LineGroup::getDefaultWidth("Extra");
ADD_PROPERTY_TYPE(ExtraWidth, (weight), group, App::Prop_None, "The thickness of LineGroup Extra lines, if enabled");
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
double defScale = hGrp->GetFloat("CenterMarkScale", 0.50);
bool defShowCenters = hGrp->GetBool("ShowCenterMarks", false);
double defScale = Preferences::getPreferenceGroup("Decorations")->GetFloat("CenterMarkScale", 0.50);
bool defShowCenters = Preferences::getPreferenceGroup("Decorations")->GetBool("ShowCenterMarks", false);
//decorations
ADD_PROPERTY_TYPE(HorizCenterLine ,(false), dgroup, App::Prop_None, "Show a horizontal centerline through view");
@@ -357,18 +354,14 @@ App::Color ViewProviderViewPart::prefSectionColor()
App::Color ViewProviderViewPart::prefHighlightColor()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("HighlightColor", 0x00000000));
fcColor.setPackedValue(Preferences::getPreferenceGroup("Decorations")->GetUnsigned("HighlightColor", 0x00000000));
return fcColor;
}
int ViewProviderViewPart::prefHighlightStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
return hGrp->GetInt("HighlightStyle", 2);
return Preferences::getPreferenceGroup("Decorations")->GetInt("HighlightStyle", 2);
}

View File

@@ -30,7 +30,6 @@
# endif
#endif
#include <App/Application.h>
#include <App/DocumentObject.h>
#include <Base/Parameter.h>
#include <Gui/Control.h>
@@ -39,12 +38,16 @@
#include <Mod/TechDraw/App/DrawComplexSection.h>
#include <Mod/TechDraw/App/DrawGeomHatch.h>
#include <Mod/TechDraw/App/DrawHatch.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "TaskSectionView.h"
#include "TaskComplexSection.h"
#include "ViewProviderViewSection.h"
#include "QGIView.h"
using namespace TechDraw;
using namespace TechDrawGui;
PROPERTY_SOURCE(TechDrawGui::ViewProviderViewSection, TechDrawGui::ViewProviderViewPart)
@@ -144,17 +147,13 @@ bool ViewProviderViewSection::doubleClicked()
void ViewProviderViewSection::getParameters()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color cutColor = App::Color((uint32_t) hGrp->GetUnsigned("CutSurfaceColor", 0xD3D3D3FF));
App::Color cutColor = App::Color((uint32_t) Preferences::getPreferenceGroup("Colors")->GetUnsigned("CutSurfaceColor", 0xD3D3D3FF));
CutSurfaceColor.setValue(cutColor);
// App::Color hatchColor = App::Color((uint32_t) hGrp->GetUnsigned("SectionHatchColor", 0x00000000));
// HatchColor.setValue(hatchColor);
hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT");
double lineWeight = hGrp->GetFloat("GeomWeight", 0.1);
double lineWeight = Preferences::getPreferenceGroup("PAT")->GetFloat("GeomWeight", 0.1);
WeightPattern.setValue(lineWeight);
}

View File

@@ -126,10 +126,7 @@ double ViewProviderWeld::prefFontSize()
double ViewProviderWeld::prefTileTextAdjust()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->
GetGroup("Mod/TechDraw/Dimensions");
double adjust = hGrp->GetFloat("TileTextAdjust", 0.75);
double adjust = Preferences::getPreferenceGroup("Dimensions")->GetFloat("TileTextAdjust", 0.75);
return adjust;
}