1 |
louhichi |
211 |
//------------------------------------------------------------
|
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 |
|
|
// main.cpp
|
16 |
|
|
//
|
17 |
|
|
//------------------------------------------------------------
|
18 |
|
|
//------------------------------------------------------------
|
19 |
|
|
// COPYRIGHT 2000
|
20 |
|
|
// Version du 02/03/2006 � 11H25
|
21 |
|
|
//------------------------------------------------------------
|
22 |
|
|
//------------------------------------------------------------
|
23 |
|
|
#include "gestionversion.h"
|
24 |
|
|
|
25 |
|
|
#ifdef WINDOWS_VERSION
|
26 |
|
|
#include "fenetre.h"
|
27 |
|
|
#endif
|
28 |
|
|
|
29 |
|
|
#pragma hdrstop
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
//--------------------------------------------------------------------------
|
33 |
|
|
#include "OCC_fonction.h"
|
34 |
|
|
#include "Rec_BREP.h"
|
35 |
|
|
#include "mg_file.h"
|
36 |
|
|
|
37 |
|
|
#include <string>
|
38 |
|
|
|
39 |
|
|
//---------------------------------------------------------------------------
|
40 |
|
|
|
41 |
|
|
void affiche(char* message)
|
42 |
|
|
{
|
43 |
|
|
#ifdef WINDOWS_VERSION
|
44 |
|
|
Form1->Memo1->Lines->Add(message);
|
45 |
|
|
#else
|
46 |
|
|
std::cout << message << std::endl;
|
47 |
|
|
#endif
|
48 |
|
|
}
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
#ifdef WINDOWS_VERSION
|
53 |
|
|
int amain(int argc,char **argv)
|
54 |
|
|
#else
|
55 |
|
|
int main(int argc,char **argv)
|
56 |
|
|
#endif
|
57 |
|
|
{
|
58 |
|
|
if (argc<4) return 1;
|
59 |
|
|
long id;
|
60 |
|
|
char fichier[500];
|
61 |
|
|
char fichier2[500];
|
62 |
|
|
double coef=1;
|
63 |
|
|
int ideal=1;
|
64 |
|
|
for (int i=0;i<argc;i++)
|
65 |
|
|
{
|
66 |
|
|
if (strcmp(argv[i],"-fichier")==0) strcpy(fichier,argv[i+1]);
|
67 |
|
|
if (strcmp(argv[i],"-step")==0) strcpy(fichier2,argv[i+1]);
|
68 |
|
|
if (strcmp(argv[i],"-idmaillage")==0) id=atoi(argv[i+1]);
|
69 |
|
|
if (strcmp(argv[i],"-coef")==0) coef=atoi(argv[i+1]);
|
70 |
|
|
if (strcmp(argv[i],"-idealiser")==0) ideal=1;
|
71 |
|
|
}
|
72 |
|
|
affiche("=====================================");
|
73 |
|
|
affiche(" RECONSTRUCTION DE SOLIDE ");
|
74 |
|
|
affiche(" UQTR-LGM");
|
75 |
|
|
affiche("=====================================");
|
76 |
|
|
affiche("");
|
77 |
|
|
affiche("");
|
78 |
|
|
affiche("Lecture du fichier de donn�es");
|
79 |
|
|
affiche("------------------------------------");
|
80 |
|
|
MG_FILE gest1(fichier);
|
81 |
|
|
FEM_MAILLAGE* fem_mai=gest1.get_fem_maillageid(id);
|
82 |
|
|
affiche("Ouverture OpenCascade");
|
83 |
|
|
affiche("------------------------------------");
|
84 |
|
|
OCC_FONCTION occ;
|
85 |
|
|
affiche("Reconstruction");
|
86 |
|
|
affiche("------------------------------------");
|
87 |
|
|
REC_BREP Reconst(fem_mai,ideal,occ);
|
88 |
|
|
Reconst.Reconstruire(coef);
|
89 |
|
|
affiche("Enregistrement");
|
90 |
|
|
affiche("------------------------------------");
|
91 |
|
|
Reconst.Enregistrer(fichier2);
|
92 |
|
|
affiche("Fin");
|
93 |
|
|
affiche("------------------------------------");
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
return 0;
|
98 |
|
|
}
|
99 |
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
#pragma package(smart_init)
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
|