1 -- Created on: 1992-11-13
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
18 -- Modified: stt:25-02-98; S3558: ajout ViewStdAdapter
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
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.
50 ------------------------------
51 ---Category: The extern types
52 ------------------------------
54 alias Coordinate is Length from Quantity;
55 ---Purpose: User-defined coordinate in the reference plane of
56 -- view (Projection or Mapping).
59 alias Parameter is Parameter from Quantity;
61 --------------------------
62 --Category: The Exceptions
63 --------------------------
65 exception BadValue inherits OutOfRange;
66 exception UnMapped inherits DomainError;
68 -----------------------------
69 ---Category: The Enumerations
70 -----------------------------
72 enumeration TypeOfView is ORTHOGRAPHIC,PERSPECTIVE
74 ---Purpose: Defines the type of projection of the view.
76 enumeration TypeOfShadingModel is COLOR,FLAT,GOURAUD,PHONG
77 end TypeOfShadingModel ;
79 -- Defines the type of shading for the graphic object:
80 -- - V3d_COLOR: simple surface color (Visual3d_TOM_NONE),
81 -- - V3d_FLAT: flat shading (Visual3d_TOM_FACET),
82 -- - V3d_GOURAUD: Gouraud shading (Visual3d_TOM_VERTEX),
83 -- - V3d_PHONG: Phong shading (Visual3d_TOM_FRAGMENT).
85 enumeration TypeOfSurfaceDetail is TEX_NONE, TEX_ENVIRONMENT, TEX_ALL
86 end TypeOfSurfaceDetail;
87 ---Purpose: Modes of visualization for objects in a view
88 -- - V3d_TEX_NONE: no texture mapping,
89 -- - V3d_TEX_ENVIRONMENT: environment mapping only,
90 -- - V3d_TEX_ALL: environment and texture mapping.
92 enumeration TypeOfVisualization is WIREFRAME,ZBUFFER
93 end TypeOfVisualization ;
94 ---Purpose: Determines the type of visualization in the view, either
95 -- WIREFRAME or ZBUFFER (shading).
97 enumeration TypeOfZclipping is OFF,BACK,FRONT,SLICE
98 -- Type "BACK" Remove rear part
99 -- Type "FRONT" Remove front part
100 -- "SLICE" Keep the slice between the front plane
101 -- plane depth + half the thickness
102 -- and the rear plane
103 -- plane depth - half the thickness.
104 -- "OFF" ZClipping deactivated.
105 end TypeOfZclipping ;
106 ---Purpose: The available options are
107 -- - V3d_OFF: Zclipping (clipping executed in the
108 -- depth of the view) is deactivated,
109 -- - V3d_BACK: back Zclipping is activated,
110 -- - V3d_FRONT: front Zclipping is activated,
111 -- - V3d_SLICE: both front and back Zclippings are activated.
113 enumeration TypeOfLight is AMBIENT,DIRECTIONAL,POSITIONAL,SPOT
115 ---Purpose: Determines the type of light.
117 enumeration TypeOfUpdate is ASAP,WAIT
119 ---Purpose: Determines the type of update of the view
120 -- - V3d_ASAP: as soon as possible. The view is updated immediately after a modification.
121 -- - V3d_WAIT: deferred. The view is updated when the Update function is called.
123 enumeration TypeOfAxe is X,Y,Z
125 ---Purpose: Determines the axis type through the coordinates X, Y, Z.
127 enumeration TypeOfOrientation is Xpos,Ypos,Zpos,Xneg,Yneg,Zneg,
128 XposYpos,XposZpos,YposZpos,XnegYneg,XnegYpos,XnegZneg,
129 XnegZpos,YnegZneg,YnegZpos,XposYneg,XposZneg,YposZneg,
130 XposYposZpos,XposYnegZpos,XposYposZneg,XnegYposZpos,
131 XposYnegZneg,XnegYposZneg,XnegYnegZpos,XnegYnegZneg
132 end TypeOfOrientation ;
133 ---Purpose: Determines the type of orientation.
135 enumeration TypeOfRepresentation is SIMPLE,COMPLETE,PARTIAL,SAMELAST
136 end TypeOfRepresentation;
139 enumeration TypeOfPickLight is POSITIONLIGHT,SPACELIGHT,
140 RADIUSTEXTLIGHT,ExtRADIUSLIGHT,IntRADIUSLIGHT,
144 enumeration TypeOfPickCamera is POSITIONCAMERA,SPACECAMERA,
145 RADIUSTEXTCAMERA,ExtRADIUSCAMERA,IntRADIUSCAMERA,
147 end TypeOfPickCamera;
149 enumeration TypeOfBackfacingModel is
150 TOBM_AUTOMATIC, TOBM_ALWAYS_DISPLAYED, TOBM_NEVER_DISPLAYED
151 end TypeOfBackfacingModel;
152 ---Purpose : Modes of display of back faces in the view
154 -- TOBM_AUTOMATIC graphic's structure setting is in use
155 -- TOBM_ALWAYS_DISPLAYED force display of back faces
156 -- TOBM_NEVER_DISPLAYED disable display of back faces
158 enumeration StereoDumpOptions is
162 end StereoDumpOptions;
163 ---Purpose : Options to be used with image dumping.
165 -- SDO_MONO dump monographic projection for stereo camera
166 -- SDO_LEFT_EYE dump left eye projection for stereo camera
167 -- SDO_RIGHT_EYE dump right eye projection for stereo camera
169 ------------------------
170 ---Category: The classes
171 ------------------------
179 deferred class Light;
183 deferred class PositionLight;
185 class PositionalLight;
187 class DirectionalLight;
191 ---------------------------------
192 ---Category: Instantiated classes
193 ---------------------------------
195 imported ListOfTransient;
197 pointer ViewerPointer to Viewer from V3d;
198 pointer ViewPointer to View from V3d;
199 pointer LayerMgrPointer to LayerMgr from V3d;
201 private class RectangularGrid;
202 private class CircularGrid;
204 private class ColorScale;
205 private class ColorScaleLayerItem;
207 ---------------------------------
208 ---Category: Methodes de package
209 ---------------------------------
211 GetProjAxis( Orientation : TypeOfOrientation )
212 returns Vector from Graphic3d ;
213 ---Purpose: Determines the orientation vector corresponding
214 -- to the predefined orientation type.
216 ArrowOfRadius ( garrow : Group from Graphic3d;
217 X0,Y0,Z0 : Coordinate;
218 DX,DY,DZ : Parameter;
219 Alpha : PlaneAngle from Quantity;
220 Lng : Parameter ) is protected;
222 ---Purpose: Compute the graphic structure of arrow.
223 -- X0,Y0,Z0 : coordinate of the arrow.
224 -- DX,DY,DZ : Direction of the arrow.
225 -- Alpha : Angle of arrow.
226 -- Lng : Length of arrow.
228 CircleInPlane ( gcircle : Group from Graphic3d;
229 X0,Y0,Z0 : Coordinate;
230 VX,VY,VZ : Parameter;
231 Radius : Parameter ) is protected;
233 ---Purpose: Compute the graphic structure of circle.
234 -- X0,Y0,Z0 : Center of circle.
235 -- VX,VY,VZ : Axis of circle.
236 -- Radius : Radius of circle.
238 SwitchViewsinWindow(aPreviousView: View from V3d;
239 aNextView: View from V3d);
242 DrawSphere(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000);
245 PickGrid(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000);
248 SetPlane(aViewer: Viewer from V3d; x1,y1,z1,x2,y2,z2: Length from Quantity);