ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/mg_cosommet.cpp
Revision: 5
Committed: Tue Jun 12 20:26:34 2007 UTC (17 years, 11 months ago)
Original Path: magic/lib/geometrie/geometrie/src/mg_cosommet.cpp
File size: 2346 byte(s)
Log Message:

File Contents

# User Rev Content
1 5 //------------------------------------------------------------
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):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);
38     }
39    
40    
41     MG_COSOMMET::MG_COSOMMET(MG_SOMMET* mgsom,MG_ARETE* mgarete):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);
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     double MG_COSOMMET::get_t()
71     {
72     return t;
73     }
74    
75     void MG_COSOMMET::enregistrer(std::ostream& o)
76     {
77     if (arete->get_cosommet1()==this)
78     o << "%" << get_id() << "=COSOMMET($"<< sommet->get_id() << ",$"<<arete->get_id() << ",1);" << std::endl;
79     if (arete->get_cosommet2()==this)
80     o << "%" << get_id() << "=COSOMMET($"<< sommet->get_id() << ",$"<<arete->get_id() << ",2);" << std::endl;
81    
82     }
83    
84    
85    
86