MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
mg_cosommet.cpp
Aller à la documentation de ce fichier.
1 //####//------------------------------------------------------------
2 //####//------------------------------------------------------------
3 //####// MAGiC
4 //####// Jean Christophe Cuilliere et Vincent FRANCOIS
5 //####// Departement de Genie Mecanique - UQTR
6 //####//------------------------------------------------------------
7 //####// MAGIC est un projet de recherche de l equipe ERICCA
8 //####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres
9 //####// http://www.uqtr.ca/ericca
10 //####// http://www.uqtr.ca/
11 //####//------------------------------------------------------------
12 //####//------------------------------------------------------------
13 //####//
14 //####// mg_cosommet.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:54 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 
23 
24 #include "gestionversion.h"
25 #include "mg_cosommet.h"
26 #include <math.h>
27 
28 
29 
30 MG_COSOMMET::MG_COSOMMET(unsigned long num,MG_SOMMET* mgsom,MG_ARETE* mgarete,double precision):MG_ELEMENT_COTOPOLOGIQUE(num),sommet(mgsom),arete(mgarete)
31 {
32  static int compteur=0;
33  compteur++;
34  if (sommet==NULL) return ;
35  if (arete==NULL) return ;
36  double coo[3];
37  sommet->get_point()->evaluer(coo);
38  arete->inverser(t,coo,precision);
39  if (t<-1e300)
40  {
41  std::cerr << std::endl;
42  std::cerr << "**********************************************************" << std::endl;
43  std::cerr << " ERREUR!!!!!. Problème de projection pour les cosommets" << std::endl;
44  std::cerr << "**********************************************************" << std::endl;
45  }
46 }
47 
48 
49 MG_COSOMMET::MG_COSOMMET(MG_SOMMET* mgsom,MG_ARETE* mgarete,double precision):MG_ELEMENT_COTOPOLOGIQUE(),sommet(mgsom),arete(mgarete)
50 {
51  static int compteur=0;
52  compteur++;
53  if (sommet==NULL) return ;
54  if (arete==NULL) return ;
55  double coo[3];
56  sommet->get_point()->evaluer(coo);
57  arete->inverser(t,coo,precision);
58  if (t<-1e300)
59  {
60  std::cerr << std::endl;
61  std::cerr << "**********************************************************" << std::endl;
62  std::cerr << " ERREUR!!!!!. Problème de projection pour les cosommets" << std::endl;
63  std::cerr << "**********************************************************" << std::endl;
64  }
65 }
66 
67 
68 MG_COSOMMET::MG_COSOMMET(MG_COSOMMET& mdd):MG_ELEMENT_COTOPOLOGIQUE(),sommet(mdd.sommet),arete(mdd.arete),t(mdd.t)
69 {
70 }
71 
72 
74 {
75 }
76 
78 {
79  return TYPE_ELEMENT_COTOPOLOGIQUE::COSOMMET;
80 }
81 
82 
84 {
85  return sommet;
86 }
87 
89 {
90  return arete;
91 }
92 
94 {
95  sommet=som;
96 }
97 
98 
100 {
101  return t;
102 }
103 
104 void MG_COSOMMET::enregistrer(std::ostream& o,double version)
105 {
106  if (arete->get_cosommet1()==this)
107  o << "%" << get_id() << "=COSOMMET($"<< sommet->get_id() << ",$"<<arete->get_id() << ",1);" << std::endl;
108  if (arete->get_cosommet2()==this)
109  o << "%" << get_id() << "=COSOMMET($"<< sommet->get_id() << ",$"<<arete->get_id() << ",2);" << std::endl;
110 
111 }
112 
113 
114 
115 
MG_ARETE::get_cosommet2
virtual class MG_COSOMMET * get_cosommet2(void)
Definition: mg_arete.cpp:85
gestionversion.h
MG_COSOMMET::change_sommet
virtual void change_sommet(MG_SOMMET *som)
Definition: mg_cosommet.cpp:93
MG_COSOMMET::sommet
class MG_SOMMET * sommet
Definition: mg_cosommet.h:47
MG_IDENTIFICATEUR::get_id
unsigned long get_id()
Definition: mg_identificateur.cpp:53
MG_COSOMMET
Definition: mg_cosommet.h:31
MG_COSOMMET::~MG_COSOMMET
virtual ~MG_COSOMMET()
Definition: mg_cosommet.cpp:73
MG_COSOMMET::t
double t
Definition: mg_cosommet.h:49
MG_ARETE::inverser
virtual void inverser(double &t, double *xyz, double precision=1e-6)
Definition: mg_arete.cpp:173
MG_COSOMMET::get_arete
virtual MG_ARETE * get_arete(void)
Definition: mg_cosommet.cpp:88
MG_SOMMET::get_point
virtual MG_POINT * get_point(void)
Definition: mg_sommet.cpp:52
MG_ELEMENT_COTOPOLOGIQUE
Definition: mg_element_cotopologique.h:30
MG_COSOMMET::get_sommet
virtual MG_SOMMET * get_sommet(void)
Definition: mg_cosommet.cpp:83
MG_COSOMMET::get_t
double get_t()
Definition: mg_cosommet.cpp:99
MG_COSOMMET::MG_COSOMMET
MG_COSOMMET(unsigned long num, class MG_SOMMET *mgsom, class MG_ARETE *mgarete, double precision=1e-6)
Definition: mg_cosommet.cpp:30
mg_cosommet.h
MG_COSOMMET::enregistrer
virtual void enregistrer(std::ostream &o, double version)
Definition: mg_cosommet.cpp:104
MG_ARETE
Definition: mg_arete.h:36
MG_ARETE::get_cosommet1
virtual class MG_COSOMMET * get_cosommet1(void)
Definition: mg_arete.cpp:81
MG_SOMMET
Definition: mg_sommet.h:35
MG_COSOMMET::get_type
virtual int get_type(void)
Definition: mg_cosommet.cpp:77
MG_COSOMMET::arete
class MG_ARETE * arete
Definition: mg_cosommet.h:48
MG_POINT::evaluer
virtual void evaluer(double *xyz)=0