Salome HOME
correct previous integration (Porting to Python 2.6)
[modules/smesh.git] / src / StdMeshers_I / StdMeshers_QuadrangleParams_i.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
23 //  File   : StdMeshers_QuadrangleParams_i.cxx
24 //  Author : Sergey KUUL, OCC
25 //  Module : SMESH
26 //  $Header$
27 //
28 #include "StdMeshers_QuadrangleParams_i.hxx"
29 #include "SMESH_Gen_i.hxx"
30 #include "SMESH_Gen.hxx"
31 #include "SMESH_PythonDump.hxx"
32
33 #include "Utils_CorbaException.hxx"
34 #include "utilities.h"
35
36 #include <TCollection_AsciiString.hxx>
37
38 using namespace std;
39
40 //=============================================================================
41 /*!
42  *  StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
43  *
44  *  Constructor
45  */
46 //=============================================================================
47
48 StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
49                                           (PortableServer::POA_ptr thePOA,
50                                            int                     theStudyId,
51                                            ::SMESH_Gen*            theGenImpl )
52      : SALOME::GenericObj_i( thePOA ), 
53        SMESH_Hypothesis_i( thePOA )
54 {
55   MESSAGE( "StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i" );
56   myBaseImpl = new ::StdMeshers_QuadrangleParams(theGenImpl->GetANewId(),
57                                                  theStudyId,
58                                                  theGenImpl);
59 }
60
61 //=============================================================================
62 /*!
63  *  StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i
64  *
65  *  Destructor
66  */
67 //=============================================================================
68
69 StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i()
70 {
71   MESSAGE( "StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i" );
72 }
73
74 //=============================================================================
75 /*!
76  *  StdMeshers_QuadrangleParams_i::SetTriaVertex
77  *
78  *  Set base vertex for triangles
79  */
80 //=============================================================================
81
82 void StdMeshers_QuadrangleParams_i::SetTriaVertex(CORBA::Long vertID)
83 {
84   MESSAGE( "StdMeshers_QuadrangleParams_i::SetTriaVertex" );
85   ASSERT( myBaseImpl );
86   try {
87     this->GetImpl()->SetTriaVertex( vertID );
88   }
89   catch ( SALOME_Exception& S_ex ) {
90     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
91                                   SALOME::BAD_PARAM );
92   }
93
94   // Update Python script
95   /*  SMESH::TPythonDump() << _this() << ".SetEdgesToReverse( "
96       << theList << " )";*/
97 }
98
99 //=============================================================================
100 /*!
101  *  StdMeshers_QuadrangleParams_i::SetObjectEntry
102  *
103  *  Set the Entry for the Main Object
104  */
105 //=============================================================================
106
107 void StdMeshers_QuadrangleParams_i::SetObjectEntry( const char* entry )
108 {
109   MESSAGE( "StdMeshers_QuadrangleParams_i::SetObjectEntry" );
110   ASSERT( myBaseImpl );
111
112   try {
113     this->GetImpl()->SetObjectEntry( entry );
114     // Update Python script
115     //    SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry << "' )";
116   }
117   catch ( SALOME_Exception& S_ex ) {
118     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
119                                   SALOME::BAD_PARAM );
120   }
121 }
122
123 //=============================================================================
124 /*!
125  *  StdMeshers_QuadrangleParams_i::GetObjectEntry
126  *
127  *  Set the Entry for the Main Object
128  */
129 //=============================================================================
130
131 char* StdMeshers_QuadrangleParams_i::GetObjectEntry()
132 {
133   MESSAGE( "StdMeshers_QuadrangleParams_i::SetObjectEntry" );
134   ASSERT( myBaseImpl );
135   const char* entry;
136   try {
137     entry = this->GetImpl()->GetObjectEntry();
138   }
139   catch ( SALOME_Exception& S_ex ) {
140     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
141                                   SALOME::BAD_PARAM );
142   }
143   return CORBA::string_dup( entry );
144 }
145
146 //=============================================================================
147 /*!
148  *  StdMeshers_QuadrangleParams_i::GetTriaVertex
149  *
150  *  Get base vertex for triangles
151  */
152 //=============================================================================
153
154 CORBA::Long StdMeshers_QuadrangleParams_i::GetTriaVertex()
155 {
156   MESSAGE( "StdMeshers_QuadrangleParams_i::GetTriaVertex" );
157   ASSERT( myBaseImpl );
158   return this->GetImpl()->GetTriaVertex();
159 }
160
161 //=============================================================================
162 /*!
163  *  StdMeshers_QuadrangleParams_i::GetImpl
164  *
165  *  Get implementation
166  */
167 //=============================================================================
168
169 ::StdMeshers_QuadrangleParams* StdMeshers_QuadrangleParams_i::GetImpl()
170 {
171   MESSAGE( "StdMeshers_QuadrangleParams_i::GetImpl" );
172   return ( ::StdMeshers_QuadrangleParams* )myBaseImpl;
173 }
174
175 //================================================================================
176 /*!
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
180  * 
181  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
182  */
183 //================================================================================  
184 CORBA::Boolean StdMeshers_QuadrangleParams_i::IsDimSupported( SMESH::Dimension type )
185 {
186   return type == SMESH::DIM_2D;
187 }
188