b311480e |
1 | -- Created on: 1993-10-21 |
2 | -- Created by: Jean-Louis FRENKEL |
3 | -- Copyright (c) 1993-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 | |
7fd59977 |
21 | -- Modified by rob Aug 20 98 : |
22 | -- new Methods : Is3D() , AddToImmediateList (GO) |
23 | -- BeginDraw redefined |
24 | -- new field : myGOList |
25 | -- => allows users to store independant Graphic |
26 | -- Objects, which will be displayed in immediate mode |
27 | -- when EndDraw is applied |
7fd59977 |
28 | |
29 | |
30 | class PresentationManager2d from PrsMgr inherits PresentationManager from PrsMgr |
31 | |
32 | ---Purpose: A framework to manage 2D displays, graphic entities |
33 | -- and their updates. Plotters, Highlights, Minima |
34 | -- maxima, immediate display (of transient graphic data???]. |
35 | |
36 | uses |
37 | ListOfTransient from TColStd, |
38 | View from Graphic2d, |
39 | TransientManager from Graphic2d, |
40 | PresentableObject from PrsMgr, |
41 | Presentation from PrsMgr, |
42 | Presentation2d from PrsMgr, |
43 | DisplayList from Graphic2d, |
44 | GraphicObject from Graphic2d, |
45 | Buffer from Graphic2d, |
46 | View from Viewer |
47 | |
48 | is |
49 | |
50 | Create(aStructureManager: View from Graphic2d) |
51 | returns mutable PresentationManager2d from PrsMgr; |
52 | ---Purpose: Creates a framework to manage displays and graphic |
53 | -- entities with the 2D view aStructureManager. |
54 | |
55 | Is3D(me) returns Boolean from Standard is redefined static; |
56 | |
57 | ColorHighlight(me: mutable; |
58 | aPresentableObject: mutable PresentableObject from PrsMgr; |
59 | anIndex: Integer from Standard; |
60 | aMode: Integer from Standard = 0) |
61 | is static; |
62 | ---Purpose: Highlights the graphic object aPresentableObject in |
63 | -- color by the color index anIndex. aPresentableObject |
64 | -- has the display mode aMode. |
65 | |
66 | EnablePlot (me: mutable; |
67 | aPresentableObject: mutable PresentableObject from PrsMgr; |
68 | aMode: Integer from Standard = 0) |
69 | is static; |
70 | ---Purpose: Allows the drawing on a plotter of the graphic object |
71 | -- aPresentableObject with the display mode aMode. |
72 | |
73 | DisablePlot (me: mutable; |
74 | aPresentableObject: mutable PresentableObject from PrsMgr; |
75 | aMode: Integer from Standard = 0) |
76 | ---Purpose: Forbids the drawing on a plotter of the graphic object |
77 | -- aPresentableObject with the display mode aMode. |
78 | is static; |
79 | |
80 | IsPlottable (me; |
81 | aPresentableObject: mutable PresentableObject from PrsMgr; |
82 | aMode: Integer from Standard = 0) |
83 | returns Boolean from Standard |
84 | ---Level: Public |
85 | ---Purpose: Returns Standard_True if the graphic object <me> |
86 | -- is plottable, Standard_False if not. |
87 | ---Category: Methods to manage the plotter |
88 | is static; |
89 | |
90 | SetOffset (me: mutable; |
91 | aPresentableObject: mutable PresentableObject from PrsMgr; |
92 | anOffset: Integer from Standard; |
93 | aMode: Integer from Standard = 0) |
94 | is static; |
95 | ---Level: Public |
96 | ---Purpose: Specifies an Offset applied to the original color |
97 | -- index of all primitives in the graphic object <me>. |
98 | -- Warning: To reset the real color of the primitives |
99 | -- you have to call this method with <anOffset> = 0. |
100 | ---Category: Methods to manage the highlight |
101 | |
102 | Offset (me; |
103 | aPresentableObject: mutable PresentableObject from PrsMgr; |
104 | aMode: Integer from Standard = 0) |
105 | returns Integer from Standard |
106 | is static; |
107 | ---Level: Public |
108 | ---Purpose: Returns the Offset applied to the original color |
109 | -- index of all primitives in the graphic object <me>. |
110 | ---Category: Methods to manage the highlight |
111 | |
112 | |
113 | InitMinMax(me: mutable) |
114 | ---Purpose: Initializes a list of 2D objects for which minima and |
115 | -- maxima will be calculated. |
116 | is static; |
117 | |
118 | AddMinMax(me: mutable; aPresentableObject: PresentableObject from PrsMgr; |
119 | aMode: Integer from Standard = 0) |
120 | ---Purpose: Appends the graphic object aPresentableObject with |
121 | -- the display mode aMode to the list of objects for |
122 | -- which minima and maxima will be calculated. |
123 | is static; |
124 | |
125 | MinMax(me; MinX,MaxX,MinY,MaxY: out Real from Standard) |
126 | ---Purpose: Returns the minima and maxima for all the graphic |
127 | -- objects listed by the AddMinMax function. |
128 | is static; |
129 | |
130 | SetHighlightColor(me:mutable; anIndex: Integer from Standard) |
131 | is static; |
132 | --- Purpose: Sets the highlight color index anIndex. |
133 | |
134 | StructureManager(me) returns mutable View from Graphic2d |
135 | is static; |
136 | ---Purpose: Returns the structure manager. |
137 | |
138 | |
139 | |
140 | BeginDraw(me:mutable) is redefined static; |
141 | |
142 | AddToImmediateList(me:mutable;aGO:GraphicObject from Graphic2d); |
143 | |
144 | EndDraw(me: mutable; aView: View from Viewer; DoubleBuffer: Boolean from Standard = Standard_False) |
145 | is redefined static; |
146 | ---Purpose: Allows rapid drawing of the view aView by avoiding |
147 | -- an update of the whole background. If DoubleBuffer is true, the background is drawn. |
148 | |
149 | |
150 | Dump (me: mutable; |
151 | aBuffer: Buffer from Graphic2d; |
152 | aPresentableObject: PresentableObject from PrsMgr; |
153 | aMode: Integer from Standard = 0) is static; |
154 | ---Level: Public |
155 | ---Purpose: Dumps the Graphic Primitives of the PresentatbleObject in the buffer |
156 | |
157 | |
158 | CastPresentation(me; aPresentableObject: mutable PresentableObject from PrsMgr; |
159 | aMode: Integer from Standard = 0) |
160 | returns mutable Presentation2d from PrsMgr |
161 | is static; |
162 | |
163 | newPresentation(me: mutable; aPresentableObject: PresentableObject from PrsMgr) |
164 | returns mutable Presentation from PrsMgr |
165 | ---Level: Internal |
166 | ---Purpose: Creates a new presentation in the presentation manager. |
167 | is redefined static; |
168 | |
169 | |
170 | |
171 | fields |
172 | |
173 | myStructureManager: View from Graphic2d; |
174 | MinMaxList: DisplayList from Graphic2d; |
175 | myTM : TransientManager from Graphic2d; |
176 | myGOList : ListOfTransient from TColStd; |
177 | end PresentationManager2d from PrsMgr; |