]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make preference flag for automatic rotation of a sketch plane selection
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 6 Nov 2015 13:29:26 +0000 (16:29 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 6 Nov 2015 13:29:26 +0000 (16:29 +0300)
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_WidgetSketchLabel.cpp

index 8c0fa0e5aedda21f10b4021d76453ba0ac01e578..34c838a741f8924ffecde5e0a1163755453bb1ec 100755 (executable)
@@ -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)
index fb815f2d0f085689b1128a65a64d874cf188772a..ff3808fb4752027f3d2c75a40c8a0b9548fd7b10 100644 (file)
@@ -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