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
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 deferred class PresentationManager from PrsMgr
23 inherits TShared from MMgt
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
31 Presentation from PrsMgr,
32 PresentableObject from PrsMgr,
34 ListOfTransient from TColStd
38 NoSuchObject from Standard
43 Is3D(me) returns Boolean from Standard is deferred;
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.
53 Erase(me:mutable; aPresentableObject: PresentableObject from PrsMgr;
54 aMode: Integer from Standard = 0)
56 ---Purpose: erases the presentation of the object in the given
57 -- Presentation manager with the given mode.
60 Clear(me:mutable; aPresentableObject: PresentableObject from PrsMgr;
61 aMode: Integer from Standard = 0)
64 -- Clears the presentation of the presentable object
65 -- aPresentableObject in this framework with the
66 -- display mode aMode.
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.
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.
81 SetDisplayPriority(me;aPresentableObject: PresentableObject from PrsMgr;
82 amode:Integer from Standard;
83 aNewPrior:Integer from Standard);
85 -- Sets the display priority aNewPrior of the
86 -- presentable object aPresentableObject in this
87 -- framework with the display mode aMode.
89 DisplayPriority(me;aPresentableObject: PresentableObject from PrsMgr;
90 amode:Integer from Standard)
91 returns Integer from Standard;
93 -- Returns the display priority of the presentable object
94 -- aPresentableObject in this framework with the
95 -- display mode aMode.
97 SetZLayer ( me : mutable;
98 thePresentableObject : PresentableObject from PrsMgr;
99 theLayerId : Integer from Standard )
101 ---Purpose: Set Z layer ID for all presentations of the object.
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.
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
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
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.
133 ---Category: Immediate display methods.
135 BeginDraw(me: mutable) is virtual;
136 ---Purpose: initializes the list of Prs to be displayed in transient mode
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.
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.
154 EndDraw(me: mutable; aView: View from V3d; 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.
160 IsImmediateModeOn(me) returns Boolean from Standard;
162 ---Purpose: Returns true if immediate (transient) mode is on.
166 ---Category: Private & deferred methods.
169 aPresentableObject: PresentableObject from PrsMgr;
170 aMode: Integer from Standard = 0)
171 returns Boolean from Standard
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.
178 aPresentableObject: PresentableObject from PrsMgr;
179 aMode: Integer from Standard = 0)
180 returns mutable Presentation from PrsMgr
181 raises NoSuchObject from Standard
183 ---Purpose: Returns the presentation Presentation of the
184 -- presentable object aPresentableObject in this
185 -- framework. aPresentableObject has the display mode aMode.
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.
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.
203 newPresentation(me: mutable; aPresentableObject: PresentableObject from PrsMgr)
204 returns mutable Presentation from PrsMgr
206 ---Purpose: Creates a new presentation in the presentation manager.
210 myImmediateMode: Boolean from Standard is protected;
211 myImmediateList: ListOfTransient from TColStd is protected;
213 end PresentationManager from PrsMgr;