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