]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
*** empty log message ***
authorvsv <vsv@opencascade.com>
Wed, 4 Jun 2008 06:29:14 +0000 (06:29 +0000)
committervsv <vsv@opencascade.com>
Wed, 4 Jun 2008 06:29:14 +0000 (06:29 +0000)
src/OBJECT/VISU_DataSetActor.cxx
src/OBJECT/VISU_DataSetActor.h
src/VISUGUI/VISU_images.ts
src/VISUGUI/VISU_msg_en.ts
src/VISUGUI/VisuGUI_ClippingDlg.cxx
src/VISUGUI/VisuGUI_ClippingPlaneMgr.cxx
src/VISUGUI/VisuGUI_ClippingPlaneMgr.h
src/VISUGUI/VisuGUI_SegmentationMgr.cxx
src/VISUGUI/VisuGUI_SegmentationMgr.h
src/VISUGUI/VisuGUI_ViewExtender.cxx
src/VISUGUI/VisuGUI_ViewExtender.h

index c19e829f5b8444cecbed34cbb20630dbae6453a8..2ac677705228721b2f12c3fe8e556ad11d070b23 100644 (file)
@@ -33,6 +33,7 @@
 #include <vtkObjectFactory.h>
 #include <vtkImplicitBoolean.h>
 #include <SALOME_ExtractGeometry.h>
+#include <vtkExtractPolyDataGeometry.h>
 #include <vtkImplicitFunctionCollection.h>
 #include <vtkPlane.h>
 
@@ -54,16 +55,20 @@ VISU_DataSetActor
 ::VISU_DataSetActor():
   myMapper(vtkDataSetMapper::New()),
   myExtractor(SALOME_ExtractGeometry::New()),
+  myPolyDataExtractor(vtkExtractPolyDataGeometry::New()),
   myFunction(vtkImplicitBoolean::New())
 {
   if(MYDEBUG) MESSAGE("VISU_DataSetActor::VISU_DataSetActor - this = "<<this);
 
   myExtractor->SetImplicitFunction(myFunction);
+  myPolyDataExtractor->SetImplicitFunction(myFunction);
   //myExtractor->ExtractBoundaryCellsOn();
+
   myFunction->SetOperationTypeToIntersection();
 
   myMapper->Delete();
   myExtractor->Delete();
+  myPolyDataExtractor->Delete();
   myFunction->Delete();
 }
 
@@ -93,8 +98,13 @@ void
 VISU_DataSetActor
 ::SetMapperInput(vtkDataSet* theDataSet) 
 {
-  myExtractor->SetInput(theDataSet);
-  myMapper->SetInput(myExtractor->GetOutput());
+  if (theDataSet->IsA("vtkPolyData")) {
+    myPolyDataExtractor->SetInput(theDataSet);
+    myMapper->SetInput(myPolyDataExtractor->GetOutput());
+  } else {
+    myExtractor->SetInput(theDataSet);
+    myMapper->SetInput(myExtractor->GetOutput());
+  }
   SetMapper(myMapper.GetPointer());
 }
 
@@ -120,7 +130,15 @@ vtkIdType VISU_DataSetActor::GetNumberOfClippingPlanes()
 //----------------------------------------------------------------------------
 bool VISU_DataSetActor::AddClippingPlane(vtkPlane* thePlane)
 {
+  vtkImplicitFunctionCollection* aFunctions = GetClippingPlanes();
+  aFunctions->InitTraversal();
+  vtkImplicitFunction* aItem;
+  while ((aItem = aFunctions->GetNextItem())) {
+    if (thePlane == aItem)
+      return false;
+  }
   myFunction->AddFunction(thePlane);
+  return true;
 }
 
 //----------------------------------------------------------------------------
index 18ef7958d31977d6173926bbe2d5cd3a2357ca45..658042294ca48b9d3b306cbc2e08939ff9982a78 100644 (file)
@@ -32,6 +32,7 @@
 
 class vtkDataSetMapper;
 class SALOME_ExtractGeometry;
+class vtkExtractPolyDataGeometry;
 class vtkImplicitBoolean;
 class vtkImplicitFunctionCollection;
 
@@ -84,6 +85,7 @@ class VTKOCC_EXPORT VISU_DataSetActor : public VISU_Actor
   //----------------------------------------------------------------------------
   vtkSmartPointer<vtkDataSetMapper> myMapper;
   vtkSmartPointer<SALOME_ExtractGeometry> myExtractor;
+  vtkSmartPointer<vtkExtractPolyDataGeometry> myPolyDataExtractor;
   vtkSmartPointer<vtkImplicitBoolean> myFunction;
 };
 
index 12a5e8282097b0cfc3d60c6797f299b409c6f42b..cbae951c36fcd0a7297fd506ccedbe41591ea883 100644 (file)
             <source>ICON_WIREFRAME</source>
             <translation>Visu_wireframe.png</translation>
         </message>
+        <message>
+            <source>ICON_DEACTIVATE_PLANES</source>
+            <translation>Visu_DeactivatePlane.png</translation>
+        </message>
+        <message>
+            <source>ICON_PLANES_MGR</source>
+            <translation>Visu_planemanager.png</translation>
+        </message>
     </context>
 </TS>
index 4e10ca2dbed2922f7cad8687551e3f61097172be..580e1a2e11868d9f902658444b08a02e752d125f 100644 (file)
@@ -3424,7 +3424,7 @@ Please, refer to the documentation.</translation>
         </message>
     </context>
     <context>
-        <name>VisuGUI_ViewExtender</name>
+        <name>VisuGUI_SegmentationMgr</name>
         <message>
             <source>MNU_CLIPPING_PLANE_MGR</source>
             <translation>Clipping planes</translation>
@@ -3441,5 +3441,21 @@ Please, refer to the documentation.</translation>
             <source>VISU_SETPLANES_MNU</source>
             <translation>Set clipping plane...</translation>
         </message>
+        <message>
+            <source>MNU_SHOW_CLIPPINGPLANES</source>
+            <translation>Show clipping planes</translation>
+        </message>
+        <message>
+            <source>DSK_SHOW_CLIPPINGPLANES</source>
+            <translation>Show/Hide clipping planes</translation>
+        </message>
+        <message>
+            <source>MNU_ACTIVATE_CLIPPINGPLANES</source>
+            <translation>Deactivate clipping planes</translation>
+        </message>
+        <message>
+            <source>DSK_ACTIVATE_CLIPPINGPLANES</source>
+            <translation>Activate/Deactivate clipping planes</translation>
+        </message>
     </context>
 </TS>
index dc5b593891d49ce558296c4f3f010ed59a9dd101..0daf34c9d0595c7709f8521ebf421a8d898cdf43 100644 (file)
@@ -646,10 +646,10 @@ void VisuGUI_ClippingDlg::applyGlobalPlanes()
 
   VisuGUI_ViewExtender* aVisuExtender = dynamic_cast<VisuGUI_ViewExtender*>(myVisuGUI->getViewExtender());
   SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI);
-  VisuGUI_SegmentationMgr* aSegmentationMgr = aVisuExtender->getSegmentationMgr();
+  VisuGUI_SegmentationMgr* aSegmentationMgr = aVisuExtender->getSegmentationMgr(aViewWindow);
   
   myDSActor->RemoveAllClippingPlanes();
-  const QListOfPlanes& aPlanes = aSegmentationMgr->getPlanes(aViewWindow);
+  const QListOfPlanes& aPlanes = aSegmentationMgr->getPlanes();
   PlaneDef aPlane;
   for (int i = 0; i < myGlobalPlanes->count(); i++) {
     if (myGlobalPlanes->item(i)->checkState() == Qt::Checked) {
@@ -1357,8 +1357,8 @@ bool VisuGUI_ClippingDlg::hasGlobalPlanes()
   SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI);
   if (!aViewWindow) return false;
 
-  VisuGUI_SegmentationMgr* aSegmentationMgr = aVisuExtender->getSegmentationMgr();
-  return aSegmentationMgr->getPlanes(aViewWindow).size() > 0;
+  VisuGUI_SegmentationMgr* aSegmentationMgr = aVisuExtender->getSegmentationMgr(aViewWindow);
+  return aSegmentationMgr->getPlanes().size() > 0;
 }
 
 //=================================================================================
@@ -1370,13 +1370,13 @@ void VisuGUI_ClippingDlg::initGlobalPlanes()
   if (!myHasGlobalPl) return;
   VisuGUI_ViewExtender* aVisuExtender = dynamic_cast<VisuGUI_ViewExtender*>(myVisuGUI->getViewExtender());
   SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI);
-  VisuGUI_SegmentationMgr* aSegmentationMgr = aVisuExtender->getSegmentationMgr();
+  VisuGUI_SegmentationMgr* aSegmentationMgr = aVisuExtender->getSegmentationMgr(aViewWindow);
   
   double aBounds[6];
   ComputeVisiblePropBounds(aViewWindow->getRenderer(), aBounds);
 
   // Add planes names to list
-  const QListOfPlanes& aPlanes = aSegmentationMgr->getPlanes(aViewWindow);
+  const QListOfPlanes& aPlanes = aSegmentationMgr->getPlanes();
   PlaneDef aPlane;
   for (int i = 0; i < aPlanes.size(); i++) {
     aPlane = aPlanes.at(i);
index 8fce9c4a29dd681dabb41c4f5ba01b06cb63c7b8..a0e1440f874bc1e41a7461bf9d400129dfa6d75b 100644 (file)
 #include <vtkImplicitPlaneWidget.h>
 #include <vtkGlyph3D.h>
 #include <vtkCallbackCommand.h>
-#include <vtkImageData.h>
-#include <vtkCutter.h>
-#include <vtkPolyDataMapper.h>
 #include <vtkActorCollection.h>
-#include <vtkActor.h>
 #include <vtkPlane.h>
 #include <vtkImplicitFunction.h>
 #include <vtkImplicitFunctionCollection.h>
@@ -70,115 +66,24 @@ using namespace std;
 
 
 
-
-#define PRINT3(MARK, VAL) printf("#### %s x=%f, y=%f, z=%f\n", MARK, VAL[0], VAL[1], VAL[2]);
-
-
-void AdjustBounds(const double bounds[6], double newBounds[6], double center[3])
-{
-  center[0] = (bounds[0] + bounds[1])/2.0;
-  center[1] = (bounds[2] + bounds[3])/2.0;
-  center[2] = (bounds[4] + bounds[5])/2.0;
-  
-  newBounds[0] = center[0] + SIZEFACTOR*(bounds[0]-center[0]);
-  newBounds[1] = center[0] + SIZEFACTOR*(bounds[1]-center[0]);
-  newBounds[2] = center[1] + SIZEFACTOR*(bounds[2]-center[1]);
-  newBounds[3] = center[1] + SIZEFACTOR*(bounds[3]-center[1]);
-  newBounds[4] = center[2] + SIZEFACTOR*(bounds[4]-center[2]);
-  newBounds[5] = center[2] + SIZEFACTOR*(bounds[5]-center[2]);
-}
-
-
-
-//****************************************************************
-PreviewPlane::PreviewPlane(SVTK_ViewWindow* theWindow, const PlaneDef& thePlane, const double* theBounds):
-  myWindow(theWindow),
-  myBounds(theBounds)
-{ 
-  double aCenter[3];
-  double aBound[6];
-
-  AdjustBounds(myBounds, aBound, aCenter);
-
-  myPlane = thePlane.plane;
-
-  myBox = vtkImageData::New();
-  myBox->SetDimensions(2, 2, 2);
-  myBox->SetOrigin(aBound[0],aBound[2],aBound[4]);
-  myBox->SetSpacing((aBound[1]-aBound[0]),
-                   (aBound[3]-aBound[2]),
-                   (aBound[5]-aBound[4]));
-
-  myCutter = vtkCutter::New();
-  myCutter->SetInput(myBox);
-  myCutter->SetCutFunction(myPlane);
-
-  myMapper = vtkPolyDataMapper::New();
-  myMapper->SetInput(myCutter->GetOutput());
-
-  myActor = vtkActor::New();
-  myActor->VisibilityOff();
-  myActor->PickableOff();
-  myActor->SetMapper(myMapper);
-  vtkProperty* aProp = vtkProperty::New();
-  float anRGB[3];
-  
-  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
-  
-  QColor aFillColor = aResourceMgr->colorValue("SMESH", "fill_color", QColor(0, 170, 255));
-  anRGB[0] = aFillColor.red()/255.;
-  anRGB[1] = aFillColor.green()/255.;
-  anRGB[2] = aFillColor.blue()/255.;
-  aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-  aProp->SetOpacity(0.75);
-  myActor->SetBackfaceProperty(aProp);
-  aProp->Delete();
-  
-  vtkProperty* aBackProp = vtkProperty::New();
-  QColor aBackFaceColor = aResourceMgr->colorValue("SMESH", "backface_color", QColor(0, 0, 255));
-  anRGB[0] = aBackFaceColor.red()/255.;
-  anRGB[1] = aBackFaceColor.green()/255.;
-  anRGB[2] = aBackFaceColor.blue()/255.;
-  aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-  aBackProp->SetOpacity(0.75);
-  myActor->SetProperty(aBackProp);
-  aBackProp->Delete();
-
-  myWindow->getRenderer()->AddActor(myActor);
-}
-
-//****************************************************************
-PreviewPlane::~PreviewPlane()
-{
-  myWindow->getRenderer()->RemoveActor(myActor);
-  myActor->Delete();
-
-  myMapper->RemoveAllInputs();
-  myMapper->Delete();
-  myCutter->Delete();
-  myBox->Delete();
-}
-
-
-  
-
-
-
 //****************************************************************
 //****************************************************************
 //****************************************************************
 VisuGUI_ClippingPlaneMgr::VisuGUI_ClippingPlaneMgr(VisuGUI* theModule, 
                                                   SVTK_ViewWindow* theViewWindow,
-                                                  const QListOfPlanes& thePlanes)
+                                                  VisuGUI_SegmentationMgr* theMgr)
   : QDialog(VISU::GetDesktop(theModule), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
     myModule(theModule),
-    myPlanes(thePlanes),
     myViewWindow(theViewWindow),
     myCurrentPlane(-1),
     myPreviewWidget(0),
     myCallback( vtkCallbackCommand::New() ),
-    myIsRestored(false)
+    mySegmentationMgr(theMgr)
 {
+  myPlanes = mySegmentationMgr->getPlanes();
+  myIsVisibleState = mySegmentationMgr->isPlanesVisible();
+  mySegmentationMgr->setPlanesVisible(false);
+
   ComputeVisiblePropBounds(myViewWindow->getRenderer(), myBounds);
 
   setWindowTitle(tr("TITLE"));
@@ -402,7 +307,6 @@ void VisuGUI_ClippingPlaneMgr::saveState()
     }
   }
   myCopyActorsMap = myActorsMap;
-  myIsRestored = false;
 }
 
 //****************************************************************
@@ -429,7 +333,6 @@ void VisuGUI_ClippingPlaneMgr::deletePlaneFromActors(int thePlaneId)
 //****************************************************************
 void VisuGUI_ClippingPlaneMgr::restoreState(const QMap<VISU_DataSetActor*, ListOfvtkPlanes>& theState)
 {
-  if (myIsRestored) return;
   QList<VISU_DataSetActor*> aActors = theState.keys();
   VISU_DataSetActor* aActor;
   vtkPlane* aPlane;
@@ -443,7 +346,6 @@ void VisuGUI_ClippingPlaneMgr::restoreState(const QMap<VISU_DataSetActor*, ListO
       aActor->AddClippingPlane(aPlane);
     }
   }
-  myIsRestored = true;
 }
 
 
@@ -452,15 +354,22 @@ void VisuGUI_ClippingPlaneMgr::onOk()
 {
   savePlane(myCurrentPlane);
   restoreState(myActorsMap);
-  emit applyPlanes();
-  onClose();
+  mySegmentationMgr->setPlanes(myPlanes);
+  if (myIsVisibleState)
+    mySegmentationMgr->setPlanesVisible(myIsVisibleState);
+  else
+    myViewWindow->Repaint();
+  close();
 }
 
 //****************************************************************
 void VisuGUI_ClippingPlaneMgr::onClose()
 {
   restoreState(myCopyActorsMap);
-  myViewWindow->Repaint();
+  if (myIsVisibleState)
+    mySegmentationMgr->setPlanesVisible(myIsVisibleState);
+  else
+    myViewWindow->Repaint();
   close();
 }
 
@@ -629,12 +538,12 @@ void VisuGUI_ClippingPlaneMgr::showPlane(int thePlaneNb)
 void VisuGUI_ClippingPlaneMgr::setEmptyPlane(PlaneDef& thePlane) const
 {
   thePlane.name = QString("Plane %1").arg(myPlanes.size());
-  thePlane.plane = vtkPlane::New();
+  thePlane.plane = CutPlaneFunction::New();
   thePlane.plane->Delete();
   thePlane.plane->SetOrigin(0.,0.,0.);
   thePlane.plane->SetNormal(0.,0.,1.);
   thePlane.isAuto = false;
-  thePlane.isOn = false;
+  //thePlane.isOn = false;
 }
 
 //****************************************************************
index 0163b3707078e25295339e0b7f9d6571f1e51d00..bacc1d6eebd315ba2b5a892b7f99579df9e95019 100644 (file)
@@ -35,9 +35,6 @@ class PreviewPlane;
 
 class vtkImplicitPlaneWidget;
 class vtkCallbackCommand;
-class vtkPolyDataMapper;
-class vtkImageData;
-class vtkCutter;
 
 class VISU_DataSetActor;
 
@@ -46,30 +43,6 @@ class VISU_DataSetActor;
 #include <vtkSmartPointer.h>
 #include <vtkActor.h>
 
-class PreviewPlane
-{
-public:
-  PreviewPlane(SVTK_ViewWindow* theWindow, const PlaneDef& thePlane, const double* theBounds);
-  ~PreviewPlane();
-
-  void setVisible(bool theVisible)
-  { myActor->SetVisibility(theVisible); }
-
-  //void setPlane(const PlaneDef& thePlane);
-
-private:
-  SVTK_ViewWindow* myWindow;
-
-  //SALOME_Actor* myActor;
-  vtkActor* myActor;
-  vtkPolyDataMapper* myMapper;
-  const double* myBounds;
-  vtkPlane* myPlane;
-  vtkImageData* myBox;
-  vtkCutter* myCutter;
-};
-
-
 
 class VisuGUI_ClippingPlaneMgr : public QDialog
 {
@@ -78,7 +51,7 @@ public:
 
   VisuGUI_ClippingPlaneMgr(VisuGUI* theModule, 
                           SVTK_ViewWindow* theViewWindow, 
-                          const QListOfPlanes& thePlanes);
+                          VisuGUI_SegmentationMgr* theMgr);
   ~VisuGUI_ClippingPlaneMgr();
 
   const QListOfPlanes& getPlanes() const { return myPlanes; }
@@ -119,6 +92,8 @@ private slots:
   void restoreState(const QMap<VISU_DataSetActor*, ListOfvtkPlanes>& theState);
 
 
+  VisuGUI_SegmentationMgr* mySegmentationMgr;
+
   QListWidget* myPlanesList;
   QLineEdit* myNameEdt;
   VisuGUI*   myModule;
@@ -139,7 +114,7 @@ private slots:
   SVTK_ViewWindow* myViewWindow;
   int myCurrentPlane;
 
-  QList<PreviewPlane*> myPreviewList;
+  ListOfPreview myPreviewList;
   vtkImplicitPlaneWidget* myPreviewWidget;
 
   vtkSmartPointer<vtkCallbackCommand> myCallback;
@@ -148,9 +123,9 @@ private slots:
   QMap<VISU_DataSetActor*, ListOfvtkPlanes> myActorsMap;
   QMap<VISU_DataSetActor*, ListOfvtkPlanes> myCopyActorsMap;
 
-  bool myIsRestored;
-
   double myBounds[6];
+
+  bool myIsVisibleState;
 };
 
 #endif
index 5c1981cc03decd474a6d54b84a0ec9871389deb6..3e768972c62f28b0b240415da5a707161e050aa4 100644 (file)
 
 
 #include "VisuGUI_SegmentationMgr.h"
+#include "VisuGUI_Tools.h"
+#include "VisuGUI_ClippingPlaneMgr.h"
 
 #include <SVTK_ViewModel.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <VTKViewer_Utilities.h>
 
 #include <VISU_PipeLine.hxx>
 #include <VISU_Actor.h>
+#include <VISU_DataSetActor.h>
+
 #include <vtkRenderer.h>
 
+#include <vtkImageData.h>
+#include <vtkCutter.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkActor.h>
+#include <vtkImplicitFunctionCollection.h>
+
+#include <QtxAction.h>
+#include <QtxActionToolMgr.h>
+#include <QDialog>
+#include <QMenu>
+
+#define SIZEFACTOR 1.5
+
+
+#define PRINT3(MARK, VAL) printf("#### %s x=%f, y=%f, z=%f\n", MARK, VAL[0], VAL[1], VAL[2]);
+
+
+void AdjustBounds(const double bounds[6], double newBounds[6], double center[3])
+{
+  center[0] = (bounds[0] + bounds[1])/2.0;
+  center[1] = (bounds[2] + bounds[3])/2.0;
+  center[2] = (bounds[4] + bounds[5])/2.0;
+  
+  newBounds[0] = center[0] + SIZEFACTOR*(bounds[0]-center[0]);
+  newBounds[1] = center[0] + SIZEFACTOR*(bounds[1]-center[0]);
+  newBounds[2] = center[1] + SIZEFACTOR*(bounds[2]-center[1]);
+  newBounds[3] = center[1] + SIZEFACTOR*(bounds[3]-center[1]);
+  newBounds[4] = center[2] + SIZEFACTOR*(bounds[4]-center[2]);
+  newBounds[5] = center[2] + SIZEFACTOR*(bounds[5]-center[2]);
+}
+
+
+
+//****************************************************************
+PreviewPlane::PreviewPlane(SVTK_ViewWindow* theWindow, const PlaneDef& thePlane, const double* theBounds):
+  myWindow(theWindow),
+  myBounds(theBounds)
+{ 
+  double aCenter[3];
+  double aBound[6];
+
+  AdjustBounds(myBounds, aBound, aCenter);
+
+  myPlane = thePlane.plane;
+
+  myBox = vtkImageData::New();
+  myBox->SetDimensions(2, 2, 2);
+  myBox->SetOrigin(aBound[0],aBound[2],aBound[4]);
+  myBox->SetSpacing((aBound[1]-aBound[0]),
+                   (aBound[3]-aBound[2]),
+                   (aBound[5]-aBound[4]));
+
+  myCutter = vtkCutter::New();
+  myCutter->SetInput(myBox);
+  myCutter->SetCutFunction(myPlane);
+
+  myMapper = vtkPolyDataMapper::New();
+  myMapper->SetInput(myCutter->GetOutput());
+
+  myActor = vtkActor::New();
+  myActor->VisibilityOff();
+  myActor->PickableOff();
+  myActor->SetMapper(myMapper);
+  vtkProperty* aProp = vtkProperty::New();
+  float anRGB[3];
+  
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  
+  QColor aFillColor = aResourceMgr->colorValue("SMESH", "fill_color", QColor(0, 170, 255));
+  anRGB[0] = aFillColor.red()/255.;
+  anRGB[1] = aFillColor.green()/255.;
+  anRGB[2] = aFillColor.blue()/255.;
+  aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+  aProp->SetOpacity(0.75);
+  myActor->SetBackfaceProperty(aProp);
+  aProp->Delete();
+  
+  vtkProperty* aBackProp = vtkProperty::New();
+  QColor aBackFaceColor = aResourceMgr->colorValue("SMESH", "backface_color", QColor(0, 0, 255));
+  anRGB[0] = aBackFaceColor.red()/255.;
+  anRGB[1] = aBackFaceColor.green()/255.;
+  anRGB[2] = aBackFaceColor.blue()/255.;
+  aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+  aBackProp->SetOpacity(0.75);
+  myActor->SetProperty(aBackProp);
+  aBackProp->Delete();
+
+  myWindow->getRenderer()->AddActor(myActor);
+}
+
+//****************************************************************
+PreviewPlane::~PreviewPlane()
+{
+  myWindow->getRenderer()->RemoveActor(myActor);
+  myActor->Delete();
+
+  myMapper->RemoveAllInputs();
+  myMapper->Delete();
+  myCutter->Delete();
+  myBox->Delete();
+}
+
+
+  
+
+
+//****************************************************************
+//****************************************************************
+//****************************************************************
+CutPlaneFunction* CutPlaneFunction::New()
+{
+  return new CutPlaneFunction();
+}
+
+void CutPlaneFunction::setActive(bool theActive) 
+{ 
+  myIsActive = theActive; 
+  Modified();
+}
+
+double CutPlaneFunction::EvaluateFunction(double x[3])
+{
+  if (myIsActive)
+    return vtkPlane::EvaluateFunction(x);
+  else 
+    return -1;
+}
+
+double CutPlaneFunction::EvaluateFunction(double x, double y, double z)
+{
+  if (myIsActive)
+    return vtkPlane::EvaluateFunction(x,y,z);
+  else 
+    return -1;
+}
+  
+CutPlaneFunction::CutPlaneFunction():
+  myIsActive(true)
+{
+
+}
+
+CutPlaneFunction::~CutPlaneFunction()
+{
+}
+
+
+
+
+//****************************************************************
+//****************************************************************
 //****************************************************************
-VisuGUI_SegmentationMgr::VisuGUI_SegmentationMgr(VisuGUI* theModule)
+VisuGUI_SegmentationMgr::VisuGUI_SegmentationMgr(VisuGUI* theModule, SVTK_ViewWindow* theWindow):
+  myIsPlanesNonActive(true),
+  myIsPlanesVisible(false),
+  myWindow(theWindow),
+  myModule(theModule),
+  myNonModalDlg(0)
 {
+  QtxAction* aAction;
+  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); 
+  aAction = new QtxAction(tr("MNU_CLIPPING_PLANE_MGR"),
+                         aResourceMgr->loadPixmap("VISU",tr("ICON_PLANES_MGR")),
+                         tr( "DSK_CLIPPING_PLANE_MGR" ),
+                         0,
+                         this,
+                         false);
+  connect(aAction, SIGNAL( activated() ), this, SLOT( onPlanesMgr() ));
+  myActionsMap[ClippingPlaneMgrId] = aAction;
+
+  aAction = new QtxAction(tr("MNU_SHOW_CLIPPINGPLANES"),
+                         aResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH")),
+                         tr( "DSK_SHOW_CLIPPINGPLANES" ),
+                         0,
+                         this,
+                         true);
+  connect(aAction, SIGNAL( toggled(bool) ), this, SLOT( setPlanesVisible(bool) ));
+  myActionsMap[ShowClippingPlanesId] = aAction;
+
+  aAction = new QtxAction(tr("MNU_ACTIVATE_CLIPPINGPLANES"),
+                         aResourceMgr->loadPixmap("VISU",tr("ICON_DEACTIVATE_PLANES")),
+                         tr( "DSK_ACTIVATE_CLIPPINGPLANES" ),
+                         0,
+                         this,
+                         true);
+  connect(aAction, SIGNAL( toggled(bool) ), this, SLOT( setPlanesNonActive(bool) ));
+  myActionsMap[DeactivateClippingPlanesId] = aAction;
 }
 
 //****************************************************************
 VisuGUI_SegmentationMgr::~VisuGUI_SegmentationMgr()
 {
+  deactivate();
 }
 
 //****************************************************************
-const QListOfPlanes& VisuGUI_SegmentationMgr::getPlanes(SVTK_ViewWindow* theWindow)
+void VisuGUI_SegmentationMgr::deactivate()
 {
-  if (!myViewPlanesMap.contains(theWindow)) {
-    QListOfPlanes aNewList;
-    myViewPlanesMap[theWindow] = aNewList;
+  if (myNonModalDlg) {
+    myNonModalDlg->close();
+    myNonModalDlg = 0;
   }
-  return myViewPlanesMap[theWindow];
 }
 
 //****************************************************************
-void VisuGUI_SegmentationMgr::setPlanes(SVTK_ViewWindow* theWindow, const QListOfPlanes& theNewPlanes)
+int VisuGUI_SegmentationMgr::createToolbar(QtxActionToolMgr* theMgr)
 {
-  myViewPlanesMap.remove(theWindow);
-  myViewPlanesMap[theWindow] = theNewPlanes;
+  int aToolBar = theMgr->createToolBar( tr("VISU_VIEW_TOOLBAR"));
+  theMgr->append( myActionsMap[ClippingPlaneMgrId], aToolBar );
+  theMgr->append( myActionsMap[DeactivateClippingPlanesId], aToolBar );
+  theMgr->append( myActionsMap[ShowClippingPlanesId], aToolBar );
+  return aToolBar;
+}
+
 
-  vtkActorCollection* anActors = theWindow->getRenderer()->GetActors();
+//****************************************************************
+const QListOfPlanes& VisuGUI_SegmentationMgr::getPlanes()
+{
+  return myListOfPlanes;
+}
+
+//****************************************************************
+void VisuGUI_SegmentationMgr::setPlanes(const QListOfPlanes& theNewPlanes)
+{
+  myListOfPlanes = theNewPlanes;
+
+  vtkActorCollection* anActors = myWindow->getRenderer()->GetActors();
   anActors->InitTraversal();
   vtkActor* aActor = 0;
   VISU_Actor* aVisuActor = 0;
   while ( (aActor = anActors->GetNextActor()) ) {
     aVisuActor = VISU_Actor::SafeDownCast(aActor);
     if (aVisuActor) {
-      applyPlanes(theWindow, aVisuActor, true);
+      applyPlanes(aVisuActor);
     }
   }
 }
 
 //****************************************************************
-void VisuGUI_SegmentationMgr::onAddActor(SVTK_ViewWindow* theWindow, VTKViewer_Actor* theActor)
+void VisuGUI_SegmentationMgr::onAddActor(VTKViewer_Actor* theActor)
 {
   VISU_Actor* aActor = VISU_Actor::SafeDownCast(theActor);
   if (!aActor) return;
-  applyPlanes(theWindow, aActor, true);
+  applyPlanes(aActor);
 }
 
 //****************************************************************
-void VisuGUI_SegmentationMgr::applyPlanes(SVTK_ViewWindow* theWindow, VISU_Actor* theActor, bool theAuto)
+void VisuGUI_SegmentationMgr::applyPlanes(VISU_Actor* theActor)
 {
-  const QListOfPlanes& aPlanes = getPlanes(theWindow);
-  for (int i = 0; i < aPlanes.size(); i++) {
-    PlaneDef aPlane = aPlanes.at(i);
-    if ((theAuto)? aPlane.isAuto : aPlane.isOn) {
+  for (int i = 0; i < myListOfPlanes.size(); i++) {
+    PlaneDef aPlane = myListOfPlanes.at(i);
+   if (aPlane.isAuto && (!isContainsPlane(theActor, aPlane.plane))) {
       theActor->AddClippingPlane(aPlane.plane);
     }
   }
-  theWindow->Repaint();
+  myWindow->Repaint();
 }
 
+
 //****************************************************************
-void VisuGUI_SegmentationMgr::onViewDeleted(SUIT_ViewWindow* theWindow)
+void VisuGUI_SegmentationMgr::setPlanesNonActive(bool theNonActive)
 {
-  SVTK_ViewWindow* aWindow = dynamic_cast<SVTK_ViewWindow*>(theWindow);
-  if (aWindow) {
-    if (myViewPlanesMap.contains(aWindow))
-      myViewPlanesMap.remove(aWindow);
+  if (myIsPlanesNonActive == theNonActive) return;
+  myIsPlanesNonActive = theNonActive;
+
+  PlaneDef aPlane;
+  for (int i = 0; i < myListOfPlanes.size(); i++) {
+    aPlane = myListOfPlanes.at(i);
+    aPlane.plane->setActive(!theNonActive);
   }
-}
+  myWindow->Repaint();
   
+}
+
+//****************************************************************
+bool VisuGUI_SegmentationMgr::isPlanesNonActive() const
+{
+  return myIsPlanesNonActive;
+}
+
+//****************************************************************
+void VisuGUI_SegmentationMgr::setPlanesVisible(bool theVisible)
+{
+  if (myIsPlanesVisible == theVisible) return;
+  myIsPlanesVisible = theVisible;
+  if (myIsPlanesVisible) {
+    double aBounds[6];
+    ComputeVisiblePropBounds(myWindow->getRenderer(), aBounds);
+    for (int i = 0; i < myListOfPlanes.size(); i++) {
+      PreviewPlane* aPreview = new PreviewPlane(myWindow, myListOfPlanes.at(i), aBounds);
+      aPreview->setVisible(true);
+      myPlanesPreview.append(aPreview);
+    }
+  } else {
+    PreviewPlane* aPreview;
+    while (myPlanesPreview.size() > 0) {
+      aPreview = myPlanesPreview.last();
+      myPlanesPreview.removeLast();
+      delete aPreview;
+    }
+  }
+  myWindow->Repaint();
+}
+
+//****************************************************************
+bool VisuGUI_SegmentationMgr::isPlanesVisible() const
+{
+  return myIsPlanesVisible;
+}
+
+//****************************************************************
+bool VisuGUI_SegmentationMgr::isContainsPlane(VISU_Actor* theActor, vtkPlane* thePlane)
+{
+  VISU_DataSetActor* aDSActor = dynamic_cast<VISU_DataSetActor*>(theActor);
+  if (!aDSActor) return false;
+
+  vtkImplicitFunctionCollection* aFunctions = aDSActor->GetClippingPlanes();
+  aFunctions->InitTraversal();
+  vtkImplicitFunction* aItem;
+  while ((aItem = aFunctions->GetNextItem())) {
+    if (thePlane == aItem)
+      return true;
+  }
+  return false;
+}
+
+//****************************************************************
+void VisuGUI_SegmentationMgr::onPlanesMgr()
+{
+  if (myNonModalDlg) return;
+
+  VisuGUI_ClippingPlaneMgr* aDlg = 
+    new VisuGUI_ClippingPlaneMgr(myModule, myWindow, this);
+
+  myNonModalDlg = aDlg;
+  connect(myNonModalDlg, SIGNAL( destroyed(QObject*) ), this, SLOT( onDialogDestroy() ));
+  myNonModalDlg->show();
+}
+
+//****************************************************************
+void VisuGUI_SegmentationMgr::onDialogDestroy()
+{
+  disconnect(myNonModalDlg, SIGNAL( destroyed(QObject*) ), this, SLOT( onDialogDestroy() ));
+  myNonModalDlg = 0;
+}
+
index 7cc51f401663fe17659dbc5fb1c8bef9912a6571..c9e7a70fbef1ce21aa6db874d5584903dcbb5481 100644 (file)
 #include <QObject>
 #include <QMap>
 #include <QList>
+#include <vtkActor.h>
 
 class VISU_Actor;
 class vtkPlane;
+class vtkPolyDataMapper;
+class vtkImageData;
+class vtkCutter;
+class QtxAction;
+class QDialog;
+
+class CutPlaneFunction: public vtkPlane
+{
+public:
+  static CutPlaneFunction* New();
+
+  vtkTypeMacro(CutPlaneFunction, vtkPlane);
+
+  virtual double EvaluateFunction(double x[3]);
+  virtual double EvaluateFunction(double x, double y, double z);
+
+  void setActive(bool theActive);
+  bool isActive() const { return myIsActive; }
+
+protected:
+  CutPlaneFunction();
+  ~CutPlaneFunction();
+
+private:
+  bool myIsActive;
+};
+
 
 
 struct PlaneDef
 {
-  //  PlaneDef() {
-  //  plane = 0;
-  //}
-  //~PlaneDef() { if (plane) plane->DebugOn();}
-  vtkSmartPointer<vtkPlane> plane;
+  vtkSmartPointer<CutPlaneFunction> plane;
   bool isAuto;
   QString name;
-  bool isOn;
+};
+
+
+class PreviewPlane
+{
+public:
+  PreviewPlane(SVTK_ViewWindow* theWindow, const PlaneDef& thePlane, const double* theBounds);
+  ~PreviewPlane();
+
+  void setVisible(bool theVisible)
+  { myActor->SetVisibility(theVisible); }
+
+private:
+  SVTK_ViewWindow* myWindow;
+
+  vtkActor* myActor;
+  vtkPolyDataMapper* myMapper;
+  const double* myBounds;
+  vtkPlane* myPlane;
+  vtkImageData* myBox;
+  vtkCutter* myCutter;
 };
 
 
 typedef QList<PlaneDef> QListOfPlanes;
 typedef QList<vtkPlane*> ListOfvtkPlanes;
+typedef QList<PreviewPlane*> ListOfPreview;
 
 class VisuGUI_SegmentationMgr: public QObject
 {
   Q_OBJECT
 public:
 
-  VisuGUI_SegmentationMgr(VisuGUI* theModule);
+  VisuGUI_SegmentationMgr(VisuGUI* theModule, SVTK_ViewWindow* theWindow);
   ~VisuGUI_SegmentationMgr();
 
-  const QListOfPlanes& getPlanes(SVTK_ViewWindow* theWindow);
-  void setPlanes(SVTK_ViewWindow* theWindow, const QListOfPlanes& theNewPlanes);
+  const QListOfPlanes& getPlanes();
+  void setPlanes(const QListOfPlanes& theNewPlanes);
+
+  bool isPlanesNonActive() const;
+
+  bool isPlanesVisible() const;
+
+  bool isContainsPlane(VISU_Actor* theActor, vtkPlane* thePlane);
+
+  int createToolbar(QtxActionToolMgr* theMgr);
+
+  void deactivate();
+
+public slots:
+  void onAddActor(VTKViewer_Actor*);
+  void setPlanesVisible(bool);
+  void setPlanesNonActive(bool);
 
 private slots:
-  void onAddActor(SVTK_ViewWindow*, VTKViewer_Actor*);
-  void onViewDeleted(SUIT_ViewWindow*);
+  void onPlanesMgr();
+  void onDialogDestroy(); 
 
  private:
-  void applyPlanes(SVTK_ViewWindow* theWindow, VISU_Actor* theActor, bool theAuto);
+  void applyPlanes(VISU_Actor* theActor);
+
+  enum { ClippingPlaneMgrId, ShowClippingPlanesId, DeactivateClippingPlanesId };
+
+  QMap<int, QtxAction*> myActionsMap;
+
+  SVTK_ViewWindow* myWindow;
+  VisuGUI* myModule;
+
+  QDialog* myNonModalDlg;
 
+  QListOfPlanes myListOfPlanes;
+  bool myIsPlanesNonActive;
+  bool myIsPlanesVisible;
 
-  QMap<SVTK_ViewWindow*, QListOfPlanes> myViewPlanesMap;
+  ListOfPreview myPlanesPreview;
 };
 
 #endif
index 37bcce559b848ac9c31bbc104968e0f81bba51c4..21ab0c0ce075c99071dc4ef7ec1e13dc1ae03b5b 100644 (file)
 
 #include "VisuGUI_ViewExtender.h"
 
-#include "VisuGUI_ClippingPlaneMgr.h"
 #include "VisuGUI.h"
 #include "VisuGUI_SegmentationMgr.h"
 #include "VisuGUI_ViewTools.h"
 #include "VisuGUI_Tools.h"
+#include <VTKViewer_Actor.h>
+
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
 
 #include <VISU_PipeLine.hxx>
-#include <SUIT_Session.h>
-#include <SUIT_ResourceMgr.h>
 #include <SUIT_ViewManager.h>
+#include <SUIT_ViewWindow.h>
+
 #include <SVTK_ViewModel.h>
-#include <LightApp_SelectionMgr.h>
-#include <SalomeApp_Application.h>
+#include <SVTK_ViewWindow.h>
 
-#include <QtxAction.h>
-#include <QtxActionToolMgr.h>
-#include <QDialog>
-#include <QMenu>
 
 
 //using namespace std;
 
 VisuGUI_ViewExtender::VisuGUI_ViewExtender(VisuGUI* theModule):
-  myModule(theModule),
-  myNonModalDlg(0)
+  myModule(theModule)
 {
-  mySegmentationMgr = new VisuGUI_SegmentationMgr(theModule);
-
-
-  QtxAction* aAction;
-  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); 
-  aAction = new QtxAction(tr("MNU_CLIPPING_PLANE_MGR"),
-                         aResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH")),
-                         tr( "DSK_CLIPPING_PLANE_MGR" ),
-                         0,
-                         this,
-                         false);
-  connect(aAction, SIGNAL( activated() ), this, SLOT( onPlanesMgr() ));
-  myActionsMap[ClippingPlaneMgrId] = aAction;
 }
 
 //****************************************************************
 VisuGUI_ViewExtender::~VisuGUI_ViewExtender()
 {
-  delete mySegmentationMgr;
+  QMapIterator<SVTK_ViewWindow*, VisuGUI_SegmentationMgr*> aIt(myViewMgrMap);
+  while (aIt.hasNext()) {
+    aIt.next();
+    delete aIt.value();
+  }
 }
 
 //****************************************************************
-int VisuGUI_ViewExtender::createToolbar(QtxActionToolMgr* theMgr)
+int VisuGUI_ViewExtender::createToolbar(SUIT_ViewWindow* theView)
 {
-  int aToolBar = theMgr->createToolBar( tr("VISU_VIEW_TOOLBAR"));
-  theMgr->append( myActionsMap[ClippingPlaneMgrId], aToolBar );
-  return aToolBar;
+  SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(theView);
+  if (!aViewWindow) return -1;
+
+  VisuGUI_SegmentationMgr* aMgr = getSegmentationMgr(aViewWindow);
+  return aMgr->createToolbar(theView->toolMgr());
 }
 
 //****************************************************************
@@ -100,22 +90,6 @@ void VisuGUI_ViewExtender::contextMenuPopup(QMenu* theMenu)
 //   theMenu->addAction(tr("VISU_SETPLANES_MNU"), this, SLOT(onSetPlanes()));
 }
 
-//****************************************************************
-void VisuGUI_ViewExtender::onPlanesMgr()
-{
-  if (myNonModalDlg) return;
-
-  SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
-  if (!aViewWindow) return;
-
-  VisuGUI_ClippingPlaneMgr* aDlg = 
-    new VisuGUI_ClippingPlaneMgr(myModule, aViewWindow, mySegmentationMgr->getPlanes(aViewWindow));
-  connect(aDlg, SIGNAL(applyPlanes()), this, SLOT(onApplyPlanes()));
-
-  myNonModalDlg = aDlg;
-  connect(myNonModalDlg, SIGNAL( destroyed(QObject*) ), this, SLOT( onDialogDestroy() ));
-  myNonModalDlg->show();
-}
 
 //****************************************************************
 void VisuGUI_ViewExtender::activate(SUIT_ViewModel* theViewer)
@@ -126,9 +100,9 @@ void VisuGUI_ViewExtender::activate(SUIT_ViewModel* theViewer)
     if (!myViewers.contains(aViewer)) {
       SUIT_ViewManager* aMgr = aViewer->getViewManager();
       connect(aMgr, SIGNAL(deleteView(SUIT_ViewWindow*)), 
-             mySegmentationMgr, SLOT(onViewDeleted(SUIT_ViewWindow*)));
+             this, SLOT(onViewDeleted(SUIT_ViewWindow*)));
       connect(aViewer, SIGNAL(actorAdded(SVTK_ViewWindow*, VTKViewer_Actor*)), 
-             mySegmentationMgr, SLOT(onAddActor(SVTK_ViewWindow*, VTKViewer_Actor*)));
+             this, SLOT(onAddActor(SVTK_ViewWindow*, VTKViewer_Actor*)));
       myViewers.append(aViewer);
     }
   }
@@ -137,24 +111,39 @@ void VisuGUI_ViewExtender::activate(SUIT_ViewModel* theViewer)
 //****************************************************************
 void VisuGUI_ViewExtender::deactivate(SUIT_ViewModel*)
 {
-  if (myNonModalDlg) {
-    myNonModalDlg->close();
-    myNonModalDlg = 0;
+  QMapIterator<SVTK_ViewWindow*, VisuGUI_SegmentationMgr*> aIt(myViewMgrMap);
+  while (aIt.hasNext()) {
+    aIt.next();
+    aIt.value()->deactivate();
   }
 }
 
+
 //****************************************************************
-void VisuGUI_ViewExtender::onDialogDestroy()
+VisuGUI_SegmentationMgr* VisuGUI_ViewExtender::getSegmentationMgr(SVTK_ViewWindow* theWindow)
 {
-  disconnect(myNonModalDlg, SIGNAL( destroyed(QObject*) ), this, SLOT( onDialogDestroy() ));
-  myNonModalDlg = 0;
+  if (myViewMgrMap.contains(theWindow)) 
+    return myViewMgrMap[theWindow];
   
+  VisuGUI_SegmentationMgr* aMgr = new VisuGUI_SegmentationMgr(myModule, theWindow);
+  myViewMgrMap[theWindow] = aMgr;
+  return aMgr;
 }
 
 //****************************************************************
-void VisuGUI_ViewExtender::onApplyPlanes()
+void VisuGUI_ViewExtender::onViewDeleted(SUIT_ViewWindow* theWindow)
 {
-  VisuGUI_ClippingPlaneMgr* aDlg = (VisuGUI_ClippingPlaneMgr*) myNonModalDlg;
-  mySegmentationMgr->setPlanes(aDlg->getViewWindow(), aDlg->getPlanes());
+  SVTK_ViewWindow* aWindow = dynamic_cast<SVTK_ViewWindow*>(theWindow);
+  if (!aWindow) return;
+
+  if (!myViewMgrMap.contains(aWindow)) return;
+  delete myViewMgrMap[aWindow];
+  myViewMgrMap.remove(aWindow);
 }
 
+//****************************************************************
+void VisuGUI_ViewExtender::onAddActor(SVTK_ViewWindow* theWindow, VTKViewer_Actor* theActor)
+{
+  if (!myViewMgrMap.contains(theWindow)) return;
+  myViewMgrMap[theWindow]->onAddActor(theActor);
+}
index 39b68be1ddc6a07e5b53668d96d51759f0ac21e1..2193a388d8a2246b358f1b5bbe0bc96c37ad7382 100644 (file)
 #include <QMap>
 
 class VisuGUI;
-class QtxAction;
-class QDialog;
+//class QtxAction;
+//class QDialog;
 
 class VisuGUI_SegmentationMgr;
 class SVTK_Viewer;
+class SVTK_ViewWindow;
+class SUIT_ViewWindow;
+class VTKViewer_Actor;
+
 
 class VisuGUI_ViewExtender:  public QObject, public CAM_ViewExtender
 {
@@ -50,33 +54,38 @@ class VisuGUI_ViewExtender:  public QObject, public CAM_ViewExtender
 
   virtual ~VisuGUI_ViewExtender();
 
-  virtual int createToolbar(QtxActionToolMgr* theMgr);
+  virtual int createToolbar(SUIT_ViewWindow* theView);
   virtual void contextMenuPopup(QMenu* theMenu);
 
   virtual void activate(SUIT_ViewModel*);
   virtual void deactivate(SUIT_ViewModel*);
 
-  VisuGUI_SegmentationMgr* getSegmentationMgr() const { return mySegmentationMgr; }
-  
+  VisuGUI_SegmentationMgr* getSegmentationMgr(SVTK_ViewWindow* theWindow);
 
 private slots:
-  void onPlanesMgr();
- void onDialogDestroy(); 
- void onApplyPlanes();
+  //  void onPlanesMgr();
+  // void onDialogDestroy(); 
+  // void onShowPlanes(bool);
+  // void onDeactivatePlanes(bool);
+ void onViewDeleted(SUIT_ViewWindow* theWindow);
+ void onAddActor(SVTK_ViewWindow* theWindow, VTKViewer_Actor* theActor);
 
  private:
-  enum { ClippingPlaneMgrId };
 
-  QMap<int, QtxAction*> myActionsMap;
+ //enum { ClippingPlaneMgrId, ShowClippingPlanesId, DeactivateClippingPlanesId };
+
+ //QMap<int, QtxAction*> myActionsMap;
   VisuGUI* myModule;
 
-  QDialog* myNonModalDlg;
+  //QDialog* myNonModalDlg;
 
-  VisuGUI_SegmentationMgr* mySegmentationMgr;
+  //VisuGUI_SegmentationMgr* mySegmentationMgr;
+  QMap<SVTK_ViewWindow*, VisuGUI_SegmentationMgr*> myViewMgrMap;
 
   QList<SVTK_Viewer*> myViewers;
 
-  SALOME_ListIO myListIO;
+  //SALOME_ListIO myListIO;
   
 };