1 |
francois |
283 |
//------------------------------------------------------------ |
2 |
|
|
//------------------------------------------------------------ |
3 |
|
|
// MAGiC |
4 |
|
|
// Jean Christophe Cuilli�re et Vincent FRANCOIS |
5 |
|
|
// D�partement de G�nie M�canique - UQTR |
6 |
|
|
//------------------------------------------------------------ |
7 |
|
|
// Le projet MAGIC est un projet de recherche du d�partement |
8 |
|
|
// de g�nie m�canique de l'Universit� du Qu�bec � |
9 |
|
|
// Trois Rivi�res |
10 |
|
|
// Les librairies ne peuvent �tre utilis�es sans l'accord |
11 |
|
|
// des auteurs (contact : francois@uqtr.ca) |
12 |
|
|
//------------------------------------------------------------ |
13 |
|
|
//------------------------------------------------------------ |
14 |
|
|
// |
15 |
|
|
// mg_cosommet.cpp |
16 |
|
|
// |
17 |
|
|
//------------------------------------------------------------ |
18 |
|
|
//------------------------------------------------------------ |
19 |
|
|
// COPYRIGHT 2000 |
20 |
|
|
// Version du 02/03/2006 � 11H22 |
21 |
|
|
//------------------------------------------------------------ |
22 |
|
|
//------------------------------------------------------------ |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
#include "gestionversion.h" |
26 |
|
|
#include "mg_cosommet.h" |
27 |
|
|
#include <math.h> |
28 |
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
|
|
MG_COSOMMET::MG_COSOMMET(unsigned long num,MG_SOMMET* mgsom,MG_ARETE* mgarete,double precision):MG_ELEMENT_COTOPOLOGIQUE(num),sommet(mgsom),arete(mgarete) |
32 |
|
|
{ |
33 |
|
|
if (sommet==NULL) return ; |
34 |
|
|
if (arete==NULL) return ; |
35 |
|
|
double coo[3]; |
36 |
|
|
sommet->get_point()->evaluer(coo); |
37 |
|
|
arete->inverser(t,coo,precision); |
38 |
|
|
} |
39 |
|
|
|
40 |
|
|
|
41 |
|
|
MG_COSOMMET::MG_COSOMMET(MG_SOMMET* mgsom,MG_ARETE* mgarete,double precision):MG_ELEMENT_COTOPOLOGIQUE(),sommet(mgsom),arete(mgarete) |
42 |
|
|
{ |
43 |
|
|
if (sommet==NULL) return ; |
44 |
|
|
if (arete==NULL) return ; |
45 |
|
|
double coo[3]; |
46 |
|
|
sommet->get_point()->evaluer(coo); |
47 |
|
|
arete->inverser(t,coo,precision); |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
|
51 |
|
|
MG_COSOMMET::MG_COSOMMET(MG_COSOMMET& mdd):MG_ELEMENT_COTOPOLOGIQUE(),sommet(mdd.sommet),arete(mdd.arete),t(mdd.t) |
52 |
|
|
{ |
53 |
|
|
} |
54 |
|
|
|
55 |
|
|
|
56 |
|
|
MG_COSOMMET::~MG_COSOMMET() |
57 |
|
|
{ |
58 |
|
|
} |
59 |
|
|
|
60 |
|
|
MG_SOMMET* MG_COSOMMET::get_sommet(void) |
61 |
|
|
{ |
62 |
|
|
return sommet; |
63 |
|
|
} |
64 |
|
|
|
65 |
|
|
MG_ARETE* MG_COSOMMET::get_arete(void) |
66 |
|
|
{ |
67 |
|
|
return arete; |
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
void MG_COSOMMET::change_sommet(MG_SOMMET* som) |
71 |
|
|
{ |
72 |
|
|
sommet=som; |
73 |
|
|
} |
74 |
|
|
|
75 |
|
|
|
76 |
|
|
double MG_COSOMMET::get_t() |
77 |
|
|
{ |
78 |
|
|
return t; |
79 |
|
|
} |
80 |
|
|
|
81 |
|
|
void MG_COSOMMET::enregistrer(std::ostream& o) |
82 |
|
|
{ |
83 |
|
|
if (arete->get_cosommet1()==this) |
84 |
|
|
o << "%" << get_id() << "=COSOMMET($"<< sommet->get_id() << ",$"<<arete->get_id() << ",1);" << std::endl; |
85 |
|
|
if (arete->get_cosommet2()==this) |
86 |
|
|
o << "%" << get_id() << "=COSOMMET($"<< sommet->get_id() << ",$"<<arete->get_id() << ",2);" << std::endl; |
87 |
|
|
|
88 |
|
|
} |
89 |
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
|