Merge pull request #11494 from Ondsel-Development/Coincident
[Sketcher] Introduce an optional unified version of coincident and pointOnObject
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -66,6 +66,8 @@ void SketcherSettings::saveSettings()
|
||||
ui->checkBoxEnableEscape->onSave();
|
||||
ui->checkBoxNotifyConstraintSubstitutions->onSave();
|
||||
ui->checkBoxAutoRemoveRedundants->onSave();
|
||||
ui->checkBoxUnifiedCoincident->onSave();
|
||||
ui->checkBoxHorVerAuto->onSave();
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -133,6 +135,8 @@ void SketcherSettings::loadSettings()
|
||||
ui->checkBoxEnableEscape->onRestore();
|
||||
ui->checkBoxNotifyConstraintSubstitutions->onRestore();
|
||||
ui->checkBoxAutoRemoveRedundants->onRestore();
|
||||
ui->checkBoxUnifiedCoincident->onRestore();
|
||||
ui->checkBoxHorVerAuto->onRestore();
|
||||
|
||||
// Dimensioning constraints mode
|
||||
ui->dimensioningMode->clear();
|
||||
|
||||
@@ -159,6 +159,44 @@ Requires to re-enter edit mode to take effect.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="checkBoxUnifiedCoincident">
|
||||
<property name="toolTip">
|
||||
<string>Unify Coincident and PointOnObject in a single tool.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unify Coincident and PointOnObject</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>UnifiedCoincident</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Sketcher/Constraints</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="checkBoxHorVerAuto">
|
||||
<property name="toolTip">
|
||||
<string>Use the automatic horizontal/vertical constraint tool. This create a command group in which you have the auto tool, horizontal and vertical.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auto tool for Horizontal/Vertical</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AutoHorVer</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Sketcher/Constraints</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -428,9 +428,17 @@ inline void SketcherAddWorkbenchConstraints(T& cons);
|
||||
template<>
|
||||
inline void SketcherAddWorkbenchConstraints<Gui::MenuItem>(Gui::MenuItem& cons)
|
||||
{
|
||||
cons << "Sketcher_ConstrainCoincident"
|
||||
<< "Sketcher_ConstrainPointOnObject"
|
||||
<< "Sketcher_ConstrainVertical"
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
|
||||
"User parameter:BaseApp/Preferences/Mod/Sketcher/Constraints");
|
||||
|
||||
if (hGrp->GetBool("UnifiedCoincident", false)) {
|
||||
cons << "Sketcher_ConstrainCoincidentUnified";
|
||||
}
|
||||
else {
|
||||
cons << "Sketcher_ConstrainCoincident"
|
||||
<< "Sketcher_ConstrainPointOnObject";
|
||||
}
|
||||
cons << "Sketcher_ConstrainVertical"
|
||||
<< "Sketcher_ConstrainHorizontal"
|
||||
<< "Sketcher_ConstrainHorVer"
|
||||
<< "Sketcher_ConstrainParallel"
|
||||
@@ -459,18 +467,33 @@ template<>
|
||||
inline void SketcherAddWorkbenchConstraints<Gui::ToolBarItem>(Gui::ToolBarItem& cons)
|
||||
{
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
|
||||
"User parameter:BaseApp/Preferences/Mod/Sketcher/dimensioning");
|
||||
"User parameter:BaseApp/Preferences/Mod/Sketcher/Constraints");
|
||||
|
||||
cons << "Sketcher_ConstrainCoincident"
|
||||
<< "Sketcher_ConstrainPointOnObject"
|
||||
<< "Sketcher_CompHorVer"
|
||||
<< "Sketcher_ConstrainParallel"
|
||||
if (hGrp->GetBool("UnifiedCoincident", false)) {
|
||||
cons << "Sketcher_ConstrainCoincidentUnified";
|
||||
}
|
||||
else {
|
||||
cons << "Sketcher_ConstrainCoincident"
|
||||
<< "Sketcher_ConstrainPointOnObject";
|
||||
}
|
||||
if (hGrp->GetBool("AutoHorVer", true)) {
|
||||
cons << "Sketcher_CompHorVer";
|
||||
}
|
||||
else {
|
||||
cons << "Sketcher_ConstrainVertical"
|
||||
<< "Sketcher_ConstrainHorizontal";
|
||||
}
|
||||
cons << "Sketcher_ConstrainParallel"
|
||||
<< "Sketcher_ConstrainPerpendicular"
|
||||
<< "Sketcher_ConstrainTangent"
|
||||
<< "Sketcher_ConstrainEqual"
|
||||
<< "Sketcher_ConstrainSymmetric"
|
||||
<< "Sketcher_ConstrainBlock"
|
||||
<< "Separator";
|
||||
|
||||
hGrp = App::GetApplication().GetParameterGroupByPath(
|
||||
"User parameter:BaseApp/Preferences/Mod/Sketcher/dimensioning");
|
||||
|
||||
if (hGrp->GetBool("SingleDimensioningTool", true)) {
|
||||
if (!hGrp->GetBool("SeparatedDimensioningTools", false)) {
|
||||
cons << "Sketcher_CompDimensionTools";
|
||||
|
||||
Reference in New Issue
Block a user