MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
pir_import.h
Aller à la documentation de ce fichier.
1 //####//------------------------------------------------------------
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 //####// pir_import.h
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:54 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 #ifdef BREP_PIRATE
23 #ifndef _PIRIMPORT_
24 #define _PIRIMPORT_
25 
26 
27 
28 
29 
30 #include <vector>
31 #include "TPL_RELATION_ENTITE.h"
32 #include "mg_gestionnaire.h"
33 #include "pggeo.h"
34 #include "pgvolume.h"
35 #include "pifich.h"
36 
37 
38 
39 class PIR_IMPORT
40 {
41 public:
42  PIR_IMPORT();
43  virtual ~PIR_IMPORT();
44  MG_GEOMETRIE* importer(MG_GESTIONNAIRE& gest,PI_FICHIER_IMPORT& fichier,char *geo,int *volume=NULL);
45  void transferer_noeud(MG_MAILLAGE& mgmai,PM_MAILLAGE& pmmai);
46  void transferer_maillage_arete(MG_GEOMETRIE& mggeo,PM_MAILLAGE& mai,int *arete=NULL);
47  void transferer_maillage_face(MG_GEOMETRIE& mggeo,PM_MAILLAGE& mai,int *face=NULL);
48 
49 private:
50  void importer_volume(MG_GEOMETRIE* mggeo,PG_GEOMETRIE* pggeo,PG_VOLUME* pgvoldesire=NULL);
51 
52  void relation(PG_FACE* ent1,MG_FACE* ent2) {
54  r.a=ent1;
55  r.b=ent2;
56  lst_face.insert(lst_face.end(),r);
57  };
58  void relation(PG_SURFACE* ent1,MG_SURFACE* ent2) {
60  r.a=ent1;
61  r.b=ent2;
62  lst_surface.insert(lst_surface.end(),r);
63  };
64  void relation(PG_ARETE* ent1,MG_ARETE* ent2) {
66  r.a=ent1;
67  r.b=ent2;
68  lst_arete.insert(lst_arete.end(),r);
69  };
70  void relation(PG_COURBE* ent1,MG_COURBE* ent2) {
72  r.a=ent1;
73  r.b=ent2;
74  lst_courbe.insert(lst_courbe.end(),r);
75  };
76  void relation(PG_SOMMET* ent1,MG_SOMMET* ent2) {
78  r.a=ent1;
79  r.b=ent2;
80  lst_sommet.insert(lst_sommet.end(),r);
81  };
82 
83 
84  // face
85  MG_FACE* trouver(PG_FACE* face)
86  {
87  std::vector<TPL_RELATION_ENTITE<PG_FACE,MG_FACE> >::iterator i;
88  for (i=lst_face.begin();i!=lst_face.end();i++)
89  if ((*i).a==face) return (*i).b;
90  return NULL;
91  };
92 
93  PG_FACE* trouver(MG_FACE* face)
94  {
95  std::vector<TPL_RELATION_ENTITE<PG_FACE,MG_FACE> >::iterator i;
96  for (i=lst_face.begin();i!=lst_face.end();i++)
97  if ((*i).b==face) return (*i).a;
98  return NULL;
99  };
100 
101  // surface
102  MG_SURFACE* trouver(PG_SURFACE* surface)
103  {
104  std::vector<TPL_RELATION_ENTITE<PG_SURFACE,MG_SURFACE> >::iterator i;
105  for (i=lst_surface.begin();i!=lst_surface.end();i++)
106  if ((*i).a==surface) return (*i).b;
107  return NULL;
108  };
109 
110  PG_SURFACE* trouver(MG_SURFACE* surface)
111  {
112  std::vector<TPL_RELATION_ENTITE<PG_SURFACE,MG_SURFACE> >::iterator i;
113  for (i=lst_surface.begin();i!=lst_surface.end();i++)
114  if ((*i).b==surface) return (*i).a;
115  return NULL;
116  };
117 
118  //arete
119  MG_ARETE* trouver(PG_ARETE* arete)
120  {
121  std::vector<TPL_RELATION_ENTITE<PG_ARETE,MG_ARETE> >::iterator i;
122  for (i=lst_arete.begin();i!=lst_arete.end();i++)
123  if ((*i).a==arete) return (*i).b;
124  return NULL;
125  };
126 
127  PG_ARETE* trouver(MG_ARETE* arete)
128  {
129  std::vector<TPL_RELATION_ENTITE<PG_ARETE,MG_ARETE> >::iterator i;
130  for (i=lst_arete.begin();i!=lst_arete.end();i++)
131  if ((*i).b==arete) return (*i).a;
132  return NULL;
133  };
134 
135  // courbe
136  MG_COURBE* trouver(PG_COURBE* courbe)
137  {
138  std::vector<TPL_RELATION_ENTITE<PG_COURBE,MG_COURBE> >::iterator i;
139  for (i=lst_courbe.begin();i!=lst_courbe.end();i++)
140  if ((*i).a==courbe) return (*i).b;
141  return NULL;
142  };
143 
144  PG_COURBE* trouver(MG_COURBE* courbe)
145  {
146  std::vector<TPL_RELATION_ENTITE<PG_COURBE,MG_COURBE> >::iterator i;
147  for (i=lst_courbe.begin();i!=lst_courbe.end();i++)
148  if ((*i).b==courbe) return (*i).a;
149  return NULL;
150  };
151 
152  //sommet
153 
154  MG_SOMMET* trouver(PG_SOMMET* sommet)
155  {
156  std::vector<TPL_RELATION_ENTITE<PG_SOMMET,MG_SOMMET> >::iterator i;
157  for (i=lst_sommet.begin();i!=lst_sommet.end();i++)
158  if ((*i).a==sommet) return (*i).b;
159  return NULL;
160  };
161 
162  PG_SOMMET* trouver(MG_SOMMET* sommet)
163  {
164  std::vector<TPL_RELATION_ENTITE<PG_SOMMET,MG_SOMMET> >::iterator i;
165  for (i=lst_sommet.begin();i!=lst_sommet.end();i++)
166  if ((*i).b==sommet) return (*i).a;
167  return NULL;
168  };
169 
170  std::vector<TPL_RELATION_ENTITE<PG_FACE,MG_FACE> > lst_face;
171  std::vector<TPL_RELATION_ENTITE<PG_SURFACE,MG_SURFACE> > lst_surface;
172  std::vector<TPL_RELATION_ENTITE<PG_ARETE,MG_ARETE> > lst_arete;
173  std::vector<TPL_RELATION_ENTITE<PG_COURBE,MG_COURBE> > lst_courbe;
174  std::vector<TPL_RELATION_ENTITE<PG_SOMMET,MG_SOMMET> > lst_sommet;
175 
176 
177 
178 
179 
180 };
181 
182 #endif
183 #endif
184 
185 
186