Implement LineGroups for default weights

- Add ability to control default weight for visible,
  hidden and decorative lines from a configuration
  file. Diffent sets of defaults can be specified as
  a preference.
This commit is contained in:
WandererFan
2017-12-01 14:01:18 -05:00
committed by wmayer
parent 214782a2de
commit 4756cfab4e
10 changed files with 360 additions and 28 deletions

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>521</width>
<height>554</height>
<height>587</height>
</rect>
</property>
<property name="windowTitle">
@@ -94,7 +94,7 @@
<number>1</number>
</property>
<property name="value">
<double>4.000000000000000</double>
<double>3.500000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>FontSize</cstring>
@@ -254,7 +254,7 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>5.000000000000000</double>
<double>3.500000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>ArrowSize</cstring>
@@ -290,7 +290,7 @@
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2" columnstretch="1,0,0">
<item row="0" column="2">
<item row="1" column="2">
<widget class="Gui::PrefComboBox" name="pcbMatting">
<property name="prefEntry" stdset="0">
<cstring>MattingStyle</cstring>
@@ -310,28 +310,28 @@
</item>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Section Line Style</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Center Line Style</string>
</property>
</widget>
</item>
<item row="0" column="0">
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Matting Style</string>
</property>
</widget>
</item>
<item row="2" column="2">
<item row="3" column="2">
<widget class="Gui::PrefColorButton" name="colCenterLine">
<property name="color">
<color>
@@ -348,7 +348,7 @@
</property>
</widget>
</item>
<item row="1" column="2">
<item row="2" column="2">
<widget class="Gui::PrefComboBox" name="pcbCenterStyle">
<property name="currentIndex">
<number>2</number>
@@ -391,7 +391,7 @@
</item>
</widget>
</item>
<item row="3" column="2">
<item row="4" column="2">
<widget class="Gui::PrefComboBox" name="pcbSectionStyle">
<property name="currentIndex">
<number>2</number>
@@ -434,21 +434,21 @@
</item>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Center Line Color</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Section Line Color</string>
</property>
</widget>
</item>
<item row="4" column="2">
<item row="5" column="2">
<widget class="Gui::PrefColorButton" name="colSectionLine">
<property name="color">
<color>
@@ -465,7 +465,7 @@
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -478,7 +478,7 @@
</property>
</spacer>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_10">
<property name="toolTip">
<string>Default weight for GeomHatch lines</string>
@@ -488,7 +488,7 @@
</property>
</widget>
</item>
<item row="5" column="2">
<item row="6" column="2">
<widget class="Gui::PrefDoubleSpinBox" name="doubleSpinBox">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -504,6 +504,26 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Line Group </string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefLineEdit" name="leLineGroup">
<property name="text">
<string>FC 0.70mm</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>LineGroup</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">

View File

@@ -56,6 +56,7 @@ void DlgPrefsTechDraw2Imp::saveSettings()
cbGlobalDecimals->onSave();
sbAltDecimals->onSave();
dsbArrowSize->onSave();
leLineGroup->onSave();
}
void DlgPrefsTechDraw2Imp::loadSettings()
@@ -73,6 +74,7 @@ void DlgPrefsTechDraw2Imp::loadSettings()
cbGlobalDecimals->onRestore();
sbAltDecimals->onRestore();
dsbArrowSize->onRestore();
leLineGroup->onRestore();
}
/**

View File

@@ -642,7 +642,7 @@ void QGIViewPart::drawSectionLine(TechDraw::DrawViewSection* viewSection, bool b
yVal = sectionSpan / 2.0;
}
sectionLine->setBounds(-xVal,-yVal,xVal,yVal);
sectionLine->setWidth(Rez::guiX(viewPart->LineWidth.getValue())); //TODO: add fudge to make sectionLine thinner than reg lines?
sectionLine->setWidth(Rez::guiX(viewPart->IsoWidth.getValue()));
sectionLine->setFont(m_font,Rez::guiX(6.0));
sectionLine->setZValue(ZVALUE::SECTIONLINE);
sectionLine->setRotation(viewPart->Rotation.getValue());
@@ -673,7 +673,7 @@ void QGIViewPart::drawCenterLines(bool b)
xVal = sectionSpan / 2.0;
yVal = 0.0;
centerLine->setBounds(-xVal,-yVal,xVal,yVal);
//centerLine->setWidth(viewPart->LineWidth.getValue());
centerLine->setWidth(Rez::guiX(viewPart->IsoWidth.getValue()));
centerLine->setZValue(ZVALUE::SECTIONLINE);
centerLine->setRotation(viewPart->Rotation.getValue());
centerLine->draw();
@@ -686,7 +686,7 @@ void QGIViewPart::drawCenterLines(bool b)
xVal = 0.0;
yVal = sectionSpan / 2.0;
centerLine->setBounds(-xVal,-yVal,xVal,yVal);
//centerLine->setWidth(viewPart->LineWidth.getValue());
centerLine->setWidth(Rez::guiX(viewPart->IsoWidth.getValue()));
centerLine->setZValue(ZVALUE::SECTIONLINE);
centerLine->setRotation(viewPart->Rotation.getValue());
centerLine->draw();
@@ -714,7 +714,7 @@ void QGIViewPart::drawHighlight(TechDraw::DrawViewDetail* viewDetail, bool b)
Base::Vector3d center = viewDetail->AnchorPoint.getValue() * viewPart->getScale();
double radius = viewDetail->Radius.getValue() * viewPart->getScale();
highlight->setBounds(center.x - radius, center.y + radius,center.x + radius, center.y - radius);
highlight->setWidth(Rez::guiX(viewPart->LineWidth.getValue()));
highlight->setWidth(Rez::guiX(viewPart->IsoWidth.getValue()));
highlight->setFont(m_font,Rez::guiX(6.0));
highlight->setZValue(ZVALUE::HIGHLIGHT);
highlight->draw();