7 #include "HEXABLOCK.hxx"
8 #include "HexDocument_impl.hxx"
11 #include "HexVertex_impl.hxx"
12 #include "HexEdge_impl.hxx"
13 #include "HexQuad_impl.hxx"
14 #include "HexHexa_impl.hxx"
15 #include "HexVector_impl.hxx"
16 #include "HexElements_impl.hxx"
17 #include "HexCrossElements_impl.hxx"
18 #include "HexCylinder_impl.hxx"
19 #include "HexPipe_impl.hxx"
20 #include "HexLaw_impl.hxx"
21 #include "HexPropagation_impl.hxx"
22 #include "HexGroup_impl.hxx"
25 using namespace HEXABLOCK_ORB;
27 Document_impl::Document_impl(HEXA_NS::Document *ptrCpp):_document_cpp(ptrCpp)
31 ::CORBA::Long Document_impl::saveVtk(const char* fname) throw (SALOME::SALOME_Exception)
33 ::CORBA::Long ret = _document_cpp->saveVtk( fname );
36 void Document_impl::purge() throw (SALOME::SALOME_Exception)
38 _document_cpp->purge();
41 HEXA_NS::Document* Document_impl::GetImpl() throw (SALOME::SALOME_Exception)
47 char* Document_impl::getFile() throw (SALOME::SALOME_Exception)
49 return CORBA::string_dup (_document_cpp->getFile());
52 void Document_impl::setFile(const char* fileName) throw (SALOME::SALOME_Exception)
54 _document_cpp->setFile(fileName);
57 ::CORBA::Boolean Document_impl::isSavedFile() throw (SALOME::SALOME_Exception)
59 return _document_cpp->isSaved();
62 ::CORBA::Long Document_impl::saveFile() throw (SALOME::SALOME_Exception)
64 return _document_cpp->saveFile();
67 void Document_impl::setTolerance(::CORBA::Double tol) throw (SALOME::SALOME_Exception)
69 _document_cpp->setTolerance(tol);
72 ::CORBA::Double Document_impl::getTolerance() throw (SALOME::SALOME_Exception)
74 return _document_cpp->getTolerance();
77 Vertex_ptr Document_impl::addVertex(::CORBA::Double x, ::CORBA::Double y, ::CORBA::Double z)
78 throw(SALOME::SALOME_Exception)
80 Vertex_ptr result = Vertex::_nil();
82 HEXA_NS::Vertex* v = _document_cpp->addVertex( x, y, z );
84 Vertex_impl* servantCorba = new Vertex_impl(v);
85 result = servantCorba->_this();
90 ::CORBA::Long Document_impl::countVertex() throw (SALOME::SALOME_Exception)
92 return _document_cpp->countVertex();
95 Vertex_ptr Document_impl::getVertex(::CORBA::Long i) throw (SALOME::SALOME_Exception)
97 Vertex_ptr result = Vertex::_nil();
99 HEXA_NS::Vertex* v = _document_cpp->getVertex(i);
101 Vertex_impl* servantCorba = new Vertex_impl(v);
102 result = servantCorba->_this();
108 Vertex_ptr Document_impl::findVertex(::CORBA::Double x, ::CORBA::Double y, ::CORBA::Double z)
109 throw (SALOME::SALOME_Exception)
111 Vertex_ptr result = Vertex::_nil();
113 HEXA_NS::Vertex* v = _document_cpp->findVertex( x, y, z);
115 Vertex_impl* servantCorba = new Vertex_impl(v);
116 result = servantCorba->_this();
122 Edge_ptr Document_impl::addEdge(Vertex_ptr v0In, Vertex_ptr v1In)
123 throw(SALOME::SALOME_Exception)
125 Edge_ptr result = Edge::_nil();
127 Vertex_impl* v0InServant = ::DownCast<Vertex_impl*>( v0In );
128 Vertex_impl* v1InServant = ::DownCast<Vertex_impl*>( v1In );
129 ASSERT( v0InServant );
130 ASSERT( v1InServant );
131 if ( v0InServant && v1InServant ) {
132 HEXA_NS::Vertex* v0 = v0InServant->GetImpl();
133 HEXA_NS::Vertex* v1 = v1InServant->GetImpl();
134 HEXA_NS::Edge* e = _document_cpp->addEdge( v0, v1 );
136 Edge_impl* servantCorba = new Edge_impl(e);
137 result = servantCorba->_this();
144 ::CORBA::Long Document_impl::countEdge() throw (SALOME::SALOME_Exception)
146 return _document_cpp->countEdge();
149 Edge_ptr Document_impl::getEdge(::CORBA::Long i) throw (SALOME::SALOME_Exception)
151 Edge_ptr result = Edge::_nil();
153 HEXA_NS::Edge* e = _document_cpp->getEdge(i);
155 Edge_impl* servantCorba = new Edge_impl(e);
156 result = servantCorba->_this();
161 Edge_ptr Document_impl::findEdge(Vertex_ptr p0In, Vertex_ptr p1In)
162 throw (SALOME::SALOME_Exception)
164 Edge_ptr result = Edge::_nil();
166 Vertex_impl* p0InServant = ::DownCast<Vertex_impl*>( p0In );
167 Vertex_impl* p1InServant = ::DownCast<Vertex_impl*>( p1In );
168 ASSERT( p0InServant );
169 ASSERT( p1InServant );
171 if ( p0InServant && p1InServant ) {
172 HEXA_NS::Vertex* p0 = p0InServant->GetImpl();
173 HEXA_NS::Vertex* p1 = p1InServant->GetImpl();
174 HEXA_NS::Edge* e = _document_cpp->findEdge( p0, p1 );
177 Edge_impl* servantCorba = new Edge_impl(e);
178 result = servantCorba->_this();
185 Quad_ptr Document_impl::addQuad(Edge_ptr e0In, Edge_ptr e1In, Edge_ptr e2In, Edge_ptr e3In)
186 throw (SALOME::SALOME_Exception)
188 Quad_ptr result = Quad::_nil();
190 Edge_impl* e0InServant = ::DownCast<Edge_impl*>( e0In );
191 Edge_impl* e1InServant = ::DownCast<Edge_impl*>( e1In );
192 Edge_impl* e2InServant = ::DownCast<Edge_impl*>( e2In );
193 Edge_impl* e3InServant = ::DownCast<Edge_impl*>( e3In );
194 ASSERT( e0InServant );
195 ASSERT( e1InServant );
196 ASSERT( e2InServant );
197 ASSERT( e3InServant );
198 if ( e0InServant && e1InServant && e2InServant && e3InServant) {
199 HEXA_NS::Edge* e0 = e0InServant->GetImpl();
200 HEXA_NS::Edge* e1 = e1InServant->GetImpl();
201 HEXA_NS::Edge* e2 = e2InServant->GetImpl();
202 HEXA_NS::Edge* e3 = e3InServant->GetImpl();
203 HEXA_NS::Quad* q = _document_cpp->addQuad( e0, e1, e2, e3 );
205 Quad_impl* servantCorba = new Quad_impl(q);
206 result = servantCorba->_this();
212 Quad_ptr Document_impl::addQuadVertices( Vertex_ptr v0In, Vertex_ptr v1In,
213 Vertex_ptr v2In, Vertex_ptr v3In )
214 throw (SALOME::SALOME_Exception)
216 Quad_ptr result = Quad::_nil();
218 Vertex_impl* v0InServant = ::DownCast<Vertex_impl*>( v0In );
219 Vertex_impl* v1InServant = ::DownCast<Vertex_impl*>( v1In );
220 Vertex_impl* v2InServant = ::DownCast<Vertex_impl*>( v2In );
221 Vertex_impl* v3InServant = ::DownCast<Vertex_impl*>( v3In );
222 ASSERT( v0InServant );
223 ASSERT( v1InServant );
224 ASSERT( v2InServant );
225 ASSERT( v3InServant );
227 if ( v0InServant && v1InServant && v2InServant && v3InServant) {
228 HEXA_NS::Vertex* v0 = v0InServant->GetImpl();
229 HEXA_NS::Vertex* v1 = v1InServant->GetImpl();
230 HEXA_NS::Vertex* v2 = v2InServant->GetImpl();
231 HEXA_NS::Vertex* v3 = v3InServant->GetImpl();
232 HEXA_NS::Quad* q = _document_cpp->addQuadVertices( v0, v1, v2, v3 );
234 Quad_impl* servantCorba = new Quad_impl(q);
235 result = servantCorba->_this();
241 ::CORBA::Long Document_impl::countQuad() throw (SALOME::SALOME_Exception)
243 return _document_cpp->countQuad();
246 Quad_ptr Document_impl::getQuad(::CORBA::Long i) throw (SALOME::SALOME_Exception)
248 Quad_ptr result = Quad::_nil();
250 HEXA_NS::Quad* q = _document_cpp->getQuad(i);
252 Quad_impl* servantCorba = new Quad_impl(q);
253 result = servantCorba->_this();
258 Quad_ptr Document_impl::findQuad(Vertex_ptr p0In, Vertex_ptr p1In) throw (SALOME::SALOME_Exception)
260 Quad_ptr result = Quad::_nil();
262 Vertex_impl* p0InServant = ::DownCast<Vertex_impl*>( p0In );
263 Vertex_impl* p1InServant = ::DownCast<Vertex_impl*>( p1In );
264 ASSERT( p0InServant );
265 ASSERT( p1InServant );
267 if ( p0InServant && p1InServant ) {
268 HEXA_NS::Vertex* p0 = p0InServant->GetImpl();
269 HEXA_NS::Vertex* p1 = p1InServant->GetImpl();
271 HEXA_NS::Quad* q = _document_cpp->findQuad( p0, p1 );
273 Quad_impl* servantCorba = new Quad_impl(q);
274 result = servantCorba->_this();
281 Hexa_ptr Document_impl::addHexa(Quad_ptr q0In, Quad_ptr q1In, Quad_ptr q2In, Quad_ptr q3In, Quad_ptr q4In, Quad_ptr q5In)
282 throw (SALOME::SALOME_Exception)
284 Hexa_ptr result = Hexa::_nil();
286 Quad_impl* q0InServant = ::DownCast<Quad_impl*>( q0In );
287 Quad_impl* q1InServant = ::DownCast<Quad_impl*>( q1In );
288 Quad_impl* q2InServant = ::DownCast<Quad_impl*>( q2In );
289 Quad_impl* q3InServant = ::DownCast<Quad_impl*>( q3In );
290 Quad_impl* q4InServant = ::DownCast<Quad_impl*>( q4In );
291 Quad_impl* q5InServant = ::DownCast<Quad_impl*>( q5In );
293 ASSERT( q0InServant );
294 ASSERT( q1InServant );
295 ASSERT( q2InServant );
296 ASSERT( q3InServant );
297 ASSERT( q4InServant );
298 ASSERT( q5InServant );
300 if ( q0InServant && q1InServant && q2InServant && q3InServant
301 && q4InServant && q5InServant ){
302 HEXA_NS::Quad* q0 = q0InServant->GetImpl();
303 HEXA_NS::Quad* q1 = q1InServant->GetImpl();
304 HEXA_NS::Quad* q2 = q2InServant->GetImpl();
305 HEXA_NS::Quad* q3 = q3InServant->GetImpl();
306 HEXA_NS::Quad* q4 = q4InServant->GetImpl();
307 HEXA_NS::Quad* q5 = q5InServant->GetImpl();
308 HEXA_NS::Hexa* h = _document_cpp->addHexa( q0, q1, q2, q3, q4, q5 );
310 Hexa_impl* servantCorba = new Hexa_impl(h);
311 result = servantCorba->_this();
319 Hexa_ptr Document_impl::addHexaVertices( Vertex_ptr v0In, Vertex_ptr v1In, Vertex_ptr v2In, Vertex_ptr v3In, Vertex_ptr v4In, Vertex_ptr v5In, Vertex_ptr v6In, Vertex_ptr v7In )
320 throw (SALOME::SALOME_Exception)
322 Hexa_ptr result = Hexa::_nil();
324 Vertex_impl* v0InServant = ::DownCast<Vertex_impl*>( v0In );
325 Vertex_impl* v1InServant = ::DownCast<Vertex_impl*>( v1In );
326 Vertex_impl* v2InServant = ::DownCast<Vertex_impl*>( v2In );
327 Vertex_impl* v3InServant = ::DownCast<Vertex_impl*>( v3In );
328 Vertex_impl* v4InServant = ::DownCast<Vertex_impl*>( v4In );
329 Vertex_impl* v5InServant = ::DownCast<Vertex_impl*>( v5In );
330 Vertex_impl* v6InServant = ::DownCast<Vertex_impl*>( v6In );
331 Vertex_impl* v7InServant = ::DownCast<Vertex_impl*>( v7In );
332 ASSERT( v0InServant );
333 ASSERT( v1InServant );
334 ASSERT( v2InServant );
335 ASSERT( v3InServant );
336 ASSERT( v4InServant );
337 ASSERT( v5InServant );
338 ASSERT( v6InServant );
339 ASSERT( v7InServant );
341 if ( v0InServant && v1InServant && v2InServant && v3InServant
342 && v4InServant && v5InServant && v6InServant && v7InServant ){
343 HEXA_NS::Vertex* v0 = v0InServant->GetImpl();
344 HEXA_NS::Vertex* v1 = v1InServant->GetImpl();
345 HEXA_NS::Vertex* v2 = v2InServant->GetImpl();
346 HEXA_NS::Vertex* v3 = v3InServant->GetImpl();
347 HEXA_NS::Vertex* v4 = v4InServant->GetImpl();
348 HEXA_NS::Vertex* v5 = v5InServant->GetImpl();
349 HEXA_NS::Vertex* v6 = v6InServant->GetImpl();
350 HEXA_NS::Vertex* v7 = v7InServant->GetImpl();
352 HEXA_NS::Hexa* h = _document_cpp->addHexaVertices( v0, v1, v2, v3, v4, v5, v6, v7 );
354 Hexa_impl* servantCorba = new Hexa_impl(h);
355 result = servantCorba->_this();
363 ::CORBA::Long Document_impl::countHexa() throw (SALOME::SALOME_Exception)
365 return _document_cpp->countHexa();
368 Hexa_ptr Document_impl::getHexa(::CORBA::Long i) throw (SALOME::SALOME_Exception)
370 Hexa_ptr result = Hexa::_nil();
372 HEXA_NS::Hexa* h = _document_cpp->getHexa(i);
374 Hexa_impl* servantCorba = new Hexa_impl(h);
375 result = servantCorba->_this();
381 Hexa_ptr Document_impl::findHexa(Vertex_ptr p0In, Vertex_ptr p1In) throw (SALOME::SALOME_Exception)
383 Hexa_ptr result = Hexa::_nil();
385 Vertex_impl* v0InServant = ::DownCast<Vertex_impl*>( p0In );
386 Vertex_impl* v1InServant = ::DownCast<Vertex_impl*>( p1In );
387 ASSERT( v0InServant );
388 ASSERT( v1InServant );
390 if ( v0InServant && v1InServant ) {
391 HEXA_NS::Vertex* v0 = v0InServant->GetImpl();
392 HEXA_NS::Vertex* v1 = v1InServant->GetImpl();
393 HEXA_NS::Hexa* h = _document_cpp->findHexa( v0, v1 );
395 Hexa_impl* servantCorba = new Hexa_impl(h);
396 result = servantCorba->_this();
402 Vector_ptr Document_impl::addVector( ::CORBA::Double dx, ::CORBA::Double dy, ::CORBA::Double dz )
403 throw(SALOME::SALOME_Exception)
405 Vector_ptr result = Vector::_nil();
406 HEXA_NS::Vector* v = _document_cpp->addVector( dx, dy, dz );
409 Vector_impl* servantCorba = new Vector_impl(v);
410 result = servantCorba->_this();
415 Vector_ptr Document_impl::addVectorVertices( Vertex_ptr v0In, Vertex_ptr v1In )
416 throw(SALOME::SALOME_Exception)
418 Vector_ptr result = Vector::_nil();
420 Vertex_impl* v0InServant = ::DownCast<Vertex_impl*>( v0In );
421 Vertex_impl* v1InServant = ::DownCast<Vertex_impl*>( v1In );
422 ASSERT( v0InServant );
423 ASSERT( v1InServant );
425 if ( v0InServant && v1InServant ) {
426 HEXA_NS::Vertex* v0 = v0InServant->GetImpl();
427 HEXA_NS::Vertex* v1 = v1InServant->GetImpl();
428 HEXA_NS::Vector* v = _document_cpp->addVectorVertices( v0, v1 );
430 Vector_impl* servantCorba = new Vector_impl(v);
431 result = servantCorba->_this();
438 // ::CORBA::Long Document_impl::countVector() throw (SALOME::SALOME_Exception)
440 // return _document_cpp->countVector();
443 // Vector_ptr Document_impl::getVector(::CORBA::Long i) throw (SALOME::SALOME_Exception)
445 // HEXA_NS::Vector* h = _document_cpp->getVector(i);
446 // Vector_impl* servantCorba = new Vector_impl(h);
447 // return servantCorba->_this();
451 Cylinder_ptr Document_impl::addCylinder( Vertex_ptr baseIn, Vector_ptr directionIn,
452 ::CORBA::Double radius, ::CORBA::Double height)
453 throw (SALOME::SALOME_Exception)
455 Cylinder_ptr result = Cylinder::_nil();
457 Vertex_impl* baseServant = ::DownCast<Vertex_impl*>( baseIn );
458 Vector_impl* directionServant = ::DownCast<Vector_impl*>( directionIn );
459 ASSERT( baseServant );
460 ASSERT( directionServant );
462 if ( baseServant && directionServant ) {
463 HEXA_NS::Vertex* base = baseServant->GetImpl();
464 HEXA_NS::Vector* direction = directionServant->GetImpl();
465 HEXA_NS::Cylinder* c = _document_cpp->addCylinder( base, direction, radius, height );
467 Cylinder_impl* servantCorba = new Cylinder_impl(c);
468 result = servantCorba->_this();
475 // ::CORBA::Long Document_impl::countCylinder() throw (SALOME::SALOME_Exception)
477 // return _document_cpp->countCylinder();
481 // Cylinder_ptr Document_impl::getCylinder(::CORBA::Long i) throw (SALOME::SALOME_Exception)
483 // HEXA_NS::Cylinder* c = _document_cpp->getCylinder(i);
484 // Cylinder_impl* servantCorba = new Cylinder_impl(c);
485 // return servantCorba->_this();
489 Pipe_ptr Document_impl::addPipe( Vertex_ptr baseIn, Vector_ptr directionIn,
490 ::CORBA::Double int_radius, ::CORBA::Double ext_radius, ::CORBA::Double height)
491 throw (SALOME::SALOME_Exception)
493 Pipe_ptr result = Pipe::_nil();
495 Vertex_impl* baseServant = ::DownCast<Vertex_impl*>( baseIn );
496 Vector_impl* directionServant = ::DownCast<Vector_impl*>( directionIn );
497 ASSERT( baseServant );
498 ASSERT( directionServant );
500 if ( baseServant && directionServant ) {
501 HEXA_NS::Vertex* base = baseServant->GetImpl();
502 HEXA_NS::Vector* direction = directionServant->GetImpl();
503 HEXA_NS::Pipe* c = _document_cpp->addPipe( base, direction, int_radius, ext_radius, height );
505 Pipe_impl* servantCorba = new Pipe_impl(c);
506 result = servantCorba->_this();
514 // ::CORBA::Long Document_impl::countPipe() throw (SALOME::SALOME_Exception)
516 // return _document_cpp->countPipe();
519 // Pipe_ptr Document_impl::getPipe(::CORBA::Long i) throw (SALOME::SALOME_Exception)
521 // HEXA_NS::Pipe* p = _document_cpp->getPipe(i);
522 // Pipe_impl* servantCorba = new Pipe_impl(p);
523 // return servantCorba->_this();
526 ::CORBA::Boolean Document_impl::removeHexa(Hexa_ptr hIn) throw (SALOME::SALOME_Exception)
528 Hexa_impl* hServant = ::DownCast<Hexa_impl*>( hIn );
532 HEXA_NS::Hexa* h = hServant->GetImpl();
533 int ok = _document_cpp->removeHexa(h);
542 ::CORBA::Boolean Document_impl::removeConnectedHexa(Hexa_ptr hIn) throw (SALOME::SALOME_Exception)
544 Hexa_impl* hServant = ::DownCast<Hexa_impl*>( hIn );
548 HEXA_NS::Hexa* h = hServant->GetImpl();
549 int ok = _document_cpp->removeConnectedHexa(h);
558 Elements_ptr Document_impl::makeCartesian( Vertex_ptr ptIn,
559 Vector_ptr vxIn, Vector_ptr vyIn, Vector_ptr vzIn,
560 ::CORBA::Long nx, ::CORBA::Long ny, ::CORBA::Long nz)
561 throw (SALOME::SALOME_Exception)
563 Elements_ptr result = Elements::_nil();
565 Vertex_impl* ptInServant = ::DownCast<Vertex_impl*>( ptIn);
566 Vector_impl* vxInServant = ::DownCast<Vector_impl*>( vxIn );
567 Vector_impl* vyInServant = ::DownCast<Vector_impl*>( vyIn );
568 Vector_impl* vzInServant = ::DownCast<Vector_impl*>( vzIn );
569 ASSERT( ptInServant );
570 ASSERT( vxInServant );
571 ASSERT( vyInServant );
572 ASSERT( vzInServant );
574 if ( ptInServant && vxInServant && vyInServant && vzInServant ){
575 HEXA_NS::Vertex* pt = ptInServant->GetImpl();
576 HEXA_NS::Vector* vx = vxInServant->GetImpl();
577 HEXA_NS::Vector* vy = vyInServant->GetImpl();
578 HEXA_NS::Vector* vz = vzInServant->GetImpl();
580 HEXA_NS::Elements* l = _document_cpp->makeCartesian(
585 Elements_impl* servantCorba = new Elements_impl(l);
586 result = servantCorba->_this();
595 Elements_ptr Document_impl::makeCartesian1(
598 ::CORBA::Long px, ::CORBA::Long py, ::CORBA::Long pz,
599 ::CORBA::Long mx, ::CORBA::Long my, ::CORBA::Long mz )
600 throw(SALOME::SALOME_Exception)
602 Elements_ptr result = Elements::_nil();
604 Vertex_impl* vxInServant = ::DownCast<Vertex_impl*>( vxIn );
605 Vector_impl* vr1InServant = ::DownCast<Vector_impl*>( vr1In );
606 ASSERT( vxInServant );
607 ASSERT( vr1InServant );
609 if ( vxInServant && vr1InServant ){
610 HEXA_NS::Vertex* vx = vxInServant->GetImpl();
611 HEXA_NS::Vector* vr1 = vr1InServant->GetImpl();
613 HEXA_NS::Elements* l = _document_cpp->makeCartesian(
620 Elements_impl* servantCorba = new Elements_impl(l);
621 result = servantCorba->_this();
628 Elements_ptr Document_impl::makeCylindrical( Vertex_ptr ptIn,
629 Vector_ptr vexIn, Vector_ptr vezIn,
630 ::CORBA::Double dr, ::CORBA::Double da, ::CORBA::Double dl,
631 ::CORBA::Long nr, ::CORBA::Long na, ::CORBA::Long nl,
632 ::CORBA::Boolean fill)
633 throw (SALOME::SALOME_Exception)
635 Elements_ptr result = Elements::_nil();
637 Vertex_impl* ptServant = ::DownCast<Vertex_impl*>( ptIn );
638 Vector_impl* vexServant = ::DownCast<Vector_impl*>( vexIn );
639 Vector_impl* vezServant = ::DownCast<Vector_impl*>( vezIn );
641 ASSERT( vexServant );
642 ASSERT( vezServant );
644 if ( ptServant && vexServant && vezServant) {
645 HEXA_NS::Vertex* pt = ptServant->GetImpl();
646 HEXA_NS::Vector* vex = vexServant->GetImpl();
647 HEXA_NS::Vector* vez = vezServant->GetImpl();
648 HEXA_NS::Elements* l = _document_cpp->makeCylindrical( pt,
650 dr, da, dl, nr, na, nl, fill );
652 Elements_impl* servantCorba = new Elements_impl(l);
653 result = servantCorba->_this();
661 // Elements_ptr Document_impl::makeSpherical( Vertex_ptr ptIn,
662 // ::CORBA::Double dx, ::CORBA::Double dy, ::CORBA::Double dz,
664 // throw (SALOME::SALOME_Exception)
666 // Vertex_impl* ptServant = ::DownCast<Vertex_impl*>( ptIn );
667 // ASSERT( ptServant );
669 // if ( ptServant ) {
670 // HEXA_NS::Vertex* pt = ptServant->GetImpl();
671 // HEXA_NS::Elements* l = _document_cpp->makeSpherical( pt, dx, dy, dz, n );
672 // Elements_impl* servantCorba = new Elements_impl(l);
673 // return servantCorba->_this();
677 Elements_ptr Document_impl::makeSpherical(
682 throw (SALOME::SALOME_Exception) //CS_TODO
684 Elements_ptr result = Elements::_nil();
686 Vertex_impl* ptServant = ::DownCast<Vertex_impl*>( ptIn );
687 Vector_impl* dvServant = ::DownCast<Vector_impl*>( dvIn );
691 if ( ptServant && dvServant ) {
692 HEXA_NS::Vertex* pt = ptServant->GetImpl();
693 HEXA_NS::Vector* dv = dvServant->GetImpl();
694 HEXA_NS::Elements* l = _document_cpp->makeSpherical( pt, dv, n, k );
696 Elements_impl* servantCorba = new Elements_impl(l);
697 result = servantCorba->_this();
708 // Elements_ptr Document_impl::makeCylinder(Cylinder_ptr cylIn, ::CORBA::Long nr, ::CORBA::Long na, ::CORBA::Long nl)
709 Elements_ptr Document_impl::makeCylinder(Cylinder_ptr cylIn, Vector_ptr vrIn, ::CORBA::Long nr, ::CORBA::Long na, ::CORBA::Long nl)
710 throw (SALOME::SALOME_Exception)
712 Elements_ptr result = Elements::_nil();
714 Cylinder_impl* cylServant = ::DownCast<Cylinder_impl*>( cylIn );
715 Vector_impl* vrServant = ::DownCast<Vector_impl*>( vrIn );
716 ASSERT( cylServant );
719 if ( cylServant && vrServant ) {
720 HEXA_NS::Cylinder* cyl = cylServant->GetImpl();
721 HEXA_NS::Vector* vr = vrServant->GetImpl();
722 HEXA_NS::Elements* l = _document_cpp->makeCylinder( cyl, vr, nr, na, nl );
724 Elements_impl* servantCorba = new Elements_impl(l);
725 result = servantCorba->_this();
731 // Elements_ptr Document_impl::makePipe( Pipe_ptr pIn, ::CORBA::Long nr, ::CORBA::Long na, ::CORBA::Long nl)
732 // throw (SALOME::SALOME_Exception)
734 // Pipe_impl* pServant = ::DownCast<Pipe_impl*>( pIn );
735 // ASSERT( pServant );
738 // HEXA_NS::Pipe* p= pServant->GetImpl();
739 // HEXA_NS::Elements* l = _document_cpp->makePipe( p, nr, na, nl );
740 // Elements_impl* servantCorba = new Elements_impl(l);
741 // return servantCorba->_this();
746 CrossElements_ptr Document_impl::makeCylinders(Cylinder_ptr c1In, Cylinder_ptr c2In)
747 throw (SALOME::SALOME_Exception)
749 CrossElements_ptr result = CrossElements::_nil();
751 Cylinder_impl* c1Servant = ::DownCast<Cylinder_impl*>( c1In );
752 Cylinder_impl* c2Servant = ::DownCast<Cylinder_impl*>( c2In );
756 if ( c1Servant && c2Servant ) {
757 HEXA_NS::Cylinder* c1= c1Servant->GetImpl();
758 HEXA_NS::Cylinder* c2= c2Servant->GetImpl();
760 HEXA_NS::CrossElements* l = _document_cpp->makeCylinders(c1,c2);
762 CrossElements_impl* servantCorba = new CrossElements_impl(l);
763 result = servantCorba->_this();
770 // Elements_ptr Document_impl::makePipes(
771 // Pipe_ptr p1In, ::CORBA::Long n1r, ::CORBA::Long n1a, ::CORBA::Long n1l,
772 // Pipe_ptr p2In, ::CORBA::Long n2r, ::CORBA::Long n2a, ::CORBA::Long n2l )
773 // throw (SALOME::SALOME_Exception)
775 // Pipe_impl* p1Servant = ::DownCast<Pipe_impl*>( p1In );
776 // Pipe_impl* p2Servant = ::DownCast<Pipe_impl*>( p2In );
777 // ASSERT( p1Servant );
778 // ASSERT( p2Servant );
780 // if ( p1Servant && p2Servant ) {
781 // HEXA_NS::Pipe* p1= p1Servant->GetImpl();
782 // HEXA_NS::Pipe* p2= p2Servant->GetImpl();
784 // HEXA_NS::Elements* l = _document_cpp->makePipes( p1, n1r, n1a, n1l, p2, n2r, n2a, n2l );
785 // Elements_impl* servantCorba = new Elements_impl(l);
786 // return servantCorba->_this();
792 Elements_ptr Document_impl::prismQuad(Quad_ptr qdIn, Vector_ptr vIn, ::CORBA::Long nb) throw (SALOME::SALOME_Exception)
794 Elements_ptr result = Elements::_nil();
796 Quad_impl* qServant = ::DownCast<Quad_impl*>( qdIn );
797 Vector_impl* vServant = ::DownCast<Vector_impl*>( vIn );
801 if ( qServant && vServant ) {
802 HEXA_NS::Quad* qd = qServant->GetImpl();
803 HEXA_NS::Vector* v = vServant->GetImpl();
805 HEXA_NS::Elements* l = _document_cpp->prismQuad(qd, v, nb);
807 Elements_impl* servantCorba = new Elements_impl(l);
808 result = servantCorba->_this();
819 // for ( int i = 0; i < theMeshesArray.length(); i++) {
820 // SMESH::SMESH_Mesh_var anInitMesh = theMeshesArray[i];
821 // if ( !anInitMesh->_is_nil() ) {
822 // SMESH_Mesh_i* anInitImpl = dynamic_cast<SMESH_Mesh_i*>( GetServant( anInitMesh ).in() );
823 // if ( anInitImpl ) {
824 // ::SMESH_Mesh& aInitLocMesh = anInitImpl->GetImpl();
826 Elements_ptr Document_impl::prismQuads(const Quads& qdsIn, Vector_ptr vIn, ::CORBA::Long nb) throw (SALOME::SALOME_Exception)
828 Elements_ptr result = Elements::_nil();
831 for ( int i = 0; i < qdsIn.length(); i++) {
832 Quad_impl* qServant = ::DownCast<Quad_impl*>( qdsIn[i] );
834 HEXA_NS::Quad* qd = qServant->GetImpl();
838 Vector_impl* vServant = ::DownCast<Vector_impl*>( vIn );
842 HEXA_NS::Vector* v = vServant->GetImpl();
843 HEXA_NS::Elements* l = _document_cpp->prismQuads(qds, v, nb);
845 Elements_impl* servantCorba = new Elements_impl(l);
846 result = servantCorba->_this();
854 Elements_ptr Document_impl::joinQuad(Quad_ptr qaIn, Quad_ptr qbIn, Vertex_ptr va1In, Vertex_ptr vb1In, Vertex_ptr va2In, Vertex_ptr vb2In, ::CORBA::Long nb) throw (SALOME::SALOME_Exception)
856 Elements_ptr result = Elements::_nil();
858 Quad_impl* qaServant = ::DownCast<Quad_impl*>( qaIn );
859 Quad_impl* qbServant = ::DownCast<Quad_impl*>( qbIn );
861 Vertex_impl* va1Servant = ::DownCast<Vertex_impl*>( va1In );
862 Vertex_impl* vb1Servant = ::DownCast<Vertex_impl*>( vb1In );
863 Vertex_impl* va2Servant = ::DownCast<Vertex_impl*>( va2In );
864 Vertex_impl* vb2Servant = ::DownCast<Vertex_impl*>( vb2In );
868 ASSERT( va1Servant );
869 ASSERT( vb1Servant );
870 ASSERT( va2Servant );
871 ASSERT( vb2Servant );
873 if ( qaServant && qbServant && va1Servant && vb1Servant && va2Servant && vb2Servant ){
874 HEXA_NS::Quad* qa = qaServant->GetImpl();
875 HEXA_NS::Quad* qb = qbServant->GetImpl();
876 HEXA_NS::Vertex* va1 = va1Servant->GetImpl();
877 HEXA_NS::Vertex* vb1 = vb1Servant->GetImpl();
878 HEXA_NS::Vertex* va2 = va2Servant->GetImpl();
879 HEXA_NS::Vertex* vb2 = vb2Servant->GetImpl();
881 HEXA_NS::Elements* l = _document_cpp->joinQuad(qa, qb, va1, vb1, va2, vb2, nb);
883 Elements_impl* servantCorba = new Elements_impl(l);
884 result = servantCorba->_this();
893 Elements_ptr Document_impl::joinQuads(const Quads& qdsIn, Quad_ptr qbIn, Vertex_ptr va1In, Vertex_ptr vb1In, Vertex_ptr va2In, Vertex_ptr vb2In, ::CORBA::Long nb) throw (SALOME::SALOME_Exception)
895 Elements_ptr result = Elements::_nil();
897 Quad_impl* qbServant = ::DownCast<Quad_impl*>( qbIn );
898 Vertex_impl* va1Servant = ::DownCast<Vertex_impl*>( va1In );
899 Vertex_impl* vb1Servant = ::DownCast<Vertex_impl*>( vb1In );
900 Vertex_impl* va2Servant = ::DownCast<Vertex_impl*>( va2In );
901 Vertex_impl* vb2Servant = ::DownCast<Vertex_impl*>( vb2In );
904 ASSERT( va1Servant );
905 ASSERT( vb1Servant );
906 ASSERT( va2Servant );
907 ASSERT( vb2Servant );
909 if ( qbServant && va1Servant && vb1Servant && va2Servant && vb2Servant ) {
910 HEXA_NS::Quad* qb = qbServant->GetImpl();
911 HEXA_NS::Vertex* va1 = va1Servant->GetImpl();
912 HEXA_NS::Vertex* vb1 = vb1Servant->GetImpl();
913 HEXA_NS::Vertex* va2 = va2Servant->GetImpl();
914 HEXA_NS::Vertex* vb2 = vb2Servant->GetImpl();
916 // MESSAGE("joinQuads AAAAAAAAAAAAA");
918 for ( int i = 0; i < qdsIn.length(); i++) {
919 Quad_impl* qServant = ::DownCast<Quad_impl*>( qdsIn[i] );
921 HEXA_NS::Quad* qd = qServant->GetImpl();
925 HEXA_NS::Elements* l = _document_cpp->joinQuads(qds, qb, va1, vb1, va2, vb2, nb);
927 Elements_impl* servantCorba = new Elements_impl(l);
928 result = servantCorba->_this();
940 ::CORBA::Long Document_impl::mergeQuads(Quad_ptr qaIn, Quad_ptr qbIn, Vertex_ptr va1In, Vertex_ptr vb1In, Vertex_ptr va2In, Vertex_ptr vb2In) throw (SALOME::SALOME_Exception)
942 Quad_impl* qaServant = ::DownCast<Quad_impl*>( qaIn );
943 Quad_impl* qbServant = ::DownCast<Quad_impl*>( qbIn );
945 Vertex_impl* va1Servant = ::DownCast<Vertex_impl*>( va1In );
946 Vertex_impl* vb1Servant = ::DownCast<Vertex_impl*>( vb1In );
947 Vertex_impl* va2Servant = ::DownCast<Vertex_impl*>( va2In );
948 Vertex_impl* vb2Servant = ::DownCast<Vertex_impl*>( vb2In );
952 ASSERT( va1Servant );
953 ASSERT( vb1Servant );
954 ASSERT( va2Servant );
955 ASSERT( vb2Servant );
957 if ( qaServant && qbServant && va1Servant && vb1Servant && va2Servant && vb2Servant ){
958 HEXA_NS::Quad* qa = qaServant->GetImpl();
959 HEXA_NS::Quad* qb = qbServant->GetImpl();
960 HEXA_NS::Vertex* va1 = va1Servant->GetImpl();
961 HEXA_NS::Vertex* vb1 = vb1Servant->GetImpl();
962 HEXA_NS::Vertex* va2 = va2Servant->GetImpl();
963 HEXA_NS::Vertex* vb2 = vb2Servant->GetImpl();
965 return _document_cpp->mergeQuads(qa, qb, va1, vb1, va2, vb2);
966 // HEXA_NS::Elements* l = _document_cpp->mergeQuads(qa, qb, va1, vb1, va2, vb2);
967 // Elements_impl* servantCorba = new Elements_impl(l);
968 // return servantCorba->_this();
974 ::CORBA::Long Document_impl::mergeEdges(Edge_ptr e1In, Edge_ptr e2In, Vertex_ptr v1In, Vertex_ptr v2In) throw (SALOME::SALOME_Exception)
976 Edge_impl* e1Servant = ::DownCast<Edge_impl*>( e1In );
977 Edge_impl* e2Servant = ::DownCast<Edge_impl*>( e2In );
979 Vertex_impl* v1Servant = ::DownCast<Vertex_impl*>( v1In );
980 Vertex_impl* v2Servant = ::DownCast<Vertex_impl*>( v2In );
987 if ( e1Servant && e2Servant && v1Servant && v2Servant ){
988 HEXA_NS::Edge* e1 = e1Servant->GetImpl();
989 HEXA_NS::Edge* e2 = e2Servant->GetImpl();
991 HEXA_NS::Vertex* v1 = v1Servant->GetImpl();
992 HEXA_NS::Vertex* v2 = v2Servant->GetImpl();
994 // HEXA_NS::Elements* l = _document_cpp->mergeEdges(e1, e2, v1, v2);
995 // Elements_impl* servantCorba = new Elements_impl(l);
996 // return servantCorba->_this();
998 return _document_cpp->mergeEdges(e1, e2, v1, v2);
1002 ::CORBA::Long Document_impl::mergeVertices(Vertex_ptr v1In, Vertex_ptr v2In) throw (SALOME::SALOME_Exception)
1004 Vertex_impl* v1Servant = ::DownCast<Vertex_impl*>( v1In );
1005 Vertex_impl* v2Servant = ::DownCast<Vertex_impl*>( v2In );
1007 ASSERT( v1Servant );
1008 ASSERT( v2Servant );
1010 if ( v1Servant && v2Servant ){
1011 HEXA_NS::Vertex* v1 = v1Servant->GetImpl();
1012 HEXA_NS::Vertex* v2 = v2Servant->GetImpl();
1014 // HEXA_NS::Elements* l = _document_cpp->mergeVertices(v1, v2);
1015 // Elements_impl* servantCorba = new Elements_impl(l);
1016 // return servantCorba->_this();
1017 return _document_cpp->mergeVertices(v1, v2);
1022 Elements_ptr Document_impl::disconnectQuad(Hexa_ptr hexIn, Quad_ptr quadIn) throw (SALOME::SALOME_Exception)
1023 // ::CORBA::Long Document_impl::disconnectQuad(Hexa_ptr hexIn, Quad_ptr quadIn) throw (SALOME::SALOME_Exception)
1024 // Quad_ptr Document_impl::disconnectQuad(Hexa_ptr hexIn, Quad_ptr quadIn) throw (SALOME::SALOME_Exception)
1026 Elements_ptr result = Elements::_nil();
1027 // Quad_ptr result = Quad::_nil();
1028 Hexa_impl* hServant = ::DownCast<Hexa_impl*>( hexIn );
1029 Quad_impl* qServant = ::DownCast<Quad_impl*>( quadIn );
1034 if ( hServant && qServant ){
1035 HEXA_NS::Hexa* h = hServant->GetImpl();
1036 HEXA_NS::Quad* q = qServant->GetImpl();
1038 HEXA_NS::Elements* elements = _document_cpp->disconnectQuad(h, q);
1039 if (elements != NULL ){
1040 Elements_impl* servantCorba = new Elements_impl(elements);
1041 result = servantCorba->_this();
1043 // HEXA_NS::Quad* qOut = _document_cpp->disconnectQuad(h, q);
1044 // if (qOut != NULL ){
1045 // Quad_impl* servantCorba = new Quad_impl(qOut);
1046 // result = servantCorba->_this();
1053 // Edge_ptr Document_impl::disconnectEdge(Hexa_ptr hexIn, Edge_ptr edgeIn) throw (SALOME::SALOME_Exception)
1054 // ::CORBA::Long Document_impl::disconnectEdge(Hexa_ptr hexIn, Edge_ptr edgeIn) throw (SALOME::SALOME_Exception)
1055 Elements_ptr Document_impl::disconnectEdge(Hexa_ptr hexIn, Edge_ptr edgeIn) throw (SALOME::SALOME_Exception)
1057 Elements_ptr result = Elements::_nil();
1059 Hexa_impl* hServant = ::DownCast<Hexa_impl*>( hexIn );
1060 Edge_impl* eServant = ::DownCast<Edge_impl*>( edgeIn );
1065 if ( hServant && eServant ){
1066 HEXA_NS::Hexa* h = hServant->GetImpl();
1067 HEXA_NS::Edge* e = eServant->GetImpl();
1069 HEXA_NS::Elements* r = _document_cpp->disconnectEdge(h, e);
1071 Elements_impl* servantCorba = new Elements_impl(r);
1072 result = servantCorba->_this();
1075 // HEXA_NS::Edge* r = _document_cpp->disconnectEdge(h, e);
1076 // Edge_impl* servantCorba = new Edge_impl(r);
1077 // return servantCorba->_this();
1079 // return _document_cpp->disconnectEdge(h, e);
1084 // Vertex_ptr Document_impl::disconnectVertex(Hexa_ptr hexIn, Vertex_ptr vxIn) throw (SALOME::SALOME_Exception)
1085 Elements_ptr Document_impl::disconnectVertex(Hexa_ptr hexIn, Vertex_ptr vxIn) throw (SALOME::SALOME_Exception)
1087 Elements_ptr result = Elements::_nil();
1089 Hexa_impl* hServant = ::DownCast<Hexa_impl*>( hexIn );
1090 Vertex_impl* vServant = ::DownCast<Vertex_impl*>( vxIn );
1095 if ( hServant && vServant ){
1096 HEXA_NS::Hexa* h = hServant->GetImpl();
1097 HEXA_NS::Vertex* v = vServant->GetImpl();
1099 HEXA_NS::Elements* r = _document_cpp->disconnectVertex(h, v);
1101 Elements_impl* servantCorba = new Elements_impl(r);
1102 result = servantCorba->_this();
1104 // HEXA_NS::Vertex* r = _document_cpp->disconnectVertex(h, v);
1105 // Vertex_impl* servantCorba = new Vertex_impl(r);
1106 // return servantCorba->_this();
1107 // // return _document_cpp->disconnectVertex(h, v);
1113 Elements_ptr Document_impl::cut(Edge_ptr eIn, ::CORBA::Long nb_of_cuts) throw (SALOME::SALOME_Exception)
1115 Elements_ptr result = Elements::_nil();
1117 Edge_impl* eServant = ::DownCast<Edge_impl*>( eIn );
1121 HEXA_NS::Edge* e = eServant->GetImpl();
1122 HEXA_NS::Elements* r = _document_cpp->cut(e, nb_of_cuts);
1124 Elements_impl* servantCorba = new Elements_impl(r);
1125 result = servantCorba->_this();
1133 Elements_ptr Document_impl::makeTranslation(Elements_ptr lIn, Vector_ptr vecIn) throw (SALOME::SALOME_Exception)
1135 Elements_ptr result = Elements::_nil();
1137 Elements_impl* lServant = ::DownCast<Elements_impl*>( lIn );
1138 Vector_impl* vecServant = ::DownCast<Vector_impl*>( vecIn );
1140 ASSERT( vecServant );
1142 if ( lServant && vecServant ){
1143 HEXA_NS::Elements* l = lServant->GetImpl();
1144 HEXA_NS::Vector* vec = vecServant->GetImpl();
1146 HEXA_NS::Elements* r = _document_cpp->makeTranslation(l, vec);
1148 Elements_impl* servantCorba = new Elements_impl(r);
1149 result = servantCorba->_this();
1156 Elements_ptr Document_impl::makeRotation(Elements_ptr lIn, Vertex_ptr pIn, Vector_ptr vecIn, ::CORBA::Double angle) throw (SALOME::SALOME_Exception)
1158 Elements_ptr result = Elements::_nil();
1160 Elements_impl* lServant = ::DownCast<Elements_impl*>( lIn );
1161 Vertex_impl* pServant = ::DownCast<Vertex_impl*>( pIn );
1162 Vector_impl* vecServant = ::DownCast<Vector_impl*>( vecIn );
1166 ASSERT( vecServant );
1168 if ( lServant && pServant && vecServant ){
1169 HEXA_NS::Elements* l = lServant->GetImpl();
1170 HEXA_NS::Vertex* p = pServant->GetImpl();
1171 HEXA_NS::Vector* vec = vecServant->GetImpl();
1173 HEXA_NS::Elements* r = _document_cpp->makeRotation(l, p, vec, angle);
1175 Elements_impl* servantCorba = new Elements_impl(r);
1176 result = servantCorba->_this();
1183 void Document_impl::performTranslation(Elements_ptr lIn, Vector_ptr vecIn) throw (SALOME::SALOME_Exception)
1185 Elements_impl* lServant = ::DownCast<Elements_impl*>( lIn );
1186 Vector_impl* vecServant = ::DownCast<Vector_impl*>( vecIn );
1189 ASSERT( vecServant );
1191 if ( lServant && vecServant ){
1192 HEXA_NS::Elements* l = lServant->GetImpl();
1193 HEXA_NS::Vector* vec = vecServant->GetImpl();
1194 _document_cpp->performTranslation(l, vec);
1199 void Document_impl::performRotation(Elements_ptr lIn, Vertex_ptr pIn, Vector_ptr vecIn, ::CORBA::Double angle) throw (SALOME::SALOME_Exception)
1201 Elements_impl* lServant = ::DownCast<Elements_impl*>( lIn );
1202 Vertex_impl* pServant = ::DownCast<Vertex_impl*>( pIn );
1203 Vector_impl* vecServant = ::DownCast<Vector_impl*>( vecIn );
1207 ASSERT( vecServant );
1209 if ( lServant && pServant && vecServant ){
1210 HEXA_NS::Elements* l = lServant->GetImpl();
1211 HEXA_NS::Vertex* p = pServant->GetImpl();
1212 HEXA_NS::Vector* vec = vecServant->GetImpl();
1213 _document_cpp->performRotation(l, p, vec, angle);
1217 Group_ptr Document_impl::addHexaGroup(const char* name) throw (SALOME::SALOME_Exception)
1219 Group_ptr result = Group::_nil();
1220 HEXA_NS::Group* g = _document_cpp->addGroup( name, HEXA_NS::HexaCell );
1222 Group_impl* servantCorba = new Group_impl(g);
1223 result = servantCorba->_this();
1229 Group_ptr Document_impl::addQuadGroup(const char* name) throw (SALOME::SALOME_Exception)
1231 Group_ptr result = Group::_nil();
1232 HEXA_NS::Group* g = _document_cpp->addGroup( name, HEXA_NS::QuadCell );
1234 Group_impl* servantCorba = new Group_impl(g);
1235 result = servantCorba->_this();
1240 Group_ptr Document_impl::addEdgeGroup(const char* name) throw (SALOME::SALOME_Exception)
1242 Group_ptr result = Group::_nil();
1243 HEXA_NS::Group* g = _document_cpp->addGroup( name, HEXA_NS::EdgeCell );
1245 Group_impl* servantCorba = new Group_impl(g);
1246 result = servantCorba->_this();
1252 Group_ptr Document_impl::addHexaNodeGroup(const char* name) throw (SALOME::SALOME_Exception)
1254 Group_ptr result = Group::_nil();
1255 HEXA_NS::Group* g = _document_cpp->addGroup( name, HEXA_NS::HexaNode );
1257 Group_impl* servantCorba = new Group_impl(g);
1258 result = servantCorba->_this();
1263 Group_ptr Document_impl::addQuadNodeGroup(const char* name) throw (SALOME::SALOME_Exception)
1265 Group_ptr result = Group::_nil();
1266 HEXA_NS::Group* g = _document_cpp->addGroup( name, HEXA_NS::QuadNode );
1268 Group_impl* servantCorba = new Group_impl(g);
1269 result = servantCorba->_this();
1275 Group_ptr Document_impl::addEdgeNodeGroup(const char* name) throw (SALOME::SALOME_Exception)
1277 Group_ptr result = Group::_nil();
1278 HEXA_NS::Group* g = _document_cpp->addGroup( name, HEXA_NS::EdgeNode );
1280 Group_impl* servantCorba = new Group_impl(g);
1281 result = servantCorba->_this();
1287 Group_ptr Document_impl::addVertexNodeGroup(const char* name) throw (SALOME::SALOME_Exception)
1289 Group_ptr result = Group::_nil();
1290 HEXA_NS::Group* g = _document_cpp->addGroup( name, HEXA_NS::Vertex_Node );
1292 Group_impl* servantCorba = new Group_impl(g);
1293 result = servantCorba->_this();
1299 ::CORBA::Long Document_impl::removeGroup(Group_ptr gIn) throw (SALOME::SALOME_Exception)
1301 Group_impl* gInServant = ::DownCast<Group_impl*>( gIn );
1302 ASSERT( gInServant );
1305 HEXA_NS::Group* g = gInServant->GetImpl();
1306 int ok = _document_cpp->removeGroup(g);
1311 ::CORBA::Long Document_impl::countGroup() throw (SALOME::SALOME_Exception)
1313 return _document_cpp->countGroup();
1317 Group_ptr Document_impl::getGroup(::CORBA::Long i) throw (SALOME::SALOME_Exception)
1319 Group_ptr result = Group::_nil();
1320 HEXA_NS::Group* g = _document_cpp->getGroup(i);
1321 if ( g != NULL ){ //CS_TODO
1322 Group_impl* servantCorba = new Group_impl(g);
1323 result = servantCorba->_this();
1329 Group_ptr Document_impl::findGroup(const char* name) throw (SALOME::SALOME_Exception)
1331 Group_ptr result = Group::_nil();
1332 HEXA_NS::Group* g = _document_cpp->findGroup(name);
1333 if ( g != NULL ){ //CS_TODO
1334 Group_impl* servantCorba = new Group_impl(g);
1335 result = servantCorba->_this();
1341 Law_ptr Document_impl::addLaw(const char* name, ::CORBA::Long nb_nodes) throw (SALOME::SALOME_Exception)
1343 Law_ptr result = Law::_nil();
1345 HEXA_NS::Law* l = _document_cpp->addLaw(name, nb_nodes);
1347 Law_impl* servantCorba = new Law_impl(l);
1348 result = servantCorba->_this();
1355 ::CORBA::Long Document_impl::countLaw() throw (SALOME::SALOME_Exception)
1357 return _document_cpp->countLaw();
1360 Law_ptr Document_impl::getLaw(::CORBA::Long i) throw (SALOME::SALOME_Exception)
1362 Law_ptr result = Law::_nil();
1364 HEXA_NS::Law* l = _document_cpp->getLaw(i);
1366 Law_impl* servantCorba = new Law_impl(l);
1367 result = servantCorba->_this();
1373 void Document_impl::removeLaw(Law_ptr l) throw (SALOME::SALOME_Exception)
1375 Law_impl* lServant = ::DownCast<Law_impl*>(l);
1378 HEXA_NS::Law* l = lServant->GetImpl();
1379 _document_cpp->removeLaw(l);
1385 Law_ptr Document_impl::findLaw(const char* name) throw (SALOME::SALOME_Exception)
1387 Law_ptr result = Law::_nil();
1389 HEXA_NS::Law* l = _document_cpp->findLaw(name);
1391 Law_impl* servantCorba = new Law_impl(l);
1392 result = servantCorba->_this();
1399 ::CORBA::Long Document_impl::countPropagation() throw (SALOME::SALOME_Exception)
1401 return _document_cpp->countPropagation();
1405 Propagation_ptr Document_impl::getPropagation(::CORBA::Long i) throw (SALOME::SALOME_Exception)
1407 Propagation_ptr result = Propagation::_nil();
1409 HEXA_NS::Propagation* p = _document_cpp->getPropagation(i);
1412 // const HEXA_NS::Edges& edges_cpp = p->getEdges();
1414 // // HEXA_NS::Edges::const_iterator itertest = edges_cpp.begin();
1415 // // itertest != edges_cpp.end();
1416 // for ( HEXA_NS::Edges::const_iterator iter = edges_cpp.begin();
1417 // iter != edges_cpp.end();
1424 Propagation_impl* servantCorba = new Propagation_impl(p);
1425 result = servantCorba->_this();
1430 Propagation_ptr Document_impl::findPropagation(Edge_ptr eIn) throw (SALOME::SALOME_Exception)
1432 Propagation_ptr result = Propagation::_nil();
1434 Edge_impl* eServant = ::DownCast<Edge_impl*>( eIn );
1438 HEXA_NS::Edge* e= eServant->GetImpl();
1440 HEXA_NS::Propagation* p = _document_cpp->findPropagation(e);
1442 Propagation_impl* servantCorba = new Propagation_impl(p);
1443 result = servantCorba->_this();
1453 // HEXA_ORB::HEXA_ORB::Hexas* Document_impl::addCartesian1(HEXA_ORB::Vertex_ptr v, HEXA_ORB::Vector_ptr v1, ::CORBA::Long px, ::CORBA::Long py, ::CORBA::Long pz, ::CORBA::Long mx, ::CORBA::Long my, ::CORBA::Long mz)
1454 // throw (SALOME::SALOME_Exception)
1456 // HEXA_ORB::HEXA_ORB::Hexas* servantGrid = new HEXA_ORB::HEXA_ORB::Hexas;
1458 // // std::cout<<"v->x()"<< v->x() << std::endl;
1459 // // std::cout<<"v->y()"<< v->y() << std::endl;
1460 // // std::cout<<"v->z()"<< v->z() << std::endl;
1462 // // std::cout<<"v1->dx()"<< v1->dx() << std::endl;
1463 // // std::cout<<"v1->dy()"<< v1->dy() << std::endl;
1464 // // std::cout<<"v1->dz()"<< v1->dz() << std::endl;
1466 // // HEXA_NS::Vertex* tmpVertex = _document_cpp->vertex( v->x(), v->y(), v->z() );
1467 // // // HEXA_NS::Vertex* tmpVertex = new HEXA_NS::Vertex(_document_cpp, v->x(), v->y(), v->z() );
1468 // // std::cout<<"tmpVertex OK"<<std::endl;
1471 // // HEXA_NS::Vector* tmpVector = _document_cpp->vector( v1->dx(), v1->dy(), v1->dz() );
1472 // // // HEXA_NS::Vector* tmpVector = new HEXA_NS::Vector(_document_cpp, v1->dx(), v1->dy(), v1->dz() );
1473 // // std::cout<<"tmpVector OK"<<std::endl;
1475 // // // HEXA_NS::HEXA_ORB::Hexas* grid = _document_cpp->cartesian( tmpVertex, tmpVector, px, py, pz, mx, my, mz );
1476 // // std::cout<<"px->"<<px<<std::endl;
1477 // // std::cout<<"py->"<<py<<std::endl;
1478 // // std::cout<<"pz->"<<pz<<std::endl;
1480 // // HEXA_NS::HEXA_ORB::Hexas* grid = _document_cpp->cartesian( tmpVertex, tmpVector, px, py, pz);
1481 // // std::cout<<"grid OK"<<std::endl;
1482 // // tmpVertex->remove();
1483 // // std::cout<<"tmpVertex->remove() OK"<<std::endl;
1484 // // tmpVector->remove();
1485 // // std::cout<<"tmpVector->remove() OK"<<std::endl;
1489 // // HEXA_NS::Hexa *oneHexa = grid->getHexa (0,0,0);
1490 // // std::cout<<"grid->getHexa OK"<<std::endl;
1492 // // Hexa_impl *servantHexa = new Hexa_impl( oneHexa );
1493 // // (*servantGrid)[ 0 ] = servantHexa->_this();
1496 // // // CORBA::ULong i = 0;
1497 // // // for (int nz=0; nz<pz ; nz++){
1498 // // // for (int ny=nz+1; ny<py-nz-1 ; ny++){
1499 // // // for (int nx=nz+1; nx<px-nz-1 ; nx++){
1500 // // // HEXA_NS::Hexa *oneHexa = grid->getHexa (nx, ny, nz);
1501 // // // // oneHexa->remove (); CS_TODO ? (not)
1502 // // // Hexa_impl *servantHexa = new Hexa_impl( oneHexa );
1503 // // // (*servantGrid)[ i++ ] = servantHexa->_this();
1507 // return servantGrid;