From: mzn Date: Mon, 24 Apr 2006 14:35:23 +0000 (+0000) Subject: PAL12114. X-Git-Tag: T3_2_0b1_pre1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=eda03521e0e17fadaf24234241013553ad8636f5;p=modules%2Fgeom.git PAL12114. --- diff --git a/src/GEOMGUI/GeometryGUI_Swig.cxx b/src/GEOMGUI/GeometryGUI_Swig.cxx index 22e3502b6..4cf10fc97 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.cxx +++ b/src/GEOMGUI/GeometryGUI_Swig.cxx @@ -45,6 +45,7 @@ #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" #include "SVTK_View.h" +#include "SVTK_Renderer.h" #include "GEOM_Actor.h" #include "GEOM_Client.hxx" @@ -230,6 +231,35 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry) ProcessVoidEvent(new TEventUpdateBrowser ()); } +void GEOM_Swig::createAndDisplayFitAllGO (const char* Entry) +{ + class TEventFitAll: public SALOME_Event + { + public: + TEventFitAll() {} + virtual void Execute() { + SUIT_Application* app = SUIT_Session::session()->activeApplication(); + if (!app) return; + + if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(app)) + { + SVTK_View* aView = aViewWindow->getView(); + aView->GetRenderer()->OnFitAll(); + } + else if (OCCViewer_Viewer* occViewer = GetOCCViewer(app)) + { + Handle(V3d_Viewer) aViewer3d = occViewer->getViewer3d(); + aViewer3d->InitActiveViews(); + + if (aViewer3d->MoreActiveViews()) + aViewer3d->ActiveView()->FitAll(); + } + } + }; + + createAndDisplayGO(Entry); + ProcessVoidEvent(new TEventFitAll()); +} int GEOM_Swig::getIndexTopology(const char* SubIOR, const char* IOR) { diff --git a/src/GEOMGUI/GeometryGUI_Swig.hxx b/src/GEOMGUI/GeometryGUI_Swig.hxx index 02489d402..e519ecad0 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.hxx +++ b/src/GEOMGUI/GeometryGUI_Swig.hxx @@ -50,6 +50,7 @@ public: ~GEOM_Swig(); void createAndDisplayGO(const char* Entry); + void createAndDisplayFitAllGO(const char* Entry); void setDisplayMode(const char* Entry, int mode); void setColor(const char* Entry, int red, int green, int blue); void setTransparency(const char* Entry, float transp); diff --git a/src/GEOMGUI/GeometryGUI_Swig.i b/src/GEOMGUI/GeometryGUI_Swig.i index d8be6b738..460e666c4 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.i +++ b/src/GEOMGUI/GeometryGUI_Swig.i @@ -37,6 +37,7 @@ class GEOM_Swig ~GEOM_Swig(); void createAndDisplayGO(const char* Entry); + void createAndDisplayFitAllGO(const char* Entry); int getIndexTopology(const char *SubEntry, const char *Entry); const char* getShapeTypeString(const char *Entry);