1 |
|
5 |
//------------------------------------------------------------
|
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 |
|
|
// visu.h
|
16 |
|
|
//
|
17 |
|
|
//------------------------------------------------------------
|
18 |
|
|
//------------------------------------------------------------
|
19 |
|
|
// COPYRIGHT 2000
|
20 |
|
|
// Version du 02/03/2006 à 11H25
|
21 |
|
|
//------------------------------------------------------------
|
22 |
|
|
//------------------------------------------------------------
|
23 |
|
|
|
24 |
|
|
#ifndef visuH
|
25 |
|
|
#define visuH
|
26 |
|
|
//---------------------------------------------------------------------------
|
27 |
|
|
#include <Classes.hpp>
|
28 |
|
|
#include <Controls.hpp>
|
29 |
|
|
#include <StdCtrls.hpp>
|
30 |
|
|
#include <Forms.hpp>
|
31 |
|
|
#include <ExtCtrls.hpp>
|
32 |
|
|
#include <ComCtrls.hpp>
|
33 |
|
|
#include <ToolWin.hpp>
|
34 |
|
|
#include <Menus.hpp>
|
35 |
|
|
#include <Dialogs.hpp>
|
36 |
|
|
#include <gl\gl.h>
|
37 |
|
|
#include <gl\glu.h>
|
38 |
|
|
//---------------------------------------------------------------------------
|
39 |
|
|
struct triangle
|
40 |
|
|
{
|
41 |
|
|
int n1;
|
42 |
|
|
int n2;
|
43 |
|
|
int n3;
|
44 |
|
|
int active;
|
45 |
|
|
};
|
46 |
|
|
|
47 |
|
|
struct noeud
|
48 |
|
|
{
|
49 |
|
|
double x;
|
50 |
|
|
double y;
|
51 |
|
|
double z;
|
52 |
|
|
};
|
53 |
|
|
|
54 |
|
|
struct segment
|
55 |
|
|
{
|
56 |
|
|
int n1;
|
57 |
|
|
int n2;
|
58 |
|
|
};
|
59 |
|
|
|
60 |
|
|
class TVisufront : public TForm
|
61 |
|
|
{
|
62 |
|
|
__published: // IDE-managed Components
|
63 |
|
|
TTimer *Timer1;
|
64 |
|
|
TMainMenu *MainMenu1;
|
65 |
|
|
TOpenDialog *OpenDialog1;
|
66 |
|
|
TMenuItem *Visualisateurdefront1;
|
67 |
|
|
TMenuItem *Fichier1;
|
68 |
|
|
TMenuItem *Ouvrir1;
|
69 |
|
|
TMenuItem *Quitter1;
|
70 |
|
|
TMenuItem *N2;
|
71 |
|
|
TMenuItem *Front1;
|
72 |
|
|
TMenuItem *N1;
|
73 |
|
|
TMenuItem *Etat1;
|
74 |
|
|
TMenuItem *N3;
|
75 |
|
|
TMenuItem *Lecture2;
|
76 |
|
|
TMenuItem *N2D1;
|
77 |
|
|
TMenuItem *N3D1;
|
78 |
|
|
TMenuItem *Axe1;
|
79 |
|
|
TMenuItem *Arte1;
|
80 |
|
|
TMenuItem *Vitesse1;
|
81 |
|
|
TMenuItem *rapide1;
|
82 |
|
|
TMenuItem *moyen1;
|
83 |
|
|
TMenuItem *lent1;
|
84 |
|
|
TMenuItem *extrementlent1;
|
85 |
|
|
TMenuItem *Pause1;
|
86 |
|
|
TMenuItem *Continue1;
|
87 |
|
|
TMenuItem *Reprendre1;
|
88 |
|
|
TMenuItem *Arrt1;
|
89 |
|
|
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
|
90 |
|
|
void __fastcall FormCreate(TObject *Sender);
|
91 |
|
|
void __fastcall FormResize(TObject *Sender);
|
92 |
|
|
void __fastcall dessineaxe(void);
|
93 |
|
|
void __fastcall FormPaint(TObject *Sender);
|
94 |
|
|
void __fastcall transformation(TObject *Sender, WORD &Key,TShiftState Shift);
|
95 |
|
|
void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
|
96 |
|
|
TShiftState Shift);
|
97 |
|
|
void __fastcall Timer1Timer(TObject *Sender);
|
98 |
|
|
void __fastcall Axe1Click(TObject *Sender);
|
99 |
|
|
void __fastcall Arte1Click(TObject *Sender);
|
100 |
|
|
void __fastcall Quitter1Click(TObject *Sender);
|
101 |
|
|
void __fastcall rapide1Click(TObject *Sender);
|
102 |
|
|
void __fastcall moyen1Click(TObject *Sender);
|
103 |
|
|
void __fastcall lent1Click(TObject *Sender);
|
104 |
|
|
void __fastcall extrementlent1Click(TObject *Sender);
|
105 |
|
|
void __fastcall Pause1Click(TObject *Sender);
|
106 |
|
|
void __fastcall Continue1Click(TObject *Sender);
|
107 |
|
|
void __fastcall Reprendre1Click(TObject *Sender);
|
108 |
|
|
void __fastcall Ouvrir1Click(TObject *Sender);
|
109 |
|
|
void __fastcall N2D1Click(TObject *Sender);
|
110 |
|
|
void __fastcall N3D1Click(TObject *Sender);
|
111 |
|
|
void __fastcall Arrt1Click(TObject *Sender);
|
112 |
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
private: // User declarations
|
116 |
|
|
public: // User declarations
|
117 |
|
|
__fastcall TVisufront(TComponent* Owner);
|
118 |
|
|
void __fastcall SetPixelFormatDescriptor(void);
|
119 |
|
|
void __fastcall recadre(double dx,double dy,int etat);
|
120 |
|
|
void __fastcall redess(void);
|
121 |
|
|
void __fastcall initvue(void);
|
122 |
|
|
triangle *lsttriangle;
|
123 |
|
|
noeud *lstnoeud;
|
124 |
|
|
segment *lstsegment;
|
125 |
|
|
HDC hdc;
|
126 |
|
|
HGLRC hrc;
|
127 |
|
|
double xmin,ymin,zmin;
|
128 |
|
|
double xmax,ymax,zmax;
|
129 |
|
|
double dx,dy;
|
130 |
|
|
int zoom;
|
131 |
|
|
int lire;
|
132 |
|
|
int numnoeud,numtriangle,numsegment,numtriangle2d,arretdemande;
|
133 |
|
|
AnsiString chemin;
|
134 |
|
|
static int nombre;
|
135 |
|
|
};
|
136 |
|
|
//---------------------------------------------------------------------------
|
137 |
|
|
extern PACKAGE TVisufront *Visufront;
|
138 |
|
|
//---------------------------------------------------------------------------
|
139 |
|
|
#endif
|