1 |
foucault |
27 |
#pragma hdrstop |
2 |
francois |
283 |
|
3 |
foucault |
27 |
#include "gestionversion.h" |
4 |
|
|
|
5 |
francois |
481 |
#include "cad4fe_mcedge.h" |
6 |
foucault |
27 |
#include "math.h" |
7 |
francois |
481 |
#include "cad4fe_mcvertex.h" |
8 |
|
|
#include "cad4fe_mcface.h" |
9 |
|
|
#include "cad4fe_polycurve.h" |
10 |
foucault |
27 |
#include "ot_algorithme_geometrique.h" |
11 |
|
|
|
12 |
francois |
283 |
#include <sstream> |
13 |
foucault |
27 |
#include <string> |
14 |
|
|
|
15 |
|
|
#ifdef __BORLANDC__ |
16 |
|
|
#pragma warn -8012 |
17 |
|
|
#pragma warn -8037 |
18 |
|
|
#endif |
19 |
|
|
|
20 |
|
|
using namespace CAD4FE; |
21 |
|
|
|
22 |
|
|
MCEdge::MCEdge(MG_ARETE * __refEdge) |
23 |
francois |
283 |
: MG_ARETE(std::string("MC")+std::string(__refEdge->get_idoriginal()), new PolyCurve(__refEdge), 1) |
24 |
foucault |
27 |
{ |
25 |
francois |
283 |
time = 0; |
26 |
|
|
copie_ccf(*__refEdge); |
27 |
foucault |
27 |
} |
28 |
|
|
|
29 |
|
|
MCEdge::MCEdge(std::string __idOriginal, PolyCurve * __polycurve) |
30 |
francois |
283 |
: MG_ARETE(__idOriginal, (PolyCurve*)__polycurve, 1) |
31 |
|
|
{ |
32 |
|
|
time = 0; |
33 |
foucault |
27 |
} |
34 |
|
|
|
35 |
|
|
MCEdge::~MCEdge() |
36 |
|
|
{ |
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
// Warning 1 : the graph node __G1Node MUST have a name |
40 |
|
|
// Warning 2 : the graph arc G2Arc(__G1Node) MUST be connected to the adjacent faces of the swEdge |
41 |
|
|
MCEdge::MCEdge(std::string __idoriginal, MCEdge & __A, MCEdge & __B) |
42 |
francois |
283 |
: MG_ARETE(__idoriginal, new PolyCurve(), 1) |
43 |
|
|
{ |
44 |
|
|
time = 0; |
45 |
foucault |
27 |
|
46 |
francois |
283 |
GetPolyCurve()->Merge (*__A.GetPolyCurve()); |
47 |
|
|
GetPolyCurve()->Merge (*__B.GetPolyCurve()); |
48 |
|
|
copie_ccf(__A); |
49 |
|
|
copie_ccf(__B); |
50 |
foucault |
27 |
|
51 |
francois |
283 |
_CopyMeshLink(__A); |
52 |
|
|
_CopyMeshLink(__B); |
53 |
|
|
} |
54 |
foucault |
27 |
|
55 |
|
|
void MCEdge::_CopyMeshLink( MCEdge & __mcEdge) |
56 |
|
|
{ |
57 |
|
|
int i; |
58 |
francois |
283 |
TPL_SET<MG_ELEMENT_MAILLAGE*> * lien_maillage = __mcEdge.get_lien_maillage(); |
59 |
|
|
TPL_SET<MG_ELEMENT_MAILLAGE*>::ITERATEUR it; |
60 |
foucault |
27 |
|
61 |
francois |
283 |
for (MG_ELEMENT_MAILLAGE* element = lien_maillage->get_premier(it);element;element = lien_maillage->get_suivant(it)) |
62 |
|
|
{ |
63 |
|
|
element->change_lien_topologie2(this); |
64 |
|
|
get_lien_maillage()->ajouter(element); |
65 |
|
|
|
66 |
|
|
MG_SEGMENT * seg = (MG_SEGMENT *) element; |
67 |
|
|
MG_NOEUD * nos[2]; |
68 |
|
|
nos[0] = seg->get_noeud1(); |
69 |
|
|
nos[1] = seg->get_noeud2(); |
70 |
|
|
for (i=0; i<2; i++) |
71 |
foucault |
27 |
{ |
72 |
francois |
283 |
if (!nos[i]->get_lien_topologie() || nos[i]->get_lien_topologie()->get_dimension() >= 1) |
73 |
|
|
nos[i]->change_lien_topologie2(this); |
74 |
foucault |
27 |
} |
75 |
francois |
283 |
} |
76 |
foucault |
27 |
} |
77 |
|
|
|
78 |
|
|
PolyCurve * |
79 |
|
|
MCEdge::GetPolyCurve ( ) |
80 |
|
|
{ |
81 |
francois |
283 |
return (PolyCurve *) get_courbe(); |
82 |
foucault |
27 |
} |
83 |
|
|
|
84 |
|
|
void MCEdge::enregistrer(std::ostream& o) |
85 |
|
|
{ |
86 |
francois |
283 |
int nb=get_nb_ccf(); |
87 |
|
|
o << "%" << get_id() << "=CAD4FE_MCEDGE("<< get_idoriginal() << ",$" << get_courbe()->get_id() << ",$"<<get_cosommet1()->get_id() << ",$" <<get_cosommet2()->get_id() << "," << get_orientation() << "," << nb; |
88 |
|
|
if (nb!=0) |
89 |
|
|
{ |
90 |
foucault |
27 |
o << ",("; |
91 |
|
|
for (int i=0;i<nb;i++) |
92 |
francois |
283 |
{ |
93 |
|
|
char nom[3]; |
94 |
|
|
get_type_ccf(i,nom); |
95 |
|
|
o << "(" << nom << "," << get_valeur_ccf(i) << ")"; |
96 |
|
|
if (i!=nb-1) o << "," ; |
97 |
|
|
} |
98 |
foucault |
27 |
o << ")"; |
99 |
francois |
283 |
} |
100 |
|
|
o << ");" << std::endl; |
101 |
foucault |
27 |
} |
102 |
|
|
|