1 // SMESH SMESH : idl implementation based on 'SMESH' unit's classes
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : StdMeshers_LayerDistribution.cxx
25 // Author : Edward AGAPOV
29 #include "StdMeshers_LayerDistribution.hxx"
31 #include "utilities.h"
36 //=============================================================================
38 * StdMeshers_LayerDistribution::StdMeshers_LayerDistribution
42 //=============================================================================
44 StdMeshers_LayerDistribution::StdMeshers_LayerDistribution(int hypId, int studyId,
46 : SMESH_Hypothesis(hypId, studyId, gen)
48 _name = "LayerDistribution"; // used by RadialPrism_3D
49 _param_algo_dim = 3; // 3D
53 //=============================================================================
55 * StdMeshers_LayerDistribution::~StdMeshers_LayerDistribution
59 //=============================================================================
61 StdMeshers_LayerDistribution::~StdMeshers_LayerDistribution()
63 MESSAGE( "StdMeshers_LayerDistribution::~StdMeshers_LayerDistribution" );
66 //=============================================================================
68 * \brief Sets 1D hypothesis specifying distribution of layers
69 * \param hyp1D - 1D hypothesis
71 //=============================================================================
73 void StdMeshers_LayerDistribution::SetLayerDistribution(SMESH_Hypothesis* hyp1D)
74 throw ( SALOME_Exception )
76 if ( myHyp != hyp1D ) {
77 if ( myHyp && hyp1D->GetDim() != 1 )
78 throw SALOME_Exception(LOCALIZED("1D hypothesis is expected"));
81 std::ostringstream os;
85 if ( mySavedHyp != os.str() )
86 NotifySubMeshesHypothesisModification();
88 mySavedHyp = os.str();
91 //=============================================================================
93 * Servant saves and loads my hypothesis
95 //=============================================================================
97 ostream & StdMeshers_LayerDistribution::SaveTo(ostream & save)
102 //=============================================================================
104 * Servant saves and loads my hypothesis
106 //=============================================================================
108 istream & StdMeshers_LayerDistribution::LoadFrom(istream & load)
113 //=============================================================================
117 //=============================================================================
119 ostream & operator <<(ostream & save, StdMeshers_LayerDistribution & hyp)
121 return hyp.SaveTo( save );
124 //=============================================================================
128 //=============================================================================
130 istream & operator >>(istream & load, StdMeshers_LayerDistribution & hyp)
132 return hyp.LoadFrom( load );
135 //================================================================================
137 * \brief Initialize start and end length by the mesh built on the geometry
138 * \param theMesh - the built mesh
139 * \param theShape - the geometry of interest
140 * \retval bool - true if parameter values have been successfully defined
142 //================================================================================
144 bool StdMeshers_LayerDistribution::SetParametersByMesh(const SMESH_Mesh* ,
145 const TopoDS_Shape& )