]> SALOME platform Git repositories - plugins/hexoticplugin.git/blob - src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx
Salome HOME
715a7fafb05dabc773da39aaa303f64c730a4a58
[plugins/hexoticplugin.git] / src / HexoticPlugin / HexoticPlugin_Hypothesis_i.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // ---
20 // File   : HexoticPlugin_Hypothesis_i.cxx
21 // Author : Lioka RAZAFINDRAZAKA (CEA)
22 // ---
23 //
24 #include "HexoticPlugin_Hypothesis_i.hxx"
25 #include "SMESH_Gen.hxx"
26 #include "SMESH_PythonDump.hxx"
27
28 #include "Utils_CorbaException.hxx"
29 #include "utilities.h"
30
31 //=============================================================================
32 /*!
33  *  HexoticPlugin_Hypothesis_i::HexoticPlugin_Hypothesis_i
34  *
35  *  Constructor
36  */
37 //=============================================================================
38 HexoticPlugin_Hypothesis_i::
39 HexoticPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
40                            int                     theStudyId,
41                            ::SMESH_Gen*            theGenImpl)
42   : SALOME::GenericObj_i( thePOA ), 
43     SMESH_Hypothesis_i( thePOA )
44 {
45   MESSAGE( "HexoticPlugin_Hypothesis_i::HexoticPlugin_Hypothesis_i" );
46   myBaseImpl = new ::HexoticPlugin_Hypothesis (theGenImpl->GetANewId(),
47                                               theStudyId,
48                                               theGenImpl);
49 }
50
51 //=============================================================================
52 /*!
53  *  HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i
54  *
55  *  Destructor
56  */
57 //=============================================================================
58 HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i()
59 {
60   MESSAGE( "HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i" );
61 }
62
63 //=============================================================================
64 /*!
65  *  HexoticPlugin_Hypothesis_i::SetHexesMinLevel
66  *  HexoticPlugin_Hypothesis_i::SetHexesMaxLevel
67  *  HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles
68  *  HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges
69  *  HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements
70  *  HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold
71  */
72 //=============================================================================
73
74 void HexoticPlugin_Hypothesis_i::SetHexesMinLevel (CORBA::Long theValue)
75 {
76   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMinLevel");
77   ASSERT(myBaseImpl);
78   this->GetImpl()->SetHexesMinLevel(theValue);
79   SMESH::TPythonDump() << _this() << ".SetHexesMinLevel( " << theValue << " )";
80 }
81
82 void HexoticPlugin_Hypothesis_i::SetHexesMaxLevel (CORBA::Long theValue)
83 {
84   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMaxLevel");
85   ASSERT(myBaseImpl);
86   this->GetImpl()->SetHexesMaxLevel(theValue);
87   SMESH::TPythonDump() << _this() << ".SetHexesMaxLevel( " << theValue << " )";
88 }
89
90 void HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles (CORBA::Boolean theValue)
91 {
92   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles");
93   ASSERT(myBaseImpl);
94   this->GetImpl()->SetHexoticQuadrangles(theValue);
95   SMESH::TPythonDump() << _this() << ".SetHexoticQuadrangles( " << theValue << " )";
96 }
97
98 void HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges (CORBA::Boolean theValue)
99 {
100   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges");
101   ASSERT(myBaseImpl);
102   this->GetImpl()->SetHexoticIgnoreRidges(theValue);
103   SMESH::TPythonDump() << _this() << ".SetHexoticIgnoreRidges( " << theValue << " )";
104 }
105
106 void HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements (CORBA::Boolean theValue)
107 {
108   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements");
109   ASSERT(myBaseImpl);
110   this->GetImpl()->SetHexoticInvalidElements(theValue);
111   SMESH::TPythonDump() << _this() << ".SetHexoticInvalidElements( " << theValue << " )";
112 }
113
114 void HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold (CORBA::Long theValue)
115 {
116   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold");
117   ASSERT(myBaseImpl);
118   this->GetImpl()->SetHexoticSharpAngleThreshold(theValue);
119   SMESH::TPythonDump() << _this() << ".SetHexoticSharpAngleThreshold( " << theValue << " )";
120 }
121
122 //=============================================================================
123 /*!
124  *  HexoticPlugin_Hypothesis_i::GetHexesMinLevel
125  *  HexoticPlugin_Hypothesis_i::GetHexesMaxLevel
126  *  HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles
127  *  HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges
128  *  HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements
129  *  HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold 
130  */
131 //=============================================================================
132
133 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexesMinLevel()
134 {
135   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexesMinLevel");
136   ASSERT(myBaseImpl);
137   return this->GetImpl()->GetHexesMinLevel();
138 }
139
140 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexesMaxLevel()
141 {
142   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexesMaxLevel");
143   ASSERT(myBaseImpl);
144   return this->GetImpl()->GetHexesMaxLevel();
145 }
146
147 CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles()
148 {
149   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles");
150   ASSERT(myBaseImpl);
151   return this->GetImpl()->GetHexoticQuadrangles();
152 }
153
154 CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges()
155 {
156   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges");
157   ASSERT(myBaseImpl);
158   return this->GetImpl()->GetHexoticIgnoreRidges();
159 }
160
161 CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements()
162 {
163   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements");
164   ASSERT(myBaseImpl);
165   return this->GetImpl()->GetHexoticInvalidElements();
166 }
167
168 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold()
169 {
170   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold");
171   ASSERT(myBaseImpl);
172   return this->GetImpl()->GetHexoticSharpAngleThreshold();
173 }
174
175 //=============================================================================
176 /*!
177  *  HexoticPlugin_Hypothesis_i::GetImpl
178  *
179  *  Get implementation
180  */
181 //=============================================================================
182 ::HexoticPlugin_Hypothesis* HexoticPlugin_Hypothesis_i::GetImpl()
183 {
184   // MESSAGE("HexoticPlugin_Hypothesis_i::GetImpl");
185   return (::HexoticPlugin_Hypothesis*)myBaseImpl;
186 }
187
188 //================================================================================
189 /*!
190  * \brief Verify whether hypothesis supports given entity type 
191   * \param type - dimension (see SMESH::Dimension enumeration)
192   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
193  * 
194  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
195  */
196 //================================================================================  
197 CORBA::Boolean HexoticPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
198 {
199   return type == SMESH::DIM_3D;
200 }