Salome HOME
Imported using TkCVS
[plugins/ghs3dprlplugin.git] / src / GHS3DPRLPlugin / GHS3DPRLPlugin_Hypothesis_i.cxx
1 //  GHS3DPRLPlugin : 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      : GHS3DPRLPlugin_Hypothesis_i.cxx
23 //  Author   : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
24 // Date      : 2007/02/01
25 // Project   : SALOME
26 //=============================================================================
27 using namespace std;
28
29 #include "GHS3DPRLPlugin_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  *  GHS3DPRLPlugin_Hypothesis_i::GHS3DPRLPlugin_Hypothesis_i
39  *
40  *  Constructor
41  */
42 //=============================================================================
43 GHS3DPRLPlugin_Hypothesis_i::
44 GHS3DPRLPlugin_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( "GHS3DPRLPlugin_Hypothesis_i::GHS3DPRLPlugin_Hypothesis_i" );
51   myBaseImpl = new ::GHS3DPRLPlugin_Hypothesis (theGenImpl->GetANewId(),
52                                               theStudyId,
53                                               theGenImpl);
54 }
55
56 //=============================================================================
57 /*!
58  *  GHS3DPRLPlugin_Hypothesis_i::~GHS3DPRLPlugin_Hypothesis_i
59  *
60  *  Destructor
61  */
62 //=============================================================================
63 GHS3DPRLPlugin_Hypothesis_i::~GHS3DPRLPlugin_Hypothesis_i()
64 {
65   MESSAGE( "GHS3DPRLPlugin_Hypothesis_i::~GHS3DPRLPlugin_Hypothesis_i" );
66 }
67
68 //=============================================================================
69 /*!
70  *  GHS3DPRLPlugin_Hypothesis_i::SetMEDName
71  *  GHS3DPRLPlugin_Hypothesis_i::SetNbPart
72  *  GHS3DPRLPlugin_Hypothesis_i::SetKeepFiles
73  */
74 //=============================================================================
75
76 void GHS3DPRLPlugin_Hypothesis_i::SetMEDName (const char *theValue)
77 {
78   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetMEDName");
79   ASSERT(myBaseImpl);
80   this->GetImpl()->SetMEDName(theValue);
81   SMESH::TPythonDump() << _this() << ".SetMEDName( " << theValue << " )";
82 }
83
84 void GHS3DPRLPlugin_Hypothesis_i::SetNbPart (CORBA::Long theValue)
85 {
86   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetNbPart");
87   ASSERT(myBaseImpl);
88   this->GetImpl()->SetNbPart(theValue);
89   SMESH::TPythonDump() << _this() << ".SetNbPart( " << theValue << " )";
90 }
91
92 void GHS3DPRLPlugin_Hypothesis_i::SetKeepFiles (CORBA::Boolean theValue)
93 {
94   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::SetKeepFiles");
95   ASSERT(myBaseImpl);
96   this->GetImpl()->SetKeepFiles(theValue);
97   SMESH::TPythonDump() << _this() << ".SetKeepFiles( " << theValue << " )";
98 }
99
100 //=============================================================================
101 /*!
102  *  GHS3DPRLPlugin_Hypothesis_i::GetMEDName
103  *  GHS3DPRLPlugin_Hypothesis_i::GetNbPart
104  *  GHS3DPRLPlugin_Hypothesis_i::GetKeepFiles
105  */
106 //=============================================================================
107
108 char * GHS3DPRLPlugin_Hypothesis_i::GetMEDName()
109 {
110   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetMEDName");
111   ASSERT(myBaseImpl);
112     CORBA::String_var c_s =
113     CORBA::string_dup(this->GetImpl()->GetMEDName().c_str());
114   return c_s._retn();
115 }
116
117 CORBA::Long GHS3DPRLPlugin_Hypothesis_i::GetNbPart()
118 {
119   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetNbPart");
120   ASSERT(myBaseImpl);
121   return this->GetImpl()->GetNbPart();
122 }
123
124 CORBA::Boolean GHS3DPRLPlugin_Hypothesis_i::GetKeepFiles()
125 {
126   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetKeepFiles");
127   ASSERT(myBaseImpl);
128   return this->GetImpl()->GetKeepFiles();
129 }
130
131 //=============================================================================
132 /*!
133  *  GHS3DPRLPlugin_Hypothesis_i::GetImpl
134  *
135  *  Get implementation
136  */
137 //=============================================================================
138 ::GHS3DPRLPlugin_Hypothesis* GHS3DPRLPlugin_Hypothesis_i::GetImpl()
139 {
140   MESSAGE("GHS3DPRLPlugin_Hypothesis_i::GetImpl");
141   return (::GHS3DPRLPlugin_Hypothesis*)myBaseImpl;
142 }
143
144 //================================================================================
145 /*!
146  * \brief Verify whether hypothesis supports given entity type
147   * \param type - dimension (see SMESH::Dimension enumeration)
148   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
149  *
150  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
151  */
152 //================================================================================
153 CORBA::Boolean GHS3DPRLPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
154 {
155   return type == SMESH::DIM_3D;
156 }