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 |
francois |
641 |
static int compteur=0; |
34 |
|
|
compteur++; |
35 |
francois |
283 |
if (sommet==NULL) return ; |
36 |
|
|
if (arete==NULL) return ; |
37 |
|
|
double coo[3]; |
38 |
|
|
sommet->get_point()->evaluer(coo); |
39 |
francois |
641 |
arete->inverser(t,coo,precision); |
40 |
|
|
if (t<-1e300) |
41 |
|
|
{ |
42 |
|
|
std::cerr << std::endl; |
43 |
|
|
std::cerr << "**********************************************************" << std::endl; |
44 |
|
|
std::cerr << " ERREUR!!!!!. Problème de projection pour les cosommets" << std::endl; |
45 |
|
|
std::cerr << "**********************************************************" << std::endl; |
46 |
|
|
} |
47 |
francois |
283 |
} |
48 |
|
|
|
49 |
|
|
|
50 |
|
|
MG_COSOMMET::MG_COSOMMET(MG_SOMMET* mgsom,MG_ARETE* mgarete,double precision):MG_ELEMENT_COTOPOLOGIQUE(),sommet(mgsom),arete(mgarete) |
51 |
|
|
{ |
52 |
francois |
641 |
static int compteur=0; |
53 |
|
|
compteur++; |
54 |
francois |
283 |
if (sommet==NULL) return ; |
55 |
|
|
if (arete==NULL) return ; |
56 |
|
|
double coo[3]; |
57 |
|
|
sommet->get_point()->evaluer(coo); |
58 |
|
|
arete->inverser(t,coo,precision); |
59 |
francois |
641 |
if (t<-1e300) |
60 |
|
|
{ |
61 |
|
|
std::cerr << std::endl; |
62 |
|
|
std::cerr << "**********************************************************" << std::endl; |
63 |
|
|
std::cerr << " ERREUR!!!!!. Problème de projection pour les cosommets" << std::endl; |
64 |
|
|
std::cerr << "**********************************************************" << std::endl; |
65 |
|
|
} |
66 |
francois |
283 |
} |
67 |
|
|
|
68 |
|
|
|
69 |
|
|
MG_COSOMMET::MG_COSOMMET(MG_COSOMMET& mdd):MG_ELEMENT_COTOPOLOGIQUE(),sommet(mdd.sommet),arete(mdd.arete),t(mdd.t) |
70 |
|
|
{ |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
|
74 |
|
|
MG_COSOMMET::~MG_COSOMMET() |
75 |
|
|
{ |
76 |
|
|
} |
77 |
|
|
|
78 |
|
|
MG_SOMMET* MG_COSOMMET::get_sommet(void) |
79 |
|
|
{ |
80 |
|
|
return sommet; |
81 |
|
|
} |
82 |
|
|
|
83 |
|
|
MG_ARETE* MG_COSOMMET::get_arete(void) |
84 |
|
|
{ |
85 |
|
|
return arete; |
86 |
|
|
} |
87 |
|
|
|
88 |
|
|
void MG_COSOMMET::change_sommet(MG_SOMMET* som) |
89 |
|
|
{ |
90 |
|
|
sommet=som; |
91 |
|
|
} |
92 |
|
|
|
93 |
|
|
|
94 |
|
|
double MG_COSOMMET::get_t() |
95 |
|
|
{ |
96 |
|
|
return t; |
97 |
|
|
} |
98 |
|
|
|
99 |
francois |
763 |
void MG_COSOMMET::enregistrer(std::ostream& o,double version) |
100 |
francois |
283 |
{ |
101 |
|
|
if (arete->get_cosommet1()==this) |
102 |
|
|
o << "%" << get_id() << "=COSOMMET($"<< sommet->get_id() << ",$"<<arete->get_id() << ",1);" << std::endl; |
103 |
|
|
if (arete->get_cosommet2()==this) |
104 |
|
|
o << "%" << get_id() << "=COSOMMET($"<< sommet->get_id() << ",$"<<arete->get_id() << ",2);" << std::endl; |
105 |
|
|
|
106 |
|
|
} |
107 |
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
|