]> SALOME platform Git repositories - modules/hexablock.git/blob - src/HEXABLOCK_I/HexHexa_impl.cxx
Salome HOME
Merge from V6_main 01/04/2013
[modules/hexablock.git] / src / HEXABLOCK_I / HexHexa_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 "HexHexa_impl.hxx"
27 #include "HexQuad_impl.hxx"
28 #include "HexEdge_impl.hxx"
29 #include "HexVertex_impl.hxx"
30
31 Hexa_impl::Hexa_impl( HEXA_NS::Hexa *ptrCpp ):_hexa_cpp(ptrCpp)
32 {
33 }
34
35 HEXA_NS::Hexa* Hexa_impl::GetImpl()
36     throw (SALOME::SALOME_Exception)
37 {
38   return _hexa_cpp;
39 }
40
41 Quad_ptr Hexa_impl::getQuad(::CORBA::Long n)
42     throw (SALOME::SALOME_Exception)
43 {
44   Quad_ptr result = Quad::_nil();
45
46   HEXA_NS::Quad* q = _hexa_cpp->getQuad(n);
47   if ( q != NULL ){
48     Quad_impl* servantCorba = new Quad_impl(q);
49     result = servantCorba->_this();
50   }
51   return result;
52 }
53
54 Edge_ptr Hexa_impl::getEdge(::CORBA::Long n)
55     throw (SALOME::SALOME_Exception)
56 {
57   Edge_ptr result = Edge::_nil();
58
59   HEXA_NS::Edge* e = _hexa_cpp->getEdge(n);
60   if ( e != NULL ){
61     Edge_impl* servantCorba = new Edge_impl(e);
62     result = servantCorba->_this();
63   }
64   return result;
65 }
66
67 Vertex_ptr Hexa_impl::getVertex(::CORBA::Long n)
68     throw (SALOME::SALOME_Exception)
69 {
70   Vertex_ptr result = Vertex::_nil();
71
72   HEXA_NS::Vertex* v = _hexa_cpp->getVertex(n);
73   if ( v != NULL ){
74     Vertex_impl* servantCorba = new Vertex_impl(v);
75     result = servantCorba->_this();
76   }
77   return result;
78 }
79
80 void Hexa_impl::setColor (::CORBA::Double val)
81      throw (SALOME::SALOME_Exception)
82 {
83   _hexa_cpp->setColor (val);
84 }
85
86 void Hexa_impl::setScalar( ::CORBA::Double val )throw (SALOME::SALOME_Exception)
87 {
88   _hexa_cpp->setScalar(val);
89 }
90
91 void Hexa_impl::dump() throw (SALOME::SALOME_Exception)
92 {
93   _hexa_cpp->dump();
94 }
95
96
97 void Hexa_impl::printName() throw (SALOME::SALOME_Exception)
98 {
99   _hexa_cpp->printName();
100 }
101
102
103 char* Hexa_impl::getName() throw (SALOME::SALOME_Exception)
104 {
105    return CORBA::string_dup( _hexa_cpp->getName() );
106 }
107
108 // ========================================================= setName
109 void Hexa_impl::setName(const char* name) 
110      throw (SALOME::SALOME_Exception)
111 {
112   _hexa_cpp->setName (name);
113 }