0024192: Adding support for shaders to OCCT visualization toolkit
[occt.git] / src / InterfaceGraphic / InterfaceGraphic_Graphic3d.hxx
CommitLineData
b311480e 1// Copyright (c) 1991-1999 Matra Datavision
2// Copyright (c) 1999-2012 OPEN CASCADE SAS
3//
4// The content of this file is subject to the Open CASCADE Technology Public
5// License Version 6.5 (the "License"). You may not use the content of this file
6// except in compliance with the License. Please obtain a copy of the License
7// at http://www.opencascade.org and read it completely before using this file.
8//
9// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11//
12// The Original Code and all software distributed under the License is
13// distributed on an "AS IS" basis, without warranty of any kind, and the
14// Initial Developer hereby disclaims all such warranties, including without
15// limitation, any warranties of merchantability, fitness for a particular
16// purpose or non-infringement. Please see the License for the specific terms
17// and conditions governing the rights and limitations under the License.
18
7fd59977 19#ifndef InterfaceGraphic_Graphic3dHeader
20#define InterfaceGraphic_Graphic3dHeader
21
30f0ad28 22#include <Graphic3d_ShaderProgram_Handle.hxx>
7fd59977 23#include <InterfaceGraphic_PrimitiveArray.hxx>
bf75be98 24#include <Standard_Transient.hxx>
7fd59977 25
26#ifdef THIS
bf75be98 27 #undef THIS
7fd59977 28#endif
7fd59977 29
30#define CALL_DEF_STRUCTHIGHLIGHTED 1
31#define CALL_DEF_STRUCTPICKABLE 2
32#define CALL_DEF_STRUCTVISIBLE 3
33
34#define CALL_DEF_STRUCTNOHIGHLIGHTED 11
35#define CALL_DEF_STRUCTNOPICKABLE 12
36#define CALL_DEF_STRUCTNOVISIBLE 13
37
38/* LISTE D'ENTIERS */
39
40typedef struct {
41
42 int NbIntegers;
43
44 int *Integers;
45
46} CALL_DEF_LISTINTEGERS;
47
48
49/* LISTE DE REELS */
50
51typedef struct {
52
53 int NbReals;
54
55 float *Reals;
56
57} CALL_DEF_LISTREALS;
58
59
60/* COULEUR */
61
62typedef struct {
63
64 float r, g, b;
65
66} CALL_DEF_COLOR;
67
68
69/* ARETE */
70
71typedef struct {
72
73 int Index1, Index2;
74
75 int Type;
76
77} CALL_DEF_EDGE;
78
79
80/* LISTE D'ARETES */
81
82typedef struct {
83
84 int NbEdges;
85
86 CALL_DEF_EDGE *Edges;
87
88} CALL_DEF_LISTEDGES;
89
90
91/* NORMALE */
92
93typedef struct {
94
95 float dx, dy, dz;
96
97} CALL_DEF_NORMAL;
98
99
100/* TEXTURE COORD */
101
102typedef struct {
103
104 float tx, ty;
105
106} CALL_DEF_TEXTURE_COORD;
107
108
109/* POINT */
110
111typedef struct {
112
113 float x, y, z;
114
115} CALL_DEF_POINT;
116
117
118/* POINTC */
119
120typedef struct {
121
122 CALL_DEF_POINT Point;
123
124 CALL_DEF_COLOR Color;
125
126} CALL_DEF_POINTC;
127
128
129/* POINTN */
130
131typedef struct {
132
133 CALL_DEF_POINT Point;
134
135 CALL_DEF_NORMAL Normal;
136
137} CALL_DEF_POINTN;
138
139
140/* POINTNT */
141
142typedef struct {
143
144 CALL_DEF_POINT Point;
145
146 CALL_DEF_NORMAL Normal;
147
148 CALL_DEF_TEXTURE_COORD TextureCoord;
149
150} CALL_DEF_POINTNT;
151
152
153/* POINTNC */
154
155typedef struct {
156
157 CALL_DEF_POINT Point;
158
159 CALL_DEF_NORMAL Normal;
160
161 CALL_DEF_COLOR Color;
162
163} CALL_DEF_POINTNC;
164
165
166/* BOITE ENGLOBANTE */
167
168typedef struct {
169
170 CALL_DEF_COLOR Color;
171
172 CALL_DEF_POINT Pmin;
173
174 CALL_DEF_POINT Pmax;
175
176} CALL_DEF_BOUNDBOX;
177
178
179/* LISTE DE POINTS */
180
181typedef union {
182
183 CALL_DEF_POINT *Points;
184
185 CALL_DEF_POINTN *PointsN;
186
187 CALL_DEF_POINTC *PointsC;
188
189 CALL_DEF_POINTNC *PointsNC;
190
191 CALL_DEF_POINTNT *PointsNT;
192
193} CALL_DEF_UPOINTS;
194
195
196/* LISTE DE POINTS */
197
198typedef struct {
199
200 int NbPoints;
201
202 int TypePoints;
203
204 CALL_DEF_UPOINTS UPoints;
205
206} CALL_DEF_LISTPOINTS;
207
208
209/* MARKER */
210
211typedef struct {
212
213 float x, y, z;
214
215} CALL_DEF_MARKER;
216
217
218/* LISTE DE MARKERS */
219
220typedef struct {
221
222 int NbMarkers;
223
224 CALL_DEF_MARKER *Markers;
225
226} CALL_DEF_LISTMARKERS;
227
228
229/* TEXTE */
230
231typedef struct {
232
13a22457 233 unsigned short *string;
7fd59977 234
235 CALL_DEF_POINT Position;
236
237 float Height;
238
239 float Angle;
240
241 int Path;
242
243 int HAlign;
244
245 int VAlign;
bf75be98 246
13a22457 247 bool Zoomable;
7fd59977 248
249} CALL_DEF_TEXT;
250
251
252/* FACETTE */
253
254typedef struct {
255
256 int NormalIsDefined;
257
258 CALL_DEF_NORMAL Normal;
259
260 int ColorIsDefined;
261
262 CALL_DEF_COLOR Color;
263
264 int TypeFacet;
265
266 int NbPoints;
267
268 int TypePoints;
269
270 CALL_DEF_UPOINTS UPoints;
271
272} CALL_DEF_FACET;
273
274
275/* LISTE DE FACETTES */
276
277typedef struct {
278
279 int NbFacets;
280
281 CALL_DEF_FACET *LFacets;
282
283} CALL_DEF_LISTFACETS;
284
285
286/* QUADRILATERE */
287
288typedef struct {
289
290 int NbPoints;
291
292 int TypePoints;
293
294 int SizeRow;
295 int SizeCol;
296
297 CALL_DEF_UPOINTS UPoints;
298
299} CALL_DEF_QUAD;
300
301
302/* TRIANGLE */
303
304typedef struct {
305
306 int NbPoints;
307
308 int TypePoints;
309
310 CALL_DEF_UPOINTS UPoints;
311
312} CALL_DEF_TRIKE;
313
314
315/* PICK IDENTIFICATEUR */
316
317typedef struct {
318
319 int IsDef;
320
321 int IsSet;
322
323 int Value;
324
325} CALL_DEF_PICKID;
326
327
328/* CONTEXTE LIGNE */
329
30f0ad28 330typedef struct
331{
332 int IsDef;
333
334 int IsSet;
335
336 CALL_DEF_COLOR Color;
337
338 int LineType;
339
340 float Width;
341
342 Handle(Graphic3d_ShaderProgram) ShaderProgram;
7fd59977 343
344} CALL_DEF_CONTEXTLINE;
345
346
347/* MATERIAL */
348
349typedef struct {
350
351 float Ambient;
352 int IsAmbient;
353
354 float Diffuse;
355 int IsDiffuse;
356
357 float Specular;
358 int IsSpecular;
359
360 float Emission;
361 int IsEmission;
362
363 float Transparency;
364 float Shininess;
365
366 float EnvReflexion;
bf75be98 367
7fd59977 368 int IsPhysic;
369
370 /* Attribut couleur eclairage */
bf75be98 371 CALL_DEF_COLOR ColorAmb, ColorDif, ColorSpec, ColorEms, Color;
7fd59977 372
7fd59977 373
bf75be98 374} CALL_DEF_MATERIAL;
7fd59977 375
376
7fd59977 377/* CONTEXTE TEXT */
378
30f0ad28 379typedef struct
380{
381 int IsDef;
382
383 int IsSet;
384
385 const char* Font;
386
387 float Space;
388
389 float Expan;
390
391 CALL_DEF_COLOR Color;
392
393 int Style;
394
395 int DisplayType;
396
397 CALL_DEF_COLOR ColorSubTitle;
7fd59977 398
399 int TextZoomable;
bf75be98 400
7fd59977 401 float TextAngle;
402
403 int TextFontAspect;
bf75be98 404
30f0ad28 405 Handle(Graphic3d_ShaderProgram) ShaderProgram;
bf75be98 406
7fd59977 407} CALL_DEF_CONTEXTTEXT;
408
409/* Transform persistence struct */
410typedef struct
411{
412 int IsSet;
413 int IsDef;
414 int Flag;
415 CALL_DEF_POINT Point;
416} CALL_DEF_TRANSFORM_PERSISTENCE;
417
7fd59977 418/* BOUNDING BOX */
419
420typedef struct {
421
422 float XMin;
423 float YMin;
424 float ZMin;
bf75be98 425
7fd59977 426 float XMax;
427 float YMax;
428 float ZMax;
429
430} CALL_DEF_BOUNDS;
431
432/* USERDRAW DATA */
433
434typedef struct {
435
436 void *Data;
437 CALL_DEF_BOUNDS *Bounds;
438
439} CALL_DEF_USERDRAW;
440
441#endif /* InterfaceGraphic_Graphic3dHeader */