]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Join BR-D5-38-2003 T_After_Join_BR-D5-38-2003
authorapo <apo@opencascade.com>
Fri, 20 Jan 2006 06:56:23 +0000 (06:56 +0000)
committerapo <apo@opencascade.com>
Fri, 20 Jan 2006 06:56:23 +0000 (06:56 +0000)
src/DisplayGUI/DisplayGUI.cxx
src/GEOMGUI/GeometryGUI_Swig.cxx
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx
src/OBJECT/GEOM_VTKTrihedron.cxx
src/OBJECT/GEOM_VTKTrihedron.hxx

index 3be30b5e13dc70f8275597417771ad66c7cbea6d..61dc6bfca652e92a84180c9292e2cdadecd989cc 100644 (file)
@@ -42,7 +42,7 @@
 #include <SALOME_ListIteratorOfListIO.hxx>
 
 #include <SVTK_ViewWindow.h>
-#include <SVTK_RenderWindowInteractor.h>
+#include <SVTK_View.h>
 #include <SVTK_ViewModel.h>
 #include <SOCC_ViewModel.h>
 #include <SVTK_Prs.h>
@@ -348,10 +348,8 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
   if ( !viewWindow ) 
     viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
   if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
-    SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
-    SVTK_RenderWindowInteractor* myRenderInter = wnd ? wnd->getRWInteractor() : 0;
-    if( myRenderInter )
-      myRenderInter->SetDisplayMode( mode );
+    SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
+    aView->SetDisplayMode( mode );
   } 
   else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
     OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
@@ -386,10 +384,8 @@ int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow )
   if ( !viewWindow ) 
     viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
   if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
-    SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
-    SVTK_RenderWindowInteractor* myRenderInter = wnd ? wnd->getRWInteractor() : 0;
-    if( myRenderInter )
-      dispMode = myRenderInter->GetDisplayMode();
+    SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
+    dispMode = aView->GetDisplayMode();
   } 
   else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
     OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
@@ -432,10 +428,7 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
   
   if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
     SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
-    SVTK_RenderWindowInteractor* rwi = vw ? vw->getRWInteractor() : 0;
-
-    if( !rwi )
-      return;
+    SVTK_View* aView = vw->getView();
 
     aSelMgr->selectedObjects( aList );
     SALOME_ListIteratorOfListIO It( aList );
@@ -445,12 +438,12 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
       SVTK_Prs* vtkPrs = stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
       if ( vtkPrs && !vtkPrs->IsNull() ) {
        if ( mode == 0 )
-         rwi->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
+         aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
        else if ( mode == 1 )
-         rwi->ChangeRepresentationToSurface( vtkPrs->GetObjects() );
+         aView->ChangeRepresentationToSurface( vtkPrs->GetObjects() );
       }
     }
-    rwi->Render();
+    aView->Repaint();
   }
   else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
     OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
index 2db10da820532ccb676c69c9600d9f9f3a2ba50d..9a10ef6df4227e056ff92abb2f6b58c3309e066b 100644 (file)
 
 #include "GeometryGUI.h"
 
-#include <SUIT_Session.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
-#include <SalomeApp_ImportOperation.h>
+#include "SUIT_Session.h"
+#include "SalomeApp_Application.h"
+#include "SalomeApp_Study.h"
+#include "SalomeApp_ImportOperation.h"
 
-#include <OB_Browser.h>
+#include "OB_Browser.h"
 
-#include <OCCViewer_ViewWindow.h>
-#include <OCCViewer_ViewManager.h>
-#include <SOCC_ViewModel.h>
+#include "OCCViewer_ViewWindow.h"
+#include "OCCViewer_ViewManager.h"
+#include "SOCC_ViewModel.h"
 
-#include <SVTK_ViewModel.h>
-#include <SVTK_ViewWindow.h>
-#include <SVTK_RenderWindowInteractor.h>
+#include "SVTK_ViewModel.h"
+#include "SVTK_ViewWindow.h"
+#include "SVTK_View.h"
 
 #include "GEOM_Actor.h"
 #include "GEOM_Client.hxx"
@@ -52,7 +52,7 @@
 #include "GEOM_AssemblyBuilder.h"
 #include "GEOM_InteractiveObject.hxx"
 
-#include <SALOME_Event.hxx>
+#include "SALOME_Event.hxx"
 
 #include "utilities.h"
 
@@ -180,10 +180,9 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
                                         "GEOM",
                                         const_cast<char*>( obj->GetID().c_str()));
 
-         if (SVTK_ViewWindow* svtkViewWindow = GetSVTKViewWindow(app)) {
-
-           SVTK_RenderWindowInteractor* aRenderInter= svtkViewWindow->getRWInteractor();
-           int aMode = aRenderInter->GetDisplayMode();
+         if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(app)) {
+           SVTK_View* aView = aViewWindow->getView();
+           int aMode = aView->GetDisplayMode();
 
            vtkActorCollection* theActors =
               GEOM_AssemblyBuilder::BuildActors(Shape,0,aMode,true);
@@ -192,9 +191,9 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
              GEOM_Actor* GActor = GEOM_Actor::SafeDownCast(anActor);
              GActor->setName(const_cast<char*>(aNameValue.c_str()));
              GActor->setIO(anIO);
-             aRenderInter->Display(GActor);
+             aView->Display(GActor);
            }
-           aRenderInter->Update();
+           aView->Repaint();
          } else if (OCCViewer_Viewer* occViewer = GetOCCViewer(app)) {
            Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
            Handle(GEOM_AISShape) aSh =
@@ -405,10 +404,10 @@ void GEOM_Swig::setDisplayMode(const char* theEntry, int theMode)
       myApp(theApp), myIO(theIO), myParam(theParam)
     {}
     virtual void Execute(){
-      if(SVTK_ViewWindow* svtkViewWindow = GetSVTKViewWindow(myApp)){
-       SVTK_RenderWindowInteractor* myRenderInter= svtkViewWindow->getRWInteractor();
-       myRenderInter->SetDisplayMode(myIO,myParam);
-       myRenderInter->Update();
+      if(SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(myApp)){
+       SVTK_View* aView = aViewWindow->getView();
+       aView->SetDisplayMode(myIO,myParam);
+       aView->Repaint();
       }
       else if(OCCViewer_Viewer* occViewer = GetOCCViewer(myApp)) {
        SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>( occViewer );
@@ -439,10 +438,10 @@ void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue)
       myApp(theApp), myIO(theIO), myParam(theParam)
     {}
     virtual void Execute(){
-      if(SVTK_ViewWindow* svtkViewWindow = GetSVTKViewWindow(myApp)){
-       SVTK_RenderWindowInteractor* myRenderInter= svtkViewWindow->getRWInteractor();
-       myRenderInter->SetColor(myIO,myParam);
-       myRenderInter->Update();
+      if(SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(myApp)){
+       SVTK_View* aView = aViewWindow->getView();
+       aView->SetColor(myIO,myParam);
+       aView->Repaint();
       }else if(OCCViewer_Viewer* occViewer = GetOCCViewer(myApp)){
        Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
        AIS_ListOfInteractive List;
@@ -486,10 +485,10 @@ void GEOM_Swig::setTransparency(const char* theEntry, float transp)
       myApp(theApp), myIO(theIO), myParam(theParam)
     {}
     virtual void Execute(){
-      if(SVTK_ViewWindow* svtkViewWindow = GetSVTKViewWindow(myApp)){
-       SVTK_RenderWindowInteractor* myRenderInter= svtkViewWindow->getRWInteractor();
-       myRenderInter->SetTransparency(myIO,myParam);
-       myRenderInter->Update();
+      if(SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(myApp)){
+       SVTK_View* aView = aViewWindow->getView();
+       aView->SetTransparency(myIO,myParam);
+       aView->Repaint();
       }else if(OCCViewer_Viewer* occViewer = GetOCCViewer(myApp)) {
        SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>( occViewer );
        if (soccViewer)
index 56004de661577224e4317faf8b2ac6437ab116fb..1d1c12a38be68a6eef9720c4569fe98baf91b195 100644 (file)
 #include "GEOM_Actor.h"
 #include "GEOMBase.h"
 
-#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include "SALOME_ListIO.hxx"
+#include "SALOME_ListIteratorOfListIO.hxx"
 
 #include <SVTK_ViewModel.h>
 #include <SVTK_ViewWindow.h>
-#include <SVTK_RenderWindowInteractor.h>
+#include <SVTK_View.h>
 
 #include <OCCViewer_ViewModel.h>
 #include <OCCViewer_ViewWindow.h>
@@ -236,13 +236,13 @@ void GEOMToolsGUI::OnColor()
          SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
          if ( !vtkVW )
            return;
-         SVTK_RenderWindowInteractor* rwi = vtkVW->getRWInteractor();
-         QColor initcolor = rwi->GetColor( selected.First()  );
+         SVTK_View* aView = vtkVW->getView();
+         QColor initcolor = aView->GetColor( selected.First()  );
          QColor c = QColorDialog::getColor( QColor(), app->desktop() );
          if ( c.isValid() ) {
            SUIT_OverrideCursor();
            for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
-             rwi->SetColor( It.Value(), c );
+             aView->SetColor( It.Value(), c );
            }
          }
        } // if ( isVTK )
index 45c470789884dc682ac40016b2aaff9beb1c1a33..0984dd88cf78bbacadc8182f46485cfa020df796 100644 (file)
 #include "GEOMBase.h"
 #include "GEOM_AISShape.hxx"
 
-#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include "SALOME_ListIO.hxx"
+#include "SALOME_ListIteratorOfListIO.hxx"
 
 #include <SVTK_ViewModel.h>
 #include <SVTK_ViewWindow.h>
-#include <SVTK_RenderWindowInteractor.h>
+#include <SVTK_View.h>
 
 #include <OCCViewer_ViewModel.h>
 #include <OCCViewer_ViewWindow.h>
@@ -205,19 +205,19 @@ void GEOMToolsGUI_TransparencyDlg::ValueHasChanged( int newValue )
     SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
     if ( !vtkVW )
       return;
-    SVTK_RenderWindowInteractor* rwi = vtkVW->getRWInteractor();
+    SVTK_View* aView = vtkVW->getView();
     if ( myFirstInit ) {       
       myFirstInit = false;
-      float transp = (rwi->GetTransparency(FirstIOS))*10.0;
+      float transp = (aView->GetTransparency(FirstIOS))*10.0;
       mySlider->setValue(int(transp));
       return;
     }
 
     SUIT_OverrideCursor();
     for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
-      rwi->SetTransparency( It.Value(), newValue/10.0 );
+      aView->SetTransparency( It.Value(), newValue/10.0 );
     }
-    rwi->Render();
+    aView->Repaint();
   } // if ( isVTK )
        
   else if ( isOCC ) {
index 67e32cedd1d8e9e5a482214e57e10ade33c3de30..3e79afb81199d92cf0aa34aaedca51af742d154a 100644 (file)
@@ -207,7 +207,6 @@ GEOM_VTKTrihedron::GEOM_VTKTrihedron()
 {
   myMapper = vtkPolyDataMapper::New();
   myAxis[ 0 ] = myAxis[ 1 ] = myAxis[ 2 ] = 0;
-  myPresent = vtkActorCollection::New();
   mySize = 100;
   SetInfinitive( true );
   myColor[ 0 ] = myColor[ 1 ] = myColor[ 1 ] = -1;
@@ -216,8 +215,6 @@ GEOM_VTKTrihedron::GEOM_VTKTrihedron()
 
 GEOM_VTKTrihedron::~GEOM_VTKTrihedron()
 {
-  myPresent->RemoveAllItems();
-  myPresent->Delete();
   for ( int i = 0; i < 3; i++ )
     myAxis[i]->Delete();
 
@@ -285,9 +282,12 @@ void GEOM_VTKTrihedron::AddToRender( vtkRenderer* theRenderer )
 
 void GEOM_VTKTrihedron::RemoveFromRender( vtkRenderer* theRenderer )
 {
-  myPresent->InitTraversal();
-  while(vtkActor* anActor = myPresent->GetNextActor())
-    theRenderer->RemoveActor(anActor);
+  for(int i = 0; i < 3; i++)
+  {
+    myAxis[i]->RemoveFromRender(theRenderer);
+  }
+
+  theRenderer->RemoveActor( this );
 }
 
 int GEOM_VTKTrihedron::GetVisibleActorCount(vtkRenderer* theRenderer)
index 92332c8c6f0a311f90c99c8aad2766ae11c029c8..b67ad3fbb9e7a00dd6e8996ec7969f2601ced367 100644 (file)
@@ -89,7 +89,6 @@ public:
   virtual bool                      hasHighlight() { return false; } 
 
 protected:
-  vtkActorCollection*               myPresent;
   VTKViewer_Axis*                   myAxis[3];
   vtkPolyDataMapper*                myMapper;
   float                             mySize;