]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
MainWindow removed from using TG_VISU_2008_2008-08-22
authorvsv <vsv@opencascade.com>
Thu, 21 Aug 2008 14:57:21 +0000 (14:57 +0000)
committervsv <vsv@opencascade.com>
Thu, 21 Aug 2008 14:57:21 +0000 (14:57 +0000)
src/VISUGUI/VisuGUI_ClippingPanel.cxx
src/VISUGUI/VisuGUI_ClippingPanel.h
src/VISUGUI/VisuGUI_GaussPointsSelectionPane.cxx
src/VISUGUI/VisuGUI_Module.cxx
src/VISUGUI/VisuGUI_SelectionPanel.cxx
src/VVTK/Makefile.am

index 59984c11b3e3103c12122e8c80209dda4b04ad0b..0714ff8a320b5137bdba2b1fda33e8fe5836166b 100644 (file)
@@ -655,16 +655,23 @@ bool VisuGUI_ClippingPanel::isVISUDataReady()
 void VisuGUI_ClippingPanel::onApply()
 {
   if (myIsApplied) return;
-
-  int aPrsNum = myPrsList->currentRow();
-  if (aPrsNum < 0) return;
-
-  foreach(int aPlnNum, myCheckedPlanes) { 
-    applyPlaneToPrs(aPlnNum, aPrsNum, (myPlanesList->item(aPlnNum, 0)->checkState() == Qt::Checked));
+  
+  PlaneDef aPlane;
+  int i;
+  for(i = 0; i < myPlanes.size(); i++) {
+    aPlane = myPlanes.at(i);
+    aPlane.plane->setActive((myPlanesList->item(i, 1)->checkState() == Qt::Checked));
   }
-  myCheckedPlanes.clear();
   myIsApplied = true;
-  VISU::UpdateObjBrowser(myModule);
+  
+  int aPrsNum = myPrsList->currentRow();
+  if (aPrsNum > -1) {
+    for(i = 0; i < myPlanes.size(); i++) {
+      applyPlaneToPrs(i, aPrsNum, (myPlanesList->item(i, 0)->checkState() == Qt::Checked));
+    }
+  //myCheckedPlanes.clear();
+    VISU::UpdateObjBrowser(myModule);
+  }
   if (myViewWindow)
     myViewWindow->Repaint();
 }
@@ -738,13 +745,18 @@ void VisuGUI_ClippingPanel::onCellChanged(int row, int col)
   PlaneDef aPlane = myPlanes.at(row);
   bool isChecked = (myPlanesList->item(row, col)->checkState() == Qt::Checked);
   if (col == 1) {  // activate column clicked
-    aPlane.plane->setActive(isChecked);
+    if (isAutoApply()) 
+      aPlane.plane->setActive(isChecked);
+    else {
+      myIsApplied = false;
+      return;
+    }
   } else { // Plane checked
     
     if (aPlane.isAuto) return;
 
     if (!isAutoApply()) {
-      myCheckedPlanes.append(row);
+      //myCheckedPlanes.append(row);
       myIsApplied = false;
       return;
     }
@@ -768,12 +780,13 @@ void VisuGUI_ClippingPanel::applyPlaneToPrs(int thePlaneNum, int thePrsNum, bool
   _PTR(SObject) aSObject = aPlane.plane->getPlaneObject();
   _PTR(SObject) aPrsSObj = aStudy->FindObjectID(aPrs->GetEntry());
   if (isChecked) {
-    if (!containsPlane(aPrs, aPlane))
+    if (!containsPlane(aPrs, aPlane)) {
       aPrs->AddClippingPlane(aPlane.plane);
     
-    if(!aStudy->GetProperties()->IsLocked()) {
-      _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject);
+      if(!aStudy->GetProperties()->IsLocked()) {
+       _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject);
        aBuilder->Addreference(aNewObj, aPrsSObj);
+      }
     }
   } else {
     for (int i = 0; i < aPrs->GetNumberOfClippingPlanes(); i++) {
index 27b977b816354e7c55df56f87eaa00766e423051..b96a4dd1e7a22ae5ac1ab345eb6b3c7e23319578 100644 (file)
@@ -178,7 +178,7 @@ private slots:
   int myEditingPlanePos;
   SVTK_ViewWindow* myViewWindow;
   bool myIsApplied;
-  QList<int> myCheckedPlanes;
+  //QList<int> myCheckedPlanes;
 };
 
 #endif
index 15d621e6d9b9a7d45d50af12404d9a990df5292e..4d5595dfb186064f0dc0640b5c0aaf20fdb8e75a 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "SVTK_Selector.h"
 #include "SVTK_ViewWindow.h"
-#include "SVTK_MainWindow.h"
+//#include "SVTK_MainWindow.h"
 #include "SVTK_RenderWindowInteractor.h"
 
 #include "VTKViewer_Algorithm.h"
@@ -87,8 +87,8 @@ namespace
 
       SVTK_RenderWindowInteractor* anInteractor = NULL;
       if( SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>( myModule ) )
-       if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
-         anInteractor = aMainWindow->GetInteractor();
+       //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
+         anInteractor = aViewWindow->GetInteractor();
 
       if ( !anInteractor )
        return aResult;
@@ -355,11 +355,11 @@ SVTK_RenderWindowInteractor* VisuGUI_GaussPointsSelectionPane::getInteractor()
 {
   if( SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>( myModule ) )
   {
-    if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
-    {
-      SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+    //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
+    //{
+      SVTK_RenderWindowInteractor* anInteractor = aViewWindow->GetInteractor();
       return anInteractor;
-    }
+      //}
   }
   return 0;
 }
index 072b5155d46ec767e7b4d476769bba16f8cf7056..2ed053901a1d02dfb6ecc27a4fc817c9c5ec4894 100644 (file)
@@ -54,7 +54,7 @@
 
 #include "SVTK_ViewModel.h"
 #include "SVTK_ViewManager.h"
-#include "SVTK_MainWindow.h"
+#include "SVTK_ViewWindow.h"
 #include "SVTK_RenderWindowInteractor.h"
 #include "VISU_Event.h"
 
@@ -991,31 +991,31 @@ void VisuGUI_Module::setProperty( SVTK_ViewWindow* viewWindow, const QString& pr
     return;
 
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-  SVTK_MainWindow* aMainWindow = viewWindow->getMainWindow();
+  //SVTK_MainWindow* aMainWindow = viewWindow->getMainWindow();
   int val;
   if ( pref == "speed_increment" ) {
     val = resMgr->integerValue( "VTKViewer", pref, 10 );
-    aMainWindow->InvokeEvent( SVTK::SetSpeedIncrementEvent, &val );
+    viewWindow->InvokeEvent( SVTK::SetSpeedIncrementEvent, &val );
   }
   else if ( pref == "spacemouse_func1_btn" ) {
     val = resMgr->integerValue( "VTKViewer", pref, 1 );
-    aMainWindow->InvokeEvent( SVTK::SetSMDecreaseSpeedEvent, &val );
+    viewWindow->InvokeEvent( SVTK::SetSMDecreaseSpeedEvent, &val );
   }
   else if ( pref == "spacemouse_func2_btn" ) {
     val = resMgr->integerValue( "VTKViewer", pref, 2 );
-    aMainWindow->InvokeEvent( SVTK::SetSMIncreaseSpeedEvent, &val );
+    viewWindow->InvokeEvent( SVTK::SetSMIncreaseSpeedEvent, &val );
   }
   else if ( pref == "spacemouse_func3_btn" ) {
     val = resMgr->integerValue( "VISU", pref, 10 );
-    aMainWindow->InvokeEvent( VISU::SetSMDecreaseMagnificationEvent, &val );
+    viewWindow->InvokeEvent( VISU::SetSMDecreaseMagnificationEvent, &val );
   }
   else if ( pref == "spacemouse_func4_btn" ) {
     val = resMgr->integerValue( "VISU", pref, 11 );
-    aMainWindow->InvokeEvent( VISU::SetSMIncreaseMagnificationEvent, &val );
+    viewWindow->InvokeEvent( VISU::SetSMIncreaseMagnificationEvent, &val );
   }
   else if ( pref == "spacemouse_func5_btn" ) {
     val = resMgr->integerValue( "VTKViewer", pref, 9 );
-    aMainWindow->InvokeEvent( SVTK::SetSMDominantCombinedSwitchEvent, &val );
+    viewWindow->InvokeEvent( SVTK::SetSMDominantCombinedSwitchEvent, &val );
   }
 }
 
index 0a750c340df485c957cb3056cfd5a81470318b46..6257e4028b67446657110533a12b7d71ffce0809 100644 (file)
@@ -61,7 +61,7 @@
 #include "SALOME_ListIteratorOfListIO.hxx"
 
 #include "SVTK_ViewWindow.h"
-#include "SVTK_MainWindow.h"
+//#include "SVTK_MainWindow.h"
 #include "SVTK_Selector.h"
 #include "SVTK_RenderWindowInteractor.h"
 
@@ -423,11 +423,11 @@ void VisuGUI_SelectionPanel::onSelectionEvent() {
 
   int aType = myTabWidget->currentIndex();
 
-  if(SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow())
-  {
-    SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+  //if(SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow())
+  //{
+    SVTK_RenderWindowInteractor* anInteractor = aViewWindow->GetInteractor();
     myGaussPointsPane->setInteractor(anInteractor);
-  }
+    //}
 
   SVTK_Selector* aSelector = aViewWindow->GetSelector();
 
@@ -672,13 +672,13 @@ bool onIdEdit (const QString& theText,
 
     aViewWindow->highlight(anIO, true, true);
 
-    if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
-    {
-      SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+    //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
+    //{
+      SVTK_RenderWindowInteractor* anInteractor = aViewWindow->GetInteractor();
       VISU_Actor* anActor = SVTK::Find<VISU_Actor>(anInteractor->getRenderer()->GetActors(),
                                                   SVTK::TIsSameIObject<VISU_Actor>( anIO ));
       anActor->Highlight( anIO );
-    }
+      //}
 
     return true;
 
index cfa91ad88922bb64bfa11f052ecda6762cf08d6d..8afb0e312f15513cafc5a953bfbcf98b68019b5b 100755 (executable)
@@ -29,46 +29,17 @@ lib_LTLIBRARIES= libVVTK.la
 # header files
 salomeinclude_HEADERS= \
        VVTK.h \
-#      VVTK_ViewManager.h \
-#      VVTK_ViewModel.h \
-#      VVTK_InteractorStyle.h \
-#      VVTK_PickingDlg.h \
-#      VVTK_SegmentationCursorDlg.h \
        VVTK_PrimitiveBox.h \
        VVTK_SizeBox.h
-#      VVTK_ViewWindow.h \
-#      VVTK_MainWindow.h \
-#      VVTK_ImageWriter.h \
-#      VVTK_ImageWriterMgr.h \
-#      VVTK_RecorderDlg.h \
-#      VVTK_Recorder.h
 
 dist_libVVTK_la_SOURCES= \
-#      VVTK_ViewManager.cxx \
-#      VVTK_ViewModel.cxx \
-#      VVTK_InteractorStyle.cxx \
-#      VVTK_PickingDlg.cxx \
-#      VVTK_SegmentationCursorDlg.cxx \
        VVTK_PrimitiveBox.cxx \
        VVTK_SizeBox.cxx
-#      VVTK_ViewWindow.cxx \
-#      VVTK_Renderer.cxx \
-#      VVTK_MainWindow.cxx \
-#      VVTK_ImageWriter.cxx \
-#      VVTK_ImageWriterMgr.cxx \
-#      VVTK_RecorderDlg.cxx \
-#      VVTK_Recorder.cxx
 
 MOC_FILES= \
-#      VVTK_ViewWindow_moc.cxx \
-#      VVTK_ViewModel_moc.cxx \
-#      VVTK_ViewManager_moc.cxx \
-#      VVTK_PickingDlg_moc.cxx \
-#      VVTK_SegmentationCursorDlg_moc.cxx \
-#      VVTK_RecorderDlg_moc.cxx \
        VVTK_PrimitiveBox_moc.cxx \
        VVTK_SizeBox_moc.cxx
-#      VVTK_MainWindow_moc.cxx
+
 nodist_libVVTK_la_SOURCES=$(MOC_FILES)
 
 libVVTK_la_CPPFLAGS= \