1 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
3 // Copyright (C) 2003 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 // File : StdMeshers_MaxLength_i.cxx
25 #include "StdMeshers_MaxLength_i.hxx"
26 #include "SMESH_Gen_i.hxx"
27 #include "SMESH_Gen.hxx"
28 #include "SMESH_PythonDump.hxx"
30 #include "Utils_CorbaException.hxx"
31 #include "utilities.h"
33 #include <TCollection_AsciiString.hxx>
37 //=============================================================================
39 * StdMeshers_MaxLength_i::StdMeshers_MaxLength_i
43 //=============================================================================
45 StdMeshers_MaxLength_i::StdMeshers_MaxLength_i( PortableServer::POA_ptr thePOA,
47 ::SMESH_Gen* theGenImpl )
48 : SALOME::GenericObj_i( thePOA ),
49 SMESH_Hypothesis_i( thePOA )
51 myBaseImpl = new ::StdMeshers_MaxLength( theGenImpl->GetANewId(),
56 //=============================================================================
58 * StdMeshers_MaxLength_i::~StdMeshers_MaxLength_i
62 //=============================================================================
64 StdMeshers_MaxLength_i::~StdMeshers_MaxLength_i()
68 //=============================================================================
70 * StdMeshers_MaxLength_i::SetLength
74 //=============================================================================
75 void StdMeshers_MaxLength_i::SetLength( CORBA::Double theLength )
76 throw ( SALOME::SALOME_Exception )
80 this->GetImpl()->SetLength( theLength );
82 catch ( SALOME_Exception& S_ex ) {
83 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
87 // Update Python script
88 SMESH::TPythonDump() << _this() << ".SetLength( " << theLength << " )";
91 //=============================================================================
93 * Sets preestimation flag
95 //=============================================================================
96 void StdMeshers_MaxLength_i::SetUsePreestimatedLength( CORBA::Boolean toUse )
97 throw ( SALOME::SALOME_Exception )
101 this->GetImpl()->SetUsePreestimatedLength( toUse );
103 catch ( SALOME_Exception& S_ex ) {
104 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
108 // this is an internal kitchen call - no Python dump
109 // Update Python script
110 //SMESH::TPythonDump() << _this() << ".SetUsePreestimatedLength( " << toUse << " )";
113 //=============================================================================
115 * Sets preestimation length
117 //=============================================================================
118 void StdMeshers_MaxLength_i::SetPreestimatedLength( CORBA::Double theLength )
120 ASSERT( myBaseImpl );
122 this->GetImpl()->SetPreestimatedLength( theLength );
124 catch ( SALOME_Exception& S_ex ) {
125 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
128 // this is an internal kitchen call - no Python dump
129 // Update Python script
130 //SMESH::TPythonDump() << _this() << ".SetPreestimatedLength( " << toUse << " )";
133 //=============================================================================
135 * StdMeshers_MaxLength_i::GetLength
139 //=============================================================================
140 CORBA::Double StdMeshers_MaxLength_i::GetLength()
142 ASSERT( myBaseImpl );
143 return this->GetImpl()->GetLength();
146 //=============================================================================
148 * StdMeshers_MaxLength_i::GetPreestimatedLength
150 //=============================================================================
151 CORBA::Double StdMeshers_MaxLength_i::GetPreestimatedLength()
153 ASSERT( myBaseImpl );
154 return this->GetImpl()->GetPreestimatedLength();
157 //=============================================================================
159 * Returns preestimation flag
161 //=============================================================================
162 CORBA::Boolean StdMeshers_MaxLength_i::GetUsePreestimatedLength()
164 ASSERT( myBaseImpl );
165 return this->GetImpl()->GetUsePreestimatedLength();
168 //================================================================================
170 * \brief Returns true if preestemated length is defined
172 //================================================================================
174 CORBA::Boolean StdMeshers_MaxLength_i::HavePreestimatedLength()
176 ASSERT( myBaseImpl );
177 return this->GetImpl()->HavePreestimatedLength();
180 //=============================================================================
182 * StdMeshers_MaxLength_i::GetImpl
186 //=============================================================================
187 ::StdMeshers_MaxLength* StdMeshers_MaxLength_i::GetImpl()
189 return ( ::StdMeshers_MaxLength* )myBaseImpl;
192 //================================================================================
194 * \brief Verify whether hypothesis supports given entity type
195 * \param type - dimension (see SMESH::Dimension enumeration)
196 * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
198 * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
200 //================================================================================
201 CORBA::Boolean StdMeshers_MaxLength_i::IsDimSupported( SMESH::Dimension type )
203 return type == SMESH::DIM_1D;