1 // Copyright (C) 2012-2015 ALNEOS
2 // Copyright (C) 2016-2024 EDF
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.alneos.com/ or email : contact@alneos.fr
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #ifndef _GMSHPlugin_Hypothesis_i_HXX_
22 #define _GMSHPlugin_Hypothesis_i_HXX_
24 #include "GMSHPlugin_Defs.hxx"
26 #include <SALOMEconfig.h>
27 #include CORBA_SERVER_HEADER(GMSHPlugin_Algorithm)
29 #include "SMESH_Hypothesis_i.hxx"
30 #include "GMSHPlugin_Hypothesis.hxx"
35 // GMSHPlugin parameters hypothesis
37 class GMSHPLUGIN_EXPORT GMSHPlugin_Hypothesis_i:
38 public virtual POA_GMSHPlugin::GMSHPlugin_Hypothesis,
39 public virtual SMESH_Hypothesis_i
43 GMSHPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
44 ::SMESH_Gen* theGenImpl);
46 virtual ~GMSHPlugin_Hypothesis_i();
49 void SetMeshCurvatureSize(CORBA::Double theMeshCurvatureSize);
50 CORBA::Double GetMeshCurvatureSize();
52 void SetMaxSize(CORBA::Double theSize);
53 CORBA::Double GetMaxSize();
55 void SetMinSize(CORBA::Double theSize);
56 CORBA::Double GetMinSize();
58 void SetSecondOrder(CORBA::Boolean theVal);
59 CORBA::Boolean GetSecondOrder();
61 void Set2DAlgo(CORBA::Long the2DAlgo);
62 CORBA::Long Get2DAlgo();
63 void Set3DAlgo(CORBA::Long the3DAlgo);
64 CORBA::Long Get3DAlgo();
65 void SetRecomb2DAlgo(CORBA::Long theRecomb2DAlgo);
66 CORBA::Long GetRecomb2DAlgo();
67 void SetRecombineAll(CORBA::Boolean theRecombineAll);
68 CORBA::Boolean GetRecombineAll();
69 void SetSubdivAlgo(CORBA::Long theSubdivAlgo);
70 CORBA::Long GetSubdivAlgo();
71 void SetRemeshAlgo(CORBA::Long theRemeshAlgo);
72 CORBA::Long GetRemeshAlgo();
73 void SetRemeshPara(CORBA::Long theRemeshPara);
74 CORBA::Long GetRemeshPara();
75 void SetSmouthSteps(CORBA::Double theSmouthSteps);
76 CORBA::Double GetSmouthSteps();
77 void SetSizeFactor(CORBA::Double theSizeFactor);
78 CORBA::Double GetSizeFactor();
79 void SetUseIncomplElem(CORBA::Boolean theUseIncomplElem);
80 CORBA::Boolean GetUseIncomplElem();
81 void SetIs2d(CORBA::Boolean theIs2d);
82 void SetVerbosityLevel(CORBA::Long theVerbLvl);
83 CORBA::Long GetVerbosityLevel();
84 CORBA::Boolean GetIs2d();
86 void SetCompoundOnShape(GEOM::GEOM_Object_ptr GeomObj);
87 void SetCompoundOnEntry(const char* entry);
88 void UnsetCompoundOnShape(GEOM::GEOM_Object_ptr GeomObj);
89 void UnsetCompoundOnEntry(const char* entry);
90 GMSHPlugin::string_array* GetCompoundOnEntries();
94 void SetGrowthRate(CORBA::Double theRate);
95 CORBA::Double GetGrowthRate();
97 void SetNbSegPerEdge(CORBA::Double theVal);
98 CORBA::Double GetNbSegPerEdge();
100 void SetNbSegPerRadius(CORBA::Double theVal);
101 CORBA::Double GetNbSegPerRadius();
103 // void SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize);
104 // void SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize);
105 // CORBA::Double GetLocalSizeOnEntry(const char* entry);
106 // GMSHPlugin::string_array* GetLocalSizeEntries();
108 void UnsetLocalSizeOnEntry(const char* entry);
110 // Get implementation
111 ::GMSHPlugin_Hypothesis* GetImpl();
113 // Verify whether hypothesis supports given entity type
114 CORBA::Boolean IsDimSupported( SMESH::Dimension type );
118 // to remember whether a parameter is already set (issue 0021364)
121 METH_SetMeshCurvatureSize = 5,
124 METH_SetSecondOrder = 4,
126 //METH_SetFineness = 16,
127 METH_SetGrowthRate = 32,
128 METH_SetNbSegPerEdge = 64,
129 METH_SetNbSegPerRadius = 128,
130 METH_SetLocalSizeOnEntry = 256,
132 METH_SetCompoundOnEntry = 299,
133 METH_Set2DAlgo = 300,
134 METH_Set3DAlgo = 301,
135 METH_SetRecomb2DAlgo = 302,
136 METH_SetRecombineAll = 303,
137 METH_SetSubdivAlgo = 304,
138 METH_SetRemeshAlgo = 305,
139 METH_SetRemeshPara = 306,
140 METH_SetSmouthSteps = 307,
141 METH_SetSizeFactor = 308,
142 METH_SetUseIncomplElem = 309,
144 METH_SetVerbosityLevel = 311,
146 METH_LAST = METH_SetLocalSizeOnEntry
148 int mySetMethodFlags;
150 // Return true if a parameter is not yet set, else return true if a parameter changes.
151 // PythonDumping depends on the result of this function.
152 // Checking only change of a parameter is not enough because then the default values are
153 // not dumped and if the defaults will change then the behaviour of scripts
154 // created without dump of the default parameters will also change what is not good.
156 bool isToSetParameter(T curValue, T newValue, /*SettingMethod*/int meth)
158 if ( mySetMethodFlags & meth ) // already set, check if a value is changing
159 return ( curValue != newValue );
161 return ( mySetMethodFlags |= meth ); // == return true
165 // method intended to remove explicit treatment of Netagen hypotheses from
166 // SMESH_NoteBook to assure backward compatibility after implemeneting
167 // issue 0021308: Remove hard-coded dependency of the external mesh plugins
168 virtual int getParamIndex(const TCollection_AsciiString& method, int nbVars) const;
170 // method used to convert variable parameters stored in an old study
171 // into myMethod2VarParams. It should return a method name for an index of
172 // variable parameters. Index is countered from zero
173 virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
176 // Methods for copying mesh definition to other geometry
178 // Return geometry this hypothesis depends on. Return false if there is no geometry parameter
179 virtual bool getObjectsDependOn( std::vector< std::string > & entryArray,
180 std::vector< int > & subIDArray ) const;
182 // Set new geometry instead of that returned by getObjectsDependOn()
183 virtual bool setObjectsDependOn( std::vector< std::string > & entryArray,
184 std::vector< int > & subIDArray );