From b15c96c83479babddb973ff0c4773c7ea67f94de Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 6 Nov 2015 16:29:26 +0300 Subject: [PATCH] Make preference flag for automatic rotation of a sketch plane selection --- src/PartSet/PartSet_Module.cpp | 2 ++ src/PartSet/PartSet_WidgetSketchLabel.cpp | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 8c0fa0e5a..34c838a74 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -211,6 +211,8 @@ void PartSet_Module::registerProperties() PLANE_SIZE); Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness", Config_Prop::Integer, SKETCH_WIDTH); + Config_PropManager::registerProp("Sketch planes", "rotate_to_plane", "Rotate to plane when selected", + Config_Prop::Boolean, "false"); } void PartSet_Module::connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect) diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index fb815f2d0..ff3808fb4 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -92,7 +92,7 @@ PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent, QGroupBox* aViewBox = new QGroupBox(tr("Sketcher plane"), this); QVBoxLayout* aViewLayout = new QVBoxLayout(aViewBox); - myViewInverted = new QCheckBox(tr("Inverted"), aViewBox); + myViewInverted = new QCheckBox(tr("Reversed"), aViewBox); aViewLayout->addWidget(myViewInverted); QPushButton* aSetViewBtn = new QPushButton(QIcon(":icons/plane_view.png"), tr("Set plane view"), aViewBox); @@ -194,7 +194,8 @@ void PartSet_WidgetSketchLabel::updateByPlaneSelected(const ModuleBase_ViewerPrs // Rotate view if the sketcher plane is selected only from preview planes // Preview planes are created only if there is no any shape - if (myYZPlane.get()) + bool aRotate = Config_PropManager::boolean("Sketch planes", "rotate_to_plane", "false"); + if (aRotate) myWorkshop->viewer()->setViewProjection(aXYZ.X(), aXYZ.Y(), aXYZ.Z(), aTwist); } // 3. Clear text in the label -- 2.39.2