1 // Copyright (C) 2007-2014 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, or (at your option) any later version.
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 bool 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,
75 static GEOM::GEOM_Object_var GetGeomObjectByEntry( const QString& );
76 static TopoDS_Shape GetTopoDSByEntry( const QString& );
78 QString GetValue() const { return myParamValue; }
80 void showPreview ( bool );
82 int GetListSize() { return myListOfIDs.size(); }
84 void SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; }
85 //void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
97 void SelectionIntoArgument();
98 void onListSelectionChanged();
104 SMESHGUI* mySMESHGUI;
105 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
106 SVTK_Selector* mySelector;
107 SMESH::SMESH_Mesh_var myMesh;
108 TopoDS_Shape myGeomShape; // shape whose sub-shapes are selected
109 TopoDS_Shape myMainShape; // main shape of the mesh
112 vtkRenderer* myRenderer;
114 QListWidget* myListWidget;
115 QPushButton* myAddButton;
116 QPushButton* myRemoveButton;
118 QPushButton* myPrevButton;
119 QPushButton* myNextButton;
120 QList<int> mySelectedIDs;
121 QList<int> myListOfIDs;
123 QString myParamValue;
125 bool myIsNotCorrected;
127 // for manage possible size of myListOfIDs
129 // for manage type of selected subshape
130 TopAbs_ShapeEnum mySubShType;
132 SMESH_PreviewActorsCollection* myPreviewActor;
133 QList<SUIT_SelectionFilter*> myGeomFilters;
134 SUIT_SelectionFilter* myFilter;
137 #endif // STDMESHERSGUI_SUBSHAPESELECTORWDG_H