1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SMESH SMESH : implementaion of SMESH idl descriptions
23 // File : SMESH_Hypothesis.cxx
24 // Author : Paul RASCLE, EDF
27 #include "SMESH_Hypothesis.hxx"
28 #include "SMESH_Gen.hxx"
29 #include "SMESH_subMesh.hxx"
30 #include "utilities.h"
34 //=============================================================================
38 //=============================================================================
40 SMESH_Hypothesis::SMESH_Hypothesis(int hypId,
42 SMESH_Gen* gen) : SMESHDS_Hypothesis(hypId)
44 //MESSAGE("SMESH_Hypothesis::SMESH_Hypothesis");
47 StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
48 myStudyContext->mapHypothesis[_hypId] = this;
50 _shapeType = 0; // to be set by algo with TopAbs_Enum
51 _param_algo_dim = -1; // to be set by algo parameter
54 //=============================================================================
58 //=============================================================================
60 SMESH_Hypothesis::~SMESH_Hypothesis()
62 MESSAGE("SMESH_Hypothesis::~SMESH_Hypothesis");
65 //=============================================================================
69 //=============================================================================
71 int SMESH_Hypothesis::GetDim() const
76 case ALGO_1D: dim = 1; break;
77 case ALGO_2D: dim = 2; break;
78 case ALGO_3D: dim = 3; break;
80 dim = ( _param_algo_dim < 0 ) ? -_param_algo_dim : _param_algo_dim; break;
85 //=============================================================================
89 //=============================================================================
91 int SMESH_Hypothesis::GetShapeType() const
96 //=============================================================================
100 //=============================================================================
102 int SMESH_Hypothesis::GetStudyId() const
107 //=============================================================================
111 //=============================================================================
113 void SMESH_Hypothesis::NotifySubMeshesHypothesisModification()
115 MESSAGE("SMESH_Hypothesis::NotifySubMeshesHypothesisModification");
117 // for all meshes in study
119 StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
120 map<int, SMESH_Mesh*>::iterator itm;
121 for (itm = myStudyContext->mapMesh.begin();
122 itm != myStudyContext->mapMesh.end();
125 SMESH_Mesh* mesh = (*itm).second;
126 mesh->NotifySubMeshesHypothesisModification( this );
130 //=============================================================================
134 //=============================================================================
136 const char* SMESH_Hypothesis::GetLibName() const
138 return _libName.c_str();
141 //=============================================================================
145 //=============================================================================
147 void SMESH_Hypothesis::SetLibName(const char* theLibName)
149 _libName = string(theLibName);
152 //=============================================================================
156 //=============================================================================
157 void SMESH_Hypothesis::SetParameters(const std::list<std::string>& theParameters)
159 _parameters = theParameters;
162 //=============================================================================
166 //=============================================================================
167 std::list<std::string> SMESH_Hypothesis::GetParameters() const