Salome HOME
Merge from V6_5_BR 05/06/2012
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_SubShapeSelectorWdg.h
index 6447516fba2406ef1d0ce95fb13369c944495499..6d3cbbe7d14963fce6b52578394c7a606ac44eeb 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : StdMeshersGUI_SubShapeSelectorWdg.h
 // Author : Open CASCADE S.A.S. (dmv)
 //
@@ -41,29 +39,38 @@ class SMESHGUI;
 class LightApp_SelectionMgr;
 class SVTK_Selector;
 class QPushButton;
+class QLabel;
 class QLineEdit;
 class QCheckBox;
 class QListWidget;
 class SMESH_Actor;
 class SMESH_PreviewActorsCollection;
 class vtkRenderer;
+class SUIT_SelectionFilter;
 
 class STDMESHERSGUI_EXPORT StdMeshersGUI_SubShapeSelectorWdg : public QWidget
 {
   Q_OBJECT
 
 public:
-  StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0 );
+  StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0,
+                                     TopAbs_ShapeEnum aSubShType = TopAbs_EDGE );
   ~StdMeshersGUI_SubShapeSelectorWdg();
 
   SMESH::long_array_var          GetListOfIDs();
   void                           SetListOfIDs( SMESH::long_array_var );
 
+  void                           SetGeomShapeEntry( const QString& theEntry );
+  const char*                    GetGeomShapeEntry() { return myEntry.toLatin1().data();}
+
   void                           SetMainShapeEntry( const QString& theEntry );
-  const char*                    GetMainShapeEntry() { return myEntry.toLatin1().data();}
+  const char*                    GetMainShapeEntry();
 
+  TopoDS_Shape                   GetGeomShape() { return myGeomShape; }
   TopoDS_Shape                   GetMainShape() { return myMainShape; }
 
+  QList<int>                     GetCorrectedListOfIDs( bool fromSubshapeToMainshape = true );
+
   static GEOM::GEOM_Object_var   GetGeomObjectByEntry( const QString& );
   static TopoDS_Shape            GetTopoDSByEntry( const QString& );
 
@@ -71,15 +78,21 @@ public:
 
   void                           showPreview ( bool );
 
+  int                            GetListSize() { return myListOfIDs.size(); }
+
   void SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; }
-  void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
+  //void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
 
 private:
   void                           updateState();
+  void                           setFilter();
+  void                           updateButtons();
 
 private slots:
   void                           onAdd(); 
   void                           onRemove(); 
+  void                           onPrevious(); 
+  void                           onNext(); 
   void                           SelectionIntoArgument();
   void                           onListSelectionChanged();
 
@@ -91,18 +104,24 @@ private:
   LightApp_SelectionMgr*         mySelectionMgr;          /* User shape selection */
   SVTK_Selector*                 mySelector;
   SMESH::SMESH_Mesh_var          myMesh;
-  TopoDS_Shape                   myMainShape;
+  TopoDS_Shape                   myGeomShape; // shape whose sub-shapes are selected
+  TopoDS_Shape                   myMainShape; // main shape of the mesh
   QString                        myEntry;
+  QString                        myMainEntry;
   vtkRenderer*                   myRenderer;
   
   QListWidget*                   myListWidget;
   QPushButton*                   myAddButton;
   QPushButton*                   myRemoveButton;
+  QLabel*                        myInfoLabel;
+  QPushButton*                   myPrevButton;
+  QPushButton*                   myNextButton;
   QList<int>                     mySelectedIDs;
   QList<int>                     myListOfIDs;
   
   QString                        myParamValue;
   bool                           myIsShown;
+  bool                           myIsNotCorrected;
 
   // for manage possible size of myListOfIDs
   int                            myMaxSize;
@@ -110,6 +129,8 @@ private:
   TopAbs_ShapeEnum               mySubShType;
   
   SMESH_PreviewActorsCollection* myPreviewActor;
+  QList<SUIT_SelectionFilter*>   myGeomFilters;
+  SUIT_SelectionFilter*          myFilter;
 };
 
 #endif // STDMESHERSGUI_SUBSHAPESELECTORWDG_H