Salome HOME
Issue #1086: Update arrows size on set view projection
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 16 Nov 2015 08:47:48 +0000 (11:47 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 16 Nov 2015 08:48:08 +0000 (11:48 +0300)
src/NewGeom/NewGeom_SalomeViewer.cpp
src/PartSet/PartSet_WidgetSketchLabel.cpp
src/XGUI/XGUI_ViewerProxy.cpp

index ebdff924986ed86f28a14f6e8c75b0c6cd3f92a0..e91e0921921bc5a6adf06b47d4e638fe9cb3b861 100644 (file)
@@ -309,7 +309,7 @@ void NewGeom_SalomeViewer::setViewProjection(double theX, double theY, double th
     if (!aView3d.IsNull()) {
       aView3d->SetProj(theX, theY, theZ);
       aView3d->SetTwist( theTwist );
-      aView3d->FitAll(0.01, true);
+      aView3d->FitAll(0.01, false);
       aView3d->SetZSize(0.);
       if (aView3d->Depth() < 0.1)
         aView3d->DepthFitAll();
index ff3808fb4752027f3d2c75a40c8a0b9548fd7b10..0c2dc8e8848fcf7731dc860ce092825994584bd3 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "PartSet_WidgetSketchLabel.h"
 #include "PartSet_Tools.h"
+#include "PartSet_Module.h"
 
 #include "SketchPlugin_SketchEntity.h"
 
@@ -195,8 +196,12 @@ 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
     bool aRotate = Config_PropManager::boolean("Sketch planes", "rotate_to_plane", "false");
-    if (aRotate)
+    if (aRotate) {
       myWorkshop->viewer()->setViewProjection(aXYZ.X(), aXYZ.Y(), aXYZ.Z(), aTwist);
+      PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
+      if (aModule)
+        aModule->onViewTransformed();
+    }
   }
   // 3. Clear text in the label
   myStackWidget->setCurrentIndex(1);
@@ -487,5 +492,8 @@ void PartSet_WidgetSketchLabel::onSetPlaneView()
     if (myViewInverted->isChecked())
       aDir.Reverse();
     myWorkshop->viewer()->setViewProjection(aDir.X(), aDir.Y(), aDir.Z(), 0.);
+    PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
+    if (aModule)
+      aModule->onViewTransformed();
   }
 }
index 90178a9670a93c4d8ed2a745ada44217d82348d1..053a87abe71513c1335cfbbcef4ca9de7ea1284f 100644 (file)
@@ -58,7 +58,7 @@ void XGUI_ViewerProxy::setViewProjection(double theX, double theY, double theZ,
   if (!aView3d.IsNull()) {
     aView3d->SetProj(theX, theY, theZ);
     aView3d->SetTwist( theTwist );
-    aView3d->FitAll(0.01, true);
+    aView3d->FitAll(0.01, false);
     aView3d->SetZSize(0.);
     if (aView3d->Depth() < 0.1)
       aView3d->DepthFitAll();