Salome HOME
Merge from V6_main 13/12/2012
[modules/hexablock.git] / src / HEXABLOCK_I / HexBiCylinder_impl.cxx
1 // Copyright (C) 2009-2012  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 "hexa_base.hxx"
21 #include "HexVertex_impl.hxx"
22 #include "HexEdge_impl.hxx"
23 #include "HexQuad_impl.hxx"
24 #include "HexHexa_impl.hxx"
25 #include "HexCylinder_impl.hxx"
26 #include "HexBiCylinder_impl.hxx"
27 #include "HEXABLOCK.hxx"
28
29
30 BiCylinder_impl::BiCylinder_impl( HEXA_NS::BiCylinder *ptrCpp )
31 {
32    bi_cylinder_cpp = ptrCpp;
33 }
34
35
36 HEXA_NS::BiCylinder* BiCylinder_impl::GetImpl()
37 {
38   return bi_cylinder_cpp;
39 }
40
41
42 Vertex_ptr BiCylinder_impl::getVertexIJK(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
43   throw (SALOME::SALOME_Exception)
44 {
45   Vertex_ptr result = Vertex::_nil();
46   HEXA_NS::Vertex* v = bi_cylinder_cpp->getVertexIJK(part, x, y, z);
47   if ( v != NULL ){
48     Vertex_impl* servantCorba = new Vertex_impl(v);
49     result = servantCorba->_this();
50   }
51   return result;
52 }
53
54
55 Edge_ptr BiCylinder_impl::getEdgeI(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
56   throw (SALOME::SALOME_Exception)
57 {
58   Edge_ptr result = Edge::_nil();
59   HEXA_NS::Edge* e = bi_cylinder_cpp->getEdgeI(part, x, y, z);
60   if ( e != NULL ){
61     Edge_impl* servantCorba = new Edge_impl(e);
62     result = servantCorba->_this();
63   }
64   return result;
65 }
66
67
68 Edge_ptr BiCylinder_impl::getEdgeJ(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
69   throw (SALOME::SALOME_Exception)
70 {
71   Edge_ptr result = Edge::_nil();
72   HEXA_NS::Edge* e = bi_cylinder_cpp->getEdgeJ(part, x, y, z);
73   if ( e != NULL ){
74     Edge_impl* servantCorba = new Edge_impl(e);
75     result = servantCorba->_this();
76   }
77   return result;
78 }
79
80
81 Edge_ptr BiCylinder_impl::getEdgeK(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
82   throw (SALOME::SALOME_Exception)
83 {
84   Edge_ptr result = Edge::_nil();
85   HEXA_NS::Edge* e = bi_cylinder_cpp->getEdgeK(part, x, y, z);
86   if ( e != NULL ){
87     Edge_impl* servantCorba = new Edge_impl(e);
88     result = servantCorba->_this();
89   }
90   return result;
91 }
92
93 Quad_ptr BiCylinder_impl::getQuadIJ(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
94   throw (SALOME::SALOME_Exception)
95 {
96   Quad_ptr result = Quad::_nil();
97   HEXA_NS::Quad* q = bi_cylinder_cpp->getQuadIJ(part, x, y, z);
98   if ( q != NULL ){
99     Quad_impl* servantCorba = new Quad_impl(q);
100     result = servantCorba->_this();
101   }
102   return result;
103 }
104
105
106 Quad_ptr BiCylinder_impl::getQuadIK(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
107   throw (SALOME::SALOME_Exception)
108 {
109   Quad_ptr result = Quad::_nil();
110   HEXA_NS::Quad* q = bi_cylinder_cpp->getQuadIK(part, x, y, z);
111   if ( q != NULL ){
112     Quad_impl* servantCorba = new Quad_impl(q);
113     result = servantCorba->_this();
114   }
115   return result;
116 }
117
118
119 Quad_ptr BiCylinder_impl::getQuadJK(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
120   throw (SALOME::SALOME_Exception)
121 {
122   Quad_ptr result = Quad::_nil();
123   HEXA_NS::Quad* q = bi_cylinder_cpp->getQuadJK(part, x, y, z);
124   if ( q != NULL ){
125     Quad_impl* servantCorba = new Quad_impl(q);
126     result = servantCorba->_this();
127   }
128   return result;
129 }
130
131
132 Hexa_ptr BiCylinder_impl::getHexaIJK(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z) throw (SALOME::SALOME_Exception)
133 {
134   Hexa_ptr result = Hexa::_nil();
135   HEXA_NS::Hexa* h = bi_cylinder_cpp->getHexaIJK(part, x, y, z);
136   if ( h != NULL ){
137     Hexa_impl* servantCorba = new Hexa_impl(h);
138     result = servantCorba->_this();
139   }
140   return result;
141 }
142 ::CORBA::Long BiCylinder_impl::saveVtk(const char* fname) throw (SALOME::SALOME_Exception)
143 {
144   ::CORBA::Long ret = bi_cylinder_cpp->saveVtk( fname );
145   return ret;
146 }
147
148 void BiCylinder_impl::dump() throw (SALOME::SALOME_Exception)
149 {
150   bi_cylinder_cpp->dump();
151 }
152
153
154 void BiCylinder_impl::printName() throw (SALOME::SALOME_Exception)
155 {
156   bi_cylinder_cpp->printName();
157 }
158
159 char* BiCylinder_impl::getName() throw (SALOME::SALOME_Exception)
160 {
161   return CORBA::string_dup( bi_cylinder_cpp->getName() );
162 }
163
164 // ========================================================= setName
165 void BiCylinder_impl::setName(const char* name)
166      throw (SALOME::SALOME_Exception)
167 {
168   bi_cylinder_cpp->setName (name);
169 }
170