]> SALOME platform Git repositories - modules/hexablock.git/blob - src/HEXABLOCK_I/HexCylinder_impl.cxx
Salome HOME
Merge from V6_main 01/04/2013
[modules/hexablock.git] / src / HEXABLOCK_I / HexCylinder_impl.cxx
1 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
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.
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 using namespace std;
20 #include "HEXABLOCK.hxx"
21 #include "utilities.h"
22
23 #include <string>
24
25 #include "hexa_base.hxx"
26 #include "HexCylinder_impl.hxx"
27 #include "HexVertex_impl.hxx"
28 #include "HexVector_impl.hxx"
29
30 Cylinder_impl::Cylinder_impl( HEXA_NS::Cylinder *ptrCpp ):_cylinder_cpp(ptrCpp)
31 {
32 }
33
34 HEXA_NS::Cylinder* Cylinder_impl::GetImpl()
35   throw (SALOME::SALOME_Exception)
36 {
37   return _cylinder_cpp;
38 }
39
40
41 Vertex_ptr Cylinder_impl::getBase()
42   throw (SALOME::SALOME_Exception)
43 {
44   Vertex_ptr result = Vertex::_nil();
45
46   HEXA_NS::Vertex* v = _cylinder_cpp->getBase();
47   if ( v!= NULL ){
48     Vertex_impl* servantCorba = new Vertex_impl(v);
49     result = servantCorba->_this();
50   }
51
52   return result;
53 }
54
55 Vector_ptr Cylinder_impl::getDirection()
56   throw (SALOME::SALOME_Exception)
57 {
58   Vector_ptr result = Vector::_nil();
59
60   HEXA_NS::Vector* v = _cylinder_cpp->getDirection();
61   if ( v!= NULL ){
62     Vector_impl* servantCorba = new Vector_impl(v);
63     result = servantCorba->_this();
64   }
65   return result;
66 }
67
68
69 ::CORBA::Double Cylinder_impl::getRadius()
70   throw (SALOME::SALOME_Exception)
71 {
72  ::CORBA::Double d = _cylinder_cpp->getRadius();
73   return d;
74 }
75
76
77 ::CORBA::Double Cylinder_impl::getHeight()
78   throw (SALOME::SALOME_Exception)
79 {
80  ::CORBA::Double d = _cylinder_cpp->getHeight();
81   return d;
82 }
83
84
85 void Cylinder_impl::dump() throw (SALOME::SALOME_Exception)
86 {
87   _cylinder_cpp->dump();
88 }
89
90
91 void Cylinder_impl::printName() throw (SALOME::SALOME_Exception)
92 {
93   _cylinder_cpp->printName();
94 }
95
96
97 char* Cylinder_impl::getName() throw (SALOME::SALOME_Exception)
98 {
99   char name[12];
100   return CORBA::string_dup( _cylinder_cpp->getName(name) );
101 }
102 // ========================================================= setName
103 void Cylinder_impl::setName(const char* name) 
104      throw (SALOME::SALOME_Exception)
105 {
106   _cylinder_cpp->setName (name);
107 }
108
109 // ::CORBA::Long Cylinder_impl::saveVtk(const char* fname) throw (SALOME::SALOME_Exception)
110 // {
111 //   ::CORBA::Long ret = _cylinder_cpp->saveVtk( fname );
112 //   return ret;
113 // }
114
115