1fe3f754b81a55d46c0440106f265d1f84e170f0
[occt.git] / src / InterfaceGraphic / InterfaceGraphic_Graphic3d.hxx
1 /*
2  * modified 27/08/97 ; PCT : ajout texture mapping
3  * modified 08/04/98 ; FGU : ajout parametres d emission (CALL_DEF_MATERIAL)
4  * modified 30/11/98 ; FMN : ajout parametres pour les textes visibles
5  * modified 24/01/00 ; EUG : G003 add DegenerationMode flag and SkipRatio value in
6  *                         CALL_DEF_STRUCTURE.
7  * modified 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
8  *
9  */
10
11
12 #ifndef InterfaceGraphic_Graphic3dHeader
13 #define InterfaceGraphic_Graphic3dHeader
14
15 #include <InterfaceGraphic_PrimitiveArray.hxx>
16
17 #define G003    /*EUG 26-01-00 Degeneration management
18 */
19
20 #define OCC1174 /*SAV 08/01/03 CONTEXTFILLAREA extended with back face interior color*/
21
22 #define OCC2934 /* SAN 22/01/04 Texture mapped fonts on WNT */
23
24 #ifdef THIS
25         #undef THIS
26 #endif
27 /* 
28   
29                      Copyright (C) 1991,1992,1993 by
30   
31                       MATRA DATAVISION, FRANCE
32   
33 This software is furnished in accordance with the terms and conditions
34 of the contract and with the inclusion of the above copyright notice.
35 This software or any other copy thereof may not be provided or otherwise
36 be made available to any other person. No title to an ownership of the
37 software is hereby transferred.
38   
39 At the termination of the contract, the software and all copies of this
40 software must be deleted.
41   
42 Facility : CAS-CADE V1
43   
44 */ 
45
46 #define CALL_DEF_STRUCTHIGHLIGHTED      1
47 #define CALL_DEF_STRUCTPICKABLE         2
48 #define CALL_DEF_STRUCTVISIBLE          3
49
50 #define CALL_DEF_STRUCTNOHIGHLIGHTED    11
51 #define CALL_DEF_STRUCTNOPICKABLE       12
52 #define CALL_DEF_STRUCTNOVISIBLE        13
53
54 /* LISTE D'ENTIERS */
55
56 typedef struct {
57
58         int NbIntegers;
59
60         int *Integers;
61
62 } CALL_DEF_LISTINTEGERS;
63
64
65 /* LISTE DE REELS */
66
67 typedef struct {
68
69         int NbReals;
70
71         float *Reals;
72
73 } CALL_DEF_LISTREALS;
74
75
76 /* COULEUR */
77
78 typedef struct {
79
80         float r, g, b;
81
82 } CALL_DEF_COLOR;
83
84
85 /* ARETE */
86
87 typedef struct {
88
89         int Index1, Index2;
90
91         int Type;
92
93 } CALL_DEF_EDGE;
94
95
96 /* LISTE D'ARETES */
97
98 typedef struct {
99
100         int NbEdges;
101
102         CALL_DEF_EDGE *Edges;
103
104 } CALL_DEF_LISTEDGES;
105
106
107 /* NORMALE */
108
109 typedef struct {
110
111         float dx, dy, dz;
112
113 } CALL_DEF_NORMAL;
114
115
116 /* TEXTURE COORD */
117
118 typedef struct {
119
120         float tx, ty;
121
122 } CALL_DEF_TEXTURE_COORD;
123
124
125 /* POINT */
126
127 typedef struct {
128
129         float x, y, z;
130
131 } CALL_DEF_POINT;
132
133
134 /* POINTC */
135
136 typedef struct {
137
138         CALL_DEF_POINT Point;
139
140         CALL_DEF_COLOR Color;
141
142 } CALL_DEF_POINTC;
143
144
145 /* POINTN */
146
147 typedef struct {
148
149         CALL_DEF_POINT Point;
150
151         CALL_DEF_NORMAL Normal;
152
153 } CALL_DEF_POINTN;
154
155
156 /* POINTNT */
157
158 typedef struct {
159
160         CALL_DEF_POINT Point;
161
162         CALL_DEF_NORMAL Normal;
163
164         CALL_DEF_TEXTURE_COORD TextureCoord;
165
166 } CALL_DEF_POINTNT;
167
168
169 /* POINTNC */
170
171 typedef struct {
172
173         CALL_DEF_POINT Point;
174
175         CALL_DEF_NORMAL Normal;
176
177         CALL_DEF_COLOR Color;
178
179 } CALL_DEF_POINTNC;
180
181
182 /* BOITE ENGLOBANTE */
183
184 typedef struct {
185
186         CALL_DEF_COLOR Color;
187
188         CALL_DEF_POINT Pmin;
189
190         CALL_DEF_POINT Pmax;
191
192 } CALL_DEF_BOUNDBOX;
193
194
195 /* LISTE DE POINTS */
196
197 typedef union {
198
199         CALL_DEF_POINT *Points;
200
201         CALL_DEF_POINTN *PointsN;
202
203         CALL_DEF_POINTC *PointsC;
204
205         CALL_DEF_POINTNC *PointsNC;
206
207         CALL_DEF_POINTNT *PointsNT;
208
209 } CALL_DEF_UPOINTS;
210
211
212 /* LISTE DE POINTS */
213
214 typedef struct {
215
216         int NbPoints;
217
218         int TypePoints;
219
220         CALL_DEF_UPOINTS UPoints;
221
222 } CALL_DEF_LISTPOINTS;
223
224
225 /* MARKER */
226
227 typedef struct {
228
229         float x, y, z;
230
231 } CALL_DEF_MARKER;
232
233
234 /* LISTE DE MARKERS */
235
236 typedef struct {
237
238         int NbMarkers;
239
240         CALL_DEF_MARKER *Markers;
241
242 } CALL_DEF_LISTMARKERS;
243
244
245 /* TEXTE */
246
247 typedef struct {
248
249         unsigned short *string;
250
251         CALL_DEF_POINT Position;
252
253         float Height;
254
255         float Angle;
256
257         int Path;
258
259         int HAlign;
260
261         int VAlign;
262         
263         bool Zoomable;
264
265 } CALL_DEF_TEXT;
266
267
268 /* FACETTE */
269
270 typedef struct {
271
272         int NormalIsDefined;
273
274         CALL_DEF_NORMAL Normal;
275
276         int ColorIsDefined;
277
278         CALL_DEF_COLOR Color;
279
280         int TypeFacet;
281
282         int NbPoints;
283
284         int TypePoints;
285
286         CALL_DEF_UPOINTS UPoints;
287
288 } CALL_DEF_FACET;
289
290
291 /* LISTE DE FACETTES */
292
293 typedef struct {
294
295         int NbFacets;
296
297         CALL_DEF_FACET *LFacets;
298
299 } CALL_DEF_LISTFACETS;
300
301
302 /* QUADRILATERE */
303
304 typedef struct {
305
306         int NbPoints;
307
308         int TypePoints;
309
310         int SizeRow;
311         int SizeCol;
312
313         CALL_DEF_UPOINTS UPoints;
314
315 } CALL_DEF_QUAD;
316
317
318 /* TRIANGLE */
319
320 typedef struct {
321
322         int NbPoints;
323
324         int TypePoints;
325
326         CALL_DEF_UPOINTS UPoints;
327
328 } CALL_DEF_TRIKE;
329
330
331 /* PICK IDENTIFICATEUR */
332
333 typedef struct {
334
335         int IsDef;
336
337         int IsSet;
338
339         int Value;
340
341 } CALL_DEF_PICKID;
342
343
344 /* CONTEXTE LIGNE */
345
346 typedef struct {
347
348         int IsDef;
349
350         int IsSet;
351
352         CALL_DEF_COLOR Color;
353
354         int LineType;
355
356         float Width;
357
358 } CALL_DEF_CONTEXTLINE;
359
360
361 /* MATERIAL */
362
363 typedef struct {
364
365         float Ambient;
366         int IsAmbient;
367
368         float Diffuse;
369         int IsDiffuse;
370
371         float Specular;
372         int IsSpecular;
373
374         float Emission;
375         int IsEmission;
376
377         float Transparency;
378         float Shininess;
379
380         float EnvReflexion;
381         
382         int IsPhysic;
383
384         /* Attribut couleur eclairage */
385         CALL_DEF_COLOR ColorAmb, ColorDif, ColorSpec, ColorEms, Color; 
386         
387
388 } CALL_DEF_MATERIAL;
389
390
391 /* TEXTURE */
392
393 typedef struct
394 {
395   int doModulate;
396   int doRepeat;
397   int Mode;
398   int doLinear;
399   float sx, sy;
400   float tx, ty;
401   float angle;
402
403   float sparams[4];
404   float tparams[4];
405
406 } CALL_DEF_INIT_TEXTURE;
407
408
409 typedef struct
410 {
411   int TexId;
412   int doTextureMap;
413
414 } CALL_DEF_TEXTURE;
415
416
417
418 /* CONTEXTE POLYGONE */
419
420 typedef struct {
421
422         int IsDef;
423
424         int IsSet;
425
426         int Style;
427
428         CALL_DEF_COLOR IntColor;
429
430 #ifdef OCC1174
431         CALL_DEF_COLOR BackIntColor;
432 #endif
433
434         CALL_DEF_COLOR EdgeColor;
435
436         int LineType;
437
438         float Width;
439
440         int Hatch;
441
442         int Distinguish;
443         int BackFace;
444
445         int Edge;
446
447         CALL_DEF_MATERIAL Front;
448         CALL_DEF_MATERIAL Back;
449
450         CALL_DEF_TEXTURE Texture;
451
452 #ifdef G003
453         int   DegenerationMode;
454         float SkipRatio;
455 #endif
456         /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */
457         int   PolygonOffsetMode;
458         float PolygonOffsetFactor;
459         float PolygonOffsetUnits;
460         /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */
461
462 } CALL_DEF_CONTEXTFILLAREA;
463
464
465 /* CONTEXTE MARKER */
466
467 typedef struct {
468
469         int IsDef;
470
471         int IsSet;
472
473         CALL_DEF_COLOR Color;
474
475         int MarkerType;
476
477         float Scale;
478
479 } CALL_DEF_CONTEXTMARKER;
480
481
482 /* CONTEXTE TEXT */
483
484 typedef struct {
485
486         int IsDef;
487
488         int IsSet;
489
490         char*  Font;
491
492         float Space;
493
494         float Expan;
495
496         CALL_DEF_COLOR Color;
497         
498         int Style;
499         
500         int DisplayType;
501
502         CALL_DEF_COLOR ColorSubTitle;
503
504         int TextZoomable;
505         
506         float TextAngle;
507
508         int TextFontAspect;
509         
510         
511 } CALL_DEF_CONTEXTTEXT;
512
513 /* Transform persistence struct */
514 typedef struct
515 {
516         int            IsSet;
517         int            IsDef;
518         int            Flag;
519         CALL_DEF_POINT Point;
520 } CALL_DEF_TRANSFORM_PERSISTENCE;
521
522 /* STRUCTURE */
523
524 typedef struct {
525
526         int Id;
527         void *ptrStructure;
528
529         int Priority;
530         int PreviousPriority;
531         int GroupBegin;
532         int GroupEnd;
533
534         CALL_DEF_CONTEXTLINE ContextLine;
535         CALL_DEF_CONTEXTFILLAREA ContextFillArea;
536         CALL_DEF_CONTEXTMARKER ContextMarker;
537         CALL_DEF_CONTEXTTEXT ContextText;
538
539         CALL_DEF_BOUNDBOX BoundBox;
540
541         float Transformation[4][4];
542         int Composition;
543
544         int ContainsFacet;
545
546         unsigned IsDeleted      :1;
547         unsigned IsOpen         :1;
548         unsigned IsInfinite     :1;
549         unsigned stick          :1;
550         unsigned highlight      :1;
551         unsigned visible        :1;
552         unsigned pick           :1;
553         unsigned HLRValidation  :1;
554         /* ABD 29/10/04  Transform Persistence of Presentation( pan, zoom, rotate ) */
555         /*int          TransformPersistenceFlag;
556         CALL_DEF_POINT TransformPersistencePoint;
557         */
558         CALL_DEF_TRANSFORM_PERSISTENCE TransformPersistence;
559         /* ABD 29/10/04  Transform Persistence of Presentation( pan, zoom, rotate ) */
560 } CALL_DEF_STRUCTURE;
561
562
563 /* GROUPE */
564
565 typedef struct {
566
567         int LabelBegin;
568         int LabelEnd;
569         void *ptrGroup;
570
571         int StructureEnd;
572
573         CALL_DEF_CONTEXTLINE ContextLine;
574         CALL_DEF_CONTEXTFILLAREA ContextFillArea;
575         CALL_DEF_CONTEXTMARKER ContextMarker;
576         CALL_DEF_CONTEXTTEXT ContextText;
577
578         CALL_DEF_STRUCTURE *Struct;
579
580         CALL_DEF_PICKID PickId;
581
582         unsigned IsDeleted      :1;
583         unsigned IsOpen         :1;
584         /*int    TransformPersistenceFlag;*/
585
586 } CALL_DEF_GROUP;
587
588 /* BOUNDING BOX */
589
590 typedef struct {
591
592         float XMin;
593         float YMin;
594         float ZMin;
595     
596         float XMax;
597         float YMax;
598         float ZMax;
599
600 } CALL_DEF_BOUNDS;
601
602 /* USERDRAW DATA */
603
604 typedef struct {
605
606         void            *Data;
607         CALL_DEF_BOUNDS *Bounds;
608
609 } CALL_DEF_USERDRAW;
610
611 #endif /* InterfaceGraphic_Graphic3dHeader */