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 |
|
|
// visuctt.h
|
16 |
|
|
//
|
17 |
|
|
//------------------------------------------------------------
|
18 |
|
|
//------------------------------------------------------------
|
19 |
|
|
// COPYRIGHT 2000
|
20 |
|
|
// Version du 02/03/2006 à 11H25
|
21 |
|
|
//------------------------------------------------------------
|
22 |
|
|
//------------------------------------------------------------
|
23 |
|
|
|
24 |
|
|
#ifndef visucttH
|
25 |
|
|
#define visucttH
|
26 |
|
|
//---------------------------------------------------------------------------
|
27 |
|
|
#include <Classes.hpp>
|
28 |
|
|
#include <Controls.hpp>
|
29 |
|
|
#include <StdCtrls.hpp>
|
30 |
|
|
#include <Forms.hpp>
|
31 |
|
|
#include <Menus.hpp>
|
32 |
|
|
#include <ExtCtrls.hpp>
|
33 |
|
|
#include <vector.h>
|
34 |
|
|
#include "ot_boite_3d.h"
|
35 |
|
|
#include <ActnList.hpp>
|
36 |
|
|
#include <ComCtrls.hpp>
|
37 |
|
|
#include <Dialogs.hpp>
|
38 |
|
|
#include <gl\gl.h>
|
39 |
|
|
#include <gl\glu.h>
|
40 |
|
|
|
41 |
|
|
#include "tpl_grille.h"
|
42 |
|
|
|
43 |
|
|
class celluleaff
|
44 |
|
|
{
|
45 |
|
|
public:
|
46 |
|
|
celluleaff(int n)
|
47 |
|
|
{
|
48 |
|
|
static long idmax=0;
|
49 |
|
|
tab=new double[8*n];
|
50 |
|
|
id=idmax++;
|
51 |
|
|
};
|
52 |
|
|
~celluleaff(void)
|
53 |
|
|
{
|
54 |
|
|
delete [] tab;
|
55 |
|
|
};
|
56 |
|
|
double get_valeur(int a,int b)
|
57 |
|
|
{
|
58 |
|
|
return tab[b+8*a];
|
59 |
|
|
};
|
60 |
|
|
void change_valeur(int a,int b,double val)
|
61 |
|
|
{
|
62 |
|
|
tab[b+8*a]=val;
|
63 |
|
|
};
|
64 |
|
|
|
65 |
|
|
BOITE_3D get_boite_3D(void)
|
66 |
|
|
{
|
67 |
|
|
BOITE_3D boite(coordpt1[0],coordpt1[1],coordpt1[2],coordpt7[0],coordpt7[1],coordpt7[2]);
|
68 |
|
|
return boite;
|
69 |
|
|
};
|
70 |
|
|
long get_id(void)
|
71 |
|
|
{
|
72 |
|
|
return id;
|
73 |
|
|
};
|
74 |
|
|
|
75 |
|
|
double coordpt1[3];
|
76 |
|
|
double coordpt2[3];
|
77 |
|
|
double coordpt3[3];
|
78 |
|
|
double coordpt4[3];
|
79 |
|
|
double coordpt5[3];
|
80 |
|
|
double coordpt6[3];
|
81 |
|
|
double coordpt7[3];
|
82 |
|
|
double coordpt8[3];
|
83 |
|
|
double *tab;
|
84 |
|
|
long id;
|
85 |
|
|
};
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
//---------------------------------------------------------------------------
|
91 |
|
|
class Tvisucttform : public TForm
|
92 |
|
|
{
|
93 |
|
|
__published: // IDE-managed Components
|
94 |
|
|
TMainMenu *MainMenu1;
|
95 |
|
|
TMenuItem *File1;
|
96 |
|
|
TMenuItem *Ouvrir1;
|
97 |
|
|
TMenuItem *Visualisation1;
|
98 |
|
|
TMenuItem *Editeur1;
|
99 |
|
|
TMenuItem *Cartedetaille1;
|
100 |
|
|
TMenuItem *Fermer1;
|
101 |
|
|
TMenuItem *MenuItem1;
|
102 |
|
|
TMenuItem *FileExitItem;
|
103 |
|
|
TTimer *Timer1;
|
104 |
|
|
TActionList *ActionList1;
|
105 |
|
|
TAction *config;
|
106 |
|
|
TAction *axeon;
|
107 |
|
|
TAction *axeoff;
|
108 |
|
|
TAction *shrinkon;
|
109 |
|
|
TAction *shrinkoff;
|
110 |
|
|
TAction *renderon;
|
111 |
|
|
TAction *renderoff;
|
112 |
|
|
TAction *xm;
|
113 |
|
|
TAction *xp;
|
114 |
|
|
TAction *ym;
|
115 |
|
|
TAction *yp;
|
116 |
|
|
TAction *zm;
|
117 |
|
|
TAction *zp;
|
118 |
|
|
TPanel *Panel1;
|
119 |
|
|
TGroupBox *GroupBox1;
|
120 |
|
|
TLabel *Label1;
|
121 |
|
|
TLabel *Label2;
|
122 |
|
|
TLabel *Label3;
|
123 |
|
|
TLabel *Label4;
|
124 |
|
|
TAction *f3;
|
125 |
|
|
TAction *f4;
|
126 |
|
|
TTrackBar *TrackBar1;
|
127 |
|
|
TTrackBar *TrackBar2;
|
128 |
|
|
TLabel *Label5;
|
129 |
|
|
TLabel *Label6;
|
130 |
|
|
TTrackBar *TrackBar3;
|
131 |
|
|
TTrackBar *TrackBar4;
|
132 |
|
|
TLabel *Label7;
|
133 |
|
|
TTrackBar *TrackBar5;
|
134 |
|
|
TTrackBar *TrackBar6;
|
135 |
|
|
TListBox *ListBox1;
|
136 |
|
|
TMenuItem *N1;
|
137 |
|
|
TMenuItem *ExplorateurMAGIC1;
|
138 |
|
|
TMenuItem *Visualisateurdefront1;
|
139 |
|
|
TMenuItem *F1;
|
140 |
|
|
TMenuItem *Appliquerunefonctionunchamps1;
|
141 |
|
|
TMenuItem *N2;
|
142 |
|
|
TMenuItem *Enregistrercettecarte1;
|
143 |
|
|
TSaveDialog *SaveDialog1;
|
144 |
|
|
TMenuItem *Composer1;
|
145 |
|
|
TUpDown *UpDown1;
|
146 |
|
|
TUpDown *UpDown2;
|
147 |
|
|
TCheckBox *CheckBox1;
|
148 |
|
|
TPanel *Panel2;
|
149 |
|
|
TCheckBox *CheckBox2;
|
150 |
|
|
TLabel *Label9;
|
151 |
|
|
TGroupBox *GroupBox2;
|
152 |
|
|
TGroupBox *GroupBox3;
|
153 |
|
|
TLabel *Label8;
|
154 |
|
|
TEdit *Edit1;
|
155 |
|
|
TEdit *Edit2;
|
156 |
|
|
TLabel *Label10;
|
157 |
|
|
TLabel *Label11;
|
158 |
|
|
TEdit *Edit3;
|
159 |
|
|
TButton *Button1;
|
160 |
|
|
TEdit *Edit4;
|
161 |
|
|
TEdit *Edit5;
|
162 |
|
|
TLabel *Label12;
|
163 |
|
|
TLabel *Label15;
|
164 |
|
|
TEdit *Edit8;
|
165 |
|
|
TEdit *Edit9;
|
166 |
|
|
TLabel *Label16;
|
167 |
|
|
TEdit *Edit6;
|
168 |
|
|
TLabel *Label13;
|
169 |
|
|
TLabel *Label14;
|
170 |
|
|
TEdit *Edit7;
|
171 |
|
|
TLabel *Label17;
|
172 |
|
|
TEdit *Edit10;
|
173 |
|
|
TEdit *Edit11;
|
174 |
|
|
TLabel *Label19;
|
175 |
|
|
TLabel *Label18;
|
176 |
|
|
TEdit *Edit12;
|
177 |
|
|
TEdit *Edit13;
|
178 |
|
|
TLabel *Label20;
|
179 |
|
|
TButton *Button2;
|
180 |
|
|
TButton *Button3;
|
181 |
|
|
void __fastcall Fermer1Click(TObject *Sender);
|
182 |
|
|
void __fastcall FileExitItemClick(TObject *Sender);
|
183 |
|
|
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
|
184 |
|
|
void __fastcall Timer1Timer(TObject *Sender);
|
185 |
|
|
void __fastcall FormActivate(TObject *Sender);
|
186 |
|
|
void __fastcall FormDeactivate(TObject *Sender);
|
187 |
|
|
void __fastcall configExecute(TObject *Sender);
|
188 |
|
|
void __fastcall FormCreate(TObject *Sender);
|
189 |
|
|
void __fastcall FormPaint(TObject *Sender);
|
190 |
|
|
void __fastcall FormResize(TObject *Sender);
|
191 |
|
|
void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
|
192 |
|
|
TShiftState Shift);
|
193 |
|
|
void __fastcall FormMouseDown(TObject *Sender, TMouseButton Button,
|
194 |
|
|
TShiftState Shift, int X, int Y);
|
195 |
|
|
void __fastcall FormMouseMove(TObject *Sender, TShiftState Shift,
|
196 |
|
|
int X, int Y);
|
197 |
|
|
void __fastcall FormMouseUp(TObject *Sender, TMouseButton Button,
|
198 |
|
|
TShiftState Shift, int X, int Y);
|
199 |
|
|
void __fastcall FormMouseWheelDown(TObject *Sender,
|
200 |
|
|
TShiftState Shift, TPoint &MousePos, bool &Handled);
|
201 |
|
|
void __fastcall FormMouseWheelUp(TObject *Sender,
|
202 |
|
|
TShiftState Shift, TPoint &MousePos, bool &Handled);
|
203 |
|
|
void __fastcall axeonExecute(TObject *Sender);
|
204 |
|
|
void __fastcall axeoffExecute(TObject *Sender);
|
205 |
|
|
void __fastcall shrinkonExecute(TObject *Sender);
|
206 |
|
|
void __fastcall shrinkoffExecute(TObject *Sender);
|
207 |
|
|
void __fastcall renderonExecute(TObject *Sender);
|
208 |
|
|
void __fastcall renderoffExecute(TObject *Sender);
|
209 |
|
|
void __fastcall xmExecute(TObject *Sender);
|
210 |
|
|
void __fastcall xpExecute(TObject *Sender);
|
211 |
|
|
void __fastcall ymExecute(TObject *Sender);
|
212 |
|
|
void __fastcall ypExecute(TObject *Sender);
|
213 |
|
|
void __fastcall zmExecute(TObject *Sender);
|
214 |
|
|
void __fastcall zpExecute(TObject *Sender);
|
215 |
|
|
void __fastcall f3Execute(TObject *Sender);
|
216 |
|
|
void __fastcall f4Execute(TObject *Sender);
|
217 |
|
|
void __fastcall TrackBar1Change(TObject *Sender);
|
218 |
|
|
void __fastcall TrackBar2Change(TObject *Sender);
|
219 |
|
|
void __fastcall TrackBar4Change(TObject *Sender);
|
220 |
|
|
void __fastcall TrackBar5Change(TObject *Sender);
|
221 |
|
|
void __fastcall TrackBar6Change(TObject *Sender);
|
222 |
|
|
void __fastcall TrackBar3Change(TObject *Sender);
|
223 |
|
|
void __fastcall ListBox1Click(TObject *Sender);
|
224 |
|
|
void __fastcall Appliquerunefonctionunchamps1Click(
|
225 |
|
|
TObject *Sender);
|
226 |
|
|
void __fastcall Enregistrercettecarte1Click(TObject *Sender);
|
227 |
|
|
void __fastcall Composer1Click(TObject *Sender);
|
228 |
|
|
void __fastcall UpDown1Click(TObject *Sender, TUDBtnType Button);
|
229 |
|
|
void __fastcall UpDown2Click(TObject *Sender, TUDBtnType Button);
|
230 |
|
|
void __fastcall CheckBox1Click(TObject *Sender);
|
231 |
|
|
void __fastcall CheckBox2Click(TObject *Sender);
|
232 |
|
|
void __fastcall Button1Click(TObject *Sender);
|
233 |
|
|
void __fastcall Button2Click(TObject *Sender);
|
234 |
|
|
void __fastcall Button3Click(TObject *Sender);
|
235 |
|
|
private: vector<celluleaff*> lst_cellule;
|
236 |
|
|
BOITE_3D boite;
|
237 |
|
|
double valmax[10];
|
238 |
|
|
double valmin[10];
|
239 |
|
|
TColor __fastcall getcolor(double r,double g,double b);
|
240 |
|
|
int RGB_r[14],RGB_g[14],RGB_b[14];
|
241 |
|
|
|
242 |
|
|
|
243 |
|
|
|
244 |
|
|
public: // User declarations
|
245 |
|
|
__fastcall Tvisucttform(TComponent* Owner);
|
246 |
|
|
void __fastcall SetPixelFormatDescriptor(void);
|
247 |
|
|
void __fastcall recadre(double dx,double dy,int etat);
|
248 |
|
|
void __fastcall dessineaxe(void);
|
249 |
|
|
void __fastcall redess(void);
|
250 |
|
|
void __fastcall initvue(void);
|
251 |
|
|
HDC hdc;
|
252 |
|
|
HGLRC hrc;
|
253 |
|
|
void __fastcall transformation(TObject *Sender, WORD &Key,TShiftState Shift);
|
254 |
|
|
int zoom;
|
255 |
|
|
double dx;
|
256 |
|
|
double dy;
|
257 |
|
|
bool debut_trans;
|
258 |
|
|
int xdepart;
|
259 |
|
|
int ydepart;
|
260 |
|
|
int shrink;
|
261 |
|
|
int render;
|
262 |
|
|
int axe;
|
263 |
|
|
double facteur_shrink;
|
264 |
|
|
int xrot;
|
265 |
|
|
int yrot;
|
266 |
|
|
int debut_rot;
|
267 |
|
|
int nb_renseignement,pasx,pasy,pasz;
|
268 |
|
|
double xmin,ymin,zmin,xmax,ymax,zmax;
|
269 |
|
|
TPL_GRILLE<celluleaff*> *grille;
|
270 |
|
|
double __fastcall evaluer(double x,double y,double z) ;
|
271 |
|
|
|
272 |
|
|
|
273 |
|
|
|
274 |
|
|
|
275 |
|
|
};
|
276 |
|
|
//---------------------------------------------------------------------------
|
277 |
|
|
extern PACKAGE Tvisucttform *visucttform;
|
278 |
|
|
//---------------------------------------------------------------------------
|
279 |
|
|
#endif
|