1 // Copyright (C) 2007-2013 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.
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 // NETGENPlugin : C++ implementation
21 // File : NETGENPlugin_SimpleHypothesis_2D.hxx
22 // Author : Edward AGAPOV
24 //=============================================================================
26 #ifndef _NETGENPlugin_SimpleHypothesis_2D_HXX_
27 #define _NETGENPlugin_SimpleHypothesis_2D_HXX_
29 #include "NETGENPlugin_Defs.hxx"
31 #include "SMESH_Hypothesis.hxx"
32 #include "Utils_SALOME_Exception.hxx"
34 // Simplified parameters of NETGEN
39 class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_2D: public SMESH_Hypothesis
43 NETGENPlugin_SimpleHypothesis_2D(int hypId, int studyId, SMESH_Gen * gen);
46 * Sets <number of segments> value
48 void SetNumberOfSegments(int nb) throw (SALOME_Exception);
50 * Returns <number of segments> value.
51 * Can be zero in case if LocalLength() has been set
53 int GetNumberOfSegments() const { return _nbSegments; }
56 * Sets <segment length> value
58 void SetLocalLength(double segmentLength) throw (SALOME_Exception);
60 * Returns <segment length> value.
61 * Can be zero in case if NumberOfSegments() has been set
63 double GetLocalLength() const { return _segmentLength; }
66 * Sets <maximum element area> to be dependent on 1D discretization
68 void LengthFromEdges();
71 * Sets <maximum element area> value.
72 * Zero or negative value means same as LengthFromEdges().
74 void SetMaxElementArea(double area);
76 * Returns <maximum element area> value.
77 * Can be zero in case of LengthFromEdges()
79 double GetMaxElementArea() const { return _area; }
82 * Enables/disables generation of quadrangular faces
84 void SetAllowQuadrangles(bool toAllow);
86 * Returns true if generation of quadrangular faces is enabled
88 bool GetAllowQuadrangles() const;
91 virtual ostream & SaveTo(ostream & save);
92 virtual istream & LoadFrom(istream & load);
95 * \brief Set parameters by mesh
96 * \param theMesh - the built mesh
97 * \param theShape - the geometry of interest
98 * \retval bool - true if theShape is meshed
100 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
103 * \brief Initialize my parameter values by default parameters.
104 * \retval bool - true if parameter values have been successfully defined
106 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
110 double _segmentLength, _area;