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 SalomeApp_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 );
57 bool isValid( QString& ) const;
58 void availableHyps( const int theDim,
60 QStringList& theHyps ) const;
61 void existingHyps( const int theDim,
63 _PTR(SObject) theFather,
65 QValueList<SMESH::SMESH_Hypothesis_var>& theHypVars );
67 bool createMesh( QString& );
68 bool createSubMesh( QString& );
69 bool editMeshOrSubMesh( QString& );
71 int currentHyp( const int, const int ) const;
72 void setCurrentHyp( const int, const int, const int );
73 void setDefaultName() const;
74 SMESH::SMESH_Hypothesis_var getAlgo( const int );
76 QString name( _PTR(SObject) ) const;
77 int find( const SMESH::SMESH_Hypothesis_var&,
78 const QValueList<SMESH::SMESH_Hypothesis_var>& ) const;
81 typedef QMap< int, QValueList<SMESH::SMESH_Hypothesis_var> > IdToHypListMap;
82 typedef QMap< int, IdToHypListMap > DimToHypMap;
84 SMESHGUI_MeshDlg* myDlg;
88 DimToHypMap myExistingHyps; //!< all hypothesis of SMESH module
89 DimToHypMap myObjHyps; //!< hypothesis assigned to the current
90 // edited mesh/sub-mesh