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.
66 ------------------------------
67 ---Category: The extern types
68 ------------------------------
70 alias Coordinate is Length from Quantity;
71 ---Purpose: User-defined coordinate in the reference plane of
72 -- view (Projection or Mapping).
75 alias Parameter is Parameter from Quantity;
77 --------------------------
78 --Category: The Exceptions
79 --------------------------
81 exception UnMapped inherits DomainError;
83 -----------------------------
84 ---Category: The Enumerations
85 -----------------------------
87 enumeration TypeOfView is ORTHOGRAPHIC,PERSPECTIVE
89 ---Purpose: Defines the type of projection of the view.
91 enumeration TypeOfShadingModel is COLOR,MULTICOLOR,FLAT,GOURAUD,HIDDEN
92 end TypeOfShadingModel ;
94 -- Defines the type of shading for the graphic object:
95 -- - V3d_COLOR: simple surface color,
96 -- - V3d_MULTICOLOR: interpolated colors,
97 -- - V3d_FLAT: flat shading,
98 -- - V3d_GOURAUD: Gouraud shading,
99 -- - V3d_HIDDEN: hidden line removal.
101 enumeration TypeOfSurfaceDetail is TEX_NONE, TEX_ENVIRONMENT, TEX_ALL
102 end TypeOfSurfaceDetail;
103 ---Purpose: Modes of visualization for objects in a view
104 -- - V3d_TEX_NONE: no texture mapping,
105 -- - V3d_TEX_ENVIRONMENT: environment mapping only,
106 -- - V3d_TEX_ALL: environment and texture mapping.
108 enumeration TypeOfVisualization is WIREFRAME,ZBUFFER
109 end TypeOfVisualization ;
110 ---Purpose: Determines the type of visualization in the view, either
111 -- WIREFRAME or ZBUFFER (shading).
113 enumeration TypeOfZclipping is OFF,BACK,FRONT,SLICE
114 -- Type "BACK" Remove rear part
115 -- Type "FRONT" Remove front part
116 -- "SLICE" Keep the slice between the front plane
117 -- plane depth + half the thickness
118 -- and the rear plane
119 -- plane depth - half the thickness.
120 -- "OFF" ZClipping deactivated.
121 end TypeOfZclipping ;
122 ---Purpose: The available options are
123 -- - V3d_OFF: Zclipping (clipping executed in the
124 -- depth of the view) is deactivated,
125 -- - V3d_BACK: back Zclipping is activated,
126 -- - V3d_FRONT: front Zclipping is activated,
127 -- - V3d_SLICE: both front and back Zclippings are activated.
129 enumeration TypeOfLight is AMBIENT,DIRECTIONAL,POSITIONAL,SPOT
131 ---Purpose: Determines the type of light.
133 enumeration TypeOfUpdate is ASAP,WAIT
135 ---Purpose: Determines the type of update of the view
136 -- - V3d_ASAP: as soon as possible. The view is updated immediately after a modification.
137 -- - V3d_WAIT: deferred. The view is updated when the Update function is called.
139 enumeration TypeOfAxe is X,Y,Z
141 ---Purpose: Determines the axis type through the coordinates X, Y, Z.
143 enumeration TypeOfOrientation is Xpos,Ypos,Zpos,Xneg,Yneg,Zneg,
144 XposYpos,XposZpos,YposZpos,XnegYneg,XnegYpos,XnegZneg,
145 XnegZpos,YnegZneg,YnegZpos,XposYneg,XposZneg,YposZneg,
146 XposYposZpos,XposYnegZpos,XposYposZneg,XnegYposZpos,
147 XposYnegZneg,XnegYposZneg,XnegYnegZpos,XnegYnegZneg
148 end TypeOfOrientation ;
149 ---Purpose: Determines the type of orientation.
151 enumeration TypeOfRepresentation is SIMPLE,COMPLETE,PARTIAL,SAMELAST
152 end TypeOfRepresentation;
155 enumeration TypeOfPickLight is POSITIONLIGHT,SPACELIGHT,
156 RADIUSTEXTLIGHT,ExtRADIUSLIGHT,IntRADIUSLIGHT,
160 enumeration TypeOfPickCamera is POSITIONCAMERA,SPACECAMERA,
161 RADIUSTEXTCAMERA,ExtRADIUSCAMERA,IntRADIUSCAMERA,
163 end TypeOfPickCamera;
165 enumeration TypeOfProjectionModel is
166 TPM_SCREEN,TPM_WALKTHROUGH
167 end TypeOfProjectionModel;
169 enumeration TypeOfBackfacingModel is
170 TOBM_AUTOMATIC, TOBM_ALWAYS_DISPLAYED, TOBM_NEVER_DISPLAYED
171 end TypeOfBackfacingModel;
172 ---Purpose : Modes of display of back faces in the view
174 -- TOBM_AUTOMATIC graphic's structure setting is in use
175 -- TOBM_ALWAYS_DISPLAYED force display of back faces
176 -- TOBM_NEVER_DISPLAYED disable display of back faces
178 ------------------------
179 ---Category: The classes
180 ------------------------
183 ---Purpose: Provides the services of a 3D viewer.
186 ---Purpose: Provides a set of services common to all types of view.
188 class OrthographicView;
189 ---Purpose: Services of an orthogonal view.
191 class PerspectiveView;
192 ---Purpose: Services of a perspective view.
195 ---Purpose: Services of layer management.
197 deferred class Light;
198 ---Purpose: Provides services common to all types of luminous source.
199 -- (base class for AmbientLight and PositionLight)
203 ---Purpose: Services of ambient light sources.
205 deferred class PositionLight;
206 ---Purpose: Provides services common to Positional,Directional,Spot Lights.
208 class PositionalLight;
209 ---Purpose: Services of positional light sources.
211 class DirectionalLight;
212 ---Purpose: Services of directional light sources.
215 ---Purpose: Services of spot light sources.
218 ---Pupose: Services of any kind of clipping plane.
220 ---------------------------------
221 ---Category: Instantiated classes
222 ---------------------------------
224 private class ListOfTransient;
226 pointer ViewerPointer to Viewer from V3d;
227 pointer ViewPointer to View from V3d;
228 pointer LayerMgrPointer to LayerMgr from V3d;
230 private class RectangularGrid;
231 private class CircularGrid;
233 private class ColorScale;
234 private class ColorScaleLayerItem;
236 ---------------------------------
237 ---Category: Methodes de package
238 ---------------------------------
240 GetProjAxis( Orientation : TypeOfOrientation )
241 returns Vector from Graphic3d ;
242 ---Purpose: Determines the orientation vector corresponding
243 -- to the predefined orientation type.
245 ArrowOfRadius ( garrow : mutable Group from Graphic3d;
246 X0,Y0,Z0 : Coordinate;
247 DX,DY,DZ : Parameter;
248 Alpha : PlaneAngle from Quantity;
249 Lng : Parameter ) is protected;
251 ---Purpose: Compute the graphic structure of arrow.
252 -- X0,Y0,Z0 : coordinate of the arrow.
253 -- DX,DY,DZ : Direction of the arrow.
254 -- Alpha : Angle of arrow.
255 -- Lng : Length of arrow.
257 CircleInPlane ( gcircle : mutable Group from Graphic3d;
258 X0,Y0,Z0 : Coordinate;
259 VX,VY,VZ : Parameter;
260 Radius : Parameter ) is protected;
262 ---Purpose: Compute the graphic structure of circle.
263 -- X0,Y0,Z0 : Center of circle.
264 -- VX,VY,VZ : Axis of circle.
265 -- Radius : Radius of circle.
267 SwitchViewsinWindow(aPreviousView: View from V3d;
268 aNextView: View from V3d);
271 DrawSphere(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000);
274 PickGrid(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000);
277 SetPlane(aViewer: Viewer from V3d; x1,y1,z1,x2,y2,z2: Length from Quantity);