Salome HOME
c7f044d13ebaeee6c468101aa90c9eb6e150962b
[plugins/ghs3dprlplugin.git] / src / GHS3DPRLPlugin / GHS3DPRLPlugin_Hypothesis_i.cxx
1 // Copyright (C) 2007-2008 OPEN CASCADE, 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 //
21 // File   : GHS3DPRLPlugin_Hypothesis_i.cxx
22 // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
23 //
24 // ---
25
26 #include "GHS3DPRLPlugin_Hypothesis_i.hxx"
27 #include "SMESH_Gen.hxx"
28 #include "SMESH_PythonDump.hxx"
29
30 #include "Utils_CorbaException.hxx"
31 #include "utilities.h"
32
33 //=============================================================================
34 /*!
35  *  GHS3DPRLPlugin_Hypothesis_i::GHS3DPRLPlugin_Hypothesis_i
36  *
37  *  Constructor
38  */
39 //=============================================================================
40 GHS3DPRLPlugin_Hypothesis_i::
41 GHS3DPRLPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
42                              int                     theStudyId,
43                              ::SMESH_Gen*            theGenImpl)
44   : SALOME::GenericObj_i( thePOA ),
45     SMESH_Hypothesis_i( thePOA )
46 {
47   MESSAGE( "GHS3DPRLPlugin_Hypothesis_i::GHS3DPRLPlugin_Hypothesis_i" );
48   myBaseImpl = new ::GHS3DPRLPlugin_Hypothesis (theGenImpl->GetANewId(),
49                                                 theStudyId,
50                                                 theGenImpl);
51 }
52
53 //=============================================================================
54 /*!
55  *  GHS3DPRLPlugin_Hypothesis_i::~GHS3DPRLPlugin_Hypothesis_i
56  *
57  *  Destructor
58  */
59 //=============================================================================
60 GHS3DPRLPlugin_Hypothesis_i::~GHS3DPRLPlugin_Hypothesis_i()
61 {
62   MESSAGE( "GHS3DPRLPlugin_Hypothesis_i::~GHS3DPRLPlugin_Hypothesis_i" );
63 }
64
65 //=============================================================================
66 /*!
67  *  GHS3DPRLPlugin_Hypothesis_i::SetMEDName
68  *  GHS3DPRLPlugin_Hypothesis_i::SetNbPart
69  *  GHS3DPRLPlugin_Hypothesis_i::SetKeepFiles
70  *  GHS3DPRLPlugin_Hypothesis_i::SetBackground
71  *  GHS3DPRLPlugin_Hypothesis_i::SetToMeshHoles
72  */
73 //=============================================================================
74
75 void GHS3DPRLPlugin_Hypothesis_i::SetMEDName (const char *theValue)
76 {
77   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetMEDName");
78   ASSERT(myBaseImpl);
79   this->GetImpl()->SetMEDName(theValue);
80   SMESH::TPythonDump() << _this() << ".SetMEDName( " << theValue << " )";
81 }
82
83 void GHS3DPRLPlugin_Hypothesis_i::SetNbPart (CORBA::Long theValue)
84 {
85   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetNbPart");
86   ASSERT(myBaseImpl);
87   this->GetImpl()->SetNbPart(theValue);
88   SMESH::TPythonDump() << _this() << ".SetNbPart( " << theValue << " )";
89 }
90
91 void GHS3DPRLPlugin_Hypothesis_i::SetKeepFiles (CORBA::Boolean theValue)
92 {
93   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetKeepFiles");
94   ASSERT(myBaseImpl);
95   this->GetImpl()->SetKeepFiles(theValue);
96   SMESH::TPythonDump() << _this() << ".SetKeepFiles( " << theValue << " )";
97 }
98
99 void GHS3DPRLPlugin_Hypothesis_i::SetBackground (CORBA::Boolean theValue)
100 {
101   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetBackground");
102   ASSERT(myBaseImpl);
103   this->GetImpl()->SetBackground(theValue);
104   SMESH::TPythonDump() << _this() << ".SetBackground( " << theValue << " )";
105 }
106
107 void GHS3DPRLPlugin_Hypothesis_i::SetToMeshHoles (CORBA::Boolean theValue)
108 {
109   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetToMeshHoles");
110   ASSERT(myBaseImpl);
111   this->GetImpl()->SetToMeshHoles(theValue);
112   SMESH::TPythonDump() << _this() << ".SetToMeshHoles( " << theValue << " )";
113 }
114
115 //=============================================================================
116 /*!
117  *  GHS3DPRLPlugin_Hypothesis_i::GetMEDName
118  *  GHS3DPRLPlugin_Hypothesis_i::GetNbPart
119  *  GHS3DPRLPlugin_Hypothesis_i::GetKeepFiles
120  *  GHS3DPRLPlugin_Hypothesis_i::GetBackground
121  *  GHS3DPRLPlugin_Hypothesis_i::GetToMeshHoles
122  */
123 //=============================================================================
124
125 char * GHS3DPRLPlugin_Hypothesis_i::GetMEDName()
126 {
127   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetMEDName");
128   ASSERT(myBaseImpl);
129     CORBA::String_var c_s =
130     CORBA::string_dup(this->GetImpl()->GetMEDName().c_str());
131   return c_s._retn();
132 }
133
134 CORBA::Long GHS3DPRLPlugin_Hypothesis_i::GetNbPart()
135 {
136   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetNbPart");
137   ASSERT(myBaseImpl);
138   return this->GetImpl()->GetNbPart();
139 }
140
141 CORBA::Boolean GHS3DPRLPlugin_Hypothesis_i::GetKeepFiles()
142 {
143   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetKeepFiles");
144   ASSERT(myBaseImpl);
145   return this->GetImpl()->GetKeepFiles();
146 }
147
148 CORBA::Boolean GHS3DPRLPlugin_Hypothesis_i::GetBackground()
149 {
150   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetBackground");
151   ASSERT(myBaseImpl);
152   return this->GetImpl()->GetBackground();
153 }
154
155 CORBA::Boolean GHS3DPRLPlugin_Hypothesis_i::GetToMeshHoles()
156 {
157   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetToMeshHoles");
158   ASSERT(myBaseImpl);
159   return this->GetImpl()->GetToMeshHoles();
160 }
161
162 //=============================================================================
163 /*!
164  *  GHS3DPRLPlugin_Hypothesis_i::GetImpl
165  *
166  *  Get implementation
167  */
168 //=============================================================================
169 ::GHS3DPRLPlugin_Hypothesis* GHS3DPRLPlugin_Hypothesis_i::GetImpl()
170 {
171   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetImpl");
172   return (::GHS3DPRLPlugin_Hypothesis*)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 GHS3DPRLPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
185 {
186   return type == SMESH::DIM_3D;
187 }