1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/
23 * Copyright (C) 2005 CEA/DEN, EDF R&D
27 * File : SMESHGUI_MeshOp.h
28 * Author : Sergey LITONIN
32 #ifndef SMESHGUI_MeshOp_H
33 #define SMESHGUI_MeshOp_H
35 #include "SMESHGUI_SelectionOp.h"
36 #include <qstringlist.h>
38 #include <SALOMEconfig.h>
39 #include CORBA_SERVER_HEADER(GEOM_Gen)
40 #include CORBA_SERVER_HEADER(SMESH_Mesh)
42 class SMESHGUI_MeshDlg;
43 class SMESH_TypeFilter;
44 class SMESH_NumberFilter;
48 * \brief Operation for mech creation or editing
50 * This operation is used for mech creation or editing.
52 class SMESHGUI_MeshOp : public SMESHGUI_SelectionOp
56 enum HypType{ Algo = 0, MainHyp, AddHyp };
59 SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh = true );
60 virtual ~SMESHGUI_MeshOp();
62 virtual LightApp_Dialog* dlg() const;
65 virtual void startOperation();
66 virtual void selectionDone();
67 virtual SUIT_SelectionFilter* createFilter( const int ) const;
68 virtual bool isValid( SUIT_Operation* ) const;
71 virtual bool onApply();
72 void onCreateHyp( const int theHypType, const int theIndex );
73 void onEditHyp( const int theHypType, const int theIndex );
74 void onHypoSet( const QString& theSetName );
77 bool isValid( QString& ) const;
78 void availableHyps( const int theDim,
80 QStringList& theHyps ) const;
81 void existingHyps( const int theDim,
83 _PTR(SObject) theFather,
85 QValueList<SMESH::SMESH_Hypothesis_var>& theHypVars );
87 bool createMesh( QString& );
88 bool createSubMesh( QString& );
89 bool editMeshOrSubMesh( QString& );
91 int currentHyp( const int, const int ) const;
92 bool isAccessibleDim( const int ) const;
93 void setCurrentHyp( const int, const int, const int );
94 void setDefaultName() const;
95 SMESH::SMESH_Hypothesis_var getAlgo( const int );
97 QString name( _PTR(SObject) ) const;
98 int find( const SMESH::SMESH_Hypothesis_var&,
99 const QValueList<SMESH::SMESH_Hypothesis_var>& ) const;
102 typedef QMap< int, QValueList<SMESH::SMESH_Hypothesis_var> > IdToHypListMap;
103 typedef QMap< int, IdToHypListMap > DimToHypMap;
105 SMESHGUI_MeshDlg* myDlg;
109 DimToHypMap myExistingHyps; //!< all hypothesis of SMESH module
110 DimToHypMap myObjHyps; //!< hypothesis assigned to the current
111 // edited mesh/sub-mesh