]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
1. Make count of copies in Translation/Rotation editable
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 27 Apr 2015 09:44:12 +0000 (12:44 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 27 Apr 2015 09:44:12 +0000 (12:44 +0300)
2. Make arrows in various view not bigger then acceptable

src/PartSet/PartSet_Module.cpp
src/SketchPlugin/plugin-Sketch.xml

index 110ac6e7447f8b9dad71ec58dc90a5a67a4d0173..7ae10661d5419ea8383b7787ebe790db8746ea76 100644 (file)
@@ -560,14 +560,29 @@ void PartSet_Module::onViewTransformed(int theTrsfType)
     return;
 
   ModuleBase_IViewer* aViewer = myWorkshop->viewer();
-  Handle(V3d_View) aView = aViewer->activeView();
+  //Handle(V3d_View) aView = aViewer->activeView();
 
   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
   XGUI_Workshop* aWorkshop = aConnector->workshop();
   XGUI_Displayer* aDisplayer = aWorkshop->displayer();
-  Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
-
-  double aLen = aView->Convert(15);
+  Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
+
+  Handle(V3d_Viewer) aV3dViewer = aContext->CurrentViewer();
+  Handle(V3d_View) aView;
+  double aScale = 0;
+  for (aV3dViewer->InitDefinedViews(); 
+       aV3dViewer->MoreDefinedViews(); 
+       aV3dViewer->NextDefinedViews()) {
+    Handle(V3d_View) aV = aV3dViewer->DefinedView();
+    double aS = aV->Scale();
+    if (aS > aScale) {
+      aScale = aS;
+      aView = aV;
+    }
+  }
+  if (aView.IsNull())
+    return;
+  double aLen = aView->Convert(20);
 
   SketcherPrs_Tools::setArrowSize(aLen);
   bool isModified = false;
index 0b8caf3c74b7b957b97c950eb58ee131495c0d66..9e2021b9cc4195a9e2fe8e72ad451987aa3b0d05 100644 (file)
         <integervalue id="MultiTranslationCopies"
             label="Number of copies"
             tooltip="Number of copies" 
-            default="1" min="1"
-            obligatory="0">
+            default="1" min="1">
           <validator id="GeomValidators_Positive"/>
         </integervalue>
       </feature>
         <integervalue id="MultiRotationCopies"
             label="Number of copies"
             tooltip="Number of copies" 
-            default="1" min="1"
-            obligatory="0">
+            default="1" min="1">
           <validator id="GeomValidators_Positive"/>
         </integervalue>
       </feature>