1 -- Created on: 1992-11-13
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
22 -- Modified: stt:25-02-98; S3558: ajout ViewStdAdapter
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
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.
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.
64 ------------------------------
65 ---Category: The extern types
66 ------------------------------
68 alias Coordinate is Length from Quantity;
69 ---Purpose: User-defined coordinate in the reference plane of
70 -- view (Projection or Mapping).
73 alias Parameter is Parameter from Quantity;
75 --------------------------
76 --Category: The Exceptions
77 --------------------------
79 exception BadValue inherits OutOfRange;
80 exception UnMapped inherits DomainError;
82 -----------------------------
83 ---Category: The Enumerations
84 -----------------------------
86 enumeration TypeOfView is ORTHOGRAPHIC,PERSPECTIVE
88 ---Purpose: Defines the type of projection of the view.
90 enumeration TypeOfShadingModel is COLOR,MULTICOLOR,FLAT,GOURAUD,HIDDEN
91 end TypeOfShadingModel ;
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.
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.
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).
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.
128 enumeration TypeOfLight is AMBIENT,DIRECTIONAL,POSITIONAL,SPOT
130 ---Purpose: Determines the type of light.
132 enumeration TypeOfUpdate is ASAP,WAIT
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.
138 enumeration TypeOfAxe is X,Y,Z
140 ---Purpose: Determines the axis type through the coordinates X, Y, Z.
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.
150 enumeration TypeOfRepresentation is SIMPLE,COMPLETE,PARTIAL,SAMELAST
151 end TypeOfRepresentation;
154 enumeration TypeOfPickLight is POSITIONLIGHT,SPACELIGHT,
155 RADIUSTEXTLIGHT,ExtRADIUSLIGHT,IntRADIUSLIGHT,
159 enumeration TypeOfPickCamera is POSITIONCAMERA,SPACECAMERA,
160 RADIUSTEXTCAMERA,ExtRADIUSCAMERA,IntRADIUSCAMERA,
162 end TypeOfPickCamera;
164 enumeration TypeOfProjectionModel is
165 TPM_SCREEN,TPM_WALKTHROUGH
166 end TypeOfProjectionModel;
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
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
177 ------------------------
178 ---Category: The classes
179 ------------------------
182 ---Purpose: Provides the services of a 3D viewer.
185 ---Purpose: Provides a set of services common to all types of view.
187 class OrthographicView;
188 ---Purpose: Services of an orthogonal view.
190 class PerspectiveView;
191 ---Purpose: Services of a perspective view.
194 ---Purpose: Services of layer management.
196 deferred class Light;
197 ---Purpose: Provides services common to all types of luminous source.
198 -- (base class for AmbientLight and PositionLight)
202 ---Purpose: Services of ambient light sources.
204 deferred class PositionLight;
205 ---Purpose: Provides services common to Positional,Directional,Spot Lights.
207 class PositionalLight;
208 ---Purpose: Services of positional light sources.
210 class DirectionalLight;
211 ---Purpose: Services of directional light sources.
214 ---Purpose: Services of spot light sources.
217 ---Pupose: Services of any kind of clipping plane.
219 ---------------------------------
220 ---Category: Instantiated classes
221 ---------------------------------
223 private class ListOfTransient;
225 pointer ViewerPointer to Viewer from V3d;
226 pointer ViewPointer to View from V3d;
227 pointer LayerMgrPointer to LayerMgr from V3d;
229 private class RectangularGrid;
230 private class CircularGrid;
232 private class ColorScale;
233 private class ColorScaleLayerItem;
235 ---------------------------------
236 ---Category: Methodes de package
237 ---------------------------------
239 GetProjAxis( Orientation : TypeOfOrientation )
240 returns Vector from Graphic3d ;
241 ---Purpose: Determines the orientation vector corresponding
242 -- to the predefined orientation type.
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;
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.
256 CircleInPlane ( gcircle : mutable Group from Graphic3d;
257 X0,Y0,Z0 : Coordinate;
258 VX,VY,VZ : Parameter;
259 Radius : Parameter ) is protected;
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.
266 SwitchViewsinWindow(aPreviousView: View from V3d;
267 aNextView: View from V3d);
270 DrawSphere(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000);
273 PickGrid(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000);
276 SetPlane(aViewer: Viewer from V3d; x1,y1,z1,x2,y2,z2: Length from Quantity);