e072c2f3bfcd0098cfe3bf239e5fc5238b972a75
[occt.git] / src / PrsMgr / PrsMgr_PresentationManager.cdl
1 -- Created on: 1995-01-25
2 -- Created by: Jean-Louis Frenkel
3 -- Copyright (c) 1995-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
22 deferred class PresentationManager from PrsMgr  
23 inherits TShared from MMgt
24
25         ---Purpose: This class represents any kind of entity able to collect
26         --          representations of an object, to show or erase them.
27         --          Example: StructureManager from Graphic3d
28         --                   View from Graphic2d
29
30 uses 
31     Presentation from PrsMgr,
32     PresentableObject from PrsMgr,
33     View from Viewer,
34     ListOfTransient from TColStd
35     
36
37 raises 
38     NoSuchObject from Standard
39 is
40
41     Initialize;
42
43     Is3D(me) returns Boolean from Standard is deferred;
44
45     Display(me: mutable; aPresentableObject: mutable PresentableObject from PrsMgr;
46                 aMode: Integer from Standard = 0)
47         ---Purpose: Displays the presentation of the object in the given
48         --          Presentation manager with the given mode.
49         --          The mode should be enumerated by the object which
50         --          inherits PresentableObject.
51     is static;
52     
53     Erase(me:mutable; aPresentableObject: PresentableObject from PrsMgr;
54                 aMode: Integer from Standard = 0)
55         ---Level: public
56         ---Purpose: erases the presentation of the object in the given
57         --          Presentation manager with the given mode.
58     is static;
59
60     Clear(me:mutable; aPresentableObject: PresentableObject from PrsMgr;
61                 aMode: Integer from Standard = 0)
62     is virtual;
63         ---Purpose:
64         -- Clears the presentation of the presentable object
65         -- aPresentableObject in this framework with the
66         -- display mode aMode.
67
68     Highlight(me: mutable; aPresentableObject: mutable PresentableObject from PrsMgr;
69                   aMode: Integer from Standard = 0)
70         ---Purpose: Highlights the presentation of the presentable object
71         -- aPresentableObject in this framework with the display mode aMode.
72     is static;
73     
74     Unhighlight(me:mutable; aPresentableObject: PresentableObject from PrsMgr;
75                 aMode: Integer from Standard = 0)
76         ---Purpose: Removes highlighting from the presentation of the
77         -- presentable object aPresentableObject in this
78         -- framework with the display mode aMode.
79     is static;
80
81     SetDisplayPriority(me;aPresentableObject: PresentableObject from PrsMgr; 
82                           amode:Integer from Standard;
83                           aNewPrior:Integer from Standard);
84         ---Purpose:
85         -- Sets the display priority aNewPrior   of the
86         -- presentable object aPresentableObject in this
87         -- framework with the display mode aMode.
88         
89     DisplayPriority(me;aPresentableObject: PresentableObject from PrsMgr; 
90                           amode:Integer from Standard)
91     returns Integer from Standard;
92         ---Purpose:
93         -- Returns the display priority of the presentable object
94         -- aPresentableObject in this framework with the
95         -- display mode aMode.
96     
97     SetZLayer ( me                   : mutable;
98                 thePresentableObject : PresentableObject from PrsMgr;
99                 theLayerId           : Integer from Standard )
100       is static;
101     ---Purpose: Set Z layer ID for all presentations of the object.
102
103     GetZLayer ( me;
104                 thePresentableObject : PresentableObject from PrsMgr )
105       returns Integer from Standard is static;
106     ---Purpose: Get Z layer ID assigned to all presentations of the object.
107     -- Method returns -1 value if object has no presentations and is
108     -- impossible to get layer index.
109     
110     IsDisplayed(me;aPresentableObject: PresentableObject from PrsMgr;
111                 aMode: Integer from Standard = 0) 
112         ---Purpose: Returns true if the presentation of the presentable
113         -- object aPresentableObject in this framework with the
114         -- display mode aMode is displayed.
115     returns Boolean from Standard
116     is static;
117
118     IsHighlighted(me;aPresentableObject: PresentableObject from PrsMgr;
119                 aMode: Integer from Standard = 0) 
120         ---Purpose: Returns true if the presentation of the presentable
121         -- object aPresentableObject in this framework with the
122         -- display mode aMode is highlighted.
123     returns Boolean from Standard
124     is static;
125
126
127     Update(me; aPresentableObject: PresentableObject from PrsMgr;
128               aMode: Integer from Standard = 0)
129         ---Purpose: Updates the presentation of the presentable object
130         -- aPresentableObject in this framework with the display mode aMode.
131     is static;
132     
133         ---Category: Immediate display methods.
134
135     BeginDraw(me: mutable) is virtual;
136         ---Purpose: initializes the list of Prs to be displayed in transient mode
137
138     Add(me: mutable ; aPresentableObject: PresentableObject from PrsMgr;
139                       aMode: Integer from Standard = 0);
140         ---Purpose: Performs an iteration of the transient objects to look
141         -- for the presentable objects with the display mode aMode.
142         -- Appends the presentation of the presentable object
143         -- aPresentableObject with the mode aMode to the list
144         -- of objects in immediate mode.
145
146     Remove(me: mutable ; aPresentableObject: PresentableObject from PrsMgr;
147                       aMode: Integer from Standard = 0);
148         ---Purpose: Performs an iteration of the transient objects to look
149         -- for the presentable objects with the display mode aMode.
150         -- Removes the presentation of the presentable object
151         -- aPresentableObject with the mode aMode from the
152         -- list of objects in immediate mode.
153
154     EndDraw(me: mutable; aView: View from Viewer; DoubleBuffer: Boolean from Standard = Standard_False)
155         ---Purpose:  Allows rapid drawing of the view aView by avoiding
156         -- an update of the whole background. If DoubleBuffer
157         -- is true, the background is drawn.
158     is deferred;
159
160     IsImmediateModeOn(me) returns Boolean from Standard;
161         ---C++: inline
162         ---Purpose: Returns true if immediate (transient) mode is on.
163
164
165
166            ---Category: Private & deferred methods.
167            
168     HasPresentation (me;
169                     aPresentableObject: PresentableObject from PrsMgr;
170                     aMode: Integer from Standard = 0)
171     returns Boolean from Standard
172     is static;
173         ---Purpose: Returns true if there is a presentation of the
174         -- presentable object aPresentableObject in this
175         -- framework, aPresentableObject having the display mode aMode.
176         
177     Presentation (me;
178                     aPresentableObject: PresentableObject from PrsMgr;
179                     aMode: Integer from Standard = 0)
180     returns mutable Presentation from PrsMgr 
181     raises NoSuchObject from Standard
182     is static;
183         ---Purpose: Returns the presentation Presentation of the
184         -- presentable object aPresentableObject in this
185         -- framework. aPresentableObject has the display mode aMode.
186         
187     AddPresentation(me: mutable;
188                     aPresentableObject: PresentableObject from PrsMgr;
189                     aMode: Integer from Standard = 0)
190         ---Purpose: Adds a presentation of the presentable object
191         -- aPresentableObject to this framework.
192         -- aPresentableObject has the display mode aMode.
193     is protected;
194
195     RemovePresentation(me: mutable;
196                        aPresentableObject: PresentableObject from PrsMgr;
197                        aMode: Integer from Standard = 0)
198         ---Purpose: Removes a presentation of the presentable object
199         -- aPresentableObject to this framework.
200         -- aPresentableObject has the display mode aMode.
201     is protected;
202
203     newPresentation(me: mutable; aPresentableObject: PresentableObject from PrsMgr)
204     returns mutable Presentation from PrsMgr
205         ---Level: Internal 
206         ---Purpose: Creates a new presentation in the presentation manager.
207     is deferred private;
208
209 fields
210     myImmediateMode: Boolean from Standard is protected;
211     myImmediateList: ListOfTransient from TColStd is protected;
212     
213 end PresentationManager from PrsMgr;