From 7ba97e37f1244579af58837742d5a8f69843b4b5 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 27 Apr 2015 12:44:12 +0300 Subject: [PATCH] 1. Make count of copies in Translation/Rotation editable 2. Make arrows in various view not bigger then acceptable --- src/PartSet/PartSet_Module.cpp | 23 +++++++++++++++++++---- src/SketchPlugin/plugin-Sketch.xml | 6 ++---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 110ac6e74..7ae10661d 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -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(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; diff --git a/src/SketchPlugin/plugin-Sketch.xml b/src/SketchPlugin/plugin-Sketch.xml index 0b8caf3c7..9e2021b9c 100644 --- a/src/SketchPlugin/plugin-Sketch.xml +++ b/src/SketchPlugin/plugin-Sketch.xml @@ -280,8 +280,7 @@ + default="1" min="1"> @@ -307,8 +306,7 @@ + default="1" min="1"> -- 2.39.2