2 #include "HEXABLOCK.hxx"
3 #include "hexa_base.hxx"
4 #include "HexElements_impl.hxx"
5 #include "HexVertex_impl.hxx"
6 #include "HexEdge_impl.hxx"
7 #include "HexQuad_impl.hxx"
8 #include "HexHexa_impl.hxx"
11 Elements_impl::Elements_impl( HEXA_NS::Elements *ptrCpp ):_elements_cpp(ptrCpp)
15 HEXA_NS::Elements* Elements_impl::GetImpl()
20 ::CORBA::Long Elements_impl::countVertex() throw (SALOME::SALOME_Exception)
22 ::CORBA::Long n = _elements_cpp->countVertex();
26 ::CORBA::Long Elements_impl::countEdge() throw (SALOME::SALOME_Exception)
28 ::CORBA::Long n = _elements_cpp->countEdge();
32 ::CORBA::Long Elements_impl::countQuad() throw (SALOME::SALOME_Exception)
34 ::CORBA::Long n = _elements_cpp->countQuad();
38 ::CORBA::Long Elements_impl::countHexa() throw (SALOME::SALOME_Exception)
40 ::CORBA::Long n = _elements_cpp->countHexa();
44 ::CORBA::Long Elements_impl::findVertex( Vertex_ptr pIn ) throw (SALOME::SALOME_Exception)
47 Vertex_impl* pInServant = ::DownCast<Vertex_impl*>( pIn );
49 HEXA_NS::Vertex* p = pInServant->GetImpl();
50 n = _elements_cpp->findVertex( p );
56 Vertex_ptr Elements_impl::getVertex(::CORBA::Long n) throw (SALOME::SALOME_Exception)
58 Vertex_ptr result = Vertex::_nil();
60 HEXA_NS::Vertex* v = _elements_cpp->getVertex(n);
62 Vertex_impl* servantCorba = new Vertex_impl(v);
63 result = servantCorba->_this();
68 Edge_ptr Elements_impl::getEdge(::CORBA::Long n) throw (SALOME::SALOME_Exception)
70 Edge_ptr result = Edge::_nil();
72 HEXA_NS::Edge* e = _elements_cpp->getEdge(n);
74 Edge_impl* servantCorba = new Edge_impl(e);
75 result = servantCorba->_this();
80 Quad_ptr Elements_impl::getQuad(::CORBA::Long n) throw (SALOME::SALOME_Exception)
82 Quad_ptr result = Quad::_nil();
84 HEXA_NS::Quad* q = _elements_cpp->getQuad(n);
86 Quad_impl* servantCorba = new Quad_impl(q);
87 result = servantCorba->_this();
92 Hexa_ptr Elements_impl::getHexa(::CORBA::Long n) throw (SALOME::SALOME_Exception)
94 Hexa_ptr result = Hexa::_nil();
96 HEXA_NS::Hexa* h = _elements_cpp->getHexa(n);
98 Hexa_impl* servantCorba = new Hexa_impl(h);
99 result = servantCorba->_this();
105 ::CORBA::Long Elements_impl::saveVtk( const char* fname ) throw (SALOME::SALOME_Exception)
107 ::CORBA::Long ret = _elements_cpp->saveVtk( fname );
112 void Elements_impl::dump() throw (SALOME::SALOME_Exception)
114 _elements_cpp->dump();
118 void Elements_impl::printName() throw (SALOME::SALOME_Exception)
120 _elements_cpp->printName();
126 Vertex_ptr Elements_impl::getVertexIJK(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
127 throw (SALOME::SALOME_Exception)
129 Vertex_ptr result = Vertex::_nil();
130 HEXA_NS::Vertex* v = _elements_cpp->getVertexIJK(x, y, z);
132 Vertex_impl* servantCorba = new Vertex_impl(v);
133 result = servantCorba->_this();
139 Edge_ptr Elements_impl::getEdgeI(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
140 throw (SALOME::SALOME_Exception)
142 Edge_ptr result = Edge::_nil();
143 HEXA_NS::Edge* e = _elements_cpp->getEdgeI(x, y, z);
145 Edge_impl* servantCorba = new Edge_impl(e);
146 result = servantCorba->_this();
152 Edge_ptr Elements_impl::getEdgeJ(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
153 throw (SALOME::SALOME_Exception)
155 Edge_ptr result = Edge::_nil();
156 HEXA_NS::Edge* e = _elements_cpp->getEdgeJ(x, y, z);
158 Edge_impl* servantCorba = new Edge_impl(e);
159 result = servantCorba->_this();
165 Edge_ptr Elements_impl::getEdgeK(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
166 throw (SALOME::SALOME_Exception)
168 Edge_ptr result = Edge::_nil();
169 HEXA_NS::Edge* e = _elements_cpp->getEdgeK(x, y, z);
171 Edge_impl* servantCorba = new Edge_impl(e);
172 result = servantCorba->_this();
177 Quad_ptr Elements_impl::getQuadIJ(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
178 throw (SALOME::SALOME_Exception)
180 Quad_ptr result = Quad::_nil();
181 HEXA_NS::Quad* q = _elements_cpp->getQuadIJ(x, y, z);
183 Quad_impl* servantCorba = new Quad_impl(q);
184 result = servantCorba->_this();
190 Quad_ptr Elements_impl::getQuadIK(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
191 throw (SALOME::SALOME_Exception)
193 Quad_ptr result = Quad::_nil();
194 HEXA_NS::Quad* q = _elements_cpp->getQuadIK(x, y, z);
196 Quad_impl* servantCorba = new Quad_impl(q);
197 result = servantCorba->_this();
203 Quad_ptr Elements_impl::getQuadJK(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
204 throw (SALOME::SALOME_Exception)
206 Quad_ptr result = Quad::_nil();
207 HEXA_NS::Quad* q = _elements_cpp->getQuadJK(x, y, z);
209 Quad_impl* servantCorba = new Quad_impl(q);
210 result = servantCorba->_this();
216 Hexa_ptr Elements_impl::getHexaIJK(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z) throw (SALOME::SALOME_Exception)
218 Hexa_ptr result = Hexa::_nil();
219 HEXA_NS::Hexa* h = _elements_cpp->getHexaIJK(x, y, z);
221 Hexa_impl* servantCorba = new Hexa_impl(h);
222 result = servantCorba->_this();
228 // Quad_ptr Elements_impl::getQuad1(EnumCoord dirIn, ::CORBA::Long nx, ::CORBA::Long ny, ::CORBA::Long nz)
229 // throw (SALOME::SALOME_Exception)
231 // Quad_ptr result = Quad::_nil();
234 // // HEXA_NS::EnumCoord k_cpp;
235 // HEXA_NS::EnumCoord dir_cpp;
238 // case DIR_X : dir_cpp = HEXA_NS::dir_x; break;
239 // case DIR_Y : dir_cpp = HEXA_NS::dir_y; break;
240 // case DIR_Z : dir_cpp = HEXA_NS::dir_z; break;
241 // case DIM3: dir_cpp = HEXA_NS::DIM3; break;
244 // HEXA_NS::Quad* q = _elements_cpp->getQuad(dir_cpp, nx, ny, nz);
246 // Quad_impl* servantCorba = new Quad_impl(q);
247 // result = servantCorba->_this();
253 // Edge_ptr Elements_impl::getEdge1(EnumCoord dirIn, ::CORBA::Long nx, ::CORBA::Long ny, ::CORBA::Long nz)
254 // throw (SALOME::SALOME_Exception)
256 // Edge_ptr result = Edge::_nil();
259 // // HEXA_NS::EnumCoord k_cpp;
260 // HEXA_NS::EnumCoord dir_cpp;
263 // case DIR_X : dir_cpp = HEXA_NS::dir_x; break;
264 // case DIR_Y : dir_cpp = HEXA_NS::dir_y; break;
265 // case DIR_Z : dir_cpp = HEXA_NS::dir_z; break;
266 // case DIM3: dir_cpp = HEXA_NS::DIM3; break;
269 // HEXA_NS::Edge* e = _elements_cpp->getEdge(dir_cpp, nx, ny, nz);
271 // Edge_impl* servantCorba = new Edge_impl(e);
272 // result = servantCorba->_this();