Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/visu.git] / src / VISUGUI / VisuGUI_CutLinesDlg.cxx
index a9983bf396bc30b2772be4eae45a0fa39e263874..545e8c8168e9512dcde831a3e6afd821baf99495 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
 
 #include "VISU_Gen_i.hh"
 #include "VISU_CutLines_i.hh"
@@ -105,7 +106,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
 
   QHBox* aPosBox = new QHBox (aPlanePane);
   aPosBox->setSpacing(5);
-  QLabel* aPosLbl = new QLabel (tr("LBL_POS"), aPosBox);
+  new QLabel (tr("LBL_POS"), aPosBox);
   myPosSpn = new QtxDblSpinBox (0, 1, 0.1, aPosBox);
   myPosSpn->setValue(0.5);
   aPlaneLayout->addWidget(aPosBox);
@@ -166,7 +167,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
 
   QHBox* aNbBox = new QHBox(aLinesPane);
   aNbBox->setSpacing(5);
-  QLabel* aNbLbl = new QLabel( tr( "LBL_NB_PLANS" ), aNbBox );
+  new QLabel( tr( "LBL_NB_PLANS" ), aNbBox );
   myNbSpn = new QtxDblSpinBox( 1, 100, 1, aNbBox );
   myNbSpn->setValue( 10 );
 
@@ -186,7 +187,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
 
   QHBox* aPosBox2 = new QHBox(aLinesPane);
   aPosBox2->setSpacing(5);
-  QLabel* aPosLbl2 = new QLabel( tr( "LBL_POS" ), aPosBox2 );
+  new QLabel( tr( "LBL_POS" ), aPosBox2 );
   myPosSpn2 = new QtxDblSpinBox( 0, 1, 0.1, aPosBox2 );
   myPosSpn2->setValue( 0.5 );
   aLinesLayout->addWidget( aPosBox2 );
@@ -258,7 +259,7 @@ VisuGUI_CutLinesDlg::~VisuGUI_CutLinesDlg()
   deletePlanes();
   if (myCutLines) //delete myCutLines;
     myCutLines->Destroy();
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
     vf->Repaint();
 }
 
@@ -327,7 +328,7 @@ int VisuGUI_CutLinesDlg::storeToPrsObject (VISU::CutLines_i* thePrs)
 //------------------------------------------------------------------------------
 void VisuGUI_CutLinesDlg::createPlanes()
 {
-  SVTK_ViewWindow* aView = VISU::GetViewWindow();
+  SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView == NULL) return;
   if (myCutLines == NULL) return;
   if (myPreviewActor != 0) return;
@@ -357,7 +358,7 @@ void VisuGUI_CutLinesDlg::createPlanes()
 void VisuGUI_CutLinesDlg::deletePlanes()
 {
   if (myPreviewActor == 0) return;
-  if (SVTK_ViewWindow* aView = VISU::GetViewWindow()){
+  if (SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>()){
     aView->RemoveActor(myPreviewActor);
     aView->RemoveActor(myPreviewActorGlyphs);
   }
@@ -414,7 +415,7 @@ void VisuGUI_CutLinesDlg::onCutSelect (int theId, bool theUpdate)
     myRotXLbl2->setText( tr("LBL_ROT_Z"));
     myRotYLbl2->setText( tr("LBL_ROT_X"));
   }
-  SVTK_ViewWindow* aView = VISU::GetViewWindow();
+  SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
       /*myCutLines->SetOrientation2(getOrientaion(false),
@@ -443,7 +444,7 @@ void VisuGUI_CutLinesDlg::setBaseDefault (bool theUpdate)
     /*    float aPos = myCutLines->GetBasePlanePosition();
     myBasePlanePos->setText( QString::number(aPos) );
     myBasePlanePos->setEnabled(false);*/
-    SVTK_ViewWindow* aView = VISU::GetViewWindow();
+    SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
     if (aView) {
       if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
         //myCutLines->SetBasePlanePosition(aPos);
@@ -515,7 +516,7 @@ void VisuGUI_CutLinesDlg::DrawTable()
     vh->setLabel( i, str.arg(i+1) );
   }
   // Update preview
-  SVTK_ViewWindow* aView = VISU::GetViewWindow();
+  SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (myPreviewCheck->isChecked()) {
       //      myCutLines->GetPL()->Update();
@@ -593,7 +594,7 @@ void VisuGUI_CutLinesDlg::updateGlyphs(bool update){
   source->Delete();
   aPlaneMapper->Delete();
 
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
     if (update)
       vf->Repaint();
 }
@@ -684,7 +685,7 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol)
     QString aTxt = myPosTable->text(theRow, 0);
     bool isChanged = !aTxt.isEmpty();
     ((QCheckTableItem*)myPosTable->item(theRow, 1))->setChecked(!isChanged);
-    SVTK_ViewWindow* aView = VISU::GetViewWindow();
+    SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
     if (aView) {
       if (myPreviewCheck->isChecked()) {
        //Update Preview
@@ -700,7 +701,7 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol)
     if (isDefault) {
       //myCutLines->SetDefaultPosition(theRow);
       // myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
-      SVTK_ViewWindow* aView = VISU::GetViewWindow();
+      SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
       if (aView) {
        if (myPreviewCheck->isChecked()) {
          //Update Preview
@@ -820,7 +821,7 @@ void VisuGUI_CutLinesDlg::reject()
 
 void VisuGUI_CutLinesDlg::onPreviewCheck (bool thePreview)
 {
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
     if (thePreview) {
       //storeToPrsObject(myCutLines);
       //      myCutLines->GetPL()->Update();
@@ -851,7 +852,7 @@ void VisuGUI_CutLinesDlg::onAllCurvesInvertedCheck(bool theInvert)
 void VisuGUI_CutLinesDlg::onRotation (double theValue)
 {
   if (myCutLines == NULL) return;
-  SVTK_ViewWindow* aView = VISU::GetViewWindow();
+  SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (myPreviewCheck->isChecked()) {
 
@@ -872,7 +873,7 @@ void VisuGUI_CutLinesDlg::onRotation (double theValue)
 void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue)
 {
   if (myCutLines == NULL) return;
-  SVTK_ViewWindow* aView = VISU::GetViewWindow();
+  SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (myPreviewCheck->isChecked()) {
       //myCutLines->SetBasePlanePosition(theValue.toDouble());