1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // NETGENPlugin : C++ implementation
23 // File : NETGENPlugin_Hypothesis_i.cxx
24 // Author : Michael Sazonov (OCN)
28 //=============================================================================
30 #include "NETGENPlugin_Hypothesis_i.hxx"
31 #include "SMESH_Gen.hxx"
32 #include "SMESH_PythonDump.hxx"
34 #include "Utils_CorbaException.hxx"
35 #include "utilities.h"
39 //=============================================================================
41 * NETGENPlugin_Hypothesis_i::NETGENPlugin_Hypothesis_i
45 //=============================================================================
46 NETGENPlugin_Hypothesis_i::
47 NETGENPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
49 ::SMESH_Gen* theGenImpl)
50 : SALOME::GenericObj_i( thePOA ),
51 SMESH_Hypothesis_i( thePOA )
53 MESSAGE( "NETGENPlugin_Hypothesis_i::NETGENPlugin_Hypothesis_i" );
54 myBaseImpl = new ::NETGENPlugin_Hypothesis (theGenImpl->GetANewId(),
59 //=============================================================================
61 * NETGENPlugin_Hypothesis_i::~NETGENPlugin_Hypothesis_i
65 //=============================================================================
66 NETGENPlugin_Hypothesis_i::~NETGENPlugin_Hypothesis_i()
68 MESSAGE( "NETGENPlugin_Hypothesis_i::~NETGENPlugin_Hypothesis_i" );
71 //=============================================================================
73 * NETGENPlugin_Hypothesis_i::SetMaxSize
77 //=============================================================================
78 void NETGENPlugin_Hypothesis_i::SetMaxSize (CORBA::Double theValue)
80 MESSAGE("NETGENPlugin_Hypothesis_i::SetMaxSize");
82 this->GetImpl()->SetMaxSize(theValue);
83 SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theValue << " )";
86 //=============================================================================
88 * NETGENPlugin_Hypothesis_i::GetMaxSize
92 //=============================================================================
93 CORBA::Double NETGENPlugin_Hypothesis_i::GetMaxSize()
95 MESSAGE("NETGENPlugin_Hypothesis_i::GetMaxSize");
97 return this->GetImpl()->GetMaxSize();
100 //=============================================================================
102 * NETGENPlugin_Hypothesis_i::SetSecondOrder
104 * Set SecondOrder flag
106 //=============================================================================
107 void NETGENPlugin_Hypothesis_i::SetSecondOrder (CORBA::Boolean theValue)
109 MESSAGE("NETGENPlugin_Hypothesis_i::SetSecondOrder");
111 this->GetImpl()->SetSecondOrder(theValue);
112 SMESH::TPythonDump() << _this() << ".SetSecondOrder( " << theValue << " )";
115 //=============================================================================
117 * NETGENPlugin_Hypothesis_i::GetSecondOrder
119 * Get SecondOrder flag
121 //=============================================================================
122 CORBA::Boolean NETGENPlugin_Hypothesis_i::GetSecondOrder()
124 MESSAGE("NETGENPlugin_Hypothesis_i::GetSecondOrder");
126 return this->GetImpl()->GetSecondOrder();
129 //=============================================================================
131 * NETGENPlugin_Hypothesis_i::SetOptimize
135 //=============================================================================
136 void NETGENPlugin_Hypothesis_i::SetOptimize (CORBA::Boolean theValue)
138 MESSAGE("NETGENPlugin_Hypothesis_i::SetOptimize");
140 this->GetImpl()->SetOptimize(theValue);
141 SMESH::TPythonDump() << _this() << ".SetOptimize( " << theValue << " )";
144 //=============================================================================
146 * NETGENPlugin_Hypothesis_i::GetOptimize
150 //=============================================================================
151 CORBA::Boolean NETGENPlugin_Hypothesis_i::GetOptimize()
153 MESSAGE("NETGENPlugin_Hypothesis_i::GetOptimize");
155 return this->GetImpl()->GetOptimize();
158 //=============================================================================
160 * NETGENPlugin_Hypothesis_i::SetFineness
164 //=============================================================================
165 void NETGENPlugin_Hypothesis_i::SetFineness (CORBA::Long theValue)
167 MESSAGE("NETGENPlugin_Hypothesis_i::SetFineness");
169 this->GetImpl()->SetFineness((::NETGENPlugin_Hypothesis::Fineness)theValue);
170 SMESH::TPythonDump() << _this() << ".SetFineness( " << theValue << " )";
173 //=============================================================================
175 * NETGENPlugin_Hypothesis_i::GetFineness
179 //=============================================================================
180 CORBA::Long NETGENPlugin_Hypothesis_i::GetFineness()
182 MESSAGE("NETGENPlugin_Hypothesis_i::GetFineness");
184 return this->GetImpl()->GetFineness();
187 //=============================================================================
189 * NETGENPlugin_Hypothesis_i::SetGrowthRate
193 //=============================================================================
194 void NETGENPlugin_Hypothesis_i::SetGrowthRate (CORBA::Double theValue)
196 MESSAGE("NETGENPlugin_Hypothesis_i::SetGrowthRate");
198 this->GetImpl()->SetGrowthRate(theValue);
199 SMESH::TPythonDump() << _this() << ".SetGrowthRate( " << theValue << " )";
202 //=============================================================================
204 * NETGENPlugin_Hypothesis_i::GetGrowthRate
208 //=============================================================================
209 CORBA::Double NETGENPlugin_Hypothesis_i::GetGrowthRate()
211 MESSAGE("NETGENPlugin_Hypothesis_i::GetGrowthRate");
213 return this->GetImpl()->GetGrowthRate();
216 //=============================================================================
218 * NETGENPlugin_Hypothesis_i::SetNbSegPerEdge
222 //=============================================================================
223 void NETGENPlugin_Hypothesis_i::SetNbSegPerEdge (CORBA::Double theValue)
225 MESSAGE("NETGENPlugin_Hypothesis_i::SetNbSegPerEdge");
227 this->GetImpl()->SetNbSegPerEdge(theValue);
228 SMESH::TPythonDump() << _this() << ".SetNbSegPerEdge( " << theValue << " )";
231 //=============================================================================
233 * NETGENPlugin_Hypothesis_i::GetNbSegPerEdge
237 //=============================================================================
238 CORBA::Double NETGENPlugin_Hypothesis_i::GetNbSegPerEdge()
240 MESSAGE("NETGENPlugin_Hypothesis_i::GetNbSegPerEdge");
242 return this->GetImpl()->GetNbSegPerEdge();
245 //=============================================================================
247 * NETGENPlugin_Hypothesis_i::SetNbSegPerRadius
251 //=============================================================================
252 void NETGENPlugin_Hypothesis_i::SetNbSegPerRadius (CORBA::Double theValue)
254 MESSAGE("NETGENPlugin_Hypothesis_i::SetNbSegPerRadius");
256 this->GetImpl()->SetNbSegPerRadius(theValue);
257 SMESH::TPythonDump() << _this() << ".SetNbSegPerRadius( " << theValue << " )";
260 //=============================================================================
262 * NETGENPlugin_Hypothesis_i::GetNbSegPerRadius
266 //=============================================================================
267 CORBA::Double NETGENPlugin_Hypothesis_i::GetNbSegPerRadius()
269 MESSAGE("NETGENPlugin_Hypothesis_i::GetNbSegPerRadius");
271 return this->GetImpl()->GetNbSegPerRadius();
274 //=============================================================================
276 * NETGENPlugin_Hypothesis_i::GetImpl
280 //=============================================================================
281 ::NETGENPlugin_Hypothesis* NETGENPlugin_Hypothesis_i::GetImpl()
283 MESSAGE("NETGENPlugin_Hypothesis_i::GetImpl");
284 return (::NETGENPlugin_Hypothesis*)myBaseImpl;
287 //================================================================================
289 * \brief Verify whether hypothesis supports given entity type
290 * \param type - dimension (see SMESH::Dimension enumeration)
291 * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
293 * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
295 //================================================================================
296 CORBA::Boolean NETGENPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
298 return type == SMESH::DIM_3D;