1 // Copyright (C) 2007-2010 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;
46 class SMESH_PreviewActorsCollection;
49 class STDMESHERSGUI_EXPORT StdMeshersGUI_SubShapeSelectorWdg : public QWidget
54 StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0 );
55 ~StdMeshersGUI_SubShapeSelectorWdg();
57 SMESH::long_array_var GetListOfIDs();
58 void SetListOfIDs( SMESH::long_array_var );
60 void SetGeomShapeEntry( const QString& theEntry );
61 const char* GetGeomShapeEntry() { return myEntry.toLatin1().data();}
63 void SetMainShapeEntry( const QString& theEntry );
64 const char* GetMainShapeEntry();
66 TopoDS_Shape GetGeomShape() { return myGeomShape; }
67 TopoDS_Shape GetMainShape() { return myMainShape; }
69 QList<int> GetCorrectedListOfIDs( bool fromSubshapeToMainshape = true );
71 static GEOM::GEOM_Object_var GetGeomObjectByEntry( const QString& );
72 static TopoDS_Shape GetTopoDSByEntry( const QString& );
74 QString GetValue() const { return myParamValue; }
76 void showPreview ( bool );
78 int GetListSize() { return myListOfIDs.size(); }
80 void SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; }
81 void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
89 void SelectionIntoArgument();
90 void onListSelectionChanged();
97 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
98 SVTK_Selector* mySelector;
99 SMESH::SMESH_Mesh_var myMesh;
100 TopoDS_Shape myGeomShape;
101 TopoDS_Shape myMainShape;
104 vtkRenderer* myRenderer;
106 QListWidget* myListWidget;
107 QPushButton* myAddButton;
108 QPushButton* myRemoveButton;
109 QList<int> mySelectedIDs;
110 QList<int> myListOfIDs;
112 QString myParamValue;
114 bool myIsNotCorrected;
116 // for manage possible size of myListOfIDs
118 // for manage type of selected subshape
119 TopAbs_ShapeEnum mySubShType;
121 SMESH_PreviewActorsCollection* myPreviewActor;
124 #endif // STDMESHERSGUI_SUBSHAPESELECTORWDG_H