Back to index

salome-smesh  6.5.0
StdMeshers_MaxLength_i.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
00021 //  File   : StdMeshers_MaxLength_i.cxx
00022 //  Module : SMESH
00023 //
00024 #include "StdMeshers_MaxLength_i.hxx"
00025 #include "SMESH_Gen_i.hxx"
00026 #include "SMESH_Gen.hxx"
00027 #include "SMESH_PythonDump.hxx"
00028 
00029 #include "Utils_CorbaException.hxx"
00030 #include "utilities.h"
00031 
00032 #include <TCollection_AsciiString.hxx>
00033 
00034 using namespace std;
00035 
00036 //=============================================================================
00042 //=============================================================================
00043 
00044 StdMeshers_MaxLength_i::StdMeshers_MaxLength_i( PortableServer::POA_ptr thePOA,
00045                                                 int                     theStudyId,
00046                                                 ::SMESH_Gen*            theGenImpl )
00047   : SALOME::GenericObj_i( thePOA ),
00048     SMESH_Hypothesis_i( thePOA )
00049 {
00050   myBaseImpl = new ::StdMeshers_MaxLength( theGenImpl->GetANewId(),
00051                                            theStudyId,
00052                                            theGenImpl );
00053 }
00054 
00055 //=============================================================================
00061 //=============================================================================
00062 
00063 StdMeshers_MaxLength_i::~StdMeshers_MaxLength_i()
00064 {
00065 }
00066 
00067 //=============================================================================
00073 //=============================================================================
00074 void StdMeshers_MaxLength_i::SetLength( CORBA::Double theLength )
00075      throw ( SALOME::SALOME_Exception )
00076 {
00077   ASSERT( myBaseImpl );
00078   try {
00079     this->GetImpl()->SetLength( theLength );
00080   }
00081   catch ( SALOME_Exception& S_ex ) {
00082     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
00083                                   SALOME::BAD_PARAM );
00084   }
00085 
00086   // Update Python script
00087   SMESH::TPythonDump() << _this() << ".SetLength( " << SMESH::TVar(theLength) << " )";
00088 }
00089 
00090 //=============================================================================
00094 //=============================================================================
00095 void StdMeshers_MaxLength_i::SetUsePreestimatedLength( CORBA::Boolean toUse )
00096   throw ( SALOME::SALOME_Exception )
00097 {
00098   ASSERT( myBaseImpl );
00099   try {
00100     this->GetImpl()->SetUsePreestimatedLength( toUse );
00101   }
00102   catch ( SALOME_Exception& S_ex ) {
00103     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
00104                                   SALOME::BAD_PARAM );
00105   }
00106 
00107   // this is an internal kitchen call - no Python dump
00108   // Update Python script
00109   //SMESH::TPythonDump() << _this() << ".SetUsePreestimatedLength( " << toUse << " )";
00110 }
00111 
00112 //=============================================================================
00116 //=============================================================================
00117 void StdMeshers_MaxLength_i::SetPreestimatedLength( CORBA::Double theLength )
00118 {
00119   ASSERT( myBaseImpl );
00120   try {
00121     this->GetImpl()->SetPreestimatedLength( theLength );
00122   }
00123   catch ( SALOME_Exception& S_ex ) {
00124     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
00125                                   SALOME::BAD_PARAM );
00126   }
00127   // this is an internal kitchen call - no Python dump
00128   // Update Python script
00129   //SMESH::TPythonDump() << _this() << ".SetPreestimatedLength( " << toUse << " )";
00130 }
00131 
00132 //=============================================================================
00138 //=============================================================================
00139 CORBA::Double StdMeshers_MaxLength_i::GetLength()
00140 {
00141   ASSERT( myBaseImpl );
00142   return this->GetImpl()->GetLength();
00143 }
00144 
00145 //=============================================================================
00149 //=============================================================================
00150 CORBA::Double StdMeshers_MaxLength_i::GetPreestimatedLength()
00151 {
00152   ASSERT( myBaseImpl );
00153   return this->GetImpl()->GetPreestimatedLength();
00154 }
00155 
00156 //=============================================================================
00160 //=============================================================================
00161 CORBA::Boolean StdMeshers_MaxLength_i::GetUsePreestimatedLength()
00162 {
00163   ASSERT( myBaseImpl );
00164   return this->GetImpl()->GetUsePreestimatedLength();
00165 }
00166 
00167 //================================================================================
00171 //================================================================================
00172 
00173 CORBA::Boolean StdMeshers_MaxLength_i::HavePreestimatedLength()
00174 {
00175   ASSERT( myBaseImpl );
00176   return this->GetImpl()->HavePreestimatedLength();
00177 }
00178 
00179 //=============================================================================
00185 //=============================================================================
00186 ::StdMeshers_MaxLength* StdMeshers_MaxLength_i::GetImpl()
00187 {
00188   return ( ::StdMeshers_MaxLength* )myBaseImpl;
00189 }
00190 
00191 //================================================================================
00199 //================================================================================  
00200 CORBA::Boolean StdMeshers_MaxLength_i::IsDimSupported( SMESH::Dimension type )
00201 {
00202   return type == SMESH::DIM_1D;
00203 }
00204 
00205 //================================================================================
00209 //================================================================================
00210 
00211 std::string StdMeshers_MaxLength_i::getMethodOfParameter(const int, int) const
00212 {
00213   return "SetLength";
00214 }