0024276: Memory leak due to a static variable
[occt.git] / src / Visual3d / Visual3d.cdl
1 -- Created on: 1991-10-07
2 -- Created by: NW,JPB,CAL
3 -- Copyright (c) 1991-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: Visual3d.cdl
22 -- Updated: Vendredi 2 Octobre 1992
23 --      Mercredi 31 mars 1993
24 --      1/08/97 ; PCT : ajout texture mapping
25 --      11-97: CAL; retrait de la dependance avec math.
26 --      15/01/98 ; FMN : Suppression Hidden Line 
27 --      16-09-98 ; BGN : Ajout TypeOfTriedronEcho, 
28 --                               TypeOfTriedronPosition.
29 --              22-09-98; BGN: S3989 (anciennement S3819): report
30 --                             dans Aspect des TypeOfTriedron*
31 --      14-01-00; GG : IMP140100 Add ViewManager pointer
32 -- Purpose: Specifications definitives
33
34 package Visual3d
35
36     ---Version:
37
38     ---Purpose: This package contains the group of classes necessary
39     --      for the implementation of commands for the 3D visualiser.
40     --      Use of this package is reserved to the visualiser.
41     --
42     --      The visualiser manages the structures, the views, the
43     --      light sources, and object picking.
44
45     ---Keywords: View, Light, Pick
46     ---Warning:
47     ---References:
48
49 uses
50
51     gp,
52     TCollection,
53     TColStd,
54     Quantity,
55     Aspect,
56     Graphic3d,
57     Image,
58     MMgt,
59     WNT,
60     OSD,
61     Font
62
63 is
64
65     ---------------------------
66     -- Category: The exceptions
67     ---------------------------
68
69     exception ClipDefinitionError inherits OutOfRange;
70     ---Category: The exceptions
71
72     exception ContextPickDefinitionError inherits OutOfRange;
73     ---Category: The exceptions
74
75     exception DepthCueingDefinitionError inherits OutOfRange;
76     ---Category: The exceptions
77
78     exception LightDefinitionError inherits OutOfRange;
79     ---Category: The exceptions
80
81     exception PickError inherits OutOfRange;
82     ---Category: The exceptions
83
84     exception TransformError inherits OutOfRange;
85     ---Category: The exceptions
86
87     exception ViewDefinitionError inherits OutOfRange;
88     ---Category: The exceptions
89
90     exception ViewManagerDefinitionError inherits OutOfRange;
91     ---Category: The exceptions
92
93     exception ViewMappingDefinitionError inherits OutOfRange;
94     ---Category: The exceptions
95
96     exception ViewOrientationDefinitionError inherits OutOfRange;
97     ---Category: The exceptions
98
99     exception ZClippingDefinitionError inherits OutOfRange;
100     ---Category: The exceptions
101
102     exception TransientDefinitionError inherits OutOfRange;
103     ---Category: The exceptions
104
105     exception LayerDefinitionError inherits OutOfRange;
106     ---Category: The exceptions
107
108     -----------------------------
109     -- Category: The enumerations
110     -----------------------------
111
112     enumeration TypeOfAnswer is TOA_YES,
113                     TOA_NO,
114                     TOA_COMPUTE
115     end TypeOfAnswer;
116     ---Purpose: The answer of the method AcceptDisplay
117     --      AcceptDisplay  means is it possible to display the
118     --             specified structure in the specified view ?
119     --      TOA_YES yes
120     --      TOA_NO  no
121     --      TOA_COMPUTE yes but we have to compute the representation
122
123     enumeration TypeOfLightSource is    TOLS_AMBIENT,
124                         TOLS_DIRECTIONAL,
125                         TOLS_POSITIONAL,
126                         TOLS_SPOT
127     end TypeOfLightSource;
128     ---Purpose: Definition of all the type of light sources
129     --
130     --      TOLS_AMBIENT    ambient light
131     --      TOLS_DIRECTIONAL    directional light
132     --      TOLS_POSITIONAL positional light
133     --      TOLS_SPOT       spot light
134
135     enumeration TypeOfModel is  TOM_NONE,
136                     TOM_INTERP_COLOR,
137                     TOM_FACET,
138                     TOM_VERTEX
139     end TypeOfModel;
140     ---Purpose: Definition of the rendering (colour shading) model
141     --  TOM_NONE        No interpolation, constant shading
142     --              (FLAT Shading)
143     --  TOM_INTERP_COLOR    Linear interpolation of color
144     --              (Gouraud Shading)
145     --  TOM_FACET       Interpolation of color based on
146     --              dot products
147     --              (Quick Phong Shading)
148     --  TOM_VERTEX      Interpolation of color based on
149     --              normals
150     --              (Phong Shading)
151     ---Category: The enumerations
152
153     enumeration TypeOfOrder is  TOO_TOPFIRST,
154                     TOO_BOTTOMFIRST
155     end TypeOfOrder;
156     ---Purpose: Definition of the order of selection
157     --      TOO_TOPFIRST    the root structure first
158     --      TOO_BOTTOMFIRST the leaf structure first
159     --      Allows exploration of a PickPath in a PickDescriptor.
160     ---Category: The enumerations
161
162     enumeration TypeOfProjection is TOP_PERSPECTIVE,
163                     TOP_PARALLEL
164     end TypeOfProjection;
165     ---Purpose: Definition of the type of 3D projection
166     --
167     --      TOP_PERSPECTIVE perspective projection (centre of
168     --              projection at a  distance finite from
169     --              plane of projection)
170     --      TOP_PARALLEL    parallel projection (point of
171     --              projection at infinity)
172     ---Category: The enumerations
173
174     enumeration TypeOfVisualization is  TOV_WIREFRAME,
175                         TOV_SHADING
176     end TypeOfVisualization;
177     ---Purpose: Modes of visualisation of objects in a view
178     --
179     --      TOV_WIREFRAME   wireframe visualisation
180     --      TOV_SHADING     shaded visualisation
181     ---Category: The enumerations
182
183     enumeration TypeOfSurfaceDetail is  TOD_NONE, 
184                         TOD_ENVIRONMENT, 
185                         TOD_ALL
186     end TypeOfSurfaceDetail;
187     ---Purpose: Modes of visualisation of objects in a view
188     --
189     --      TOD_NONE        no texture mapping
190     --      TOD_ENVIRONMENT only environnement mapping
191     --      TOD_ALL     environnement + texture mapping
192     ---Category: The enumerations
193
194         enumeration TypeOfBackfacingModel is
195                 TOBM_AUTOMATIC, TOBM_FORCE, TOBM_DISABLE
196         end TypeOfBackfacingModel;
197         ---Purpose  : Modes of display of back faces in the view
198         --
199         --            TOBM_AUTOMATIC graphic's structure setting is in use
200         --            TOBM_FORCE     force display of back faces
201         --            TOBM_DISABLE   disable display of back faces
202         ---Category : Enumerations
203
204     ------------------------
205     -- Category: The classes
206     ------------------------
207
208     class ContextPick;
209     ---Purpose: This class allows the creation and update of a
210     --      pick context for one view of the viewer.
211     --      A context allows the control of different parameters
212     --      before the activation of a pick :
213     --
214     --      * pick aperture.
215     --      * the depth of pick, the number of sub-structures selected.
216     --      * the order of picking, the possibility to traverse
217     --        the pick structures starting from the roots or the leaves.
218     ---Category: The classes
219
220     class ContextView;
221     ---Purpose: This class manages the creation and update of a
222     --      visualisation context for one view in the viewer.
223     --
224     --      A context is defined by :
225     --      * Antialiasing.
226     --      * ZClipping.
227     --      * Depth-cueing.
228     --      * The type of visualisation.
229     --      * The light sources.
230     ---Category: The classes
231
232     class Light;
233     ---Purpose: This class defines and updates light sources.
234     --      There is no limit to the number of light sources defined.
235     --      Only the number of active sources is limited.
236     ---Category: The classes
237
238     class PickDescriptor;
239     ---Purpose: A PickDescriptor contains information on the picks.
240     --      It contains a certain number of PickPaths.
241     ---Category: The classes
242
243     class PickPath;
244     ---Purpose: A PickPath is a vector ( elem_num, pick_id, struct_id ).
245     --      It is one of the constituents of a PickDescriptor.
246     --      There are many Pickpaths in a PickDescriptor.
247     --      Each PickPath describes a structure or an sub-structure.
248     --      The pick-id is set by the SetPickId method from Group.
249     ---Category: The classes
250
251     class View;
252     ---Purpose: Creation and editing of a view in a 3D visualiser.
253     --
254     --      A 3D view is composed of an 'orientation' part defined
255     --      by the position of the observer, the viewing direction,
256     --      and a 'mapping' part defined by the type of projection
257     --      (parallel or perspective), and by the window-viewport
258     --      couple which allows passage from the projected coordinate
259     --      space into the screen space.
260     ---Category: The classes
261
262     class ViewManager;
263     ---Purpose: 3D Visualiser
264     ---Category: The classes
265
266     class ViewMapping;
267     ---Purpose: This class describes a projection and a system of
268     --      coordinates called NPC.(Normalized Projection Coordinates)
269     ---Category: The classes
270
271     class ViewOrientation;
272     ---Purpose: This class describes the manner in which the
273     --      observer looks at the visualised scene.
274     --      It defines a coordinates system called VRC
275     --      (View Reference Coordinates) with 3 axes U,V,N
276     ---Category: The classes
277
278     class TransientManager;
279     ---Purpose: 3D Transient Visualiser
280     ---Category: The classes
281
282     class Layer;
283     ---Purpose: 2D Layer
284     ---Category: The classes
285
286         class LayerItem;
287     ---Purpose: 2D Layer presentation unit
288     ---Category: The classes
289
290         ---------------------
291         -- Category: Pointers
292         ---------------------
293
294         pointer ViewPtr to View from Visual3d;
295         ---Category: Pointers
296
297         pointer ViewManagerPtr to ViewManager from Visual3d;
298         ---Category: Pointers
299
300     ---------------------------------
301     -- Category: Instantiated classes
302     ---------------------------------
303
304         imported NListOfLayerItem;
305     
306     class SequenceOfPickPath instantiates
307             Sequence from TCollection (PickPath from Visual3d);
308     ---Category: Instantiated classes
309
310     class HSequenceOfPickPath instantiates
311             HSequence from TCollection
312             (PickPath from Visual3d, SequenceOfPickPath);
313     ---Category: Instantiated classes
314
315     class SetOfLight instantiates
316             Set from TCollection (Light from Visual3d);
317     ---Category: Instantiated classes
318
319     class HSetOfLight instantiates
320             HSet from TCollection
321             (Light from Visual3d, SetOfLight);
322     ---Category: Instantiated classes
323
324     class SetOfView instantiates
325             Set from TCollection (View from Visual3d);
326     ---Category: Instantiated classes
327
328     class HSetOfView instantiates
329             HSet from TCollection
330             (View from Visual3d, SetOfView);
331     ---Category: Instantiated classes
332
333 end Visual3d;