Sketcher: Improve validation ui to select whether to ignore construction geometry or not

========================================================================================

Users generally expect that validate Sketch checks the visible part, perhaps because it is not called from the sketcher's edit view, but from the 3D view, perhaps
because that part is relevant for further construction.

On the other hand the tool's name is Validate Sketch and construction geometry belongs to the sketch.

So a new checkbox is introduced, by default enabled to ignore construction, but still allowing the user to make it operate in one direction or the other.

See:
https://forum.freecadweb.org/viewtopic.php?f=3&t=26139&p=208582#p208693
This commit is contained in:
Abdullah Tahiri
2018-01-11 10:44:49 +01:00
committed by wmayer
parent 7599292287
commit 0d21e94d3f
2 changed files with 17 additions and 6 deletions

View File

@@ -70,6 +70,7 @@ SketcherValidation::SketcherValidation(Sketcher::SketchObject* Obj, QWidget* par
ui->fixButton->setEnabled(false);
ui->fixConstraint->setEnabled(false);
ui->swapReversed->setEnabled(false);
ui->checkBoxIgnoreConstruction->setEnabled(true);
double tolerances[8] = {
Precision::Confusion() / 100,
Precision::Confusion() / 10,
@@ -180,7 +181,7 @@ void SketcherValidation::on_findButton_clicked()
for (std::size_t i=0; i<geom.size(); i++) {
Part::Geometry* g = geom[i];
if(g->Construction)
if(g->Construction && ui->checkBoxIgnoreConstruction->isChecked())
continue;
if (g->getTypeId() == Part::GeomLineSegment::getClassTypeId()) {

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>242</width>
<height>423</height>
<width>311</width>
<height>453</height>
</rect>
</property>
<property name="windowTitle">
@@ -57,7 +57,7 @@
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QPushButton" name="fixButton">
<property name="text">
<string>Fix</string>
@@ -67,20 +67,30 @@
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxTolerance"/>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QPushButton" name="findButton">
<property name="text">
<string>Find</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<widget class="QPushButton" name="highlightButton">
<property name="text">
<string>Highlight open vertexes</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxIgnoreConstruction">
<property name="text">
<string>Ignore construction geometry</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>