0022795: Make possible to display some presentable objects in overlay of others,...
[occt.git] / src / PrsMgr / PrsMgr_PresentableObject.cdl
CommitLineData
7fd59977 1-- File: PrsMgr_PresentableObject.cdl
2-- Created: Wed Jan 25 09:23:00 1995
3-- Author: Jean-Louis Frenkel
4-- Modified by Rob (18/12/96) -> information about modes to update.
5-- Rob (04/07/97) -> TypeOfPresentation3d () Method
6-- changed to Public Method.
7-- -> Option Projector Dependant/Independant
8-- may be set at any time , not only in
9-- the constructor or the presentable.
10-- ->Insert Locations Methods...
11-- Rob (16/12/97) -> Get the list of modes to be updated
12-- -> Flags all the Prs to be updated...
13-- GG IMP020200 -> Presentations() method become protected
14-- and no more private.
15-- SAN (22/03/04) -> OCC4895 High-level interface for controlling
16-- polygon offsets: Fill() made protected virtual.
17--
18---Copyright: Matra Datavision 1995
19
20deferred class PresentableObject from PrsMgr inherits TShared from MMgt
21
22
23 ---Purpose: A framework to supply the Graphic2d or Graphic3d
24 -- structure of the object to be presented. On the first
25 -- display request, this structure is created by calling the
26 -- appropriate algorithm and retaining this frameworkfor
27 -- further display.
28 -- This abstract framework is inherited in Application
29 -- Interactive Services (AIS), notably in:
30 -- - AIS_InteractiveObject
31 -- - AIS_ConnectedInteractive
32 -- - AIS_MultipleConnectedInteractive
33 -- - AIS_Shape
34 -- Consequently, 3D presentation should be handled by
35 -- the relevant daughter classes and their member
36 -- functions in AIS. This is particularly true in the
37 -- creation of new interactive objects.
38
39uses
40 Presentation from PrsMgr,
41 Presentation from Prs3d,
42 GraphicObject from Graphic2d,
43 Presentations from PrsMgr,
44 PresentationManager from PrsMgr,
45 PresentationManager2d from PrsMgr,
46 PresentationManager3d from PrsMgr,
47 TypeOfPresentation3d from PrsMgr,
48 DataStructureManager from Graphic3d,
49 Projector from Prs3d,
50 Transformation from Geom,
51 ListOfInteger from TColStd,
52 Location from TopLoc,
53 -- ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate )
54 TransModeFlags from Graphic3d,
55 Pnt from gp,
56 CTransPersStruct from Graphic3d
57 -- ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate )
58
59raises
60 NotImplemented from Standard
61is
62
63
64 Initialize(aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView);
65
66---Category: deferred methods.
67--
68 Compute(me:mutable;
69 aPresentationManager: PresentationManager2d from PrsMgr;
70 aPresentation: mutable GraphicObject from Graphic2d;
71 aMode: Integer from Standard = 0)
72 ---Purpose: Calculates the 2D view aPresentation and its
73 -- updates. The latter are managed by aPresentationManager.
74 -- aPresentableObject has the display mode aMode;
75 -- this has the default value of 0, that is, the wireframe display mode.
76 -- Note that this syntax is not used in AIS as that
77 -- package only concerns 3D display.
78
79 raises NotImplemented from Standard
80 is virtual protected;
81
82 Compute(me:mutable;
83 aPresentationManager: PresentationManager3d from PrsMgr;
84 aPresentation: mutable Presentation from Prs3d;
85 aMode: Integer from Standard = 0)
86 ---Purpose: Calculates the 3D view aPresentation and its
87 -- updates. The latter are managed by aPresentationManager.
88 -- aPresentableObject has the display mode aMode;
89 -- this has the default value of 0, that is, the wireframe display mode.
90 raises NotImplemented from Standard
91 is virtual protected;
92
93 Compute(me : mutable;
94 aProjector : Projector from Prs3d;
95 aPresentation : mutable Presentation from Prs3d)
96 ---Purpose: Calculates the 3D view aPresentation and its
97 -- updates. The latter are managed by
98 -- aPresentationManager. Each of the views in the
99 -- viewer and every modification such as rotation, for
100 -- example, entails recalculation.
101 -- It must be redefined to implement hidden line removal
102 -- for the object. The user never calls this method
103 -- himself. This is done via the InteractiveContext object
104 -- and is dependent on the point of view from which the
105 -- object is displayed.
106 raises NotImplemented from Standard
107 is virtual protected;
108
109 Compute(me : mutable;
110 aProjector : Projector from Prs3d;
111 aTrsf : Transformation from Geom;
112 aPresentation : mutable Presentation from Prs3d)
113 is virtual protected;
114 ---Purpose: Calculates the 3D view aPresentation and its
115 -- updates. The latter are managed by
116 -- aPresentationManager. A point of view is provided
117 -- by the projector aProjector, and the geometric
118 -- transformation which has transformed associated
119 -- presentable objects is specified by aTrsf.
120 -- This function is to be used in case where a hidden
121 -- line removal display cannot be calculated
122 -- automatically. This occurs when associated
123 -- presentable objects have been transformed
124 -- geometrically, but not translated.
125 -- Warning
126 -- The transformation aTrsf must be applied to the
127 -- object before computation.
128
129 Update(me: mutable;AllModes: Boolean=Standard_False)
130 ---Purpose: recomputes all presentations of the object.
131 ---Level: Public
132 is protected;
133
134 Update(me: mutable; aMode: Integer from Standard; ClearOther: Boolean from Standard)
135 ---Purpose: Recomputes the presentation in the given mode.
136 -- If ClearOther is true, other presentation will be cleared.
137 is protected;
138
139 Fill(me: mutable;
140 aPresentationManager: PresentationManager from PrsMgr;
141 aPresentation: mutable Presentation from PrsMgr;
142 aMode: Integer from Standard = 0)
143 -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
144 is virtual protected;
145 --- Purpose: High-level interface for controlling polygon offsets
146
147 -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
148
149
150 -- Presentations(me: mutable) returns Presentations from PrsMgr
151 -- is static private;
152
153 Presentations(me : mutable) returns Presentations from PrsMgr
154 is static protected;
155 ---C++: return &
156
157 TypeOfPresentation3d(me) returns TypeOfPresentation3d from PrsMgr
158 is static;
159 ---Purpose: Returns information on whether the object accepts display in HLR mode or not.
160
161 -- ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate )
162 SetTransformPersistence( me : mutable;
163 aFlag : TransModeFlags from Graphic3d;
164 APoint : Pnt from gp )
165 is virtual;
166 ---Level: Public
167 ---Purpose: Sets up Transform Persistence Mode for this object.
168 -- This function used to lock in object position, rotation and / or zooming relative to camera position.
169 -- Object will be drawn in the origin setted by APoint parameter (except Graphic3d_TMF_TriedronPers flag
170 -- - see description later). aFlag should be:
171 -- - Graphic3d_TMF_None - no persistence attributes (reset);
172 -- - Graphic3d_TMF_PanPers - object doesn't move;
173 -- - Graphic3d_TMF_ZoomPers - object doesn't resize;
174 -- - Graphic3d_TMF_RotatePers - object doesn't rotate;
175 -- - Graphic3d_TMF_FullPers - pan, zoom and rotate transform persistence;
176 -- - Graphic3d_TMF_TriedronPers - object behaves like trihedron;
177 -- - combination (Graphic3d_TMF_PanPers | Graphic3d_TMF_ZoomPers);
178 -- - combination (Graphic3d_TMF_PanPers | Graphic3d_TMF_RotatePers);
179 -- - combination (Graphic3d_TMF_ZoomPers | Graphic3d_TMF_RotatePers).
180 -- If Graphic3d_TMF_TriedronPers persistence mode selected APoint coordinates X and Y means:
181 -- - X = 0.0, Y = 0.0 - center of view window;
182 -- - X > 0.0, Y > 0.0 - right upper corner of view window;
183 -- - X > 0.0, Y < 0.0 - right lower corner of view window;
184 -- - X < 0.0, Y > 0.0 - left upper corner of view window;
185 -- - X < 0.0, Y < 0.0 - left lower corner of view window.
186 -- And Z coordinate defines the gap from border of view window (except center position).
187 ---Category: Graphic attributes management
188
189 SetTransformPersistence( me : mutable;
190 aFlag : TransModeFlags from Graphic3d )
191 is static;
192 ---Level: Public
193 ---Purpose: Calls previous method with point (0,0,0)
194 ---Category: Graphic attributes management
195
196
197 GetTransformPersistenceMode( me ) returns TransModeFlags from Graphic3d is static;
198
199 ---Level: Public
200 ---Purpose: Gets Transform Persistence Mode for this object
201 ---Category: Graphic attributes management
202
203 GetTransformPersistencePoint( me ) returns Pnt from gp is static;
204
205 ---Level: Public
206 ---Purpose: Gets point of transform persistence for this object
207 ---Category: Graphic attributes management
208
209 -- ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate )
210
211 SetTypeOfPresentation(me:mutable; aType: TypeOfPresentation3d from PrsMgr);
212
213 SetToUpdate (me:mutable;aMode:Integer from Standard);
214 ---Purpose: flags the Prs of mode <AMode> to be Updated.
215 -- the Update will be done when needed.
216
217 SetToUpdate(me:mutable);
218 ---Purpose: flags all the Presentations to be Updated.
219
220 ToBeUpdated(me;ListOfMode : out ListOfInteger from TColStd);
221 ---Purpose: gives the list of modes which are flagged "to be updated".
222
223 SetLocation(me:mutable;aLoc:Location from TopLoc) is virtual;
224
225 HasLocation(me) returns Boolean from Standard;
226
227 Location(me) returns any Location from TopLoc;
228 ---C++: inline
229 ---C++: return const&
230
231 ResetLocation(me:mutable) is virtual;
232
233 UpdateLocation(me:mutable) is virtual;
234
235 UpdateLocation(me:mutable;P : mutable Presentation from Prs3d) is virtual;
236
59f45b7c 237 SetZLayer ( me : mutable;
238 thePrsMgr : PresentationManager from PrsMgr;
239 theLayerId : Integer from Standard )
240 is virtual;
241 ---Purpose: Set Z layer ID and update all presentations of
242 -- the presentable object. The layer can be set only for displayed object.
243 -- If all object presentations are removed, the layer ID will be set to
244 -- default value when computing presentation. The layers mechanism allows
245 -- drawing objects in higher layers in overlay of objects in lower layers.
7fd59977 246
59f45b7c 247 GetZLayer ( me;
248 thePrsMgr : PresentationManager from PrsMgr )
249 returns Integer from Standard is static;
250 ---Purpose: Get ID of Z layer. If no presentations of object is displayed,
251 -- and layer ID is unavailable, the -1 value is returned.
252
7fd59977 253fields
254 myPresentations: Presentations from PrsMgr is protected;
255 myTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr is protected;
256 myLocation : Location from TopLoc is protected;
257 --myTransformPersistence : TransModeFlags from Graphic3d;
258 myTransformPersistence : CTransPersStruct from Graphic3d;
259
260friends
261 class PresentationManager from PrsMgr,
262 Compute from Presentation3d from PrsMgr(me : mutable; aProjector : DataStructureManager from Graphic3d),
263 Compute from Presentation3d from PrsMgr(me : mutable; aProjector : DataStructureManager from Graphic3d;
264 aGivenStruct : Structure from Graphic3d),
265 Compute from Presentation3d from PrsMgr(me : mutable; aProjector : DataStructureManager from Graphic3d;
266 TheTrsf : Transformation from Geom),
267 Compute from Presentation3d from PrsMgr(me : mutable; aProjector : DataStructureManager from Graphic3d;
268 TheTrsf : Transformation from Geom;
269 aGivenStruct : Structure from Graphic3d)
270end PresentableObject from PrsMgr;