ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/mg_sommet.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_sommet.cpp
File size: 2794 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_sommet.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_sommet.h"
27     //#include "affiche.h"
28     //#include "message.h"
29    
30    
31    
32     MG_SOMMET::MG_SOMMET(std::string idori,unsigned long num,MG_POINT* mgpt):MG_ELEMENT_TOPOLOGIQUE(num,idori),point(mgpt)
33     {
34     }
35    
36    
37     MG_SOMMET::MG_SOMMET(std::string idori,MG_POINT* mgpt):MG_ELEMENT_TOPOLOGIQUE(idori),point(mgpt)
38     {
39     }
40    
41    
42    
43     MG_SOMMET::MG_SOMMET(MG_SOMMET& mdd):MG_ELEMENT_TOPOLOGIQUE(mdd),point(mdd.point)
44     {
45     }
46    
47    
48     MG_SOMMET::~MG_SOMMET()
49     {
50     // if (lst_cosommet.size()!=0) afficheur << WARCOSOMMET << this->get_id() << enderr;
51     }
52    
53    
54     MG_POINT* MG_SOMMET::get_point(void)
55     {
56     return point;
57     }
58    
59    
60    
61     void MG_SOMMET::ajouter_mg_cosommet(class MG_COSOMMET* cosom)
62     {
63     lst_cosommet.insert(lst_cosommet.end(),cosom);
64     }
65    
66     int MG_SOMMET::get_nb_mg_cosommet(void)
67     {
68     return lst_cosommet.size();
69     }
70    
71    
72     void MG_SOMMET::supprimer_mg_cosommet(class MG_COSOMMET* cosom)
73     {
74     std::vector<MG_COSOMMET*>::iterator i;
75     for (i=lst_cosommet.begin();i!=lst_cosommet.end();i++)
76     {
77     if ((*i)==cosom)
78     {
79     lst_cosommet.erase(i);
80     return;
81     }
82     }
83     }
84    
85    
86    
87     MG_COSOMMET* MG_SOMMET::get_mg_cosommet(int num)
88     {
89     return lst_cosommet[num];
90     }
91    
92     int MG_SOMMET::get_dimension(void)
93     {
94     return 0;
95     }
96    
97     void MG_SOMMET::enregistrer(std::ostream& o)
98     {
99     int nb=get_nb_ccf();
100     o <<"%" << get_id() << "=SOMMET("<< get_idoriginal() << ",$" << point->get_id() << "," << nb;
101     if (nb!=0)
102     {
103     o << ",(";
104     for (int i=0;i<nb;i++)
105     {
106     char nom[3];
107     get_type_ccf(i,nom);
108     o << "(" << nom << "," << get_valeur_ccf(i) << ")";
109     if (i!=nb-1) o << "," ;
110     }
111     o << ")";
112     }
113     o << ");" << std::endl;
114     }
115    
116    
117