Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis_2D_i.cxx
1 //  NETGENPlugin : 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 //
22 // File      : NETGENPlugin_Hypothesis_2D_i.cxx
23 // Author    : Michael Sazonov (OCN)
24 // Date      : 03/04/2006
25 // Project   : SALOME
26 // $Header$
27 //=============================================================================
28 using namespace std;
29
30 #include "NETGENPlugin_Hypothesis_2D_i.hxx"
31 #include "SMESH_Gen.hxx"
32 #include "SMESH_PythonDump.hxx"
33
34 #include "Utils_CorbaException.hxx"
35 #include "utilities.h"
36
37 //=============================================================================
38 /*!
39  *  NETGENPlugin_Hypothesis_2D_i::NETGENPlugin_Hypothesis_2D_i
40  *
41  *  Constructor
42  */
43 //=============================================================================
44 NETGENPlugin_Hypothesis_2D_i::
45 NETGENPlugin_Hypothesis_2D_i (PortableServer::POA_ptr thePOA,
46                               int                     theStudyId,
47                               ::SMESH_Gen*            theGenImpl)
48   : SALOME::GenericObj_i( thePOA ),
49     SMESH_Hypothesis_i( thePOA ),
50     NETGENPlugin_Hypothesis_i( thePOA, theStudyId, theGenImpl )
51 {
52   MESSAGE( "NETGENPlugin_Hypothesis_2D_i::NETGENPlugin_Hypothesis_2D_i" );
53   if (myBaseImpl)
54     delete (::NETGENPlugin_Hypothesis*)myBaseImpl;
55   myBaseImpl = new ::NETGENPlugin_Hypothesis_2D (theGenImpl->GetANewId(),
56                                                  theStudyId,
57                                                  theGenImpl);
58 }
59
60 //=============================================================================
61 /*!
62  *  NETGENPlugin_Hypothesis_2D_i::~NETGENPlugin_Hypothesis_2D_i
63  *
64  *  Destructor
65  */
66 //=============================================================================
67 NETGENPlugin_Hypothesis_2D_i::~NETGENPlugin_Hypothesis_2D_i()
68 {
69   MESSAGE( "NETGENPlugin_Hypothesis_2D_i::~NETGENPlugin_Hypothesis_2D_i" );
70 }
71
72 //=============================================================================
73 /*!
74  *  NETGENPlugin_Hypothesis_2D_i::SetQuadAllowed
75  *
76  *  Set QuadAllowed flag
77  */
78 //=============================================================================
79 void NETGENPlugin_Hypothesis_2D_i::SetQuadAllowed (CORBA::Boolean theValue)
80 {
81   MESSAGE("NETGENPlugin_Hypothesis_2D_i::SetQuadAllowed");
82   ASSERT(myBaseImpl);
83   this->GetImpl()->SetQuadAllowed(theValue);
84   SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValue << " )";
85 }
86
87 //=============================================================================
88 /*!
89  *  NETGENPlugin_Hypothesis_2D_i::GetQuadAllowed
90  *
91  *  Get QuadAllowed flag
92  */
93 //=============================================================================
94 CORBA::Boolean NETGENPlugin_Hypothesis_2D_i::GetQuadAllowed()
95 {
96   MESSAGE("NETGENPlugin_Hypothesis_2D_i::GetQuadAllowed");
97   ASSERT(myBaseImpl);
98   return this->GetImpl()->GetQuadAllowed();
99 }
100
101 //=============================================================================
102 /*!
103  *  NETGENPlugin_Hypothesis_2D_i::GetImpl
104  *
105  *  Get implementation
106  */
107 //=============================================================================
108 ::NETGENPlugin_Hypothesis_2D* NETGENPlugin_Hypothesis_2D_i::GetImpl()
109 {
110   MESSAGE("NETGENPlugin_Hypothesis_2D_i::GetImpl");
111   return (::NETGENPlugin_Hypothesis_2D*)myBaseImpl;
112 }
113
114 //================================================================================
115 /*!
116  * \brief Verify whether hypothesis supports given entity type 
117   * \param type - dimension (see SMESH::Dimension enumeration)
118   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
119  * 
120  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
121  */
122 //================================================================================  
123 CORBA::Boolean NETGENPlugin_Hypothesis_2D_i::IsDimSupported( SMESH::Dimension type )
124 {
125   return type == SMESH::DIM_2D;
126 }