]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
PAL12114. T3_2_0b1_pre1
authormzn <mzn@opencascade.com>
Mon, 24 Apr 2006 14:35:23 +0000 (14:35 +0000)
committermzn <mzn@opencascade.com>
Mon, 24 Apr 2006 14:35:23 +0000 (14:35 +0000)
src/GEOMGUI/GeometryGUI_Swig.cxx
src/GEOMGUI/GeometryGUI_Swig.hxx
src/GEOMGUI/GeometryGUI_Swig.i

index 22e3502b62b3f42834dd12eb45b395bf5bb56d60..4cf10fc97064bcd9b6ce5ea63ed02cead2114ecd 100644 (file)
@@ -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)
 {
index 02489d402d880f88855ab4908523dca85d7e25a3..e519ecad0da3fd8a92fef8699cf3657d46ed8d7e 100644 (file)
@@ -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);
index d8be6b738b374292ca8a142c63a3d8eec7602966..460e666c44bb765df072edf372e782c9768f968b 100644 (file)
@@ -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);