1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : StdMeshersGUI_SubShapeSelectorWdg.h
21 // Author : Open CASCADE S.A.S. (dmv)
23 #ifndef STDMESHERSGUI_SUBSHAPESELECTORWDG_H
24 #define STDMESHERSGUI_SUBSHAPESELECTORWDG_H
28 #include "SMESH_StdMeshersGUI.hxx"
29 #include "SMESH_SMESHGUI.hxx"
33 #include <QStringList>
34 #include <TopoDS_Shape.hxx>
36 #include <SMESHGUI_VTKUtils.h>
39 class LightApp_SelectionMgr;
47 class SMESH_PreviewActorsCollection;
49 class SUIT_SelectionFilter;
51 class STDMESHERSGUI_EXPORT StdMeshersGUI_SubShapeSelectorWdg : public QWidget
56 StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0,
57 TopAbs_ShapeEnum aSubShType = TopAbs_EDGE );
58 ~StdMeshersGUI_SubShapeSelectorWdg();
60 SMESH::long_array_var GetListOfIDs();
61 void SetListOfIDs( SMESH::long_array_var );
63 void SetGeomShapeEntry( const QString& theEntry );
64 const char* GetGeomShapeEntry() { return myEntry.toLatin1().data();}
66 void SetMainShapeEntry( const QString& theEntry );
67 const char* GetMainShapeEntry();
69 TopoDS_Shape GetGeomShape() { return myGeomShape; }
70 TopoDS_Shape GetMainShape() { return myMainShape; }
72 QList<int> GetCorrectedListOfIDs( bool fromSubshapeToMainshape = true );
74 static GEOM::GEOM_Object_var GetGeomObjectByEntry( const QString& );
75 static TopoDS_Shape GetTopoDSByEntry( const QString& );
77 QString GetValue() const { return myParamValue; }
79 void showPreview ( bool );
81 int GetListSize() { return myListOfIDs.size(); }
83 void SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; }
84 //void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
96 void SelectionIntoArgument();
97 void onListSelectionChanged();
103 SMESHGUI* mySMESHGUI;
104 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
105 SVTK_Selector* mySelector;
106 SMESH::SMESH_Mesh_var myMesh;
107 TopoDS_Shape myGeomShape; // shape whose sub-shapes are selected
108 TopoDS_Shape myMainShape; // main shape of the mesh
111 vtkRenderer* myRenderer;
113 QListWidget* myListWidget;
114 QPushButton* myAddButton;
115 QPushButton* myRemoveButton;
117 QPushButton* myPrevButton;
118 QPushButton* myNextButton;
119 QList<int> mySelectedIDs;
120 QList<int> myListOfIDs;
122 QString myParamValue;
124 bool myIsNotCorrected;
126 // for manage possible size of myListOfIDs
128 // for manage type of selected subshape
129 TopAbs_ShapeEnum mySubShType;
131 SMESH_PreviewActorsCollection* myPreviewActor;
132 QList<SUIT_SelectionFilter*> myGeomFilters;
133 SUIT_SelectionFilter* myFilter;
136 #endif // STDMESHERSGUI_SUBSHAPESELECTORWDG_H