f52e78b48b44c795e15bc38a9ee8a975f2f5f5cd
[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-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21 -- Package:     V3d.cdl
22 -- Modified:    stt:25-02-98; S3558: ajout ViewStdAdapter
23 --              ZOV - Mars 30 1998
24 --              stt:08-04-98; suppr. ViewStdAdapter
25 --              16-09-98 ; BGN : Ajout TypeOfTriedronEcho,
26 --                               TypeOfTriedronPosition.
27 --              22-09-98; BGN: S3989 (anciennement S3819): report
28 --                             dans Aspect des TypeOfTriedron*
29 -- Purpose:     Specifications provisoires
30
31 package V3d
32
33         ---Purpose: This package contains the set of commands and services
34         --          of the 3D Viewer. It provides a set of high level commands
35         --          to control the views and viewing modes. This package is
36         --          complementary to the Visual3D graphic package.
37         --    Warning
38         -- The CSF_WALKTHROUGH variable enables you to
39         -- manage the perspective of the view in the viewer by
40         -- defining setenv CSF_WALKTHROUGH "Yes".
41         -- If you use the syntax unsetenv
42         -- CSF_WALKTHROUGH, you undefine the variable
43         -- (you make sure that the variable is deactivated). In
44         -- this case, the eye is located outside the 3D bounding
45         -- box of the view. This is the default behavior for
46         -- managing the view perspective.
47
48
49 uses
50         TColStd,
51         Graphic3d,
52         Visual3d,
53         MMgt,
54         TCollection,
55         Quantity,
56         Aspect,
57         Image,
58         gp,
59         OSD,
60         Font
61
62 is
63
64         ------------------------------
65         ---Category:  The extern types
66         ------------------------------
67
68         alias Coordinate is Length from Quantity;
69         ---Purpose: User-defined coordinate in the reference plane of
70         --          view (Projection or Mapping).
71
72
73         alias Parameter is Parameter from Quantity;
74
75         --------------------------
76         --Category: The Exceptions
77         --------------------------
78
79         exception BadValue inherits OutOfRange;
80         exception UnMapped inherits DomainError;
81
82         -----------------------------
83         ---Category: The Enumerations
84         -----------------------------
85
86         enumeration TypeOfView is ORTHOGRAPHIC,PERSPECTIVE
87         end TypeOfView ;
88         ---Purpose: Defines the type of projection of the view.
89
90         enumeration TypeOfShadingModel is COLOR,MULTICOLOR,FLAT,GOURAUD,HIDDEN
91               end TypeOfShadingModel ;
92         ---Purpose:
93         -- Defines the type of shading for the graphic object:
94         -- -   V3d_COLOR: simple surface color,
95         -- -   V3d_MULTICOLOR: interpolated colors,
96         -- -   V3d_FLAT: flat shading,
97         -- -   V3d_GOURAUD: Gouraud shading,
98         -- -   V3d_HIDDEN: hidden line removal.
99
100         enumeration  TypeOfSurfaceDetail  is  TEX_NONE, TEX_ENVIRONMENT, TEX_ALL
101                end TypeOfSurfaceDetail;
102         ---Purpose: Modes of visualization for objects in a view
103         -- -   V3d_TEX_NONE: no texture mapping,
104         -- -   V3d_TEX_ENVIRONMENT: environment mapping only,
105         -- -   V3d_TEX_ALL: environment and texture mapping.
106
107        enumeration TypeOfVisualization is      WIREFRAME,ZBUFFER
108                end TypeOfVisualization ;
109         ---Purpose: Determines the type of visualization in the view, either
110         -- WIREFRAME or ZBUFFER (shading).
111
112         enumeration TypeOfZclipping is     OFF,BACK,FRONT,SLICE
113         --          Type "BACK"    Remove rear part
114         --          Type "FRONT"   Remove front part
115         --               "SLICE"   Keep the slice between the front plane
116         --                         plane depth + half the thickness
117         --                         and the rear plane
118         --                         plane depth - half the thickness.
119         --               "OFF"     ZClipping deactivated.
120         end TypeOfZclipping ;
121         ---Purpose: The available options are
122         -- -   V3d_OFF: Zclipping (clipping executed in the
123         --   depth of the view) is deactivated,
124         -- -   V3d_BACK: back Zclipping is activated,
125         -- -   V3d_FRONT: front Zclipping is activated,
126         -- -   V3d_SLICE: both front and back Zclippings are activated.
127
128         enumeration TypeOfLight is AMBIENT,DIRECTIONAL,POSITIONAL,SPOT
129         end TypeOfLight ;
130         ---Purpose: Determines the type of light.
131
132         enumeration TypeOfUpdate is ASAP,WAIT
133         end TypeOfUpdate ;
134         ---Purpose: Determines the type of update of the view
135         -- -   V3d_ASAP: as soon as possible. The view is updated immediately after a modification.
136         -- -   V3d_WAIT: deferred. The view is updated when the Update function is called.
137
138         enumeration TypeOfAxe is X,Y,Z
139         end TypeOfAxe ;
140         ---Purpose: Determines the axis type through the coordinates X, Y, Z.
141
142         enumeration TypeOfOrientation is Xpos,Ypos,Zpos,Xneg,Yneg,Zneg,
143             XposYpos,XposZpos,YposZpos,XnegYneg,XnegYpos,XnegZneg,
144             XnegZpos,YnegZneg,YnegZpos,XposYneg,XposZneg,YposZneg,
145             XposYposZpos,XposYnegZpos,XposYposZneg,XnegYposZpos,
146             XposYnegZneg,XnegYposZneg,XnegYnegZpos,XnegYnegZneg
147         end TypeOfOrientation ;
148         ---Purpose: Determines the type of orientation.
149
150         enumeration TypeOfRepresentation is SIMPLE,COMPLETE,PARTIAL,SAMELAST
151         end TypeOfRepresentation;
152
153
154         enumeration TypeOfPickLight is POSITIONLIGHT,SPACELIGHT,
155             RADIUSTEXTLIGHT,ExtRADIUSLIGHT,IntRADIUSLIGHT,
156             NOTHING
157         end TypeOfPickLight;
158
159         enumeration TypeOfPickCamera is POSITIONCAMERA,SPACECAMERA,
160             RADIUSTEXTCAMERA,ExtRADIUSCAMERA,IntRADIUSCAMERA,
161             NOTHINGCAMERA
162         end TypeOfPickCamera;
163
164     enumeration TypeOfProjectionModel is
165         TPM_SCREEN,TPM_WALKTHROUGH
166     end TypeOfProjectionModel;
167
168         enumeration TypeOfBackfacingModel is
169             TOBM_AUTOMATIC, TOBM_ALWAYS_DISPLAYED, TOBM_NEVER_DISPLAYED
170         end TypeOfBackfacingModel;
171         ---Purpose  : Modes of display of back faces in the view
172         --
173         --            TOBM_AUTOMATIC graphic's structure setting is in use
174         --            TOBM_ALWAYS_DISPLAYED     force display of back faces
175         --            TOBM_NEVER_DISPLAYED      disable display of back faces
176
177         ------------------------
178         ---Category: The classes
179         ------------------------
180
181         class Viewer;
182         ---Purpose: Provides the services of a 3D viewer.
183
184         class View;
185         ---Purpose: Provides a set of services common to all types of view.
186
187         class OrthographicView;
188         ---Purpose: Services of an orthogonal view.
189
190         class PerspectiveView;
191         ---Purpose: Services of a perspective view.
192
193         class LayerMgr;
194         ---Purpose: Services of layer management.
195
196         deferred class Light;
197         ---Purpose: Provides services common to all types of luminous source.
198         --          (base class for AmbientLight and PositionLight)
199
200
201         class AmbientLight;
202         ---Purpose: Services of ambient light sources.
203
204         deferred class PositionLight;
205         ---Purpose: Provides services common to Positional,Directional,Spot Lights.
206
207         class PositionalLight;
208         ---Purpose: Services of positional light sources.
209
210         class DirectionalLight;
211         ---Purpose: Services of directional light sources.
212
213         class SpotLight;
214         ---Purpose: Services of spot light sources.
215
216         class Plane;
217         ---Pupose: Services of any kind of clipping plane.
218
219         ---------------------------------
220         ---Category: Instantiated classes
221         ---------------------------------
222
223         private class ListOfTransient;
224
225         pointer ViewerPointer to Viewer from V3d;
226         pointer ViewPointer to View from V3d;
227         pointer LayerMgrPointer to LayerMgr from V3d;
228
229         private class RectangularGrid;
230         private class CircularGrid;
231
232         private class ColorScale;
233     private class ColorScaleLayerItem;
234
235         ---------------------------------
236         ---Category: Methodes de package
237         ---------------------------------
238
239         GetProjAxis( Orientation : TypeOfOrientation )
240                                 returns Vector from Graphic3d ;
241         ---Purpose: Determines the orientation vector corresponding
242         --          to the predefined orientation type.
243
244         ArrowOfRadius ( garrow   : mutable Group from Graphic3d;
245                         X0,Y0,Z0 : Coordinate;
246                         DX,DY,DZ : Parameter;
247                         Alpha    : PlaneAngle from Quantity;
248                         Lng      : Parameter ) is protected;
249         ---Level: Advanced
250         ---Purpose: Compute the graphic structure of arrow.
251         --          X0,Y0,Z0 : coordinate of the arrow.
252         --          DX,DY,DZ : Direction of the arrow.
253         --          Alpha    : Angle of arrow.
254         --          Lng      : Length of arrow.
255
256         CircleInPlane ( gcircle  : mutable Group from Graphic3d;
257                         X0,Y0,Z0 : Coordinate;
258                         VX,VY,VZ : Parameter;
259                         Radius   : Parameter ) is protected;
260         ---Level: Advanced
261         ---Purpose: Compute the graphic structure of circle.
262         --          X0,Y0,Z0 : Center of circle.
263         --          VX,VY,VZ : Axis of circle.
264         --          Radius   : Radius of circle.
265
266         SwitchViewsinWindow(aPreviousView: View from V3d;
267                             aNextView: View from V3d);
268
269
270         DrawSphere(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000);
271         ---Purpose: test.
272
273         PickGrid(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000);
274         ---Purpose: test.
275
276         SetPlane(aViewer: Viewer from V3d; x1,y1,z1,x2,y2,z2: Length from Quantity);
277         ---Purpose: test.
278
279 end V3d;
280