Salome HOME
c2d77c42bb9afe32e0b71dde45b4fdc3be6db38c
[plugins/ghs3dprlplugin.git] / src / GHS3DPRLPlugin / GHS3DPRLPlugin_Hypothesis_i.cxx
1 // Copyright (C) 2007-2021  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // ---
21 // File   : GHS3DPRLPlugin_Hypothesis_i.cxx
22 // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
23 // ---
24 //
25 #include "GHS3DPRLPlugin_Hypothesis_i.hxx"
26 #include "SMESH_Gen.hxx"
27 #include "SMESH_PythonDump.hxx"
28
29 #include "Utils_CorbaException.hxx"
30 #include "utilities.h"
31
32 //=============================================================================
33 /*!
34  *  GHS3DPRLPlugin_Hypothesis_i::GHS3DPRLPlugin_Hypothesis_i
35  *
36  *  Constructor
37  */
38 //=============================================================================
39 GHS3DPRLPlugin_Hypothesis_i::
40 GHS3DPRLPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
41                              ::SMESH_Gen*            theGenImpl)
42   : SALOME::GenericObj_i( thePOA ),
43     SMESH_Hypothesis_i( thePOA )
44 {
45   MESSAGE( "GHS3DPRLPlugin_Hypothesis_i::GHS3DPRLPlugin_Hypothesis_i" );
46   myBaseImpl = new ::GHS3DPRLPlugin_Hypothesis (theGenImpl->GetANewId(),
47                                                 theGenImpl);
48 }
49
50 //=============================================================================
51 /*!
52  *  GHS3DPRLPlugin_Hypothesis_i::~GHS3DPRLPlugin_Hypothesis_i
53  *
54  *  Destructor
55  */
56 //=============================================================================
57 GHS3DPRLPlugin_Hypothesis_i::~GHS3DPRLPlugin_Hypothesis_i()
58 {
59   MESSAGE( "GHS3DPRLPlugin_Hypothesis_i::~GHS3DPRLPlugin_Hypothesis_i" );
60 }
61
62 //=============================================================================
63 /*!
64  *  GHS3DPRLPlugin_Hypothesis_i::SetMEDName
65  *  GHS3DPRLPlugin_Hypothesis_i::SetNbPart
66  *  GHS3DPRLPlugin_Hypothesis_i::SetKeepFiles
67  *  GHS3DPRLPlugin_Hypothesis_i::SetBackground
68  *  GHS3DPRLPlugin_Hypothesis_i::SetMultithread
69  *  GHS3DPRLPlugin_Hypothesis_i::SetGradation
70  *  GHS3DPRLPlugin_Hypothesis_i::SetMinSize
71  *  GHS3DPRLPlugin_Hypothesis_i::SetMaxSize
72  */
73 //=============================================================================
74
75 void GHS3DPRLPlugin_Hypothesis_i::SetMEDName (const char *theValue)
76 {
77   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetMEDName");
78   ASSERT(myBaseImpl);
79   this->GetImpl()->SetMEDName(theValue);
80   SMESH::TPythonDump() << _this() << ".SetMEDName( '" << theValue << "' )";
81 }
82
83 void GHS3DPRLPlugin_Hypothesis_i::SetNbPart (CORBA::Long theValue)
84 {
85   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetNbPart");
86   ASSERT(myBaseImpl);
87   this->GetImpl()->SetNbPart(theValue);
88   SMESH::TPythonDump() << _this() << ".SetNbPart( " << theValue << " )";
89 }
90
91 void GHS3DPRLPlugin_Hypothesis_i::SetKeepFiles (CORBA::Boolean theValue)
92 {
93   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetKeepFiles");
94   ASSERT(myBaseImpl);
95   this->GetImpl()->SetKeepFiles(theValue);
96   SMESH::TPythonDump() << _this() << ".SetKeepFiles( " << theValue << " )";
97 }
98
99 void GHS3DPRLPlugin_Hypothesis_i::SetBackground (CORBA::Boolean theValue)
100 {
101   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetBackground");
102   ASSERT(myBaseImpl);
103   this->GetImpl()->SetBackground(theValue);
104   SMESH::TPythonDump() << _this() << ".SetBackground( " << theValue << " )";
105 }
106
107 void GHS3DPRLPlugin_Hypothesis_i::SetMultithread (CORBA::Boolean theValue)
108 {
109   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetMultithread");
110   ASSERT(myBaseImpl);
111   this->GetImpl()->SetMultithread(theValue);
112   SMESH::TPythonDump() << _this() << ".SetMultithread( " << theValue << " )";
113 }
114
115 //void GHS3DPRLPlugin_Hypothesis_i::SetToMergeSubdomains (CORBA::Boolean theValue)
116 //{
117 //  MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetToMergeSubdomains");
118 //  ASSERT(myBaseImpl);
119 //  this->GetImpl()->SetToMergeSubdomains(theValue);
120 //  SMESH::TPythonDump() << _this() << ".SetToMergeSubdomains( " << theValue << " )";
121 //}
122
123 void GHS3DPRLPlugin_Hypothesis_i::SetGradation (CORBA::Float theValue)
124 {
125   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetGradation");
126   ASSERT(myBaseImpl);
127   this->GetImpl()->SetGradation(theValue);
128   SMESH::TPythonDump() << _this() << ".SetGradation( " << theValue << " )";
129 }
130
131 void GHS3DPRLPlugin_Hypothesis_i::SetMinSize (CORBA::Float theValue)
132 {
133   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetMinSize");
134   ASSERT(myBaseImpl);
135   this->GetImpl()->SetMinSize(theValue);
136   SMESH::TPythonDump() << _this() << ".SetMinSize( " << theValue << " )";
137 }
138
139 void GHS3DPRLPlugin_Hypothesis_i::SetMaxSize (CORBA::Float theValue)
140 {
141   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetMaxSize");
142   ASSERT(myBaseImpl);
143   this->GetImpl()->SetMaxSize(theValue);
144   SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theValue << " )";
145 }
146
147
148
149
150
151 //=============================================================================
152 /*!
153  *  GHS3DPRLPlugin_Hypothesis_i::GetMEDName
154  *  GHS3DPRLPlugin_Hypothesis_i::GetNbPart
155  *  GHS3DPRLPlugin_Hypothesis_i::GetKeepFiles
156  *  GHS3DPRLPlugin_Hypothesis_i::GetBackground
157  *  GHS3DPRLPlugin_Hypothesis_i::GetMultithread
158  *  GHS3DPRLPlugin_Hypothesis_i::GetGradation
159  *  GHS3DPRLPlugin_Hypothesis_i::GetMinSize
160  *  GHS3DPRLPlugin_Hypothesis_i::GetMaxSize
161  */
162 //=============================================================================
163
164 char * GHS3DPRLPlugin_Hypothesis_i::GetMEDName()
165 {
166   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetMEDName");
167   ASSERT(myBaseImpl);
168   CORBA::String_var c_s =
169   CORBA::string_dup(this->GetImpl()->GetMEDName().c_str());
170   return c_s._retn();
171 }
172
173 CORBA::Long GHS3DPRLPlugin_Hypothesis_i::GetNbPart()
174 {
175   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetNbPart");
176   ASSERT(myBaseImpl);
177   return this->GetImpl()->GetNbPart();
178 }
179
180 CORBA::Boolean GHS3DPRLPlugin_Hypothesis_i::GetKeepFiles()
181 {
182   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetKeepFiles");
183   ASSERT(myBaseImpl);
184   return this->GetImpl()->GetKeepFiles();
185 }
186
187 CORBA::Boolean GHS3DPRLPlugin_Hypothesis_i::GetBackground()
188 {
189   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetBackground");
190   ASSERT(myBaseImpl);
191   return this->GetImpl()->GetBackground();
192 }
193
194 CORBA::Boolean GHS3DPRLPlugin_Hypothesis_i::GetMultithread()
195 {
196   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetMultithread");
197   ASSERT(myBaseImpl);
198   return this->GetImpl()->GetMultithread();
199 }
200
201 //CORBA::Boolean GHS3DPRLPlugin_Hypothesis_i::GetToMergeSubdomains()
202 //{
203 //  MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetToMergeSubdomains");
204 //  ASSERT(myBaseImpl);
205 //  return this->GetImpl()->GetToMergeSubdomains();
206 //}
207
208 CORBA::Float GHS3DPRLPlugin_Hypothesis_i::GetGradation()
209 {
210   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetGradation");
211   ASSERT(myBaseImpl);
212   return this->GetImpl()->GetGradation();
213 }
214
215 CORBA::Float GHS3DPRLPlugin_Hypothesis_i::GetMinSize()
216 {
217   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetMinSize");
218   ASSERT(myBaseImpl);
219   return this->GetImpl()->GetMinSize();
220 }
221
222 CORBA::Float GHS3DPRLPlugin_Hypothesis_i::GetMaxSize()
223 {
224   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetMaxSize");
225   ASSERT(myBaseImpl);
226   return this->GetImpl()->GetMaxSize();
227 }
228
229 void GHS3DPRLPlugin_Hypothesis_i::SetAdvancedOption(const char* theOptAndVals )
230 {
231   if ( theOptAndVals && GetImpl()->GetAdvancedOption() != theOptAndVals )
232   {
233     GetImpl()->SetAdvancedOption( theOptAndVals );
234     SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << theOptAndVals << "' )";
235   }
236 }
237
238 char* GHS3DPRLPlugin_Hypothesis_i::GetAdvancedOption()
239 {
240   return CORBA::string_dup( GetImpl()->GetAdvancedOption().c_str() );
241 }
242
243 //=============================================================================
244 /*!
245  *  GHS3DPRLPlugin_Hypothesis_i::GetImpl
246  *
247  *  Get implementation
248  */
249 //=============================================================================
250 ::GHS3DPRLPlugin_Hypothesis* GHS3DPRLPlugin_Hypothesis_i::GetImpl()
251 {
252   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetImpl");
253   return (::GHS3DPRLPlugin_Hypothesis*)myBaseImpl;
254 }
255
256 //================================================================================
257 /*!
258  * \brief Verify whether hypothesis supports given entity type
259  * \param type - dimension (see SMESH::Dimension enumeration)
260  * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
261  *
262  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
263  */
264 //================================================================================
265 CORBA::Boolean GHS3DPRLPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
266 {
267   return type == SMESH::DIM_3D;
268 }