]> SALOME platform Git repositories - modules/hexablock.git/blob - src/HEXABLOCK_I/HexPipe_impl.cxx
Salome HOME
Merge from V6_main 01/04/2013
[modules/hexablock.git] / src / HEXABLOCK_I / HexPipe_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 "HexVertex_impl.hxx"
27 #include "HexVector_impl.hxx"
28 #include "HexPipe_impl.hxx"
29
30 Pipe_impl::Pipe_impl( HEXA_NS::Pipe *ptrCpp ):_pipe_cpp(ptrCpp)
31 {
32 }
33
34 HEXA_NS::Pipe* Pipe_impl::GetImpl() throw (SALOME::SALOME_Exception)
35 {
36   return _pipe_cpp;
37 }
38
39 Vertex_ptr Pipe_impl::getBase() throw (SALOME::SALOME_Exception)
40 {
41   Vertex_ptr result = Vertex::_nil();
42
43   HEXA_NS::Vertex* v = _pipe_cpp->getBase();
44   if ( v!= NULL ){  
45     Vertex_impl* servantCorba = new Vertex_impl(v);
46     result = servantCorba->_this();
47   }
48   return result;
49 }
50
51 Vector_ptr Pipe_impl::getDirection() throw (SALOME::SALOME_Exception)
52 {
53   Vector_ptr result = Vector::_nil();
54
55   HEXA_NS::Vector* v = _pipe_cpp->getDirection();
56
57   if ( v!= NULL ){  
58     Vector_impl* servantCorba = new Vector_impl(v);
59     result = servantCorba->_this();
60   }
61   return result;
62 }
63
64 ::CORBA::Double Pipe_impl::getInternal_radius() throw (SALOME::SALOME_Exception)
65 {
66 //   ::CORBA::Double d = _pipe_cpp->getInternal_radius(); CS_TODO
67   ::CORBA::Double d = _pipe_cpp->getInternalRadius();
68   return d;
69 }
70
71 ::CORBA::Double Pipe_impl::getRadius() throw (SALOME::SALOME_Exception)
72 {
73   ::CORBA::Double d = _pipe_cpp->getRadius();
74   return d;
75 }
76
77 ::CORBA::Double Pipe_impl::getHeight() throw (SALOME::SALOME_Exception)
78 {
79   ::CORBA::Double d = _pipe_cpp->getHeight();
80   return d;
81 }
82
83
84 void Pipe_impl::dump() throw (SALOME::SALOME_Exception)
85 {
86   _pipe_cpp->dump();
87 }
88
89
90 void Pipe_impl::printName() throw (SALOME::SALOME_Exception)
91 {
92   _pipe_cpp->printName();
93 }
94
95
96 char* Pipe_impl::getName() throw (SALOME::SALOME_Exception)
97 {
98   return CORBA::string_dup( _pipe_cpp->getName() );
99 }
100 // ========================================================= setName
101 void Pipe_impl::setName(const char* name) 
102      throw (SALOME::SALOME_Exception)
103 {
104   _pipe_cpp->setName (name);
105 }