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;
48 class SUIT_SelectionFilter;
50 class STDMESHERSGUI_EXPORT StdMeshersGUI_SubShapeSelectorWdg : public QWidget
55 StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0 );
56 ~StdMeshersGUI_SubShapeSelectorWdg();
58 SMESH::long_array_var GetListOfIDs();
59 void SetListOfIDs( SMESH::long_array_var );
61 void SetGeomShapeEntry( const QString& theEntry );
62 const char* GetGeomShapeEntry() { return myEntry.toLatin1().data();}
64 void SetMainShapeEntry( const QString& theEntry );
65 const char* GetMainShapeEntry();
67 TopoDS_Shape GetGeomShape() { return myGeomShape; }
68 TopoDS_Shape GetMainShape() { return myMainShape; }
70 QList<int> GetCorrectedListOfIDs( bool fromSubshapeToMainshape = true );
72 static GEOM::GEOM_Object_var GetGeomObjectByEntry( const QString& );
73 static TopoDS_Shape GetTopoDSByEntry( const QString& );
75 QString GetValue() const { return myParamValue; }
77 void showPreview ( bool );
79 int GetListSize() { return myListOfIDs.size(); }
81 void SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; }
82 void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
90 void SelectionIntoArgument();
91 void onListSelectionChanged();
98 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
99 SVTK_Selector* mySelector;
100 SMESH::SMESH_Mesh_var myMesh;
101 TopoDS_Shape myGeomShape;
102 TopoDS_Shape myMainShape;
105 vtkRenderer* myRenderer;
107 QListWidget* myListWidget;
108 QPushButton* myAddButton;
109 QPushButton* myRemoveButton;
110 QList<int> mySelectedIDs;
111 QList<int> myListOfIDs;
113 QString myParamValue;
115 bool myIsNotCorrected;
117 // for manage possible size of myListOfIDs
119 // for manage type of selected subshape
120 TopAbs_ShapeEnum mySubShType;
122 SMESH_PreviewActorsCollection* myPreviewActor;
123 QList<SUIT_SelectionFilter*> myGeomFilters;
124 SUIT_SelectionFilter* myFilter;
127 #endif // STDMESHERSGUI_SUBSHAPESELECTORWDG_H