4 * Copyright (C) 2005 CEA/DEN, EDF R&D
8 * File : SMESHGUI_MeshOp.h
9 * Author : Sergey LITONIN
13 #ifndef SMESHGUI_MeshOp_H
14 #define SMESHGUI_MeshOp_H
16 #include "SMESHGUI_SelectionOp.h"
17 #include <qstringlist.h>
19 #include <SALOMEconfig.h>
20 #include CORBA_SERVER_HEADER(GEOM_Gen)
21 #include CORBA_SERVER_HEADER(SMESH_Mesh)
23 class SMESHGUI_MeshDlg;
24 class SMESH_TypeFilter;
25 class SMESH_NumberFilter;
29 * \brief Operation for mech creation or editing
31 * This operation is used for mech creation or editing.
33 class SMESHGUI_MeshOp : public SMESHGUI_SelectionOp
37 enum HypType{ Algo = 0, MainHyp, AddHyp };
40 SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh = true );
41 virtual ~SMESHGUI_MeshOp();
43 virtual LightApp_Dialog* dlg() const;
46 virtual void startOperation();
47 virtual void selectionDone();
48 virtual SUIT_SelectionFilter* createFilter( const int ) const;
49 virtual bool isValid( SUIT_Operation* ) const;
52 virtual bool onApply();
53 void onCreateHyp( const int theHypType, const int theIndex );
54 void onEditHyp( const int theHypType, const int theIndex );
55 void onHypoSet( const QString& theSetName );
58 bool isValid( QString& ) const;
59 void availableHyps( const int theDim,
61 QStringList& theHyps ) const;
62 void existingHyps( const int theDim,
64 _PTR(SObject) theFather,
66 QValueList<SMESH::SMESH_Hypothesis_var>& theHypVars );
68 bool createMesh( QString& );
69 bool createSubMesh( QString& );
70 bool editMeshOrSubMesh( QString& );
72 int currentHyp( const int, const int ) const;
73 bool isAccessibleDim( const int ) const;
74 void setCurrentHyp( const int, const int, const int );
75 void setDefaultName() const;
76 SMESH::SMESH_Hypothesis_var getAlgo( const int );
78 QString name( _PTR(SObject) ) const;
79 int find( const SMESH::SMESH_Hypothesis_var&,
80 const QValueList<SMESH::SMESH_Hypothesis_var>& ) const;
83 typedef QMap< int, QValueList<SMESH::SMESH_Hypothesis_var> > IdToHypListMap;
84 typedef QMap< int, IdToHypListMap > DimToHypMap;
86 SMESHGUI_MeshDlg* myDlg;
90 DimToHypMap myExistingHyps; //!< all hypothesis of SMESH module
91 DimToHypMap myObjHyps; //!< hypothesis assigned to the current
92 // edited mesh/sub-mesh