1 |
francois |
249 |
//------------------------------------------------------------
|
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 "toxfem.h"
|
37 |
|
|
#include <fstream>
|
38 |
|
|
#include <string.h>
|
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 |
|
|
#ifdef WINDOWS_VERSION
|
52 |
|
|
int amain(int argc,char **argv)
|
53 |
|
|
#else
|
54 |
|
|
int main(int argc,char **argv)
|
55 |
|
|
#endif
|
56 |
|
|
{
|
57 |
|
|
char nomfichier[500];
|
58 |
|
|
char nomfichiersortie[500];
|
59 |
|
|
int nummai;
|
60 |
|
|
int numgeo;
|
61 |
|
|
int numgroupe;
|
62 |
|
|
nomfichiersortie[0]='0';
|
63 |
|
|
for (int i=0;i<argc;i++)
|
64 |
|
|
{
|
65 |
|
|
if (strcmp(argv[i],"-fichier")==0) strcpy(nomfichier,argv[i+1]);
|
66 |
|
|
if (strcmp(argv[i],"-out")==0) strcpy(nomfichiersortie,argv[i+1]);
|
67 |
|
|
if (strcmp(argv[i],"-nummaillage")==0) nummai=atoi(argv[i+1]);
|
68 |
|
|
if (strcmp(argv[i],"-numgeometrie")==0) numgeo=atoi(argv[i+1]);
|
69 |
|
|
if (strcmp(argv[i],"-groupe")==0) numgroupe=atoi(argv[i+1]);
|
70 |
|
|
}
|
71 |
|
|
affiche("Debut");
|
72 |
|
|
affiche("Lecture fichier magic");
|
73 |
|
|
MG_FILE gest(nomfichier);
|
74 |
|
|
MG_GEOMETRIE* geo=gest.get_mg_geometrieid(numgeo);
|
75 |
|
|
FEM_MAILLAGE* mai=gest.get_fem_maillageid(nummai);
|
76 |
|
|
MG_GROUPE_TOPOLOGIQUE* mggt=geo->get_mg_groupe_topologiqueid(numgroupe);
|
77 |
|
|
TOXFEM t(&gest,geo,mai);
|
78 |
|
|
t.importer(nomfichier,mggt);
|
79 |
|
|
if (nomfichiersortie[0]=='0') strcpy(nomfichiersortie,nomfichier);
|
80 |
|
|
gest.enregistrer(nomfichiersortie);
|
81 |
|
|
affiche("fin totale");
|
82 |
|
|
|
83 |
|
|
return 0;
|
84 |
|
|
}
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
#pragma package(smart_init)
|