ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/mtu/src/mg_cosommet.cpp
Revision: 1158
Committed: Thu Jun 13 22:18:49 2024 UTC (11 months, 1 week ago) by francois
File size: 3411 byte(s)
Log Message:
compatibilité Ubuntu 22.04
Suppression des refeences à Windows
Ajout d'une banière

File Contents

# User Rev Content
1 francois 1158 //####//------------------------------------------------------------
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 francois 283
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 francois 641 static int compteur=0;
33     compteur++;
34 francois 283 if (sommet==NULL) return ;
35     if (arete==NULL) return ;
36     double coo[3];
37     sommet->get_point()->evaluer(coo);
38 francois 641 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 francois 283 }
47    
48    
49     MG_COSOMMET::MG_COSOMMET(MG_SOMMET* mgsom,MG_ARETE* mgarete,double precision):MG_ELEMENT_COTOPOLOGIQUE(),sommet(mgsom),arete(mgarete)
50     {
51 francois 641 static int compteur=0;
52     compteur++;
53 francois 283 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 francois 641 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 francois 283 }
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    
73     MG_COSOMMET::~MG_COSOMMET()
74     {
75     }
76    
77 couturad 906 int MG_COSOMMET::get_type(void)
78     {
79     return TYPE_ELEMENT_COTOPOLOGIQUE::COSOMMET;
80     }
81    
82    
83 francois 283 MG_SOMMET* MG_COSOMMET::get_sommet(void)
84     {
85     return sommet;
86     }
87    
88     MG_ARETE* MG_COSOMMET::get_arete(void)
89     {
90     return arete;
91     }
92    
93     void MG_COSOMMET::change_sommet(MG_SOMMET* som)
94     {
95     sommet=som;
96     }
97    
98    
99     double MG_COSOMMET::get_t()
100     {
101     return t;
102     }
103    
104 francois 763 void MG_COSOMMET::enregistrer(std::ostream& o,double version)
105 francois 283 {
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