ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/reconstruction/src/occ_fonction.cpp
Revision: 5
Committed: Tue Jun 12 20:26:34 2007 UTC (17 years, 11 months ago)
Original Path: magic/lib/reconstruction/reconstruction/src/OCC_fonction.cpp
File size: 12365 byte(s)
Log Message:

File Contents

# User Rev Content
1 5 //---------------------------------------------------------------------------
2     #include "gestionversion.h"
3    
4     #pragma hdrstop
5    
6     #include "OCC_fonction.h"
7     #include "tpl_map_entite.h"
8     #include <atl\atlmod.h>
9    
10     //---------------------------------------------------------------------------
11    
12     #pragma package(smart_init)
13    
14     //OCC_FONCTION fonction;
15    
16     OCC_FONCTION::OCC_FONCTION()
17     {
18     char name[500];
19     DWORD type,taille;
20     HKEY clef;
21     RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\UQTR\\VMM\\",0,KEY_EXECUTE,&clef);
22     RegQueryValueEx(clef,"pathmodule",0,&type,0,&taille);
23     RegQueryValueEx(clef,"pathmodule",0,&type,name,&taille);
24     strcat(name,"\\OCC_Fonction.dll");
25     HANDLE h=LoadLibrary(name);
26    
27    
28     CC=(int(*)())GetProcAddress(h,"Creer_Coquille");
29     AFC=(int(*)())GetProcAddress(h,"Ajouter_face_Coquille");
30     Enr=(int(*)(char* path1))GetProcAddress(h,"Sauvegarder");
31     CSP=(int(*)(double Pnt_Inser[3], double Vect_Nor[3]))GetProcAddress(h,"Creer_Surf_Plane");
32     ACF=(int(*)(int ii))GetProcAddress(h,"Ajouter_Contour_Face");
33     EF=(int(*)(char *path1))GetProcAddress(h,"Sauvegarder_Face");
34     CSC=(int(*)(double Pnt_Inser[], double Vect_Direc[], double R))GetProcAddress(h,"Creer_Surface_Cylindrique");
35     CSCo=(int(*)(double Pnt_Inser[], double Vect_Direc[], double R, double Ang))GetProcAddress(h,"Creer_Surface_Conique");
36     CST=(int(*)(double Pnt_Inser[], double Vect_Direc[], double GR, double PR))GetProcAddress(h,"Creer_Surface_Torique");
37     CSS=(int(*)(double Pnt_Inser[], double Vect_Direc[], double R))GetProcAddress(h,"Creer_Surface_Spherique");
38     IS=(int(*)(void))GetProcAddress(h,"Initialiser_Surface");
39     RSP=(int(*)(double x, double y, double z))GetProcAddress(h,"Rapprocher_Surface_Point");
40     CalS=(int(*)(void))GetProcAddress(h,"Calculer_Surface");
41     DetS=(int(*)(void))GetProcAddress(h,"Determiner_Surface");
42     ICC=(int(*)(void))GetProcAddress(h,"Initialiser_Contour_Contraint");
43     APC=(int(*)(double x, double y, double z, int i))GetProcAddress(h,"Ajouter_Point_Courbe");
44     ACCC=(int(*)(int nb_points))GetProcAddress(h,"Ajouter_Courbe_Contour_Contraint");
45     RSC=(int(*)(void))GetProcAddress(h,"Rapprocher_Surface_Contour");
46     CCurv=(int(*)(double xx, double yy, double zz, int ii))GetProcAddress(h,"Construire_Courbe");
47     ACl=(int(*)(int nb_points, int num))GetProcAddress(h,"Ajouter_courbe_liste");
48     CSAC=(int(*)(int nb))GetProcAddress(h,"Construire_Surface_Contour");
49     CS=(int(*)(void))GetProcAddress(h,"Convertir_Surface");
50     CFS=(int(*)(void))GetProcAddress(h,"Creer_Face_Surface");
51     CCont=(int(*)(void))GetProcAddress(h,"Creer_Contour");
52     CAL=(int(*)(double Point1[3], double Point2[3]))GetProcAddress(h,"Creer_Arete_Lineaire");
53     CAC=(int(*)(double Pnt_Inser[3],double Normale[3], double Point1[3], double Point2[3], double R))GetProcAddress(h,"Creer_Arete_Circulaire");
54     CAE=(int(*)(double Pnt_Inser[3], double Point1[3], double Point2[3], double GR, double PR))GetProcAddress(h,"Creer_Arete_Elliptique");
55     APA=(int(*)(double xx, double yy, double zz, int ii))GetProcAddress(h,"Ajouter_Point_Arete");
56     CAS=(int(*)(int nbpts))GetProcAddress(h,"Construire_Arete_Spline");
57     EA=(int(*)(char *path1))GetProcAddress(h,"Sauvegarder_Arete");
58    
59     RapSCS=(int(*)(int nb))GetProcAddress(h,"Rapprocher_Surface_Courbe_Spline");
60     AAC=(int(*)(int nb))GetProcAddress(h,"Ajouter_Arete_Contour");
61     ISC=(int(*)(double Pnt_Inser[], double Vect_Direc[], double R))GetProcAddress(h,"Initialiser_Surface_Cylindrique");
62     ISS=(int(*)(void))GetProcAddress(h,"Initialiser_Surface_Surface");
63    
64    
65     APAI=(int(*)(double x, double y, double z, int i))GetProcAddress(h,"Ajouter_Point_Array_Ideal");
66     DPB=(int(*)(int i))GetProcAddress(h,"Determiner_Param_Boite");
67     GPB=(double(*)(int i))GetProcAddress(h,"Get_Param_Boite");
68     DP=(int(*)(int nb, double Epsilon))GetProcAddress(h,"Determiner_Plan");
69    
70     LR=(int(*)(double Pnt_Inser[], double Vect_Direc[]))GetProcAddress(h,"Ligne_Revolution");
71     DPC=(double(*)(double x, double y, double z))GetProcAddress(h,"Distance_Point_Curve");
72     PPL=(int(*)(void))GetProcAddress(h,"Pt_Proj_Ligne");
73     PnPL=(double(*)(int ii))GetProcAddress(h,"Pnt_Proj_Ligne");
74     GCT=(int(*)(double Pnt_Insersion[3], double Vect_Directeur[3],double Rayon))GetProcAddress(h,"GCercle_Tore");
75    
76     CSCR=(int(*)(double Pnt_Insersion[3], double Vect_Directeur[3],double Vecteur1[3],double Rayon))GetProcAddress(h,"Creer_Surface_Cylindrique_Revolution");
77     FR=(int(*)(void))GetProcAddress(h,"Face_Revolution");
78    
79    
80    
81     ASlI=(int(*)(int num))GetProcAddress(h,"Ajouter_Surface_liste_Ideal");
82     PPSI=(int(*)(double x, double y,double z, int num))GetProcAddress(h,"Projeter_Point_Surface_Idealisee");
83     PPSId=(int(*)(void))GetProcAddress(h,"Pt_Proj_Surface_Ideal");
84     PPSIde=(double(*)(int ii))GetProcAddress(h,"Pnt_Proj_Surface_Ideal");
85    
86    
87     }
88    
89     OCC_FONCTION::~OCC_FONCTION()
90     {
91     }
92     //********************************** Classe Reconstruction generale ************
93     int OCC_FONCTION::Creer_Coquille()
94     {
95     c=(*CC)();
96     return c;
97    
98     }
99     int OCC_FONCTION::Ajouter_face_Coquille()
100     {
101     c=(*AFC)();
102     return c;
103     }
104     int OCC_FONCTION::Enregistrer(char* path)
105     {
106     c=(*Enr)(path);
107     return c;
108     }
109     //************************************ Classe Face Plane ***********************
110     int OCC_FONCTION::Creer_Surf_Plane(double Pnt_Insersion[3], double Vect_Normal[3])
111     {
112     c=(*CSP)(Pnt_Insersion,Vect_Normal);
113     return c;
114     }
115    
116     int OCC_FONCTION::Ajouter_Contour_Face(int ii)
117     {
118     c=(*ACF)(ii);
119     return c;
120     }
121    
122     int OCC_FONCTION::Enregistrer_Face(char *path)
123     {
124     c=(*EF)(path);
125     return c;
126     }
127     //************************************* Classe Face Cylindrique ****************
128     int OCC_FONCTION::Creer_Surface_Cylindrique(double Pnt_Insersion[3], double Vect_Directeur[3],double Rayon)
129     {
130     c=(*CSC)(Pnt_Insersion,Vect_Directeur,Rayon);
131     return c;
132     }
133     //************************************* Classe Face Conique ********************
134     int OCC_FONCTION::Creer_Surface_Conique(double Pnt_Insersion[3], double Vect_Directeur[3],double Rayon, double Angle)
135     {
136     c=(*CSCo)(Pnt_Insersion,Vect_Directeur,Rayon, Angle);
137     return c;
138     }
139     //************************************ Classe Tore *****************************
140     int OCC_FONCTION::Creer_Surface_Torique(double Pnt_Insersion[], double Vect_Directeur[], double GRayon, double PRayon)
141     {
142     c=(*CST)(Pnt_Insersion,Vect_Directeur,GRayon,PRayon);
143     return c;
144     }
145     //*********************************** Classe Spherique *************************
146     int OCC_FONCTION::Creer_Surf_Spherique(double Pnt_Insersion[], double Vect_Directeur[], double Rayon)
147     {
148     c=(*CSS)(Pnt_Insersion,Vect_Directeur,Rayon);
149     return c;
150     }
151     //*********************************** Classe Face NURBS ************************
152     int OCC_FONCTION::Initialiser_Surface()
153     {
154     c=(*IS)();
155     return c;
156     }
157     int OCC_FONCTION::Rapprocher_Surface_Point(double x1, double y1, double z1)
158     {
159     c=(*RSP)(x1,y1,z1);
160     return c;
161     }
162     int OCC_FONCTION::Calculer_Surface()
163     {
164     c=(*CalS)();
165     return c;
166     }
167     int OCC_FONCTION::Determiner_Surface()
168     {
169     c=(*DetS)();
170     return c;
171     }
172     //******************************************************************************
173     int OCC_FONCTION::Initialiser_Contour_Contraint()
174     {
175     c=(*ICC)();
176     return c;
177     }
178     int OCC_FONCTION::Ajouter_Point_Courbe(double x1, double y1, double z1, int i1)
179     {
180     c=(*APC)(x1,y1,z1,i1);
181     return c;
182     }
183     int OCC_FONCTION::Ajouter_Courbe_Contour_Contraint(int nbpts)
184     {
185     c=(*ACCC)(nbpts);
186     return c;
187     }
188     int OCC_FONCTION::Rapprocher_Surface_Contour()
189     {
190     c=(*RSC)();
191     return c;
192     }
193     int OCC_FONCTION::Construire_Courbe(double x, double y, double z, int i)
194     {
195     c=(*CCurv)(x,y,z,i);
196     return c;
197     }
198     int OCC_FONCTION::Ajouter_courbe_liste(int nb_pts,int num)
199     {
200     c=(*ACl)(nb_pts, num);
201     return c;
202     }
203     int OCC_FONCTION::Construire_Surface_Contour(int num)
204     {
205     c=(*CSAC)(num);
206     return c;
207     }
208     int OCC_FONCTION::Convertir_Surface()
209     {
210     c=(*CS)();
211     return c;
212     }
213     int OCC_FONCTION::Creer_Face_Surface()
214     {
215     c=(*CFS)();
216     return c;
217     }
218     //*************************** Classe Contour ***********************************
219     int OCC_FONCTION::Creer_Contour()
220     {
221     c=(*CCont)();
222     return c;
223     }
224     //*************************** Classe Arete Lineaire ****************************
225     int OCC_FONCTION::Creer_Arete_Lineaire(double P1[3], double P2[3])
226     {
227     c=(*CAL)(P1, P2);
228     return c;
229     }
230     //**************************** Classe Arete Circulaire *************************
231     int OCC_FONCTION::Creer_Arete_Circulaire(double Pnt_Insersion[3], double Normal[3],double P1[3], double P2[3], double Rayon)
232     {
233     c=(*CAC)(Pnt_Insersion,Normal, P1, P2, Rayon);
234     return c;
235     }
236     //*************************** Classe Arete Elliptique **************************
237     int OCC_FONCTION::Creer_Arete_Elliptique(double Pnt_Insersion[3], double P1[3], double P2[3], double GRayon, double PRayon)
238     {
239     c=(*CAE)(Pnt_Insersion, P1, P2, GRayon, PRayon);
240     return c;
241     }
242     //*************************** Classe Arete Spline ******************************
243     int OCC_FONCTION::Ajouter_Point_Arete(double x, double y, double z, int i)
244     {
245     c=(*APA)(x,y,z,i);
246     return c;
247     }
248     int OCC_FONCTION::Construire_Arete_Spline(int nb_pts)
249     {
250     c=(*CAS)(nb_pts);
251     return c;
252     }
253     int OCC_FONCTION::Enregistrer_Arete(char* path)
254     {
255     c =(*EA)(path);
256     return c;
257     }
258    
259     int OCC_FONCTION::Rapprocher_Surface_Courbe_Spline(int nb)
260     {
261     c =(*RapSCS)(nb);
262     return c;
263     }
264    
265     int OCC_FONCTION::Ajouter_Arete_Contour(int nb)
266     {
267     c =(*AAC)(nb);
268     return c;
269     }
270    
271     int OCC_FONCTION::Initialiser_Surface_Cylindrique(double Pnt_Insersion[3], double Vect_Directeur[3],double Rayon)
272     {
273     c =(*ISC)(Pnt_Insersion,Vect_Directeur,Rayon);
274     return c;
275     }
276    
277     int OCC_FONCTION::Initialiser_Surface_Surface()
278     {
279     c=(*ISS)();
280     return c;
281     }
282    
283     int OCC_FONCTION::Ajouter_Point_Array_Ideal(double x, double y, double z, int i)
284     {
285     c=(*APAI)(x,y,z,i);
286     return c;
287     }
288    
289     int OCC_FONCTION::Determiner_Param_Boite(int i)
290     {
291     c=(*DPB)(i);
292     return c;
293     }
294    
295     double OCC_FONCTION::Get_Param_Boite(int i)
296     {
297     d=(*GPB)(i);
298     return d;
299     }
300    
301     int OCC_FONCTION::Determiner_Plan(int nb, double Epsilon)
302     {
303     c=(*DP)(nb, Epsilon);
304     return c;
305     }
306    
307    
308     int OCC_FONCTION::Ligne_Revolution(double Pnt_Inser[], double Vect_Direc[])
309     {
310     c=(*LR)(Pnt_Inser, Vect_Direc);
311     return c;
312     }
313    
314     double OCC_FONCTION::Distance_Point_Curve(double x, double y, double z)
315     {
316     d=(*DPC)(x, y, z);
317     return d;
318     }
319    
320     int OCC_FONCTION::Creer_Surface_Cylindrique_Revolution(double Pnt_Insersion[3], double Vect_Directeur[3],double Vecteur1[3],double Rayon)
321     {
322     c=(*CSCR)(Pnt_Insersion, Vect_Directeur,Vecteur1,Rayon);
323     return c;
324     }
325    
326     int OCC_FONCTION::Face_Revolution()
327     {
328     c=(*FR)();
329     return c;
330     }
331    
332    
333    
334    
335    
336    
337    
338     int OCC_FONCTION::Pt_Proj_Ligne()
339     {
340     c=(*PPL)();
341     return c;
342     }
343    
344     double OCC_FONCTION::Pnt_Proj_Ligne(int ii)
345     {
346     d=(*PnPL)(ii);
347     return d;
348     }
349    
350     int OCC_FONCTION::GCercle_Tore(double Pnt_Insersion[3], double Vect_Directeur[3],double Rayon)
351     {
352     c=(*GCT)(Pnt_Insersion, Vect_Directeur,Rayon);
353     return c;
354     }
355    
356    
357    
358     int OCC_FONCTION::Ajouter_Surface_liste_Ideal(int num)
359     {
360     c=(*ASlI)(num);
361     return c;
362     }
363    
364     int OCC_FONCTION::Projeter_Point_Surface_Idealisee(double x, double y,double z, int num)
365     {
366     c=(*PPSI)(x, y, z, num);
367     return c;
368     }
369    
370     int OCC_FONCTION::Pt_Proj_Surface_Ideal()
371     {
372     c=(*PPSId)();
373     return c;
374     }
375    
376    
377     double OCC_FONCTION::Pnt_Proj_Surface_Ideal(int ii)
378     {
379     d=(*PPSIde)(ii);
380     return d;
381     }
382    
383