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 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
23 // File : StdMeshers_QuadrangleParams_i.cxx
24 // Author : Sergey KUUL, OCC
28 #include "StdMeshers_QuadrangleParams_i.hxx"
29 #include "SMESH_Gen_i.hxx"
30 #include "SMESH_Gen.hxx"
31 #include "SMESH_PythonDump.hxx"
33 #include "Utils_CorbaException.hxx"
34 #include "utilities.h"
36 #include <TCollection_AsciiString.hxx>
40 //=============================================================================
42 * StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
46 //=============================================================================
48 StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
49 (PortableServer::POA_ptr thePOA,
51 ::SMESH_Gen* theGenImpl )
52 : SALOME::GenericObj_i( thePOA ),
53 SMESH_Hypothesis_i( thePOA )
55 MESSAGE( "StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i" );
56 myBaseImpl = new ::StdMeshers_QuadrangleParams(theGenImpl->GetANewId(),
61 //=============================================================================
63 * StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i
67 //=============================================================================
69 StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i()
71 MESSAGE( "StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i" );
74 //=============================================================================
76 * StdMeshers_QuadrangleParams_i::SetTriaVertex
78 * Set base vertex for triangles
80 //=============================================================================
82 void StdMeshers_QuadrangleParams_i::SetTriaVertex(CORBA::Long vertID)
84 MESSAGE( "StdMeshers_QuadrangleParams_i::SetTriaVertex" );
87 this->GetImpl()->SetTriaVertex( vertID );
89 catch ( SALOME_Exception& S_ex ) {
90 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
94 // Update Python script
95 SMESH::TPythonDump() << _this() << ".SetTriaVertex( "
99 //=============================================================================
101 * StdMeshers_QuadrangleParams_i::SetObjectEntry
103 * Set the Entry for the Main Object
105 //=============================================================================
107 void StdMeshers_QuadrangleParams_i::SetObjectEntry( const char* entry )
109 MESSAGE( "StdMeshers_QuadrangleParams_i::SetObjectEntry" );
110 ASSERT( myBaseImpl );
113 this->GetImpl()->SetObjectEntry( entry );
114 // Update Python script
115 // SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry << "' )";
117 catch ( SALOME_Exception& S_ex ) {
118 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
123 //=============================================================================
125 * StdMeshers_QuadrangleParams_i::GetObjectEntry
127 * Set the Entry for the Main Object
129 //=============================================================================
131 char* StdMeshers_QuadrangleParams_i::GetObjectEntry()
133 MESSAGE( "StdMeshers_QuadrangleParams_i::SetObjectEntry" );
134 ASSERT( myBaseImpl );
137 entry = this->GetImpl()->GetObjectEntry();
139 catch ( SALOME_Exception& S_ex ) {
140 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
143 return CORBA::string_dup( entry );
146 //=============================================================================
148 * StdMeshers_QuadrangleParams_i::GetTriaVertex
150 * Get base vertex for triangles
152 //=============================================================================
154 CORBA::Long StdMeshers_QuadrangleParams_i::GetTriaVertex()
156 MESSAGE( "StdMeshers_QuadrangleParams_i::GetTriaVertex" );
157 ASSERT( myBaseImpl );
158 return this->GetImpl()->GetTriaVertex();
161 //=============================================================================
163 * StdMeshers_QuadrangleParams_i::GetImpl
167 //=============================================================================
169 ::StdMeshers_QuadrangleParams* StdMeshers_QuadrangleParams_i::GetImpl()
171 MESSAGE( "StdMeshers_QuadrangleParams_i::GetImpl" );
172 return ( ::StdMeshers_QuadrangleParams* )myBaseImpl;
175 //================================================================================
177 * \brief Verify whether hypothesis supports given entity type
178 * \param type - dimension (see SMESH::Dimension enumeration)
179 * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
181 * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
183 //================================================================================
184 CORBA::Boolean StdMeshers_QuadrangleParams_i::IsDimSupported( SMESH::Dimension type )
186 return type == SMESH::DIM_2D;