ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/mtu/src/mg_sommet.cpp
Revision: 1180
Committed: Fri Sep 20 20:10:22 2024 UTC (7 months, 4 weeks ago) by francois
File size: 3443 byte(s)
Log Message:
Correction dans la quadratisation sans geometrie

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_sommet.cpp
15     //####//
16     //####//------------------------------------------------------------
17     //####//------------------------------------------------------------
18     //####// COPYRIGHT 2000-2024
19     //####// jeu 13 jun 2024 11:58:55 EDT
20     //####//------------------------------------------------------------
21     //####//------------------------------------------------------------
22 francois 283
23    
24     #include "gestionversion.h"
25     #include "mg_sommet.h"
26     #include "vct_sommet.h"
27    
28    
29    
30 couturad 814 MG_SOMMET::MG_SOMMET(std::string idori,unsigned long num,MG_POINT* mgpt):MG_ELEMENT_TOPOLOGIQUE(num,idori),point(mgpt),vect(NULL),pole(false)
31 francois 283 {
32     }
33    
34    
35 couturad 814 MG_SOMMET::MG_SOMMET(std::string idori,MG_POINT* mgpt):MG_ELEMENT_TOPOLOGIQUE(idori),point(mgpt),vect(NULL),pole(false)
36 francois 283 {
37     }
38    
39    
40    
41 couturad 814 MG_SOMMET::MG_SOMMET(MG_SOMMET& mdd):MG_ELEMENT_TOPOLOGIQUE(mdd),point(mdd.point),vect(NULL),pole(mdd.pole)
42 francois 283 {
43     }
44    
45    
46     MG_SOMMET::~MG_SOMMET()
47     {
48     if (vect!=NULL) delete vect;
49     }
50    
51    
52     MG_POINT* MG_SOMMET::get_point(void)
53     {
54     return point;
55     }
56    
57    
58    
59     void MG_SOMMET::ajouter_mg_cosommet(class MG_COSOMMET* cosom)
60     {
61     lst_cosommet.insert(lst_cosommet.end(),cosom);
62     }
63    
64     int MG_SOMMET::get_nb_mg_cosommet(void)
65     {
66     return lst_cosommet.size();
67     }
68    
69    
70     void MG_SOMMET::supprimer_mg_cosommet(class MG_COSOMMET* cosom)
71     {
72     std::vector<MG_COSOMMET*>::iterator i;
73     for (i=lst_cosommet.begin();i!=lst_cosommet.end();i++)
74     {
75     if ((*i)==cosom)
76     {
77     lst_cosommet.erase(i);
78     return;
79     }
80     }
81     }
82    
83     void MG_SOMMET::get_topologie_sousjacente(TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> *lst)
84     {
85     }
86    
87    
88     MG_COSOMMET* MG_SOMMET::get_mg_cosommet(int num)
89     {
90     return lst_cosommet[num];
91     }
92    
93     int MG_SOMMET::get_dimension(void)
94     {
95     return 0;
96     }
97    
98 couturad 906 int MG_SOMMET::get_type(void)
99     {
100     return TYPE_ELEMENT_TOPOLOGIQUE::SOMMET;
101     }
102    
103 francois 283 VCT& MG_SOMMET::get_vectorisation(void)
104     {
105     if (vect==NULL) vect=new VCT_SOMMET(this);
106     return *vect;
107     }
108 francois 526
109    
110 francois 1180 bool MG_SOMMET::est_une_topo_element(void)
111 francois 526 {
112     return false;
113     }
114 couturad 814
115     bool MG_SOMMET::est_pole(void)
116     {
117     return pole;
118     }
119     void MG_SOMMET::change_pole(bool val)
120     {
121     pole=val;
122     }
123    
124 francois 1095 BOITE_3D MG_SOMMET::get_boite_3D(void)
125 couturad 911 {
126     return get_point()->get_boite_3D();
127     }
128    
129 francois 763 void MG_SOMMET::enregistrer(std::ostream& o,double version)
130 francois 283 {
131     int nb=get_nb_ccf();
132 francois 763 o <<"%" << get_id() << "=SOMMET("<< get_idoriginal() << ",$" << point->get_id() << "," ;
133 couturad 814 if (pole) o << "1,"; else o << "0,";
134 francois 763 if (version<2)
135     {
136     o << nb;
137 francois 283 if (nb!=0)
138     {
139     o << ",(";
140     for (int i=0;i<nb;i++)
141     {
142     char nom[3];
143     get_type_ccf(i,nom);
144     o << "(" << nom << "," << get_valeur_ccf(i) << ")";
145     if (i!=nb-1) o << "," ;
146     }
147     o << ")";
148     }
149 francois 763 }
150     else enregistrer_ccf(o,version);
151 francois 283 o << ");" << std::endl;
152     }
153    
154    
155