b311480e |
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 |
7fd59977 |
5 | -- |
b311480e |
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 | |
7fd59977 |
21 | -- Package: V3d.cdl |
7fd59977 |
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* |
7fd59977 |
29 | -- Purpose: Specifications provisoires |
7fd59977 |
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 | Viewer, |
51 | TColStd, |
52 | Graphic3d, |
53 | Visual3d, |
54 | MMgt, |
55 | TCollection, |
56 | Quantity, |
57 | Aspect, |
58 | PlotMgt, |
59 | Image, |
60 | gp, |
eeaaaefb |
61 | OSD, |
62 | Font |
7fd59977 |
63 | |
64 | is |
65 | |
66 | ------------------------------ |
67 | ---Category: The extern types |
68 | ------------------------------ |
69 | |
70 | alias Coordinate is Length from Quantity; |
71 | ---Purpose: User-defined coordinate in the reference plane of |
72 | -- view (Projection or Mapping). |
73 | |
74 | |
75 | alias Parameter is Parameter from Quantity; |
76 | |
77 | -------------------------- |
78 | --Category: The Exceptions |
79 | -------------------------- |
80 | |
81 | exception UnMapped inherits DomainError; |
82 | |
83 | ----------------------------- |
84 | ---Category: The Enumerations |
85 | ----------------------------- |
86 | |
87 | enumeration TypeOfView is ORTHOGRAPHIC,PERSPECTIVE |
88 | end TypeOfView ; |
89 | ---Purpose: Defines the type of projection of the view. |
90 | |
91 | enumeration TypeOfShadingModel is COLOR,MULTICOLOR,FLAT,GOURAUD,HIDDEN |
92 | end TypeOfShadingModel ; |
93 | ---Purpose: |
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. |
100 | |
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. |
107 | |
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). |
112 | |
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. |
128 | |
129 | enumeration TypeOfLight is AMBIENT,DIRECTIONAL,POSITIONAL,SPOT |
130 | end TypeOfLight ; |
131 | ---Purpose: Determines the type of light. |
132 | |
133 | enumeration TypeOfUpdate is ASAP,WAIT |
134 | end TypeOfUpdate ; |
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. |
138 | |
139 | enumeration TypeOfAxe is X,Y,Z |
140 | end TypeOfAxe ; |
141 | ---Purpose: Determines the axis type through the coordinates X, Y, Z. |
142 | |
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. |
150 | |
151 | enumeration TypeOfRepresentation is SIMPLE,COMPLETE,PARTIAL,SAMELAST |
152 | end TypeOfRepresentation; |
153 | |
154 | |
155 | enumeration TypeOfPickLight is POSITIONLIGHT,SPACELIGHT, |
156 | RADIUSTEXTLIGHT,ExtRADIUSLIGHT,IntRADIUSLIGHT, |
157 | NOTHING |
158 | end TypeOfPickLight; |
159 | |
160 | enumeration TypeOfPickCamera is POSITIONCAMERA,SPACECAMERA, |
161 | RADIUSTEXTCAMERA,ExtRADIUSCAMERA,IntRADIUSCAMERA, |
162 | NOTHINGCAMERA |
163 | end TypeOfPickCamera; |
164 | |
165 | enumeration TypeOfProjectionModel is |
166 | TPM_SCREEN,TPM_WALKTHROUGH |
167 | end TypeOfProjectionModel; |
168 | |
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 |
173 | -- |
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 |
177 | |
178 | ------------------------ |
179 | ---Category: The classes |
180 | ------------------------ |
181 | |
182 | class Viewer; |
183 | ---Purpose: Provides the services of a 3D viewer. |
184 | |
185 | deferred class View; |
186 | ---Purpose: Provides a set of services common to all types of view. |
187 | |
188 | class OrthographicView; |
189 | ---Purpose: Services of an orthogonal view. |
190 | |
191 | class PerspectiveView; |
192 | ---Purpose: Services of a perspective view. |
193 | |
194 | class LayerMgr; |
195 | ---Purpose: Services of layer management. |
196 | |
197 | deferred class Light; |
198 | ---Purpose: Provides services common to all types of luminous source. |
199 | -- (base class for AmbientLight and PositionLight) |
200 | |
201 | |
202 | class AmbientLight; |
203 | ---Purpose: Services of ambient light sources. |
204 | |
205 | deferred class PositionLight; |
206 | ---Purpose: Provides services common to Positional,Directional,Spot Lights. |
207 | |
208 | class PositionalLight; |
209 | ---Purpose: Services of positional light sources. |
210 | |
211 | class DirectionalLight; |
212 | ---Purpose: Services of directional light sources. |
213 | |
214 | class SpotLight; |
215 | ---Purpose: Services of spot light sources. |
216 | |
7fd59977 |
217 | class Plane; |
218 | ---Pupose: Services of any kind of clipping plane. |
219 | |
220 | --------------------------------- |
221 | ---Category: Instantiated classes |
222 | --------------------------------- |
223 | |
224 | private class ListOfTransient; |
225 | |
226 | pointer ViewerPointer to Viewer from V3d; |
227 | pointer ViewPointer to View from V3d; |
228 | pointer LayerMgrPointer to LayerMgr from V3d; |
229 | |
230 | private class RectangularGrid; |
231 | private class CircularGrid; |
232 | |
233 | private class ColorScale; |
234 | private class ColorScaleLayerItem; |
235 | |
236 | --------------------------------- |
237 | ---Category: Methodes de package |
238 | --------------------------------- |
239 | |
240 | GetProjAxis( Orientation : TypeOfOrientation ) |
241 | returns Vector from Graphic3d ; |
242 | ---Purpose: Determines the orientation vector corresponding |
243 | -- to the predefined orientation type. |
244 | |
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; |
250 | ---Level: Advanced |
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. |
256 | |
257 | CircleInPlane ( gcircle : mutable Group from Graphic3d; |
258 | X0,Y0,Z0 : Coordinate; |
259 | VX,VY,VZ : Parameter; |
260 | Radius : Parameter ) is protected; |
261 | ---Level: Advanced |
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. |
266 | |
267 | SwitchViewsinWindow(aPreviousView: View from V3d; |
268 | aNextView: View from V3d); |
269 | |
270 | |
271 | DrawSphere(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000); |
272 | ---Purpose: test. |
273 | |
274 | PickGrid(aViewer: Viewer from V3d; aRadius: Length from Quantity =1000); |
275 | ---Purpose: test. |
276 | |
277 | SetPlane(aViewer: Viewer from V3d; x1,y1,z1,x2,y2,z2: Length from Quantity); |
278 | ---Purpose: test. |
279 | |
280 | end V3d; |
281 | |