1 // SMESH SMESH : implementaion of SMESH idl descriptions
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_subMesh.hxx
25 // Author : Paul RASCLE, EDF
29 #ifndef _SMESH_SUBMESH_HXX_
30 #define _SMESH_SUBMESH_HXX_
32 #include "SMESHDS_Mesh.hxx"
33 #include "SMESHDS_SubMesh.hxx"
34 #include "Utils_SALOME_Exception.hxx"
35 #include <TopoDS_Shape.hxx>
36 #include <TColStd_IndexedMapOfTransient.hxx>
37 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
44 class SMESH_Hypothesis;
49 SMESH_subMesh(int Id, SMESH_Mesh * father, SMESHDS_Mesh * meshDS,
50 const TopoDS_Shape & aSubShape);
51 virtual ~ SMESH_subMesh();
55 // bool Contains(const TopoDS_Shape & aSubShape)
56 // throw (SALOME_Exception);
58 SMESHDS_SubMesh * GetSubMeshDS() throw(SALOME_Exception);
60 SMESH_subMesh *GetFirstToCompute() throw(SALOME_Exception);
62 const map < int, SMESH_subMesh * >&DependsOn();
63 const map < int, SMESH_subMesh * >&Dependants();
65 const TopoDS_Shape & GetSubShape();
67 bool _vertexSet; // only for vertex subMesh, set to false for dim > 0
70 { NOT_READY, READY_TO_COMPUTE,
71 COMPUTE_OK, FAILED_TO_COMPUTE
74 { NO_ALGO, MISSING_HYP, HYP_OK };
77 REMOVE_HYP, REMOVE_ALGO,
78 ADD_FATHER_HYP, ADD_FATHER_ALGO,
79 REMOVE_FATHER_HYP, REMOVE_FATHER_ALGO
82 { MODIF_HYP, MODIF_ALGO_STATE, COMPUTE,
83 CLEAN, CLEANDEP, SUBMESH_COMPUTED
86 bool AlgoStateEngine(int event, SMESH_Hypothesis * anHyp)
87 throw(SALOME_Exception);
89 void SubMeshesAlgoStateEngine(int event, SMESH_Hypothesis * anHyp)
90 throw(SALOME_Exception);
92 void DumpAlgoState(bool isMain);
94 bool ComputeStateEngine(int event) throw(SALOME_Exception);
102 void InsertDependence(const TopoDS_Shape aSubShape);
103 // void FinalizeDependence(list<TopoDS_Shape>& shapeList);
105 bool SubMeshesComputed() throw(SALOME_Exception);
107 bool SubMeshesReady();
109 void RemoveSubMeshElementsAndNodes();
110 void UpdateDependantsState();
111 void CleanDependants();
112 void ExtractDependants(const TopTools_IndexedDataMapOfShapeListOfShape & M,
113 const TopAbs_ShapeEnum etype);
114 void SetAlgoState(int state);
116 TopoDS_Shape _subShape;
117 SMESHDS_Mesh * _meshDS;
118 SMESHDS_SubMesh * _subMeshDS;
121 map < int, SMESH_subMesh * >_mapDepend;
122 map < int, SMESH_subMesh * >_mapDependants;
123 bool _dependenceAnalysed;
124 bool _dependantsFound;