Salome HOME
23368: [CEA 1865] Possibility to define faces to mesh as a single one: transpatch...
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_SubShapeSelectorWdg.h
index c6b9d95f1ba1d3b3c8301441ed81dfa5d42001fd..adf62f1d6cdb5fd43c521a1ec05810afeb062c7d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -24,7 +24,7 @@
 #define STDMESHERSGUI_SUBSHAPESELECTORWDG_H
 
 // SMESH includes
-#include <SMESHGUI.h>
+#include "SMESHGUI.h"
 #include "SMESH_StdMeshersGUI.hxx"
 #include "SMESH_SMESHGUI.hxx"
 
 #include <QStringList>
 #include <TopoDS_Shape.hxx>
 
-#include <SMESHGUI_VTKUtils.h>
+#include <string>
 
 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;
@@ -53,36 +50,41 @@ class STDMESHERSGUI_EXPORT StdMeshersGUI_SubShapeSelectorWdg : public QWidget
   Q_OBJECT
 
 public:
-  StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0,
-                                     TopAbs_ShapeEnum aSubShType = TopAbs_EDGE );
+  StdMeshersGUI_SubShapeSelectorWdg( QWidget*         parent = 0,
+                                     TopAbs_ShapeEnum subShType = TopAbs_EDGE,
+                                     const bool       toShowList = true);
   ~StdMeshersGUI_SubShapeSelectorWdg();
 
   SMESH::long_array_var          GetListOfIDs();
   bool                           SetListOfIDs( SMESH::long_array_var );
+  const QList<int>&              GetSelectedIDs() const { return mySelectedIDs; }
 
-  void                           SetGeomShapeEntry( const QString& theEntry );
-  const char*                    GetGeomShapeEntry() { return myEntry.toLatin1().data();}
-
-  void                           SetMainShapeEntry( const QString& theEntry );
+  void                           SetGeomShapeEntry( const QString& theEntry,
+                                                    const QString& theMainShapeEntry);
   const char*                    GetMainShapeEntry();
 
   TopoDS_Shape                   GetGeomShape() { return myGeomShape; }
   TopoDS_Shape                   GetMainShape() { return myMainShape; }
 
-  QList<int>                     GetCorrectedListOfIDs( bool fromSubshapeToMainshape,
-                                                        bool* isOK=0);
-
   static GEOM::GEOM_Object_var   GetGeomObjectByEntry( const QString& );
   static TopoDS_Shape            GetTopoDSByEntry( const QString& );
 
   QString                        GetValue() const { return myParamValue; }
 
-  void                           showPreview ( bool );
+  void                           ShowPreview( bool );
 
   int                            GetListSize() { return myListOfIDs.size(); }
 
-  void SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; }
-  //void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
+  void                           SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; }
+
+  vtkRenderer*                   GetRenderer() { return myRenderer; }
+  SMESH_PreviewActorsCollection* GetActorCollection() { return myPreviewActor; }
+  void                           ClearSelected();
+  void                           ActivateSelection( bool );
+
+signals:
+  void                           selectionChanged(); // in the list
+  void                           shapeSelected();    // globally
 
 private:
   void                           updateState();
@@ -94,7 +96,7 @@ private slots:
   void                           onRemove(); 
   void                           onPrevious(); 
   void                           onNext(); 
-  void                           SelectionIntoArgument();
+  void                           selectionIntoArgument();
   void                           onListSelectionChanged();
 
 private:
@@ -107,8 +109,8 @@ private:
   SMESH::SMESH_Mesh_var          myMesh;
   TopoDS_Shape                   myGeomShape; // shape whose sub-shapes are selected
   TopoDS_Shape                   myMainShape; // main shape of the mesh
-  QString                        myEntry;
-  QString                        myMainEntry;
+  std::string                    myEntry;
+  std::string                    myMainEntry;
   vtkRenderer*                   myRenderer;
   
   QListWidget*                   myListWidget;
@@ -122,7 +124,6 @@ private:
   
   QString                        myParamValue;
   bool                           myIsShown;
-  bool                           myIsNotCorrected;
 
   // for manage possible size of myListOfIDs
   int                            myMaxSize;