Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/visu.git] / src / VISUGUI / VisuGUI_CutPlanesDlg.cxx
index c4072907cd942daefde932fd03132643960e4129..486a475d200b47b435f13d0fd01f54d9940c1843 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
 
 #include "VISU_CutPlanes_i.hh"
 #include "VISU_CutPlanesPL.hxx"
@@ -166,11 +167,10 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent)
 
 VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane()
 {
-  cout<<"### VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane"<<endl;
   deletePlanes();
   if (myCutPlanes)
     myCutPlanes->Destroy();
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
     vf->Repaint();
 }
 
@@ -194,7 +194,7 @@ void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs)
 
 void VisuGUI_CutPlanesPane::createPlanes()
 {
-  if (VISU::GetViewWindow() == NULL) return;
+  if (VISU::GetActiveViewWindow<SVTK_ViewWindow>() == NULL) return;
   if (myCutPlanes == NULL) return;
   if (myPreviewActor != 0) return;
 
@@ -211,7 +211,7 @@ void VisuGUI_CutPlanesPane::createPlanes()
   myPreviewActor->PickableOff();
   myPreviewActor->SetMapper(aPlaneMapper);
   aPlaneMapper->Delete();
-  VISU::GetViewWindow()->AddActor(myPreviewActor);
+  VISU::GetActiveViewWindow<SVTK_ViewWindow>()->AddActor(myPreviewActor);
 }
 
 int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs)
@@ -349,7 +349,7 @@ void VisuGUI_CutPlanesPane::DrawTable()
 
   // Update preview
   if (myPreviewCheck->isChecked()) {
-    if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+    if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
       myCutPlanes->GetPL()->Update();
       deletePlanes();
       createPlanes();
@@ -386,7 +386,7 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol)
 
     if (myPreviewCheck->isChecked()) {
       //Update Preview
-      if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+      if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
        myCutPlanes->SetPlanePosition( theRow, aTxt.toDouble());
        myCutPlanes->GetPL()->Update();
        deletePlanes();
@@ -401,7 +401,7 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol)
       myPosTable->setText(theRow, 0, QString::number(myCutPlanes->GetPlanePosition(theRow)));
 
       if (myPreviewCheck->isChecked()) {
-       if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+       if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
          //Update Preview
          myCutPlanes->GetPL()->Update();
          deletePlanes();
@@ -417,7 +417,7 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol)
 void VisuGUI_CutPlanesPane::deletePlanes()
 {
   if (myPreviewActor == 0) return;
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
     vf->RemoveActor(myPreviewActor);
   myPreviewActor->Delete();
   myPreviewActor = 0;
@@ -427,7 +427,7 @@ void VisuGUI_CutPlanesPane::onRotation (double theValue)
 {
   if (myCutPlanes == NULL) return;
   if (myPreviewCheck->isChecked()) {
-    if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+    if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
       myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
       myCutPlanes->GetPL()->Update();
       deletePlanes();
@@ -439,7 +439,7 @@ void VisuGUI_CutPlanesPane::onRotation (double theValue)
 
 void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview)
 {
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
     if (thePreview) {
       storeToPrsObject(myCutPlanes);
       myCutPlanes->GetPL()->Update();