1 // NETGENPlugin : C++ implementation
3 // Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : NETGENPlugin_Hypothesis.hxx
23 // Author : Michael Sazonov (OCN)
27 //=============================================================================
29 #ifndef _NETGENPlugin_Hypothesis_HXX_
30 #define _NETGENPlugin_Hypothesis_HXX_
32 #include "SMESH_Hypothesis.hxx"
33 #include "Utils_SALOME_Exception.hxx"
35 // Parameters for work of NETGEN
38 class NETGENPlugin_Hypothesis: public SMESH_Hypothesis
42 NETGENPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
44 void SetMaxSize(double theSize);
45 double GetMaxSize() const { return _maxSize; }
47 void SetSecondOrder(bool theVal);
48 bool GetSecondOrder() const { return _secondOrder; }
50 void SetOptimize(bool theVal);
51 bool GetOptimize() const { return _optimize; }
63 void SetFineness(Fineness theFineness);
64 Fineness GetFineness() const { return _fineness; }
66 // the following parameters are controlled by Fineness
68 void SetGrowthRate(double theRate);
69 double GetGrowthRate() const { return _growthRate; }
71 void SetNbSegPerEdge(double theVal);
72 double GetNbSegPerEdge() const { return _nbSegPerEdge; }
74 void SetNbSegPerRadius(double theVal);
75 double GetNbSegPerRadius() const { return _nbSegPerRadius; }
77 // the default values (taken from NETGEN 4.5 sources)
79 static double GetDefaultMaxSize();
80 static Fineness GetDefaultFineness();
81 static double GetDefaultGrowthRate();
82 static double GetDefaultNbSegPerEdge();
83 static double GetDefaultNbSegPerRadius();
84 static bool GetDefaultSecondOrder();
85 static bool GetDefaultOptimize();
88 virtual ostream & SaveTo(ostream & save);
89 virtual istream & LoadFrom(istream & load);
90 friend ostream & operator <<(ostream & save, NETGENPlugin_Hypothesis & hyp);
91 friend istream & operator >>(istream & load, NETGENPlugin_Hypothesis & hyp);
95 * \param theMesh - the built mesh
96 * \param theShape - the geometry of interest
97 * \retval bool - always false
99 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
104 double _nbSegPerEdge;
105 double _nbSegPerRadius;