[TD]Add preference for overlapping edge cleaning

This commit is contained in:
wandererfan
2023-04-15 11:01:13 -04:00
committed by WandererFan
parent b85e990807
commit 52754ffde5
4 changed files with 336 additions and 300 deletions

View File

@@ -309,7 +309,6 @@ bool Preferences::lightOnDark()
void Preferences::lightOnDark(bool state)
{
Base::Console().Message("Pref::useLightText - set to %d\n", state);
getPreferenceGroup("Colors")->SetBool("LightOnDark", state);
}
@@ -376,3 +375,8 @@ bool Preferences::autoCorrectDimRefs()
{
return getPreferenceGroup("Dimensions")->GetBool("AutoCorrectRefs", true);
}
int Preferences::scrubCount()
{
return getPreferenceGroup("General")->GetInt("ScrubCount", 0);
}

View File

@@ -99,6 +99,7 @@ public:
static App::Color getAccessibleColor(App::Color orig);
static bool autoCorrectDimRefs();
static int scrubCount();
};
}//end namespace TechDraw

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>444</width>
<height>380</height>
<height>384</height>
</rect>
</property>
<property name="windowTitle">
@@ -40,8 +40,8 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0">
<item row="3" column="0">
<widget class="Gui::PrefCheckBox" name="cbShowLoose">
<item row="11" column="2">
<widget class="Gui::PrefSpinBox" name="sbMaxTiles">
<property name="minimumSize">
<size>
<width>0</width>
@@ -49,38 +49,63 @@
</size>
</property>
<property name="toolTip">
<string>Include 2D Objects in projection</string>
<string>Limit of 64x64 pixel SVG tiles used to hatch a single face.
For large scalings you might get an error about to many SVG tiles.
Then you need to increase the tile limit.</string>
</property>
<property name="text">
<string>Show Loose 2D Geom</string>
<property name="alignment">
<set>Qt::AlignRight</set>
</property>
<property name="checked">
<bool>false</bool>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>10000</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowLoose2d</cstring>
<cstring>MaxSVGTile</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
<cstring>Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Max SVG Hatch Tiles</string>
<item row="2" column="2">
<widget class="Gui::PrefCheckBox" name="cbFuseBeforeSection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Perform a fuse operation on input shape(s) before Section view processing</string>
</property>
<property name="text">
<string>Line End Cap Shape</string>
<string>Fuse Before Section</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>SectionFuseFirst</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
@@ -106,14 +131,106 @@
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Max PAT Hatch Segments</string>
<item row="9" column="2">
<widget class="Gui::PrefDoubleSpinBox" name="pdsbMarkFuzz">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>174</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Selection area around center marks
Each unit is approx. 0.1 mm wide</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>5.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>MarkFuzz</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="6" column="2">
<item row="12" column="2">
<widget class="Gui::PrefSpinBox" name="sbMaxPat">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Maximum hatch line segments to use
when hatching a face with a PAT pattern</string>
</property>
<property name="alignment">
<set>Qt::AlignRight</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>10000</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>MaxSeg</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/PAT</cstring>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Max SVG Hatch Tiles</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefCheckBox" name="cbReportProgress">
<property name="toolTip">
<string>Issue progress messages while building View geometry</string>
</property>
<property name="text">
<string>Report Progress</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ReportProgress</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="Gui::PrefDoubleSpinBox" name="pdsbEdgeFuzz">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -154,7 +271,120 @@ Each unit is approx. 0.1 mm wide</string>
</property>
</widget>
</item>
<item row="8" column="2">
<item row="5" column="2">
<widget class="Gui::PrefCheckBox" name="cbDebugDetail">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Dump intermediate results during Detail view processing</string>
</property>
<property name="text">
<string>Debug Detail</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>debugDetail</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Line End Cap Shape</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_4">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Mark Fuzz</string>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Max PAT Hatch Segments</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="Gui::PrefCheckBox" name="cbCrazyEdges">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Include edges with unexpected geometry (zero length etc.) in results</string>
</property>
<property name="text">
<string>Allow Crazy Edges</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>allowCrazyEdge</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="Gui::PrefCheckBox" name="cbShowSectionEdges">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Highlights border of section cut in section views</string>
</property>
<property name="text">
<string>Show Section Edges</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowSectionEdges</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="Gui::PrefComboBox" name="cbEndCap">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -200,72 +430,8 @@ Only change unless you know what you are doing!</string>
</item>
</widget>
</item>
<item row="2" column="2">
<widget class="Gui::PrefCheckBox" name="cbFuseBeforeSection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Perform a fuse operation on input shape(s) before Section view processing</string>
</property>
<property name="text">
<string>Fuse Before Section</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>SectionFuseFirst</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="Gui::PrefCheckBox" name="cbShowSectionEdges">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Highlights border of section cut in section views</string>
</property>
<property name="text">
<string>Show Section Edges</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowSectionEdges</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="Gui::PrefCheckBox" name="cbCrazyEdges">
<item row="5" column="0">
<widget class="Gui::PrefCheckBox" name="cbDebugSection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -273,60 +439,19 @@ Only change unless you know what you are doing!</string>
</sizepolicy>
</property>
<property name="toolTip">
<string>Include edges with unexpected geometry (zero length etc.) in results</string>
<string>Dump intermediate results during Section view processing</string>
</property>
<property name="text">
<string>Allow Crazy Edges</string>
<string>Debug Section</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>allowCrazyEdge</cstring>
<cstring>debugSection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="Gui::PrefCheckBox" name="cbDebugDetail">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Dump intermediate results during Detail view processing</string>
</property>
<property name="text">
<string>Debug Detail</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>debugDetail</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_4">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Mark Fuzz</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="cbDetectFaces">
<property name="sizePolicy">
@@ -355,7 +480,32 @@ can be a performance penalty in complex models.</string>
</property>
</widget>
</item>
<item row="6" column="0">
<item row="4" column="0">
<widget class="Gui::PrefCheckBox" name="cbShowLoose">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Include 2D Objects in projection</string>
</property>
<property name="text">
<string>Show Loose 2D Geom</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowLoose2d</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
@@ -374,169 +524,6 @@ can be a performance penalty in complex models.</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="Gui::PrefDoubleSpinBox" name="pdsbMarkFuzz">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>174</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Selection area around center marks
Each unit is approx. 0.1 mm wide</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>5.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>MarkFuzz</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefCheckBox" name="cbReportProgress">
<property name="toolTip">
<string>Issue progress messages while building View geometry</string>
</property>
<property name="text">
<string>Report Progress</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ReportProgress</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="Gui::PrefSpinBox" name="sbMaxTiles">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Limit of 64x64 pixel SVG tiles used to hatch a single face.
For large scalings you might get an error about to many SVG tiles.
Then you need to increase the tile limit.</string>
</property>
<property name="alignment">
<set>Qt::AlignRight</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>10000</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>MaxSVGTile</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="Gui::PrefSpinBox" name="sbMaxPat">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Maximum hatch line segments to use
when hatching a face with a PAT pattern</string>
</property>
<property name="alignment">
<set>Qt::AlignRight</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>10000</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>MaxSeg</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/PAT</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="Gui::PrefCheckBox" name="cbDebugSection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Dump intermediate results during Section view processing</string>
</property>
<property name="text">
<string>Debug Section</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>debugSection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="cbNewFaceFinder">
<property name="toolTip">
@@ -556,6 +543,48 @@ when hatching a face with a PAT pattern</string>
</property>
</widget>
</item>
<item row="6" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Overlap Edges Scrub Passes</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="Gui::PrefSpinBox" name="sbScrubCount">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The number of times FreeCAD should try to remove overlapping edges returned by the Hidden Line Removal algorithm. A value of 0 indicates no scrubbing, 1 indicates a single pass and 2 indicates a second pass should be performed. Values above 2 are generally not productive. Each pass adds to the time required to produce the drawing.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="suffix">
<string/>
</property>
<property name="prefix">
<string/>
</property>
<property name="prefEntry" stdset="0">
<cstring>ScrubCount</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>

View File

@@ -59,6 +59,7 @@ void DlgPrefsTechDrawAdvancedImp::saveSettings()
ui->cbReportProgress->onSave();
ui->cbAutoCorrectRefs->onSave();
ui->cbNewFaceFinder->onSave();
ui->sbScrubCount->onSave();
}
void DlgPrefsTechDrawAdvancedImp::loadSettings()
@@ -78,6 +79,7 @@ void DlgPrefsTechDrawAdvancedImp::loadSettings()
ui->cbReportProgress->onRestore();
ui->cbAutoCorrectRefs->onRestore();
ui->cbNewFaceFinder->onRestore();
ui->sbScrubCount->onRestore();
}
/**