[TD] Variable line stretching distance
This commit is contained in:
@@ -1456,7 +1456,7 @@ void execExtendShortenLine(Gui::Command* cmd, bool extend) {
|
||||
}
|
||||
double scale = objFeat->getScale();
|
||||
Base::Vector3d direction = (P1 - P0).Normalize();
|
||||
Base::Vector3d delta = direction * 2.0;
|
||||
Base::Vector3d delta = direction * activeDimAttributes.getLineStretch();
|
||||
Base::Vector3d startPt, endPt;
|
||||
if (extend) {
|
||||
startPt = P0 - delta;
|
||||
|
||||
@@ -180,6 +180,7 @@ App::Color lineAttributes::getColorValue(void)
|
||||
dimAttributes::dimAttributes(void)
|
||||
{
|
||||
cascadeSpacing = 7.0;
|
||||
lineStretch = 2.0;
|
||||
}
|
||||
|
||||
void dimAttributes::setCascadeSpacing(double spacing)
|
||||
@@ -187,6 +188,11 @@ void dimAttributes::setCascadeSpacing(double spacing)
|
||||
cascadeSpacing = spacing;
|
||||
}
|
||||
|
||||
void dimAttributes::setLineStretch(double stretch)
|
||||
{
|
||||
lineStretch = stretch;
|
||||
}
|
||||
|
||||
dimAttributes activeDimAttributes; // container holding dimension attributes
|
||||
|
||||
//===========================================================================
|
||||
@@ -291,6 +297,8 @@ void TaskSelectLineAttributes::setUiEdit()
|
||||
|
||||
double cascadeSpacing = activeDimAttributes.getCascadeSpacing();
|
||||
ui->sbSpacing->setValue(cascadeSpacing);
|
||||
double lineStretching = activeDimAttributes.getLineStretch();
|
||||
ui->sbStretch->setValue(lineStretching);
|
||||
|
||||
}
|
||||
|
||||
@@ -355,6 +363,8 @@ bool TaskSelectLineAttributes::accept()
|
||||
|
||||
double cascadeSpacing = ui->sbSpacing->value();
|
||||
activeDimAttributes.setCascadeSpacing(cascadeSpacing);
|
||||
double lineStretching = ui->sbStretch->value();
|
||||
activeDimAttributes.setLineStretch(lineStretching);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -32,12 +32,15 @@
|
||||
|
||||
class dimAttributes {
|
||||
double cascadeSpacing;
|
||||
double lineStretch;
|
||||
|
||||
public:
|
||||
|
||||
dimAttributes(void);
|
||||
void setCascadeSpacing(double);
|
||||
double getCascadeSpacing(void) {return cascadeSpacing;}
|
||||
void setLineStretch(double);
|
||||
double getLineStretch(void) {return lineStretch;}
|
||||
|
||||
}; // class dimAttributes
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>350</width>
|
||||
<height>406</height>
|
||||
<width>250</width>
|
||||
<height>482</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -31,17 +31,17 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_styles">
|
||||
<property name="text">
|
||||
<string>Line style:</string>
|
||||
<string>Linestyles:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="rbSolid">
|
||||
<property name="toolTip">
|
||||
<string>Set line style to solid</string>
|
||||
<string>Set Line style to solid</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Solid</string>
|
||||
<string>solid</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -54,7 +54,7 @@
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="rbDashed">
|
||||
<property name="text">
|
||||
<string>Dashed</string>
|
||||
<string>dashed</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -67,7 +67,7 @@
|
||||
<item row="3" column="0">
|
||||
<widget class="QRadioButton" name="rbDotted">
|
||||
<property name="text">
|
||||
<string>Dotted</string>
|
||||
<string>dotted</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -80,7 +80,7 @@
|
||||
<item row="4" column="0">
|
||||
<widget class="QRadioButton" name="rbDashDotted">
|
||||
<property name="text">
|
||||
<string>Dashdot</string>
|
||||
<string>dashdot</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@@ -100,14 +100,14 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_width">
|
||||
<property name="text">
|
||||
<string>Line width:</string>
|
||||
<string>Lineswidth:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="rbThin">
|
||||
<property name="text">
|
||||
<string>Thin 0,18</string>
|
||||
<string>thin 0,18</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -120,7 +120,7 @@
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="rbMiddle">
|
||||
<property name="text">
|
||||
<string>Middle 0,35</string>
|
||||
<string>middle 0,35</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@@ -136,7 +136,7 @@
|
||||
<item row="3" column="0">
|
||||
<widget class="QRadioButton" name="rbThick">
|
||||
<property name="text">
|
||||
<string>Thick 0,70</string>
|
||||
<string>thick 0,70</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -153,14 +153,14 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_colors">
|
||||
<property name="text">
|
||||
<string>Line color:</string>
|
||||
<string>Linecolors:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="rbBlack">
|
||||
<property name="text">
|
||||
<string>Black</string>
|
||||
<string>black</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@@ -176,7 +176,7 @@
|
||||
<item row="1" column="1">
|
||||
<widget class="QRadioButton" name="rbBlue">
|
||||
<property name="text">
|
||||
<string>Blue</string>
|
||||
<string>blue</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -189,7 +189,7 @@
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="rbGrey">
|
||||
<property name="text">
|
||||
<string>Grey</string>
|
||||
<string>grey</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -202,7 +202,7 @@
|
||||
<item row="2" column="1">
|
||||
<widget class="QRadioButton" name="rbMagenta">
|
||||
<property name="text">
|
||||
<string>Magenta</string>
|
||||
<string>magenta</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -215,7 +215,7 @@
|
||||
<item row="3" column="0">
|
||||
<widget class="QRadioButton" name="rbRed">
|
||||
<property name="text">
|
||||
<string>Red</string>
|
||||
<string>red</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -228,7 +228,7 @@
|
||||
<item row="3" column="1">
|
||||
<widget class="QRadioButton" name="rbCyan">
|
||||
<property name="text">
|
||||
<string>Cyan</string>
|
||||
<string>cyan</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -241,7 +241,7 @@
|
||||
<item row="4" column="0">
|
||||
<widget class="QRadioButton" name="rbGreen">
|
||||
<property name="text">
|
||||
<string>Green</string>
|
||||
<string>green</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -254,7 +254,7 @@
|
||||
<item row="4" column="1">
|
||||
<widget class="QRadioButton" name="rbYellow">
|
||||
<property name="text">
|
||||
<string>Yellow</string>
|
||||
<string>yellow</string>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
@@ -267,27 +267,45 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="horizontalGroupBox">
|
||||
<layout class="QHBoxLayout" name="Spin001">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_spacing">
|
||||
<property name="text">
|
||||
<string>Cascade spacing</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="sbSpacing">
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>7.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layout class="QGridLayout" name="cascadeValues" rowstretch="0,0" columnstretch="0,0">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_spacing">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cascade spacing</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QDoubleSpinBox" name="sbSpacing">
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_stretch">
|
||||
<property name="text">
|
||||
<string>Delta distance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="sbStretch">
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -296,12 +314,12 @@
|
||||
</resources>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="bgLineWidth">
|
||||
<buttongroup name="bgLineStyles">
|
||||
<property name="exclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</buttongroup>
|
||||
<buttongroup name="bgLineStyles">
|
||||
<buttongroup name="bgLineWidth">
|
||||
<property name="exclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user