2 //=============================================================================
3 // File : SMESH_Hypothesis.cxx
4 // Created : sam mai 18 08:08:50 CEST 2002
5 // Author : Paul RASCLE, EDF
7 // Copyright : EDF 2002
9 //=============================================================================
12 #include "SMESH_Hypothesis.hxx"
13 #include "SMESH_Gen.hxx"
14 #include "utilities.h"
16 //=============================================================================
20 //=============================================================================
22 SMESH_Hypothesis::SMESH_Hypothesis(int hypId,
24 SMESH_Gen* gen) : SMESHDS_Hypothesis(hypId)
26 //MESSAGE("SMESH_Hypothesis::SMESH_Hypothesis");
29 StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
30 myStudyContext->mapHypothesis[_hypId] = this;
32 // _shapeType = -1; // to be set by algo with TopAbs_Enum
33 _shapeType = 0; // to be set by algo with TopAbs_Enum
36 //=============================================================================
40 //=============================================================================
42 SMESH_Hypothesis::~SMESH_Hypothesis()
44 MESSAGE("SMESH_Hypothesis::~SMESH_Hypothesis");
47 //=============================================================================
51 //=============================================================================
53 int SMESH_Hypothesis::GetDim()
58 case ALGO_1D: dim = 1; break;
59 case ALGO_2D: dim = 2; break;
60 case ALGO_3D: dim = 3; break;
65 //=============================================================================
69 //=============================================================================
71 int SMESH_Hypothesis::GetShapeType()
76 //=============================================================================
80 //=============================================================================
82 int SMESH_Hypothesis::GetStudyId()
87 //=============================================================================
91 //=============================================================================
93 void SMESH_Hypothesis::NotifySubMeshesHypothesisModification()
95 MESSAGE("SMESH_Hypothesis::NotifySubMeshesHypothesisModification");
97 // for all meshes in study
99 StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
100 map<int, SMESH_Mesh*>::iterator itm;
101 for (itm = myStudyContext->mapMesh.begin();
102 itm != myStudyContext->mapMesh.end();
105 SMESH_Mesh* mesh = (*itm).second;
106 const list<SMESH_subMesh*>& subMeshes =
107 mesh->GetSubMeshUsingHypothesis(this);
109 //for all subMeshes using hypothesis
111 list<SMESH_subMesh*>::const_iterator its;
112 for (its = subMeshes.begin(); its != subMeshes.end(); its++)
113 (*its)->ComputeStateEngine(SMESH_subMesh::MODIF_HYP);