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

File Contents

# Content
1 //------------------------------------------------------------
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_coquille.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_coquille.h"
27 #include "mg_coque.h"
28 //#include "message.h"
29
30 MG_COQUILLE::MG_COQUILLE(unsigned long num,class MG_VOLUME* mgvol):MG_ELEMENT_COTOPOLOGIQUE(num),volume(mgvol),coque(NULL)
31 {
32 }
33
34 MG_COQUILLE::MG_COQUILLE(unsigned long num,class MG_COQUE* mgcoq):MG_ELEMENT_COTOPOLOGIQUE(num),volume(NULL),coque(mgcoq)
35 {
36 }
37
38
39 MG_COQUILLE::MG_COQUILLE(class MG_VOLUME* mgvol):MG_ELEMENT_COTOPOLOGIQUE(),volume(mgvol),coque(NULL)
40 {
41 }
42
43 MG_COQUILLE::MG_COQUILLE(class MG_COQUE* mgcoq):MG_ELEMENT_COTOPOLOGIQUE(),volume(NULL),coque(mgcoq)
44 {
45 }
46
47 MG_COQUILLE::MG_COQUILLE(long unsigned int num): MG_ELEMENT_COTOPOLOGIQUE(num),volume(NULL),coque(NULL)
48 {
49 }
50
51
52 MG_COQUILLE::MG_COQUILLE():MG_ELEMENT_COTOPOLOGIQUE(),volume(NULL),coque(NULL)
53 {
54 }
55
56
57
58 MG_COQUILLE::MG_COQUILLE(MG_COQUILLE& mdd):MG_ELEMENT_COTOPOLOGIQUE(),volume(mdd.volume),lst_coface(mdd.lst_coface),coque(mdd.coque)
59 {
60 }
61
62
63 MG_COQUILLE::~MG_COQUILLE()
64 {
65 }
66
67 int MG_COQUILLE::get_type(void)
68 {
69 return TYPE_ELEMENT_COTOPOLOGIQUE::COQUILLE;
70 }
71
72
73 void MG_COQUILLE::ajouter_mg_coface(class MG_COFACE* mgcoface)
74 {
75 lst_coface.insert(lst_coface.end(),mgcoface);
76 }
77
78 int MG_COQUILLE::get_nb_mg_coface(void)
79 {
80 return lst_coface.size();
81 }
82
83 MG_VOLUME* MG_COQUILLE::get_mg_volume(void)
84 {
85 return volume;
86 }
87
88 MG_COQUE* MG_COQUILLE::get_mg_coque(void)
89 {
90 return coque;
91 }
92 MG_COFACE* MG_COQUILLE::get_mg_coface(int num)
93 {
94 return lst_coface[num];
95 }
96
97 MG_COFACE* MG_COQUILLE::get_mg_cofaceid(int num)
98 {
99 for (std::vector<MG_COFACE*>::iterator it=lst_coface.begin();it!=lst_coface.end();it++)
100 if ((*it)->get_id()==num) return *it;
101 return NULL;
102
103 }
104
105 void MG_COQUILLE::supprimer_mg_coface(class MG_COFACE* mgcoface)
106 {
107 std::vector<MG_COFACE*>::iterator i;
108 for (i=lst_coface.begin();i!=lst_coface.end();i++)
109 {
110 if ((*i)==mgcoface)
111 {
112 lst_coface.erase(i);
113 return;
114 }
115 }
116 }
117
118
119 void MG_COQUILLE::enregistrer(std::ostream& o,double version)
120 {
121 if (volume!=NULL)
122 {
123 o << "%" << get_id() << "=COQUILLE($"<< volume->get_id() << ",(";
124 }
125 if (coque!=NULL) o << "%" << get_id() << "=COQUILLE($"<< coque->get_id() << ",(";
126 for (unsigned int i=0;i<lst_coface.size();i++)
127 {
128 o << "$" << lst_coface[i]->get_id();
129 if (i!=lst_coface.size()-1) o << ",";
130 else o << ")";
131 }
132 o << ");" << std::endl;
133 }
134
135
136