+ issue #0001203: Allow User to Adjust Size of Constraint Points
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "TaskSketcherGeneral.h"
|
||||
#include <App/Application.h>
|
||||
#include <Gui/PrefWidgets.h>
|
||||
#include <Gui/Inventor/MarkerBitmaps.h>
|
||||
|
||||
using namespace SketcherGui;
|
||||
|
||||
@@ -120,6 +121,10 @@ void SketcherSettings::saveSettings()
|
||||
ui->checkBoxAdvancedSolverTaskBox->onSave();
|
||||
form->saveSettings();
|
||||
|
||||
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
|
||||
int markerSize = ui->EditSketcherMarkerSize->itemData(ui->EditSketcherMarkerSize->currentIndex()).toInt();
|
||||
hViewGrp->SetInt("EditSketcherMarkerSize", markerSize);
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part");
|
||||
QVariant data = ui->comboBox->itemData(ui->comboBox->currentIndex());
|
||||
int pattern = data.toInt();
|
||||
@@ -154,6 +159,16 @@ void SketcherSettings::loadSettings()
|
||||
ui->checkBoxAdvancedSolverTaskBox->onRestore();
|
||||
form->loadSettings();
|
||||
|
||||
std::list<int> sizes = Gui::Inventor::MarkerBitmaps::getSupportedSizes("CIRCLE_FILLED");
|
||||
for (std::list<int>::iterator it = sizes.begin(); it != sizes.end(); ++it)
|
||||
ui->EditSketcherMarkerSize->addItem(tr("%1 px").arg(*it), *it);
|
||||
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
|
||||
int markerSize = hViewGrp->GetInt("EditSketcherMarkerSize", 7);
|
||||
int markerIndex = ui->EditSketcherMarkerSize->findData(QVariant(markerSize));
|
||||
if (markerIndex < 0)
|
||||
markerIndex = 1;
|
||||
ui->EditSketcherMarkerSize->setCurrentIndex(markerIndex);
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part");
|
||||
int pattern = hGrp->GetInt("GridLinePattern", 0x0f0f);
|
||||
int index = ui->comboBox->findData(QVariant(pattern));
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<property name="toolTip">
|
||||
<string>The color of edges being edited</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
@@ -73,7 +73,7 @@
|
||||
<property name="toolTip">
|
||||
<string>The color of vertices being edited</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
@@ -106,7 +106,7 @@
|
||||
<property name="toolTip">
|
||||
<string>The color of edges being edited</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
@@ -139,7 +139,7 @@
|
||||
<property name="toolTip">
|
||||
<string>The color of vertices being edited</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>38</green>
|
||||
@@ -172,7 +172,7 @@
|
||||
<property name="toolTip">
|
||||
<string>The color of fully constrained geometry in edit mode</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>38</green>
|
||||
@@ -192,7 +192,7 @@
|
||||
<property name="toolTip">
|
||||
<string>The color of construction geometry in edit mode</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
@@ -225,7 +225,7 @@
|
||||
<property name="toolTip">
|
||||
<string>The color of external geometry in edit mode</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>204</red>
|
||||
<green>51</green>
|
||||
@@ -271,7 +271,7 @@
|
||||
<property name="toolTip">
|
||||
<string>The color of fully constrained geometry in edit mode</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
@@ -397,7 +397,7 @@
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<widget class="Gui::PrefColorButton" name="CursorTextColor">
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
@@ -446,7 +446,7 @@
|
||||
<property name="toolTip">
|
||||
<string>The color of driving constraints in edit mode</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>38</green>
|
||||
@@ -466,7 +466,7 @@
|
||||
<property name="toolTip">
|
||||
<string>The color of non-driving constrains or dimensions in edit mode</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>38</green>
|
||||
@@ -493,63 +493,71 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>182</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Font size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefSpinBox" name="EditSketcherFontSize">
|
||||
<property name="suffix">
|
||||
<string>px</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>17</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>EditSketcherFontSize</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>View</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>182</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Font size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Gui::PrefSpinBox" name="EditSketcherFontSize">
|
||||
<property name="suffix">
|
||||
<string>px</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>17</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>EditSketcherFontSize</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>View</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Grid line pattern</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QLabel" name="label_marker">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>182</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Marker size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="EditSketcherMarkerSize"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Grid line pattern</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="Gui::PrefCheckBox" name="dialogOnDistanceConstraint">
|
||||
<property name="text">
|
||||
<string>Ask for value after creating a distance constraint</string>
|
||||
@@ -565,7 +573,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="Gui::PrefCheckBox" name="continueMode">
|
||||
<property name="text">
|
||||
<string>Geometry Creation "Continue Mode"</string>
|
||||
|
||||
@@ -96,6 +96,7 @@
|
||||
#include <Gui/DlgEditFileIncludeProptertyExternal.h>
|
||||
#include <Gui/SoFCBoundingBox.h>
|
||||
#include <Gui/SoFCUnifiedSelection.h>
|
||||
#include <Gui/Inventor/MarkerBitmaps.h>
|
||||
|
||||
#include <Mod/Part/App/Geometry.h>
|
||||
#include <Mod/Sketcher/App/SketchObject.h>
|
||||
@@ -155,6 +156,7 @@ struct EditData {
|
||||
PreselectPoint(-1),
|
||||
PreselectCurve(-1),
|
||||
PreselectCross(-1),
|
||||
MarkerSize(7),
|
||||
blockedPreselection(false),
|
||||
FullyConstrained(false),
|
||||
//ActSketch(0), // if you are wondering, it went to SketchObject, accessible via getSketchObject()->getSolvedSketch()
|
||||
@@ -183,6 +185,7 @@ struct EditData {
|
||||
int PreselectPoint;
|
||||
int PreselectCurve;
|
||||
int PreselectCross;
|
||||
int MarkerSize;
|
||||
std::set<int> PreselectConstraintSet;
|
||||
bool blockedPreselection;
|
||||
bool FullyConstrained;
|
||||
@@ -1011,9 +1014,8 @@ bool ViewProviderSketch::mouseMove(const SbVec2s &cursorPos, Gui::View3DInventor
|
||||
Mode != STATUS_SKETCH_DragConstraint &&
|
||||
Mode != STATUS_SKETCH_UseRubberBand) {
|
||||
|
||||
SoPickedPoint *pp = this->getPointOnRay(cursorPos, viewer);
|
||||
preselectChanged = detectPreselection(pp, viewer, cursorPos);
|
||||
delete pp;
|
||||
boost::scoped_ptr<SoPickedPoint> pp(this->getPointOnRay(cursorPos, viewer));
|
||||
preselectChanged = detectPreselection(pp.get(), viewer, cursorPos);
|
||||
}
|
||||
|
||||
switch (Mode) {
|
||||
@@ -4206,6 +4208,9 @@ bool ViewProviderSketch::setEdit(int ModNum)
|
||||
assert(!edit);
|
||||
edit = new EditData();
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
|
||||
edit->MarkerSize = hGrp->GetInt("EditSketcherMarkerSize", 7);
|
||||
|
||||
createEditInventorNodes();
|
||||
edit->visibleBeforeEdit = this->isVisible();
|
||||
this->hide(); // avoid that the wires interfere with the edit lines
|
||||
@@ -4213,7 +4218,6 @@ bool ViewProviderSketch::setEdit(int ModNum)
|
||||
ShowGrid.setValue(true);
|
||||
TightGrid.setValue(false);
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
|
||||
float transparency;
|
||||
|
||||
// set the point color
|
||||
@@ -4417,7 +4421,7 @@ void ViewProviderSketch::createEditInventorNodes(void)
|
||||
|
||||
edit->PointSet = new SoMarkerSet;
|
||||
edit->PointSet->setName("PointSet");
|
||||
edit->PointSet->markerIndex = SoMarkerSet::CIRCLE_FILLED_7_7;
|
||||
edit->PointSet->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex("CIRCLE_FILLED", edit->MarkerSize);
|
||||
pointsRoot->addChild(edit->PointSet);
|
||||
|
||||
// stuff for the Curves +++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
Reference in New Issue
Block a user