1 |
francois |
422 |
//------------------------------------------------------------
|
2 |
|
|
//------------------------------------------------------------
|
3 |
|
|
// MAGiC
|
4 |
|
|
// Jean Christophe Cuilli�e et Vincent FRANCOIS
|
5 |
|
|
// D�artement de G�ie M�anique - UQTR
|
6 |
|
|
//------------------------------------------------------------
|
7 |
|
|
// Le projet MAGIC est un projet de recherche du d�artement
|
8 |
|
|
// de g�ie m�anique de l'Universit�du Qu�ec �
|
9 |
|
|
// Trois Rivi�es
|
10 |
|
|
// Les librairies ne peuvent �re utilis�s 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 |
|
|
#ifdef WINDOWS_VERSION
|
25 |
|
|
#include "fenetre.h"
|
26 |
|
|
#endif
|
27 |
|
|
|
28 |
|
|
#pragma hdrstop
|
29 |
|
|
|
30 |
|
|
#include "mg_file.h"
|
31 |
|
|
#include "vct_multi_modele.h"
|
32 |
|
|
#include "vct_comparaison.h"
|
33 |
|
|
#include "tpl_octree.h"
|
34 |
|
|
#include "tpl_grille.h"
|
35 |
|
|
#include "ot_decalage_parametre.h"
|
36 |
|
|
#include "ot_cpu.h"
|
37 |
|
|
#include "fct_generateur_3D.h"
|
38 |
|
|
#include "mailleur3d_peau.h"
|
39 |
|
|
#include <fstream>
|
40 |
|
|
#include <string.h>
|
41 |
|
|
#include "mg_maillage_algos.h"
|
42 |
|
|
//---------------------------------------------------------------------------
|
43 |
|
|
|
44 |
|
|
void affiche(char* message)
|
45 |
|
|
{
|
46 |
|
|
#ifdef WINDOWS_VERSION
|
47 |
|
|
Form1->Memo1->Lines->Add(message);
|
48 |
|
|
#else
|
49 |
|
|
std::cout << message << std::endl;
|
50 |
|
|
#endif
|
51 |
|
|
}
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
#ifdef WINDOWS_VERSION
|
55 |
|
|
int amain(int argc,char **argv)
|
56 |
|
|
#else
|
57 |
|
|
int main(int argc,char **argv)
|
58 |
|
|
#endif
|
59 |
|
|
{
|
60 |
|
|
char fichier[500];
|
61 |
|
|
char fichiersortie[500];
|
62 |
francois |
423 |
strcpy(fichiersortie,"");
|
63 |
francois |
422 |
char fichiercarte[500];
|
64 |
|
|
double critere=1.56;
|
65 |
|
|
int analyse=0;
|
66 |
|
|
char message[500];
|
67 |
|
|
int niveau=2;
|
68 |
|
|
bool versioncompilee=false;
|
69 |
|
|
int nummai=0;
|
70 |
|
|
if (argc<3)
|
71 |
|
|
{
|
72 |
|
|
sprintf(message,"mailleur_peau.exe -magic fich.magic -out fich2.magic -carte fich.ctt -mesh num");
|
73 |
|
|
affiche(message);
|
74 |
|
|
return 0;
|
75 |
|
|
}
|
76 |
|
|
for (int i=0;i<argc;i++)
|
77 |
|
|
{
|
78 |
|
|
if (strcmp(argv[i],"-carte")==0) strcpy(fichiercarte,argv[i+1]);
|
79 |
|
|
if (strcmp(argv[i],"-magic")==0) strcpy(fichier,argv[i+1]);
|
80 |
|
|
if (strcmp(argv[i],"-out")==0) strcpy(fichiersortie,argv[i+1]);
|
81 |
|
|
if (strcmp(argv[i],"-niveauopt")==0) niveau=atoi(argv[i+1]);
|
82 |
|
|
if (strcmp(argv[i],"-version")==0) versioncompilee=true;
|
83 |
|
|
if (strcmp(argv[i],"-mesh")==0) nummai=atoi(argv[i+1]);
|
84 |
|
|
}
|
85 |
francois |
423 |
if (strcmp(fichiersortie,"")==0) strcpy(fichiersortie,fichier);
|
86 |
francois |
422 |
sprintf(message," Mailleur 3D d'une enveloppe triangulee");
|
87 |
|
|
affiche(message);
|
88 |
|
|
if (versioncompilee)
|
89 |
|
|
{
|
90 |
|
|
GESTIONVERSION v;
|
91 |
|
|
char version[500];
|
92 |
|
|
v.print(version);
|
93 |
|
|
affiche(version);
|
94 |
|
|
}
|
95 |
|
|
sprintf(message," Fichier carte : %s",fichiercarte);
|
96 |
|
|
affiche(message);
|
97 |
|
|
affiche((char*)"Lecture fichier magic");
|
98 |
|
|
MG_FILE gest(fichier);
|
99 |
|
|
affiche((char*)"Lecture carte de taille");
|
100 |
|
|
FCT_GENERATEUR_3D<4> carte;
|
101 |
|
|
carte.lire(fichiercarte);
|
102 |
|
|
MG_MAILLAGE* mai;
|
103 |
|
|
if (nummai==0) mai=gest.get_mg_maillage(0);
|
104 |
|
|
else mai=gest.get_mg_maillageid(nummai);
|
105 |
|
|
MAILLEUR3D_PEAU m3d(mai,NULL,NULL,&carte);
|
106 |
|
|
m3d.active_affichage(affiche);
|
107 |
|
|
m3d.change_niveau_optimisation(niveau);
|
108 |
|
|
affiche((char*)"Maillage 3D");
|
109 |
|
|
m3d.maille(NULL,NULL,NULL);
|
110 |
|
|
affiche((char*)"Enregistrement");
|
111 |
|
|
MG_MAILLAGE::DIMENSIONMAILLAGESANSTOPO=3;
|
112 |
|
|
gest.enregistrer(fichiersortie);
|
113 |
|
|
affiche((char*)"Fin");
|
114 |
|
|
return 0;
|
115 |
|
|
}
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
|
|
#pragma package(smart_init)
|