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