Salome HOME
[SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D...
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_SimpleHypothesis_3D_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_SimpleHypothesis_3D_i.cxx
23 // Author    : Edward AGAPOV
24 // Project   : SALOME
25 //=============================================================================
26
27 #include "NETGENPlugin_SimpleHypothesis_3D_i.hxx"
28 #include "NETGENPlugin_SimpleHypothesis_3D.hxx"
29
30 #include <SMESH_Gen.hxx>
31 #include <SMESH_PythonDump.hxx>
32
33 #include <Utils_CorbaException.hxx>
34 #include <utilities.h>
35
36 using namespace std;
37
38 //=============================================================================
39 /*!
40  *  NETGENPlugin_SimpleHypothesis_3D_i::NETGENPlugin_SimpleHypothesis_3D_i
41  *
42  *  Constructor
43  */
44 //=============================================================================
45 NETGENPlugin_SimpleHypothesis_3D_i::
46 NETGENPlugin_SimpleHypothesis_3D_i (PortableServer::POA_ptr thePOA,
47                                     int                     theStudyId,
48                                     ::SMESH_Gen*            theGenImpl)
49   : SALOME::GenericObj_i( thePOA ),
50     SMESH_Hypothesis_i( thePOA ),
51     NETGENPlugin_SimpleHypothesis_2D_i( thePOA,theStudyId,theGenImpl )
52 {
53   MESSAGE( "NETGENPlugin_SimpleHypothesis_3D_i::NETGENPlugin_SimpleHypothesis_3D_i" );
54   if ( myBaseImpl )
55     delete myBaseImpl;
56   myBaseImpl = new ::NETGENPlugin_SimpleHypothesis_3D (theGenImpl->GetANewId(),
57                                                        theStudyId,
58                                                        theGenImpl);
59 }
60
61 //=============================================================================
62 /*!
63  *  NETGENPlugin_SimpleHypothesis_3D_i::~NETGENPlugin_SimpleHypothesis_3D_i
64  *
65  *  Destructor
66  */
67 //=============================================================================
68 NETGENPlugin_SimpleHypothesis_3D_i::~NETGENPlugin_SimpleHypothesis_3D_i()
69 {
70   MESSAGE( "NETGENPlugin_SimpleHypothesis_3D_i::~NETGENPlugin_SimpleHypothesis_3D_i" );
71 }
72
73 //=============================================================================
74 /*!
75  *  NETGENPlugin_SimpleHypothesis_3D_i::LengthFromFaces()
76  */
77 //=============================================================================
78 void NETGENPlugin_SimpleHypothesis_3D_i::LengthFromFaces()
79 {
80   MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::LengthFromFaces");
81   ASSERT(myBaseImpl);
82   this->GetImpl()->LengthFromFaces();
83   SMESH::TPythonDump() << _this() << ".LengthFromFaces()";
84 }
85
86 //=============================================================================
87 /*!
88  *  NETGENPlugin_SimpleHypothesis_3D_i::SetMaxElementVolume()
89  */
90 //=============================================================================
91 void NETGENPlugin_SimpleHypothesis_3D_i::SetMaxElementVolume(CORBA::Double value)
92 {
93   MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::SetMaxElementVolume");
94   ASSERT(myBaseImpl);
95   this->GetImpl()->SetMaxElementVolume(value);
96   SMESH::TPythonDump() << _this() << ".SetMaxElementVolume( " << value << " )";
97 }
98
99
100 //=============================================================================
101 /*!
102  *  NETGENPlugin_SimpleHypothesis_3D_i::GetMaxElementVolume()
103  */
104 //=============================================================================
105 CORBA::Double NETGENPlugin_SimpleHypothesis_3D_i::GetMaxElementVolume()
106 {
107   MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::GetMaxElementVolume");
108   ASSERT(myBaseImpl);
109   return this->GetImpl()->GetMaxElementVolume();
110 }
111 //=============================================================================
112 /*!
113  *  NETGENPlugin_SimpleHypothesis_3D_i::GetImpl
114  */
115 //=============================================================================
116 ::NETGENPlugin_SimpleHypothesis_3D* NETGENPlugin_SimpleHypothesis_3D_i::GetImpl()
117 {
118   MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::GetImpl");
119   return (::NETGENPlugin_SimpleHypothesis_3D*)myBaseImpl;
120 }
121
122 //================================================================================
123 /*!
124  * \brief Verify whether hypothesis supports given entity type 
125   * \param type - dimension (see SMESH::Dimension enumeration)
126   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
127  * 
128  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
129  */
130 //================================================================================  
131 CORBA::Boolean NETGENPlugin_SimpleHypothesis_3D_i::IsDimSupported( SMESH::Dimension type )
132 {
133   return type == SMESH::DIM_3D;
134 }