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_NumberOfLayers.cxx
25 // Author : Edward AGAPOV
29 #include "StdMeshers_NumberOfLayers.hxx"
32 #include "utilities.h"
37 //=============================================================================
39 * StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers
43 //=============================================================================
45 StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers(int hypId, int studyId,
47 : SMESH_Hypothesis(hypId, studyId, gen)
49 _name = "NumberOfLayers"; // used by RadialPrism_3D
50 _param_algo_dim = 3; // 3D
54 //=============================================================================
56 * StdMeshers_NumberOfLayers::~StdMeshers_NumberOfLayers
60 //=============================================================================
62 StdMeshers_NumberOfLayers::~StdMeshers_NumberOfLayers()
64 MESSAGE( "StdMeshers_NumberOfLayers::~StdMeshers_NumberOfLayers" );
67 //=============================================================================
69 * StdMeshers_NumberOfLayers::SetNumberOfLayers
71 * Sets <number of segments> parameter value
73 //=============================================================================
75 void StdMeshers_NumberOfLayers::SetNumberOfLayers(int numberOfLayers)
76 throw ( SALOME_Exception )
78 if ( _nbLayers != numberOfLayers ) {
79 if ( numberOfLayers <= 0 )
80 throw SALOME_Exception(LOCALIZED("numberOfLayers must be positive"));
81 _nbLayers = numberOfLayers;
83 NotifySubMeshesHypothesisModification();
87 //=============================================================================
89 * StdMeshers_NumberOfLayers::GetNumberOfLayers
91 * Returns <number of layers> parameter value
93 //=============================================================================
95 int StdMeshers_NumberOfLayers::GetNumberOfLayers() const
100 //=============================================================================
104 //=============================================================================
106 ostream & StdMeshers_NumberOfLayers::SaveTo(ostream & save)
112 //=============================================================================
116 //=============================================================================
118 istream & StdMeshers_NumberOfLayers::LoadFrom(istream & load)
121 isOK = (load >> _nbLayers);
123 load.clear(ios::badbit | load.rdstate());
127 //=============================================================================
131 //=============================================================================
133 ostream & operator <<(ostream & save, StdMeshers_NumberOfLayers & hyp)
135 return hyp.SaveTo( save );
138 //=============================================================================
142 //=============================================================================
144 istream & operator >>(istream & load, StdMeshers_NumberOfLayers & hyp)
146 return hyp.LoadFrom( load );
149 //================================================================================
151 * \brief Initialize start and end length by the mesh built on the geometry
152 * \param theMesh - the built mesh
153 * \param theShape - the geometry of interest
154 * \retval bool - true if parameter values have been successfully defined
156 //================================================================================
158 bool StdMeshers_NumberOfLayers::SetParametersByMesh(const SMESH_Mesh* ,
159 const TopoDS_Shape& )