1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : StdMeshersGUI_SubShapeSelectorWdg.h
23 // Author : Open CASCADE S.A.S. (dmv)
25 #ifndef STDMESHERSGUI_SUBSHAPESELECTORWDG_H
26 #define STDMESHERSGUI_SUBSHAPESELECTORWDG_H
30 #include "SMESH_StdMeshersGUI.hxx"
31 #include "SMESH_SMESHGUI.hxx"
35 #include <QStringList>
36 #include <TopoDS_Shape.hxx>
38 #include <SMESHGUI_VTKUtils.h>
41 class LightApp_SelectionMgr;
48 class SMESH_PreviewActorsCollection;
51 class STDMESHERSGUI_EXPORT StdMeshersGUI_SubShapeSelectorWdg : public QWidget
56 StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0 );
57 ~StdMeshersGUI_SubShapeSelectorWdg();
59 SMESH::long_array_var GetListOfIDs();
60 void SetListOfIDs( SMESH::long_array_var );
62 void SetGeomShapeEntry( const QString& theEntry );
63 const char* GetGeomShapeEntry() { return myEntry.toLatin1().data();}
65 void SetMainShapeEntry( const QString& theEntry );
66 const char* GetMainShapeEntry();
68 TopoDS_Shape GetGeomShape() { return myGeomShape; }
69 TopoDS_Shape GetMainShape() { return myMainShape; }
71 QList<int> GetCorrectedListOfIDs( bool fromSubshapeToMainshape = true );
73 static GEOM::GEOM_Object_var GetGeomObjectByEntry( const QString& );
74 static TopoDS_Shape GetTopoDSByEntry( const QString& );
76 QString GetValue() const { return myParamValue; }
78 void showPreview ( bool );
80 int GetListSize() { return myListOfIDs.size(); }
82 void SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; }
83 void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
91 void SelectionIntoArgument();
92 void onListSelectionChanged();
99 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
100 SVTK_Selector* mySelector;
101 SMESH::SMESH_Mesh_var myMesh;
102 TopoDS_Shape myGeomShape;
103 TopoDS_Shape myMainShape;
106 vtkRenderer* myRenderer;
108 QListWidget* myListWidget;
109 QPushButton* myAddButton;
110 QPushButton* myRemoveButton;
111 QList<int> mySelectedIDs;
112 QList<int> myListOfIDs;
114 QString myParamValue;
116 bool myIsNotCorrected;
118 // for manage possible size of myListOfIDs
120 // for manage type of selected subshape
121 TopAbs_ShapeEnum mySubShType;
123 SMESH_PreviewActorsCollection* myPreviewActor;
126 #endif // STDMESHERSGUI_SUBSHAPESELECTORWDG_H