From: vsv Date: Fri, 6 Nov 2015 13:29:26 +0000 (+0300) Subject: Make preference flag for automatic rotation of a sketch plane selection X-Git-Tag: V_2.0.0_alfa1~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b15c96c83479babddb973ff0c4773c7ea67f94de;p=modules%2Fshaper.git Make preference flag for automatic rotation of a sketch plane selection --- 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