1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // SMESH SMESH : implementaion of SMESH idl descriptions
21 // File : StdMeshers_MaxLength.hxx
24 #ifndef _SMESH_MaxLength_HXX_
25 #define _SMESH_MaxLength_HXX_
27 #include "SMESH_StdMeshers.hxx"
29 #include "SMESH_Hypothesis.hxx"
30 #include "Utils_SALOME_Exception.hxx"
32 class STDMESHERS_EXPORT StdMeshers_MaxLength: public SMESH_Hypothesis
35 StdMeshers_MaxLength(int hypId, int studyId, SMESH_Gen * gen);
36 virtual ~ StdMeshers_MaxLength();
38 void SetLength(double length) throw(SALOME_Exception);
39 double GetLength() const;
41 bool HavePreestimatedLength() const { return _preestimated > 0.; }
42 double GetPreestimatedLength() const { return _preestimated; }
43 void SetPreestimatedLength(double length);
45 void SetUsePreestimatedLength(bool toUse);
46 bool GetUsePreestimatedLength() const;
48 virtual std::ostream & SaveTo(std::ostream & save);
49 virtual std::istream & LoadFrom(std::istream & load);
52 * \brief Initialize segment length by the mesh built on the geometry
53 * \param theMesh - the built mesh
54 * \param theShape - the geometry of interest
55 * \retval bool - true if parameter values have been successfully defined
57 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
60 * \brief Initialize my parameter values by default parameters.
61 * \retval bool - true if parameter values have been successfully defined
63 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
66 double _length, _preestimated;