1 // Copyright (C) 2007-2021 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, or (at your option) any later version.
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 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
21 // File : StdMeshers_MaxLength_i.cxx
24 #include "StdMeshers_MaxLength_i.hxx"
25 #include "SMESH_Gen_i.hxx"
26 #include "SMESH_Gen.hxx"
27 #include "SMESH_PythonDump.hxx"
29 #include "Utils_CorbaException.hxx"
30 #include "utilities.h"
32 #include <TCollection_AsciiString.hxx>
36 //=============================================================================
38 * StdMeshers_MaxLength_i::StdMeshers_MaxLength_i
42 //=============================================================================
44 StdMeshers_MaxLength_i::StdMeshers_MaxLength_i( PortableServer::POA_ptr thePOA,
45 ::SMESH_Gen* theGenImpl )
46 : SALOME::GenericObj_i( thePOA ),
47 SMESH_Hypothesis_i( thePOA )
49 myBaseImpl = new ::StdMeshers_MaxLength( theGenImpl->GetANewId(),
53 //=============================================================================
55 * StdMeshers_MaxLength_i::~StdMeshers_MaxLength_i
59 //=============================================================================
61 StdMeshers_MaxLength_i::~StdMeshers_MaxLength_i()
65 //=============================================================================
67 * StdMeshers_MaxLength_i::SetLength
71 //=============================================================================
72 void StdMeshers_MaxLength_i::SetLength( CORBA::Double theLength )
76 this->GetImpl()->SetLength( theLength );
78 catch ( SALOME_Exception& S_ex ) {
79 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
83 // Update Python script
84 SMESH::TPythonDump() << _this() << ".SetLength( " << SMESH::TVar(theLength) << " )";
87 //=============================================================================
89 * Sets preestimation flag
91 //=============================================================================
92 void StdMeshers_MaxLength_i::SetUsePreestimatedLength( CORBA::Boolean toUse )
96 this->GetImpl()->SetUsePreestimatedLength( toUse );
98 catch ( SALOME_Exception& S_ex ) {
99 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
103 // this is an internal kitchen call - no Python dump
104 // Update Python script
105 //SMESH::TPythonDump() << _this() << ".SetUsePreestimatedLength( " << toUse << " )";
108 //=============================================================================
110 * Sets preestimation length
112 //=============================================================================
113 void StdMeshers_MaxLength_i::SetPreestimatedLength( CORBA::Double theLength )
115 ASSERT( myBaseImpl );
117 this->GetImpl()->SetPreestimatedLength( theLength );
119 catch ( SALOME_Exception& S_ex ) {
120 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
123 // this is an internal kitchen call - no Python dump
124 // Update Python script
125 //SMESH::TPythonDump() << _this() << ".SetPreestimatedLength( " << toUse << " )";
128 //=============================================================================
130 * StdMeshers_MaxLength_i::GetLength
134 //=============================================================================
135 CORBA::Double StdMeshers_MaxLength_i::GetLength()
137 ASSERT( myBaseImpl );
138 return this->GetImpl()->GetLength();
141 //=============================================================================
143 * StdMeshers_MaxLength_i::GetPreestimatedLength
145 //=============================================================================
146 CORBA::Double StdMeshers_MaxLength_i::GetPreestimatedLength()
148 ASSERT( myBaseImpl );
149 return this->GetImpl()->GetPreestimatedLength();
152 //=============================================================================
154 * Returns preestimation flag
156 //=============================================================================
157 CORBA::Boolean StdMeshers_MaxLength_i::GetUsePreestimatedLength()
159 ASSERT( myBaseImpl );
160 return this->GetImpl()->GetUsePreestimatedLength();
163 //================================================================================
165 * \brief Returns true if preestemated length is defined
167 //================================================================================
169 CORBA::Boolean StdMeshers_MaxLength_i::HavePreestimatedLength()
171 ASSERT( myBaseImpl );
172 return this->GetImpl()->HavePreestimatedLength();
175 //=============================================================================
177 * StdMeshers_MaxLength_i::GetImpl
181 //=============================================================================
182 ::StdMeshers_MaxLength* StdMeshers_MaxLength_i::GetImpl()
184 return ( ::StdMeshers_MaxLength* )myBaseImpl;
187 //================================================================================
189 * \brief Verify whether hypothesis supports given entity type
190 * \param type - dimension (see SMESH::Dimension enumeration)
191 * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
193 * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
195 //================================================================================
196 CORBA::Boolean StdMeshers_MaxLength_i::IsDimSupported( SMESH::Dimension type )
198 return type == SMESH::DIM_1D;
201 //================================================================================
203 * \brief Return method name corresponding to index of variable parameter
205 //================================================================================
207 std::string StdMeshers_MaxLength_i::getMethodOfParameter(const int, int) const