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 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
21 // File : StdMeshers_QuadrangleParams_i.cxx
22 // Author : Sergey KUUL, OCC
26 #include "StdMeshers_QuadrangleParams_i.hxx"
27 #include "SMESH_Gen_i.hxx"
28 #include "SMESH_Gen.hxx"
29 #include "SMESH_PythonDump.hxx"
31 #include "Utils_CorbaException.hxx"
32 #include "utilities.h"
34 #include <TCollection_AsciiString.hxx>
38 //=============================================================================
40 * StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
44 //=============================================================================
46 StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
47 (PortableServer::POA_ptr thePOA,
49 ::SMESH_Gen* theGenImpl )
50 : SALOME::GenericObj_i( thePOA ),
51 SMESH_Hypothesis_i( thePOA )
53 MESSAGE( "StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i" );
54 myBaseImpl = new ::StdMeshers_QuadrangleParams(theGenImpl->GetANewId(),
59 //=============================================================================
61 * StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i
65 //=============================================================================
67 StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i()
69 MESSAGE( "StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i" );
72 //=============================================================================
74 * StdMeshers_QuadrangleParams_i::SetTriaVertex
76 * Set base vertex for triangles
78 //=============================================================================
80 void StdMeshers_QuadrangleParams_i::SetTriaVertex(CORBA::Long vertID)
82 MESSAGE( "StdMeshers_QuadrangleParams_i::SetTriaVertex" );
85 this->GetImpl()->SetTriaVertex( vertID );
87 catch ( SALOME_Exception& S_ex ) {
88 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
92 // Update Python script
93 SMESH::TPythonDump() << _this() << ".SetTriaVertex( "
97 //=============================================================================
99 * StdMeshers_QuadrangleParams_i::SetObjectEntry
101 * Set the Entry for the Main Object
103 //=============================================================================
105 void StdMeshers_QuadrangleParams_i::SetObjectEntry( const char* entry )
107 MESSAGE( "StdMeshers_QuadrangleParams_i::SetObjectEntry" );
108 ASSERT( myBaseImpl );
111 this->GetImpl()->SetObjectEntry( entry );
112 // Update Python script
113 // SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry << "' )";
115 catch ( SALOME_Exception& S_ex ) {
116 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
121 //=============================================================================
123 * StdMeshers_QuadrangleParams_i::GetObjectEntry
125 * Set the Entry for the Main Object
127 //=============================================================================
129 char* StdMeshers_QuadrangleParams_i::GetObjectEntry()
131 MESSAGE( "StdMeshers_QuadrangleParams_i::SetObjectEntry" );
132 ASSERT( myBaseImpl );
135 entry = this->GetImpl()->GetObjectEntry();
137 catch ( SALOME_Exception& S_ex ) {
138 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
141 return CORBA::string_dup( entry );
144 //=============================================================================
146 * StdMeshers_QuadrangleParams_i::GetTriaVertex
148 * Get base vertex for triangles
150 //=============================================================================
152 CORBA::Long StdMeshers_QuadrangleParams_i::GetTriaVertex()
154 MESSAGE( "StdMeshers_QuadrangleParams_i::GetTriaVertex" );
155 ASSERT( myBaseImpl );
156 return this->GetImpl()->GetTriaVertex();
159 //=============================================================================
161 * StdMeshers_QuadrangleParams_i::GetImpl
165 //=============================================================================
167 ::StdMeshers_QuadrangleParams* StdMeshers_QuadrangleParams_i::GetImpl()
169 MESSAGE( "StdMeshers_QuadrangleParams_i::GetImpl" );
170 return ( ::StdMeshers_QuadrangleParams* )myBaseImpl;
173 //================================================================================
175 * \brief Verify whether hypothesis supports given entity type
176 * \param type - dimension (see SMESH::Dimension enumeration)
177 * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
179 * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
181 //================================================================================
182 CORBA::Boolean StdMeshers_QuadrangleParams_i::IsDimSupported( SMESH::Dimension type )
184 return type == SMESH::DIM_2D;