1 // Copyright (C) 2009-2023 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : HEXABLOCKPlugin_Hypothesis_i.cxx
21 // Created : Wed Apr 2 13:53:01 2008
22 // Author : Lioka RAZAFINDRAZAKA (CEA)
24 #include <SMESH_Gen.hxx>
25 #include <SMESH_PythonDump.hxx>
26 #include <SMESH_Mesh_i.hxx>
28 // #include "HEXABLOCK.hxx"
29 #include "HEXABLOCKPlugin_Hypothesis_i.hxx"
30 // #include "HexDocument_impl.hxx" // Perime
31 #include "HexDocument.hxx"
33 #include <Utils_CorbaException.hxx>
34 #include <utilities.h>
36 //=======================================================================
37 //function : HEXABLOCKPlugin_Hypothesis_i
38 //=======================================================================
40 HEXABLOCKPlugin_Hypothesis_i::HEXABLOCKPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
41 ::SMESH_Gen* theGenImpl)
42 : SALOME::GenericObj_i( thePOA ),
43 SMESH_Hypothesis_i( thePOA )
45 MESSAGE( "HEXABLOCKPlugin_Hypothesis_i::HEXABLOCKPlugin_Hypothesis_i" );
46 myBaseImpl = new ::HEXABLOCKPlugin_Hypothesis (theGenImpl->GetANewId(),
48 _poa = PortableServer::POA::_duplicate(thePOA);
51 //=======================================================================
52 //function : ~HEXABLOCKPlugin_Hypothesis_i
53 //=======================================================================
55 HEXABLOCKPlugin_Hypothesis_i::~HEXABLOCKPlugin_Hypothesis_i()
57 MESSAGE( "HEXABLOCKPlugin_Hypothesis_i::~HEXABLOCKPlugin_Hypothesis_i" );
60 //=============================================================================
64 //=============================================================================
66 ::HEXABLOCKPlugin_Hypothesis* HEXABLOCKPlugin_Hypothesis_i::GetImpl()
68 return (::HEXABLOCKPlugin_Hypothesis*)myBaseImpl;
71 //================================================================================
73 * \brief Verify whether hypothesis supports given entity type
75 //================================================================================
77 CORBA::Boolean HEXABLOCKPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
79 return type == SMESH::DIM_3D;
82 //================================================================================
84 * Define the document to be meshed, mandatory
86 //================================================================================
87 // ================================================================= GetDocument
88 char* HEXABLOCKPlugin_Hypothesis_i::GetDocument ()
91 cpchar xml = this->GetImpl()->GetXmlFlow ();
92 return CORBA::string_dup (xml);
95 // ================================================================= SetDocument
96 void HEXABLOCKPlugin_Hypothesis_i::SetDocument (const char* name)
99 // this->GetImpl()->SetXmlFlow (xml);
100 this->GetImpl()->SetDocument (name);
103 //================================================================================
105 * To define the hight dimension to generated: 3 = hexas, 2 = quads, 1 = segments, 0 = nodes
107 //================================================================================
109 CORBA::Long HEXABLOCKPlugin_Hypothesis_i::GetDimension() {
111 return this->GetImpl()->GetDimension();
114 void HEXABLOCKPlugin_Hypothesis_i::SetDimension(CORBA::Long dim) {
116 this->GetImpl()->SetDimension(dim);