0025282: Visualization, OpenGl_PrimitiveArray - provide built-in GLSL programs as...
[occt.git] / src / V3d / V3d.cdl
1 -- Created on: 1992-11-13
2 -- Created by: GG
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 -- Package:     V3d.cdl
18 -- Modified:    stt:25-02-98; S3558: ajout ViewStdAdapter
19 --              ZOV - Mars 30 1998
20 --              stt:08-04-98; suppr. ViewStdAdapter
21 --              16-09-98 ; BGN : Ajout TypeOfTriedronEcho,
22 --                               TypeOfTriedronPosition.
23 --              22-09-98; BGN: S3989 (anciennement S3819): report
24 --                             dans Aspect des TypeOfTriedron*
25 -- Purpose:     Specifications provisoires
26
27 package V3d
28
29         ---Purpose: This package contains the set of commands and services
30         --          of the 3D Viewer. It provides a set of high level commands
31         --          to control the views and viewing modes. This package is
32         --          complementary to the Visual3D graphic package.
33
34 uses
35         TColStd,
36         Graphic3d,
37         Visual3d,
38         MMgt,
39         TCollection,
40         Quantity,
41         Aspect,
42         Image,
43         gp,
44         OSD,
45         Font
46
47 is
48
49         ------------------------------
50         ---Category:  The extern types
51         ------------------------------
52
53         alias Coordinate is Length from Quantity;
54         ---Purpose: User-defined coordinate in the reference plane of
55         --          view (Projection or Mapping).
56
57
58         alias Parameter is Parameter from Quantity;
59
60         --------------------------
61         --Category: The Exceptions
62         --------------------------
63
64         exception BadValue inherits OutOfRange;
65         exception UnMapped inherits DomainError;
66
67         -----------------------------
68         ---Category: The Enumerations
69         -----------------------------
70
71         enumeration TypeOfView is ORTHOGRAPHIC,PERSPECTIVE
72         end TypeOfView ;
73         ---Purpose: Defines the type of projection of the view.
74
75         enumeration TypeOfShadingModel is COLOR,FLAT,GOURAUD,PHONG
76               end TypeOfShadingModel ;
77         ---Purpose:
78         -- Defines the type of shading for the graphic object:
79         -- -   V3d_COLOR: simple surface color (Visual3d_TOM_NONE),
80         -- -   V3d_FLAT: flat shading (Visual3d_TOM_FACET),
81         -- -   V3d_GOURAUD: Gouraud shading (Visual3d_TOM_VERTEX),
82         -- -   V3d_PHONG: Phong shading (Visual3d_TOM_FRAGMENT).
83
84         enumeration  TypeOfSurfaceDetail  is  TEX_NONE, TEX_ENVIRONMENT, TEX_ALL
85                end TypeOfSurfaceDetail;
86         ---Purpose: Modes of visualization for objects in a view
87         -- -   V3d_TEX_NONE: no texture mapping,
88         -- -   V3d_TEX_ENVIRONMENT: environment mapping only,
89         -- -   V3d_TEX_ALL: environment and texture mapping.
90
91        enumeration TypeOfVisualization is      WIREFRAME,ZBUFFER
92                end TypeOfVisualization ;
93         ---Purpose: Determines the type of visualization in the view, either
94         -- WIREFRAME or ZBUFFER (shading).
95
96         enumeration TypeOfZclipping is     OFF,BACK,FRONT,SLICE
97         --          Type "BACK"    Remove rear part
98         --          Type "FRONT"   Remove front part
99         --               "SLICE"   Keep the slice between the front plane
100         --                         plane depth + half the thickness
101         --                         and the rear plane
102         --                         plane depth - half the thickness.
103         --               "OFF"     ZClipping deactivated.
104         end TypeOfZclipping ;
105         ---Purpose: The available options are
106         -- -   V3d_OFF: Zclipping (clipping executed in the
107         --   depth of the view) is deactivated,
108         -- -   V3d_BACK: back Zclipping is activated,
109         -- -   V3d_FRONT: front Zclipping is activated,
110         -- -   V3d_SLICE: both front and back Zclippings are activated.
111
112         enumeration TypeOfLight is AMBIENT,DIRECTIONAL,POSITIONAL,SPOT
113         end TypeOfLight ;
114         ---Purpose: Determines the type of light.
115
116         enumeration TypeOfUpdate is ASAP,WAIT
117         end TypeOfUpdate ;
118         ---Purpose: Determines the type of update of the view
119         -- -   V3d_ASAP: as soon as possible. The view is updated immediately after a modification.
120         -- -   V3d_WAIT: deferred. The view is updated when the Update function is called.
121
122         enumeration TypeOfAxe is X,Y,Z
123         end TypeOfAxe ;
124         ---Purpose: Determines the axis type through the coordinates X, Y, Z.
125
126         enumeration TypeOfOrientation is Xpos,Ypos,Zpos,Xneg,Yneg,Zneg,
127             XposYpos,XposZpos,YposZpos,XnegYneg,XnegYpos,XnegZneg,
128             XnegZpos,YnegZneg,YnegZpos,XposYneg,XposZneg,YposZneg,
129             XposYposZpos,XposYnegZpos,XposYposZneg,XnegYposZpos,
130             XposYnegZneg,XnegYposZneg,XnegYnegZpos,XnegYnegZneg
131         end TypeOfOrientation ;
132         ---Purpose: Determines the type of orientation.
133
134         enumeration TypeOfRepresentation is SIMPLE,COMPLETE,PARTIAL,SAMELAST
135         end TypeOfRepresentation;
136
137
138         enumeration TypeOfPickLight is POSITIONLIGHT,SPACELIGHT,
139             RADIUSTEXTLIGHT,ExtRADIUSLIGHT,IntRADIUSLIGHT,
140             NOTHING
141         end TypeOfPickLight;
142
143         enumeration TypeOfPickCamera is POSITIONCAMERA,SPACECAMERA,
144             RADIUSTEXTCAMERA,ExtRADIUSCAMERA,IntRADIUSCAMERA,
145             NOTHINGCAMERA
146         end TypeOfPickCamera;
147
148         enumeration TypeOfBackfacingModel is
149             TOBM_AUTOMATIC, TOBM_ALWAYS_DISPLAYED, TOBM_NEVER_DISPLAYED
150         end TypeOfBackfacingModel;
151         ---Purpose  : Modes of display of back faces in the view
152         --
153         --            TOBM_AUTOMATIC graphic's structure setting is in use
154         --            TOBM_ALWAYS_DISPLAYED     force display of back faces
155         --            TOBM_NEVER_DISPLAYED      disable display of back faces
156
157         enumeration StereoDumpOptions is
158             SDO_MONO,
159             SDO_LEFT_EYE,
160             SDO_RIGHT_EYE
161         end StereoDumpOptions;
162         ---Purpose : Options to be used with image dumping.
163         --
164         --            SDO_MONO dump monographic projection for stereo camera
165         --            SDO_LEFT_EYE dump left eye projection for stereo camera
166         --            SDO_RIGHT_EYE dump right eye projection for stereo camera
167
168         ------------------------
169         ---Category: The classes
170         ------------------------
171
172         class Viewer;
173
174         class View;
175
176         class LayerMgr;
177
178         deferred class Light;
179
180         class AmbientLight;
181
182         deferred class PositionLight;
183
184         class PositionalLight;
185
186         class DirectionalLight;
187
188         class SpotLight;
189
190         ---------------------------------
191         ---Category: Instantiated classes
192         ---------------------------------
193
194         imported ListOfTransient;
195
196         pointer ViewerPointer to Viewer from V3d;
197         pointer ViewPointer to View from V3d;
198         pointer LayerMgrPointer to LayerMgr from V3d;
199
200         private class RectangularGrid;
201         private class CircularGrid;
202
203         private class ColorScale;
204     private class ColorScaleLayerItem;
205
206         ---------------------------------
207         ---Category: Methodes de package
208         ---------------------------------
209
210         GetProjAxis( Orientation : TypeOfOrientation )
211                                 returns Vector from Graphic3d ;
212         ---Purpose: Determines the orientation vector corresponding
213         --          to the predefined orientation type.
214
215         ArrowOfRadius ( garrow   : Group from Graphic3d;
216                         X0,Y0,Z0 : Coordinate;
217                         DX,DY,DZ : Parameter;
218                         Alpha    : PlaneAngle from Quantity;
219                         Lng      : Parameter ) is protected;
220         ---Level: Advanced
221         ---Purpose: Compute the graphic structure of arrow.
222         --          X0,Y0,Z0 : coordinate of the arrow.
223         --          DX,DY,DZ : Direction of the arrow.
224         --          Alpha    : Angle of arrow.
225         --          Lng      : Length of arrow.
226
227         CircleInPlane ( gcircle  : Group from Graphic3d;
228                         X0,Y0,Z0 : Coordinate;
229                         VX,VY,VZ : Parameter;
230                         Radius   : Parameter ) is protected;
231         ---Level: Advanced
232         ---Purpose: Compute the graphic structure of circle.
233         --          X0,Y0,Z0 : Center of circle.
234         --          VX,VY,VZ : Axis of circle.
235         --          Radius   : Radius of circle.
236
237         SwitchViewsinWindow(aPreviousView: View from V3d;
238                             aNextView: View from V3d);
239
240
241         DrawSphere(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000);
242         ---Purpose: test.
243
244         PickGrid(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000);
245         ---Purpose: test.
246
247         SetPlane(aViewer: Viewer from V3d; x1,y1,z1,x2,y2,z2: Length from Quantity);
248         ---Purpose: test.
249
250 end V3d;
251