Salome HOME
Join modifications from BR_Dev_For_4_0.
[plugins/hexoticplugin.git] / src / HexoticPlugin / HexoticPlugin_Hypothesis_i.cxx
1 //  HexoticPlugin : C++ implementation
2 //
3 //  Copyright (C) 2006  OPEN CASCADE, CEA/DEN, EDF R&D
4 // 
5 //  This library is free software; you can redistribute it and/or 
6 //  modify it under the terms of the GNU Lesser General Public 
7 //  License as published by the Free Software Foundation; either 
8 //  version 2.1 of the License. 
9 // 
10 //  This library is distributed in the hope that it will be useful, 
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
13 //  Lesser General Public License for more details. 
14 // 
15 //  You should have received a copy of the GNU Lesser General Public 
16 //  License along with this library; if not, write to the Free Software 
17 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
18 // 
19 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
20 //
21 //
22 // File      : HexoticPlugin_Hypothesis_i.cxx
23 // Author    : Lioka RAZAFINDRAZAKA (CEA)
24 // Date      : 2006/06/30
25 // Project   : SALOME
26 //=============================================================================
27 using namespace std;
28
29 #include "HexoticPlugin_Hypothesis_i.hxx"
30 #include "SMESH_Gen.hxx"
31 #include "SMESH_PythonDump.hxx"
32
33 #include "Utils_CorbaException.hxx"
34 #include "utilities.h"
35
36 //=============================================================================
37 /*!
38  *  HexoticPlugin_Hypothesis_i::HexoticPlugin_Hypothesis_i
39  *
40  *  Constructor
41  */
42 //=============================================================================
43 HexoticPlugin_Hypothesis_i::
44 HexoticPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
45                            int                     theStudyId,
46                            ::SMESH_Gen*            theGenImpl)
47   : SALOME::GenericObj_i( thePOA ), 
48     SMESH_Hypothesis_i( thePOA )
49 {
50   MESSAGE( "HexoticPlugin_Hypothesis_i::HexoticPlugin_Hypothesis_i" );
51   myBaseImpl = new ::HexoticPlugin_Hypothesis (theGenImpl->GetANewId(),
52                                               theStudyId,
53                                               theGenImpl);
54 }
55
56 //=============================================================================
57 /*!
58  *  HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i
59  *
60  *  Destructor
61  */
62 //=============================================================================
63 HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i()
64 {
65   MESSAGE( "HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i" );
66 }
67
68 //=============================================================================
69 /*!
70  *  HexoticPlugin_Hypothesis_i::SetHexesMinLevel
71  *  HexoticPlugin_Hypothesis_i::SetHexesMaxLevel
72  *  HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles
73  *  HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges
74  *  HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements
75  *  HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold
76  */
77 //=============================================================================
78
79 void HexoticPlugin_Hypothesis_i::SetHexesMinLevel (CORBA::Long theValue)
80 {
81   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMinLevel");
82   ASSERT(myBaseImpl);
83   this->GetImpl()->SetHexesMinLevel(theValue);
84   SMESH::TPythonDump() << _this() << ".SetHexesMinLevel( " << theValue << " )";
85 }
86
87 void HexoticPlugin_Hypothesis_i::SetHexesMaxLevel (CORBA::Long theValue)
88 {
89   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMaxLevel");
90   ASSERT(myBaseImpl);
91   this->GetImpl()->SetHexesMaxLevel(theValue);
92   SMESH::TPythonDump() << _this() << ".SetHexesMaxLevel( " << theValue << " )";
93 }
94
95 void HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles (CORBA::Boolean theValue)
96 {
97   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles");
98   ASSERT(myBaseImpl);
99   this->GetImpl()->SetHexoticQuadrangles(theValue);
100   SMESH::TPythonDump() << _this() << ".SetHexoticQuadrangles( " << theValue << " )";
101 }
102
103 void HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges (CORBA::Boolean theValue)
104 {
105   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges");
106   ASSERT(myBaseImpl);
107   this->GetImpl()->SetHexoticIgnoreRidges(theValue);
108   SMESH::TPythonDump() << _this() << ".SetHexoticIgnoreRidges( " << theValue << " )";
109 }
110
111 void HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements (CORBA::Boolean theValue)
112 {
113   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements");
114   ASSERT(myBaseImpl);
115   this->GetImpl()->SetHexoticInvalidElements(theValue);
116   SMESH::TPythonDump() << _this() << ".SetHexoticInvalidElements( " << theValue << " )";
117 }
118
119 void HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold (CORBA::Long theValue)
120 {
121   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold");
122   ASSERT(myBaseImpl);
123   this->GetImpl()->SetHexoticSharpAngleThreshold(theValue);
124   SMESH::TPythonDump() << _this() << ".SetHexoticSharpAngleThreshold( " << theValue << " )";
125 }
126
127 //=============================================================================
128 /*!
129  *  HexoticPlugin_Hypothesis_i::GetHexesMinLevel
130  *  HexoticPlugin_Hypothesis_i::GetHexesMaxLevel
131  *  HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles
132  *  HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges
133  *  HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements
134  *  HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold 
135  */
136 //=============================================================================
137
138 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexesMinLevel()
139 {
140   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexesMinLevel");
141   ASSERT(myBaseImpl);
142   return this->GetImpl()->GetHexesMinLevel();
143 }
144
145 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexesMaxLevel()
146 {
147   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexesMaxLevel");
148   ASSERT(myBaseImpl);
149   return this->GetImpl()->GetHexesMaxLevel();
150 }
151
152 CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles()
153 {
154   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles");
155   ASSERT(myBaseImpl);
156   return this->GetImpl()->GetHexoticQuadrangles();
157 }
158
159 CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges()
160 {
161   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges");
162   ASSERT(myBaseImpl);
163   return this->GetImpl()->GetHexoticIgnoreRidges();
164 }
165
166 CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements()
167 {
168   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements");
169   ASSERT(myBaseImpl);
170   return this->GetImpl()->GetHexoticInvalidElements();
171 }
172
173 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold()
174 {
175   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold");
176   ASSERT(myBaseImpl);
177   return this->GetImpl()->GetHexoticSharpAngleThreshold();
178 }
179
180 //=============================================================================
181 /*!
182  *  HexoticPlugin_Hypothesis_i::GetImpl
183  *
184  *  Get implementation
185  */
186 //=============================================================================
187 ::HexoticPlugin_Hypothesis* HexoticPlugin_Hypothesis_i::GetImpl()
188 {
189   // MESSAGE("HexoticPlugin_Hypothesis_i::GetImpl");
190   return (::HexoticPlugin_Hypothesis*)myBaseImpl;
191 }
192
193 //================================================================================
194 /*!
195  * \brief Verify whether hypothesis supports given entity type 
196   * \param type - dimension (see SMESH::Dimension enumeration)
197   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
198  * 
199  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
200  */
201 //================================================================================  
202 CORBA::Boolean HexoticPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
203 {
204   return type == SMESH::DIM_3D;
205 }