1 // Copyright (C) 2012-2013 ALNEOS
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.alneos.com/ or email : contact@alneos.fr
19 #ifndef _GMSHPlugin_Hypothesis_i_HXX_
20 #define _GMSHPlugin_Hypothesis_i_HXX_
22 #include "GMSHPlugin_Defs.hxx"
24 #include <SALOMEconfig.h>
25 #include CORBA_SERVER_HEADER(GMSHPlugin_Algorithm)
27 #include "SMESH_Hypothesis_i.hxx"
28 #include "GMSHPlugin_Hypothesis.hxx"
33 // GMSHPlugin parameters hypothesis
35 class GMSHPLUGIN_EXPORT GMSHPlugin_Hypothesis_i:
36 public virtual POA_GMSHPlugin::GMSHPlugin_Hypothesis,
37 public virtual SMESH_Hypothesis_i
41 GMSHPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
43 ::SMESH_Gen* theGenImpl);
45 virtual ~GMSHPlugin_Hypothesis_i();
49 void SetMaxSize(CORBA::Double theSize);
50 CORBA::Double GetMaxSize();
52 void SetMinSize(CORBA::Double theSize);
53 CORBA::Double GetMinSize();
55 void SetSecondOrder(CORBA::Boolean theVal);
56 CORBA::Boolean GetSecondOrder();
58 void Set2DAlgo(CORBA::Long the2DAlgo);
59 CORBA::Long Get2DAlgo();
60 void Set3DAlgo(CORBA::Long the3DAlgo);
61 CORBA::Long Get3DAlgo();
62 void SetRecomb2DAlgo(CORBA::Long theRecomb2DAlgo);
63 CORBA::Long GetRecomb2DAlgo();
64 void SetRecombineAll(CORBA::Boolean theRecombineAll);
65 CORBA::Boolean GetRecombineAll();
66 void SetSubdivAlgo(CORBA::Long theSubdivAlgo);
67 CORBA::Long GetSubdivAlgo();
68 void SetRemeshAlgo(CORBA::Long theRemeshAlgo);
69 CORBA::Long GetRemeshAlgo();
70 void SetRemeshPara(CORBA::Long theRemeshPara);
71 CORBA::Long GetRemeshPara();
72 void SetSmouthSteps(CORBA::Double theSmouthSteps);
73 CORBA::Double GetSmouthSteps();
74 void SetSizeFactor(CORBA::Double theSizeFactor);
75 CORBA::Double GetSizeFactor();
76 void SetUseIncomplElem(CORBA::Boolean theUseIncomplElem);
77 CORBA::Boolean GetUseIncomplElem();
78 void SetIs2d(CORBA::Boolean theIs2d);
80 void SetCompoundOnShape(GEOM::GEOM_Object_ptr GeomObj);
81 void SetCompoundOnEntry(const char* entry);
82 void UnsetCompoundOnShape(GEOM::GEOM_Object_ptr GeomObj);
83 void UnsetCompoundOnEntry(const char* entry);
84 GMSHPlugin::string_array* GetCompoundOnEntries();
88 void SetGrowthRate(CORBA::Double theRate);
89 CORBA::Double GetGrowthRate();
91 void SetNbSegPerEdge(CORBA::Double theVal);
92 CORBA::Double GetNbSegPerEdge();
94 void SetNbSegPerRadius(CORBA::Double theVal);
95 CORBA::Double GetNbSegPerRadius();
97 void SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize);
98 void SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize);
99 CORBA::Double GetLocalSizeOnEntry(const char* entry);
100 GMSHPlugin::string_array* GetLocalSizeEntries();
102 void UnsetLocalSizeOnEntry(const char* entry);
104 // Get implementation
105 ::GMSHPlugin_Hypothesis* GetImpl();
107 // Verify whether hypothesis supports given entity type
108 CORBA::Boolean IsDimSupported( SMESH::Dimension type );
112 // to remember whether a parameter is already set (issue 0021364)
117 METH_SetSecondOrder = 4,
119 //METH_SetFineness = 16,
120 METH_SetGrowthRate = 32,
121 METH_SetNbSegPerEdge = 64,
122 METH_SetNbSegPerRadius = 128,
123 METH_SetLocalSizeOnEntry = 256,
125 METH_SetCompoundOnEntry = 299,
126 METH_Set2DAlgo = 300,
127 METH_Set3DAlgo = 301,
128 METH_SetRecomb2DAlgo = 302,
129 METH_SetRecombineAll = 303,
130 METH_SetSubdivAlgo = 304,
131 METH_SetRemeshAlgo = 305,
132 METH_SetRemeshPara = 306,
133 METH_SetSmouthSteps = 307,
134 METH_SetSizeFactor = 308,
135 METH_SetUseIncomplElem = 309,
138 METH_LAST = METH_SetLocalSizeOnEntry
140 int mySetMethodFlags;
142 // Return true if a parameter is not yet set, else return true if a parameter changes.
143 // PythonDumping depends on the result of this function.
144 // Checking only change of a parameter is not enough because then the default values are
145 // not dumped and if the defaults will change then the behaviour of scripts
146 // created without dump of the default parameters will also change what is not good.
148 bool isToSetParameter(T curValue, T newValue, /*SettingMethod*/int meth)
150 if ( mySetMethodFlags & meth ) // already set, check if a value is changing
151 return ( curValue != newValue );
153 return ( mySetMethodFlags |= meth ); // == return true
157 // method intended to remove explicit treatment of Netagen hypotheses from
158 // SMESH_NoteBook to assure backward compatibility after implemeneting
159 // issue 0021308: Remove hard-coded dependency of the external mesh plugins
160 virtual int getParamIndex(const TCollection_AsciiString& method, int nbVars) const;
162 // method used to convert variable parameters stored in an old study
163 // into myMethod2VarParams. It should return a method name for an index of
164 // variable parameters. Index is countered from zero
165 virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;