1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // NETGENPlugin : C++ implementation
21 // File : NETGENPlugin_SimpleHypothesis_2D_i.cxx
22 // Author : Edward AGAPOV
24 //=============================================================================
26 #include "NETGENPlugin_SimpleHypothesis_2D_i.hxx"
27 #include "NETGENPlugin_SimpleHypothesis_2D.hxx"
29 #include <SMESH_Gen.hxx>
30 #include <SMESH_PythonDump.hxx>
32 #include <Utils_CorbaException.hxx>
33 #include <utilities.h>
37 //=============================================================================
39 * NETGENPlugin_SimpleHypothesis_2D_i::NETGENPlugin_SimpleHypothesis_2D_i
43 //=============================================================================
44 NETGENPlugin_SimpleHypothesis_2D_i::
45 NETGENPlugin_SimpleHypothesis_2D_i (PortableServer::POA_ptr thePOA,
47 ::SMESH_Gen* theGenImpl)
48 : SALOME::GenericObj_i( thePOA ),
49 SMESH_Hypothesis_i( thePOA )
51 MESSAGE( "NETGENPlugin_SimpleHypothesis_2D_i::NETGENPlugin_SimpleHypothesis_2D_i" );
52 myBaseImpl = new ::NETGENPlugin_SimpleHypothesis_2D (theGenImpl->GetANewId(),
57 //=============================================================================
59 * NETGENPlugin_SimpleHypothesis_2D_i::~NETGENPlugin_SimpleHypothesis_2D_i
63 //=============================================================================
64 NETGENPlugin_SimpleHypothesis_2D_i::~NETGENPlugin_SimpleHypothesis_2D_i()
66 MESSAGE( "NETGENPlugin_SimpleHypothesis_2D_i::~NETGENPlugin_SimpleHypothesis_2D_i" );
69 //=============================================================================
71 * NETGENPlugin_SimpleHypothesis_2D_i::SetNumberOfSegments
73 //=============================================================================
74 void NETGENPlugin_SimpleHypothesis_2D_i::SetNumberOfSegments(CORBA::Short nb)
75 throw ( SALOME::SALOME_Exception )
77 MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::SetNumberOfSegments");
80 this->GetImpl()->SetNumberOfSegments(nb);
82 catch (SALOME_Exception& S_ex) {
83 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
85 SMESH::TPythonDump() << _this() << ".SetNumberOfSegments( " << nb << " )";
88 //=============================================================================
90 * NETGENPlugin_SimpleHypothesis_2D_i::GetNumberOfSegments()
92 //=============================================================================
93 CORBA::Short NETGENPlugin_SimpleHypothesis_2D_i::GetNumberOfSegments()
95 MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetNumberOfSegments");
97 return this->GetImpl()->GetNumberOfSegments();
100 //================================================================================
104 //================================================================================
106 void NETGENPlugin_SimpleHypothesis_2D_i::SetLocalLength(CORBA::Double segmentLength)
108 MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::SetLocalLength");
111 this->GetImpl()->SetLocalLength(segmentLength);
113 catch (SALOME_Exception& S_ex) {
114 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
116 SMESH::TPythonDump() << _this() << ".SetLocalLength( " << segmentLength << " )";
119 //================================================================================
123 //================================================================================
125 CORBA::Double NETGENPlugin_SimpleHypothesis_2D_i::GetLocalLength()
127 MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetLocalLength");
129 return this->GetImpl()->GetLocalLength();
132 //=============================================================================
134 * NETGENPlugin_SimpleHypothesis_2D_i::LengthFromEdges()
136 //=============================================================================
137 void NETGENPlugin_SimpleHypothesis_2D_i::LengthFromEdges()
139 MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::LengthFromEdges");
141 this->GetImpl()->LengthFromEdges();
142 SMESH::TPythonDump() << _this() << ".LengthFromEdges()";
145 //=============================================================================
147 * NETGENPlugin_SimpleHypothesis_2D_i::SetMaxElementArea()
149 //=============================================================================
150 void NETGENPlugin_SimpleHypothesis_2D_i::SetMaxElementArea(CORBA::Double area)
152 MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::SetMaxElementArea");
154 this->GetImpl()->SetMaxElementArea(area);
155 SMESH::TPythonDump() << _this() << ".SetMaxElementArea( " << area << " )";
159 //=============================================================================
161 * NETGENPlugin_SimpleHypothesis_2D_i::GetMaxElementArea()
163 //=============================================================================
164 CORBA::Double NETGENPlugin_SimpleHypothesis_2D_i::GetMaxElementArea()
166 MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetMaxElementArea");
168 return this->GetImpl()->GetMaxElementArea();
170 //=============================================================================
172 * NETGENPlugin_SimpleHypothesis_2D_i::GetImpl
174 //=============================================================================
175 ::NETGENPlugin_SimpleHypothesis_2D* NETGENPlugin_SimpleHypothesis_2D_i::GetImpl()
177 MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetImpl");
178 return (::NETGENPlugin_SimpleHypothesis_2D*)myBaseImpl;
181 //================================================================================
183 * \brief Verify whether hypothesis supports given entity type
184 * \param type - dimension (see SMESH::Dimension enumeration)
185 * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
187 * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
189 //================================================================================
190 CORBA::Boolean NETGENPlugin_SimpleHypothesis_2D_i::IsDimSupported( SMESH::Dimension type )
192 return type == SMESH::DIM_2D;