Salome HOME
4728e6da2926dbd8fd93114c93322efd5581a812
[modules/hexablock.git] / src / HEXABLOCK / HexDocument.cxx
1
2 // C++ : La clase principale de Hexa
3
4 #include "HexDocument.hxx"
5
6 #include "HexEltBase.hxx"
7 #include "HexVertex.hxx"
8 #include "HexEdge.hxx"
9 #include "HexQuad.hxx"
10 #include "HexHexa.hxx"
11
12 #include "HexElements.hxx"
13 #include "HexCrossElements.hxx"
14
15 #include "HexVector.hxx"
16 #include "HexCylinder.hxx"
17 #include "HexPipe.hxx"
18 #include "HexMatrix.hxx"
19 #include "HexCloner.hxx"
20 #include "HexPropagation.hxx"
21 #include "HexLaw.hxx"
22
23 #include "HexXmlWriter.hxx"
24 #include "HexXmlTree.hxx"
25 #include "HexGlobale.hxx"
26 #include "HexGroups.hxx"
27
28 BEGIN_NAMESPACE_HEXA
29
30 // ======================================================== Constructeur
31 Document::Document (cpchar filename)
32 {
33    glob = Globale::getInstance ();
34
35    doc_db        = 0;
36    nbr_errors    = 0;
37    doc_modified  = true;
38    doc_name      = filename;
39    doc_tolerance = 1e-6;
40    nbr_laws      = 0;
41    nbr_propagations = 0;
42    maj_propagation  = true;
43
44    addLaw ("DefaultLaw", 0);
45
46    for (EnumElt type = EL_NONE ; type < EL_MAXI ; type=(EnumElt) (type+1))
47        {
48        doc_first_elt [type] = doc_last_elt [type] = new EltBase (); 
49        doc_nbr_elt   [type] = 0;
50        }
51 }
52 // ======================================================== Destructeur
53 Document::~Document ()
54 {
55    for (EnumElt type = EL_NONE ; type < EL_MAXI ; type=(EnumElt) (type+1))
56        {
57        //  printf ("____________________________ Type=%d\n", type);
58        EltBase* next = NULL;
59        for (EltBase* elt=doc_first_elt [type] ; elt != NULL ; elt=next) 
60            {
61            //  elt->dump();
62            next = elt->next();
63            //  Display(elt);e0057
64            //  if (type!=EL_NONE) 
65               delete elt;
66            }
67        }
68 }
69 // ======================================================== addVector
70 Vector* Document::addVector (double dx, double dy, double dz)
71 {
72    Vector* pv = new Vector (this, dx, dy, dz); 
73    doc_vector.push_back (pv);
74    return  pv;
75 }
76 // ======================================================== addVectorVertices
77 Vector* Document::addVectorVertices (Vertex* va, Vertex* vb)
78 {
79    Vector* pv = addVector (vb->getX () - va->getX (),
80                            vb->getY () - va->getY (),
81                            vb->getZ () - va->getZ ());
82    return  pv;
83 }
84 // ======================================================== addVertex
85 Vertex* Document::addVertex (double x, double y, double z)
86 {
87    Vertex* pv   = new Vertex (this, x, y, z);
88    doc_modified = true;
89    return pv;
90 }
91 // ======================================================== addEdge
92 Edge* Document::addEdge (Vertex* va, Vertex* vb)
93 {
94    if (va==NULL || vb==NULL) 
95       return NULL;
96
97    Edge* arete  = new Edge (va, vb);
98    doc_modified = true;
99    return arete;
100 }
101 // ======================================================== addEdge (bis)
102 Edge* Document::addEdge (Vertex* va, Vector* vec)
103 {
104    doc_modified = true;
105    Vertex* vb   = addVertex (va->getX () + vec->getDx(), 
106                              va->getY () + vec->getDy(), 
107                              va->getZ () + vec->getDz());
108
109    Edge*  arete = addEdge (va, vb);
110    return arete;
111 }
112 // ======================================================== addQuadVertices
113 Quad* Document::addQuadVertices (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd)
114 {
115    Quad* face   = new Quad (va, vb, vc, vd);
116    doc_modified = true;
117    return face;
118 }
119 // ======================================================== addQuad
120 Quad* Document::addQuad (Edge* ea, Edge* eb, Edge* ec, Edge* ed)
121 {
122    Quad* face   = new Quad (ea, eb, ec, ed);
123    doc_modified = true;
124    return face;
125 }
126 // ======================================================== addHexaVertices
127 Hexa* Document::addHexaVertices (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd,
128                                  Vertex* ve, Vertex* vf, Vertex* vg, Vertex* vh)
129 {
130    Hexa* pave   = new Hexa (va, vb, vc, vd, ve, vf, vg, vh);
131    doc_modified = true;
132    return pave;
133 }
134 // ======================================================== addHexa
135 Hexa* Document::addHexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, 
136                          Quad* qf)
137 {
138    Hexa* pave   = new Hexa (qa, qb, qc, qd, qe, qf);
139    doc_modified = true;
140    return pave;
141 }
142 // ======================================================== addCylinder
143 Cylinder* Document::addCylinder (Vertex* b, Vector* d, double r,  double h)
144 {
145    doc_modified  = true;
146    Cylinder* cyl = new  Cylinder (b, d, r, h);
147    doc_cylinder.push_back (cyl);
148    return    cyl;
149 }
150 // ======================================================== addPipe
151 Pipe* Document::addPipe (Vertex* b, Vector* d, double ri, double re, double h)
152 {
153    doc_modified = true;
154    Pipe*  tuyau = new  Pipe (b, d, ri, re, h);
155    doc_pipe.push_back (tuyau);
156    return tuyau;
157 }
158 // ======================================================== makeCartesian
159 Elements* Document::makeCartesian (Vertex* v, Vector* dir, 
160                             int px, int py, int pz, int mx, int my, int mz)
161 {
162    Vector* v1 = new Vector (this, dir->getDx(), 0, 0); 
163    Vector* v2 = new Vector (this, 0, dir->getDy(), 0); 
164    Vector* v3 = new Vector (this, 0,0,  dir->getDz()); 
165    Elements*  grille = new Elements (this);
166    grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz, mx, my, mz);
167    return grille;
168 }
169 // ======================================================== makeCartesian
170 Elements* Document::makeCartesian (Vertex* v, Vector* v1, Vector* v2, 
171                     Vector* v3, int px, int py, int pz, int mx, int my, int mz)
172 {
173    Elements* grille = new Elements (this);
174    grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz, mx, my, mz);
175    return grille;
176 }
177 // ======================================================== makeSpherical
178 Elements* Document::makeSpherical (Vertex* c, Vector* dv, int nb, double k)
179 {
180    Elements* grille = new Elements (this);
181    grille->makeSphericalGrid (c, dv, nb, k);
182    return grille;
183 }
184 // ======================================================== makeCylindrical
185 Elements* Document::makeCylindrical (Vertex* c, Vector* b, Vector* h, 
186         double dr, double da, double dl, int nr, int na, int nl, bool fill)
187 {
188    Elements* grille = new Elements (this);
189    grille->makeCylindricalGrid (c, b, h, dr, da, dl, nr, na, nl, fill);
190    return grille;
191 }
192 // ======================================================== findVertex
193 Vertex* Document::findVertex (double vx, double vy, double vz)
194 {
195    double xmin = vx - doc_tolerance;
196    double xmax = vx + doc_tolerance;
197    double ymin = vy - doc_tolerance;
198    double ymax = vy + doc_tolerance;
199    double zmin = vz - doc_tolerance;
200    double zmax = vz + doc_tolerance;
201
202    for (EltBase* elt = doc_first_elt[EL_VERTEX]->next (); elt!=NULL;
203                  elt = elt->next())
204        {
205        if (elt->isHere())
206           { 
207           Vertex* node = static_cast <Vertex*> (elt); 
208           if (node->isin (xmin, xmax, ymin, ymax, zmin, zmax))
209              return node;
210           }
211        }
212    return NULL;
213 }
214 // ======================================================== findEdge
215 Edge* Document::findEdge (Vertex* v1, Vertex* v2)
216 {
217    for (EltBase* elt = doc_first_elt[EL_EDGE]->next (); elt!=NULL;
218                  elt = elt->next())
219        {
220        Edge* candidat  = static_cast <Edge*> (elt); 
221        if (candidat->definedBy (v1, v2))
222           return candidat;
223        }
224    return NULL;
225 }
226 // ======================================================== findQuad
227 Quad* Document::findQuad (Vertex* v1, Vertex* v2)
228 {
229    for (EltBase* elt = doc_first_elt[EL_QUAD]->next (); elt!=NULL;
230                  elt = elt->next())
231        {
232        Quad* candidat  = static_cast <Quad*> (elt); 
233        if (candidat->definedBy (v1, v2))
234           return candidat;
235        }
236    return NULL;
237 }
238 // ======================================================== findHexa
239 Hexa* Document::findHexa (Vertex* v1, Vertex* v2)
240 {
241    for (EltBase* elt = doc_first_elt[EL_HEXA]->next (); elt!=NULL;
242                  elt = elt->next())
243        {
244        Hexa* candidat  = static_cast <Hexa*> (elt); 
245        if (candidat->definedBy (v1, v2))
246           return candidat;
247        }
248    return NULL;
249 }
250 // ======================================================== makeCylinder
251 int index_tv (Vertex* table[], Vertex* elt)
252 {
253    for (int nro=0; nro<QUAD4; nro++)
254         if (elt == table[nro])
255            return nro;
256
257    return NOTHING;
258 }
259 // ======================================================== mergeQuads
260 int Document::mergeQuads (Quad* par, Quad* old, Vertex* v1, Vertex* v2, 
261                                                 Vertex* v3, Vertex* v4)
262 {
263    update ();
264
265    if (   par==NULL || par->isDeleted() || old==NULL || old->isDeleted() 
266        || v1 ==NULL || v1 ->isDeleted() || v2 ==NULL || v2 ->isDeleted() 
267        || v3 ==NULL || v3 ->isDeleted() || v4 ==NULL || v4 ->isDeleted()) 
268       return HERR;
269
270    for (int nro=0 ; nro<QUAD4 ; nro++) 
271        if (old->indexVertex (par->getVertex(nro))!= NOTHING)
272           return HERR+nro+1;
273
274    if (debug())
275       {
276       printf ("  ----------------- mergeQuads : \n");
277       HexDump (old);
278       HexDump (par);
279       HexDump (v1);
280       HexDump (v2);
281       HexDump (v3);
282       HexDump (v4);
283       }
284
285    Vertex *tv1 [QUAD4], *tv2 [QUAD4];
286    Edge   *te1 [QUAD4], *te2 [QUAD4];
287
288    int ier1 = par->ordoVertex (v1, v3, tv1);
289    int ier2 = old->ordoVertex (v2, v4, tv2);
290    if (ier1 != HOK)      return ier1;
291    else if (ier2 != HOK) return ier2;
292
293    for (int nro=0 ; nro<QUAD4 ; nro++)
294        {
295        te1 [nro] = par->getEdge(nro);
296        Vertex* va1 = te1[nro]->getVertex(V_AMONT);
297        Vertex* vb1 = te1[nro]->getVertex(V_AVAL);
298        int na = index_tv  (tv1, va1);
299        int nb = index_tv  (tv1, vb1);
300        if (na==NOTHING || nb==NOTHING)
301           return HERR;
302
303        te2 [nro] = old->findEdge (tv2[na], tv2[nb]);
304        if (te2[nro]==NULL)
305           return HERR;
306        }
307
308    if (debug())
309       {
310       printf ("  ----------------- Correspondances mergeQuads : \n");
311       for (int nro=0 ; nro<QUAD4 ; nro++)
312           {
313           printf ("  %d  : ", nro);
314           tv2 [nro]->printName(" -> ");
315           tv1 [nro]->printName("\n");
316           }
317       for (int nro=0 ; nro<QUAD4 ; nro++)
318           {
319           printf ("  %d  : ", nro);
320           te2 [nro]->printName(" (");
321           te2 [nro]->getVertex(0)->printName(", ");
322           te2 [nro]->getVertex(1)->printName(") -> ");
323           te1 [nro]->printName(" (");
324           te1 [nro]->getVertex(0)->printName(", ");
325           te1 [nro]->getVertex(1)->printName(")\n");
326           }
327       }
328
329    replaceQuad (old, par);
330    for (int nro=0 ; nro<QUAD4 ; nro++) 
331        replaceEdge   (te2[nro], te1[nro]);
332    for (int nro=0 ; nro<QUAD4 ; nro++) 
333        replaceVertex (tv2[nro], tv1[nro]);
334
335    maj_connection = false;
336    purge_elements = false;
337    return HOK;
338 }
339 // ======================================================== mergeEdges
340 int Document::mergeEdges (Edge* e1, Edge* e2, Vertex* v1, Vertex* v2)
341 {
342    if (e1==NULL || e1->isDeleted() || e2==NULL || e2->isDeleted()) 
343       return HERR;
344
345    for (int nro=0 ; nro<V_TWO ; nro++) 
346        if (e1->index (e2->getVertex(nro))!= NOTHING)
347           return HERR+nro+1;
348
349    Vertex *tv1 [V_TWO], *tv2 [V_TWO];
350
351    int ier1 = e1->anaMerge (v1, tv1);
352    int ier2 = e2->anaMerge (v2, tv2);
353
354    if (ier1 != HOK)      return ier1;
355    else if (ier2 != HOK) return ier2;
356
357    replaceEdge (e2, e1);
358    for (int nro=0 ; nro<V_TWO ; nro++) 
359        replaceVertex (tv2[nro], tv1[nro]);
360
361    maj_connection = false;
362    return HOK;
363 }
364 // ======================================================== mergeVertices
365 int Document::mergeVertices (Vertex* v1, Vertex* v2)
366 {
367    if (v1==v2 || v1==NULL || v1->isDeleted() 
368               || v2==NULL || v2->isDeleted())
369       return HERR;
370
371    replaceVertex (v2, v1);
372
373    maj_connection = false;
374    return HOK;
375 }
376 // ======================================================== replaceVertex
377 void Document::replaceVertex (Vertex* old, Vertex* par)
378 {
379    if (old==par)
380       return;
381
382    for (int type=EL_EDGE ; type <= EL_HEXA ; type++)
383        {
384        for (EltBase* elt = doc_first_elt[type]->next (); elt!=NULL;
385                      elt = elt->next())
386            if (elt->isHere ())
387                elt->replaceVertex (old, par);
388        }
389    old->suppress ();
390 }
391 // ======================================================== replaceEdge
392 void Document::replaceEdge (Edge* old, Edge* par)
393 {
394    if (old==par)
395       return;
396
397    for (int type=EL_QUAD ; type <= EL_HEXA ; type++)
398        {
399        for (EltBase* elt = doc_first_elt[type]->next (); elt!=NULL;
400                      elt = elt->next())
401            if (elt->isHere ())
402                elt->replaceEdge (old, par);
403        }
404    old->suppress ();
405 }
406 // ======================================================== replaceQuad
407 void Document::replaceQuad (Quad* old, Quad* par)
408 {
409    if (old==par)
410       return;
411
412    for (EltBase* elt = doc_first_elt[EL_HEXA]->next (); elt!=NULL;
413                  elt = elt->next())
414        if (elt->isHere ())
415           {
416           Hexa* cell = static_cast <Hexa*> (elt);
417           cell->replaceQuad (old, par);
418           }
419    old->suppress ();
420 }
421 // ======================================================== prismQuad
422 Elements* Document::prismQuad  (Quad* start, Vector* dir, int nb)
423 {
424    Quads  tstart;
425    tstart.push_back (start);
426
427    update ();
428    Elements* prisme = prismQuads (tstart, dir, nb);
429    return    prisme;
430 }
431 // ======================================================== prismQuads
432 Elements* Document::prismQuads (Quads& tstart, Vector* dir, int nb)
433 {
434    if (nb<=0) return NULL;
435
436    Elements*  prisme = new Elements (this);
437    prisme->prismQuads (tstart, dir, nb);
438    return prisme;
439 }
440 // ======================================================== joinQuads
441 Elements* Document::joinQuads (Quads& start, Quad* dest, Vertex* v1, 
442                                Vertex* v2, Vertex* v3, Vertex* v4, int nb)
443 {
444    if (nb<=0)      return NULL;
445
446    update ();
447    Elements*  joint = new Elements (this);
448    joint->joinQuads (start, nb, v1, v2, v3, v4, dest);
449    return joint;
450 }
451 // ======================================================== joinQuad
452 Elements* Document::joinQuad (Quad* start, Quad* dest, Vertex* v1, 
453                               Vertex* v2,  Vertex* v3, Vertex* v4, int nb)
454 {
455    Quads  tstart;
456    tstart.push_back (start);
457
458    Elements* joint = joinQuads (tstart, dest, v1, v2, v3, v4, nb);
459    return    joint;
460 }
461 // ========================================================== getHexa
462 Hexa* Document::getHexa (int nro) 
463 {
464    return static_cast <Hexa*> (getElement (EL_HEXA, nro));
465 }
466 // ========================================================== getQuad
467 Quad* Document::getQuad (int nro) 
468 {
469    return static_cast <Quad*> (getElement (EL_QUAD, nro));
470 }
471 // ========================================================== getEdge
472 Edge* Document::getEdge (int nro) 
473
474    return static_cast <Edge*> (getElement (EL_EDGE, nro));
475 }
476 // ========================================================== getVertex
477 Vertex* Document::getVertex (int nro) 
478
479    return static_cast <Vertex*> (getElement (EL_VERTEX, nro)); 
480 }
481 // ========================================================== countElement
482 int Document::countElement (EnumElt type)
483
484    int compteur = 0;
485    for (EltBase* elt = doc_first_elt[type]->next (); elt!=NULL;
486                  elt = elt->next())
487        if (elt->isHere())
488           compteur ++;
489
490    return compteur;
491 }
492 // ========================================================== getElement
493 EltBase* Document::getElement (EnumElt type, int nro) 
494
495    int compteur = 0;
496    for (EltBase* elt = doc_first_elt[type]->next (); elt!=NULL;
497                  elt = elt->next())
498        {
499        if (elt->isHere())
500           {
501           if (compteur>=nro)
502              return elt;
503           compteur ++;
504           }
505        }
506    return NULL;
507 }
508 // ========================================================= addLaw
509 Law* Document::addLaw (const char* name, int nbnodes)
510
511    Law* loi = new Law (name, nbnodes);
512    doc_laws.push_back (loi);
513    nbr_laws ++;
514    return loi;
515 }
516 // ========================================================= GetLaw
517 Law* Document::getLaw (int nro)
518
519    if (nro <0 || nro>= nbr_laws)
520       return NULL;
521
522    return doc_laws [nro];
523 }
524 // ========================================================= FindLaw
525 Law* Document::findLaw (const char* name)
526
527    std::string nom = name;
528    for (int nro=0 ; nro<nbr_laws; nro++)
529        if (doc_laws [nro]->getName() == nom)
530           return doc_laws [nro];
531
532    return NULL;
533 }
534 // ========================================================= removeLaw
535 int Document::removeLaw (Law* loi)
536
537    for (int nro=1 ; nro<nbr_laws; nro++)
538        if (doc_laws [nro] == loi)
539           {
540           delete doc_laws [nro];
541           doc_laws.erase (doc_laws.begin()+nro);
542           nbr_laws= doc_laws.size();
543           return HOK;
544           }
545
546    return HERR;
547 }
548 // ========================================================= majPropagation
549 void Document::majPropagation ()
550
551    majReferences ();
552    if (purge_elements)
553        purge ();
554
555    for (int nro=0 ; nro<nbr_propagations ; nro++)
556        {
557        delete doc_propagation [nro];
558        }
559
560    doc_propagation.clear ();
561    nbr_propagations = 0;
562    maj_propagation  = false;
563
564    for (EltBase* elt = doc_first_elt[EL_EDGE]->next (); elt!=NULL;
565                  elt = elt->next())
566        {
567        Edge* arete = static_cast <Edge*> (elt);
568        if (arete!=NULL)
569            arete->setPropag (NOTHING, true);
570        }
571
572    //  markAll (NO_COUNTED, EL_EDGE);
573
574    for (EltBase* elt = doc_first_elt[EL_HEXA]->next (); elt!=NULL;
575                  elt = elt->next())
576        {
577        Hexa* cell = static_cast <Hexa*> (elt);
578        if (cell!=NULL && cell->isHere())
579           {
580           for (int ne=0 ; ne<HE_MAXI ; ne++)
581               {
582               Edge* arete = cell->getEdge(ne);
583               if (arete->getPropag()<0)
584                  {
585                  Propagation* prop = new Propagation (); 
586                  doc_propagation.push_back (prop);
587                  arete->propager (prop, nbr_propagations);
588                  nbr_propagations ++;
589                  prop->majLaw();
590                  }
591               }
592           }
593        }
594 }
595 // ======================================================== countPropagation
596 int Document::countPropagation ()
597 {
598    if (maj_propagation)
599        majPropagation ();
600
601    return nbr_propagations;
602 }
603 // ======================================================== getPropagation
604 Propagation* Document::getPropagation (int nro)
605 {
606    if (maj_propagation)
607        majPropagation ();
608
609    if (nro < 0 || nro >= nbr_propagations)
610        return NULL;
611
612    return doc_propagation [nro];
613 }
614 // ======================================================== findPropagation
615 Propagation* Document::findPropagation (Edge* arete)
616 {
617    if (arete==NULL) 
618        return NULL;
619
620    if (maj_propagation)
621        majPropagation ();
622
623    return getPropagation (arete->getPropag ());
624 }
625 // ======================================================== disconnectQuad
626 Elements* Document::disconnectQuad (Hexa* cell, Quad* element)
627 {
628    if (cell==NULL || element==NULL) 
629       return NULL;
630
631    update ();
632    Elements* crees = cell->disconnectQuad (element);
633
634    if (crees!=NULL) 
635        majReferences ();
636
637    return crees;
638 }
639 // ======================================================== disconnectEdge
640 Elements* Document::disconnectEdge (Hexa* cell, Edge* element)
641 {
642    if (cell==NULL || element==NULL) 
643       return NULL;
644
645    update ();
646    Elements* crees = cell->disconnectEdge (element);
647
648    if (crees!=NULL)
649        majReferences ();
650    return crees;
651 }
652 // ======================================================== disconnectVertex
653 Elements* Document::disconnectVertex (Hexa* cell, Vertex* element)
654 {
655    if (cell==NULL || element==NULL) 
656       return NULL;
657
658    update ();
659    Elements* crees = cell->disconnectVertex (element);
660
661    if (crees!=NULL) 
662        majReferences ();
663    return crees;
664 }
665 // ======================================================== cut
666 Elements* Document::cut (Edge* edge, int nbcuts)
667 {
668    Elements* t_hexas = new Elements (this);
669
670    if (edge==NULL || nbcuts<=0)
671       return t_hexas;
672
673    Propagation* prop    = findPropagation (edge);
674    const Edges& t_edges = prop->getEdges ();
675
676    t_hexas->cutHexas (t_edges, nbcuts);
677
678    majPropagation ();
679    return t_hexas;
680 }
681 // ======================================================== addGroup
682 Group* Document::addGroup    (cpchar name, EnumGroup kind)
683 {
684    Group* grp = new Group (name, kind);
685    doc_group.push_back (grp);
686    return grp;
687 }
688 // ======================================================== findGroup
689 Group* Document::findGroup   (cpchar name)
690 {
691    int nbre = doc_group.size();
692
693    for (int ng=0 ; ng<nbre ; ng++) 
694        if (Cestegal (doc_group [ng]->getName(), name))
695           return doc_group [ng];
696
697    return NULL;
698 }
699 // ======================================================== removeGroup
700 int Document::removeGroup (Group* grp)
701 {
702    int nbre = doc_group.size();
703    for (int ng=0 ; ng<nbre ; ng++) 
704        {
705        if (grp == doc_group [ng])
706           {
707           doc_group.erase (doc_group.begin() + ng);
708           delete grp;
709           return HOK;
710           }
711        }
712                       // Pas trouve dans la liste. On detruit quand meme
713    delete grp;
714    return HERR;
715 }// ======================================================== makeCylinder
716 Elements* Document::makeCylinder (Cylinder* cyl, Vector* base, int nr, int na, 
717                                                                        int nl)
718 {
719    Elements* grille = new Elements (this);
720    grille->makeCylinder (cyl, base, nr, na, nr);
721    return grille;
722 }
723 // ======================================================== makeCylinders
724 CrossElements* Document::makeCylinders (Cylinder* cyl1, Cylinder* cyl2)
725 {
726    CrossElements* grille = new CrossElements (this);
727    grille->crossCylinders (cyl1, cyl2, true);
728    return grille;
729 }
730
731 // ======================================================== makePipe
732 Elements* Document::makePipe (Pipe* pipe, Vector* bx, int nr, int na, int nl)
733 {
734    Elements* grille = new Elements (this);
735    grille->makePipe (pipe, bx, nr, na, nr);
736    return grille;
737 }
738 // ======================================================== makePipes
739 CrossElements* Document::makePipes (Pipe* pipe1, Pipe* pipe2)
740 {
741    CrossElements* grille = new CrossElements (this);
742    grille->crossCylinders (pipe1, pipe2, false);
743    return grille;
744 }
745 END_NAMESPACE_HEXA