ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/mg_cosommet.cpp
Revision: 906
Committed: Mon Nov 13 22:30:18 2017 UTC (7 years, 6 months ago) by couturad
File size: 3352 byte(s)
Log Message:
Nouveau opencascade commit 1

File Contents

# User Rev Content
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 couturad 906 int MG_COSOMMET::get_type(void)
79     {
80     return TYPE_ELEMENT_COTOPOLOGIQUE::COSOMMET;
81     }
82    
83    
84 francois 283 MG_SOMMET* MG_COSOMMET::get_sommet(void)
85     {
86     return sommet;
87     }
88    
89     MG_ARETE* MG_COSOMMET::get_arete(void)
90     {
91     return arete;
92     }
93    
94     void MG_COSOMMET::change_sommet(MG_SOMMET* som)
95     {
96     sommet=som;
97     }
98    
99    
100     double MG_COSOMMET::get_t()
101     {
102     return t;
103     }
104    
105 francois 763 void MG_COSOMMET::enregistrer(std::ostream& o,double version)
106 francois 283 {
107     if (arete->get_cosommet1()==this)
108     o << "%" << get_id() << "=COSOMMET($"<< sommet->get_id() << ",$"<<arete->get_id() << ",1);" << std::endl;
109     if (arete->get_cosommet2()==this)
110     o << "%" << get_id() << "=COSOMMET($"<< sommet->get_id() << ",$"<<arete->get_id() << ",2);" << std::endl;
111    
112     }
113    
114    
115    
116