0024047: Exception in TPrsStd_AISPresentation during destruction of TDocStd_Document
[occt.git] / src / TPrsStd / TPrsStd_AISPresentation.cdl
CommitLineData
b311480e 1-- Created on: 1998-09-30
2-- Created by: Denis PASCAL
3-- Copyright (c) 1998-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
22-- Lastly modified by :
23-- +---------------------------------------------------------------------------+
24-- ! ivan ! SetMode ! 5-04-2001! 3.0-00-1!
25-- +---------------------------------------------------------------------------+
26
27
28
29class AISPresentation from TPrsStd inherits Attribute from TDF
30
31 ---Purpose: An attribute to associate an
32-- AIS_InteractiveObject to a label in an AIS viewer.
33-- This attribute works in collaboration with TPrsStd_AISViewer.
34-- Note that all the Set... and Unset... attribute
35-- methods as well as the query methods for
36-- visualization attributes and the HasOwn... test
37-- methods are shortcuts to the respective
38-- AIS_InteractiveObject settings.
39
40uses GUID from Standard,
41 AttributeIndexedMap from TDF,
42 DataSet from TDF,
43 AttributeDelta from TDF,
44 Label from TDF,
45 RelocationTable from TDF,
46 InteractiveObject from AIS,
47 Length from Quantity,
48 NameOfColor from Quantity,
49 PlaneAngle from Quantity,
50 NameOfMaterial from Graphic3d,
51 Drawer from AIS
52is
53
54 GetID (myclass) returns GUID from Standard;
55 ---Purpose: Returns the GUID for TPrsStd_AISPresentation attributes.
56 ---C++: return const &
57
58 Set (myclass; L : Label from TDF; driver : GUID from Standard)
59 ---Purpose: Creates or retrieves the presentation attribute on
60 -- the label L, and sets the GUID driver.
61 returns AISPresentation from TPrsStd;
62
63 Unset (myclass; L : Label from TDF);
64 ---Purpose: Delete (if exist) the presentation attribute associated to the label <L>.
65
66
67 Set (myclass; master : Attribute from TDF)
68 ---Purpose: Creates or retrieves the AISPresentation
69 -- attribute attached to master.
70 -- The GUID of the driver will be the GUID of master.
71 -- master is the attribute you want to display.
72 returns AISPresentation from TPrsStd;
73
74
75 ---Category: Presentation attribute implementation
76 -- ======================================
77
78 Create returns mutable AISPresentation from TPrsStd;
79
80 SetDisplayed(me : mutable; B : Boolean from Standard);
81
82 Display (me : mutable; update : Boolean from Standard = Standard_False);
83 ---Purpose: Display presentation of object in AIS viewer.
84 -- If <update> = True then AISObject is recomputed and all
85 -- the visualization settings are applied
86
87 Erase (me : mutable; remove : Boolean from Standard = Standard_False);
88 ---Purpose: Removes the presentation of this AIS
89 -- presentation attribute from the TPrsStd_AISViewer.
90 -- If remove is true, this AIS presentation attribute
91 -- is removed from the interactive context.
92
93 Update (me : mutable);
94 ---Purpose: Recompute presentation of object and apply the visualization settings
95
96
97 GetDriverGUID (me) returns GUID from Standard;
98
99 SetDriverGUID (me: mutable ; guid : GUID from Standard);
100
101 IsDisplayed (me)
102 returns Boolean from Standard;
103---Purpose:
104-- Returns true if this AIS presentation attribute is displayed.
105 GetAIS (me) returns InteractiveObject from AIS;
106 ---Purpose: Returns AIS_InteractiveObject stored in the presentation attribute
107
108 AISUpdate (me : mutable)
109 ---Purpose: Updates AIS_InteractiveObject stored in the attribute
110 -- and applies the visualization settings
111 is private;
112
113 AISDisplay (me : mutable)
114 ---Purpose: Displays AIS_InteractiveObject stored in the attribute
115 is private;
116
117 AISErase (me : mutable; remove : Boolean from Standard = Standard_False)
118 ---Purpose: Erases AIS_InteractiveObject stored in the attribute in
119 -- the viewer; If <remove> = True then AISObject is removed
120 -- from AIS_InteractiveContext instead of simple erasing in the viewer
121 is private;
122
123 ---Category: Visualization settings of AIS_InteractiveObject
124 -- ================================================
125
126 Material(me) returns NameOfMaterial from Graphic3d;
127
128---Purpose:
129-- Returns the material setting for this presentation attribute.
130 SetMaterial(me : mutable; aName : NameOfMaterial from Graphic3d);
131---Purpose: Sets the material aName for this presentation attribute.
132 HasOwnMaterial(me) returns Boolean from Standard;
133---Purpose: Returns true if this presentation attribute already has a material setting.
134 UnsetMaterial(me : mutable);
135---Purpose: Removes the material setting from this presentation attribute.
136 SetTransparency(me : mutable; aValue : Real from Standard=0.6);
137--- Purpose:
138-- Sets the transparency value aValue for this
139-- presentation attribute.
140-- This value is 0.6 by default.
141 Transparency(me) returns Real from Standard;
142
143 HasOwnTransparency(me) returns Boolean from Standard;
144---Purpose: Returns true if this presentation attribute already has a transparency setting.
145 UnsetTransparency(me : mutable);
146---Purpose: Removes the transparency setting from this presentation attribute.
147 Color(me) returns NameOfColor from Quantity;
148
149 SetColor(me: mutable; aColor : NameOfColor from Quantity);
150---Purpose: Sets the color aColor for this presentation attribute.
151 HasOwnColor(me) returns Boolean from Standard;
152---Purpose: Returns true if this presentation attribute already has a color setting.
153 UnsetColor(me : mutable);
154---Purpose: Removes the color setting from this presentation attribute.
155 Width(me) returns Real from Standard ;
156
157 SetWidth(me: mutable; aWidth : Real from Standard);
158---Purpose: Sets the width aWidth for this presentation attribute.
159 HasOwnWidth(me) returns Boolean from Standard;
160---Purpose: Returns true if this presentation attribute already has a width setting.
161 UnsetWidth(me : mutable);
162---Purpose: Removes the width setting from this presentation attribute.
163 Mode(me) returns Integer from Standard;
164
165 SetMode(me: mutable; theMode : Integer from Standard);
166
167 HasOwnMode(me) returns Boolean from Standard;
168
169 UnsetMode(me : mutable);
170
171 SelectionMode(me) returns Integer from Standard;
172
173 SetSelectionMode(me: mutable; theSelectionMode : Integer from Standard);
174
175 HasOwnSelectionMode(me) returns Boolean from Standard;
176
177 UnsetSelectionMode(me : mutable);
178
179
180 ---Category: Methods of TDF_Attribute
181 -- ========================
182
183 ID(me)returns GUID from Standard;
184 ---C++: return const &
185
186 NewEmpty(me)
187 returns mutable Attribute from TDF;
188
189 Restore(me: mutable; with : Attribute from TDF);
190
191 Paste (me; into : mutable Attribute from TDF;
192 RT : mutable RelocationTable from TDF);
193
194 BackupCopy(me) returns mutable Attribute from TDF is redefined;
195
196 ---Category: Callbacks for viewer updating
197 -- =============================
198
199 AfterAddition (me: mutable)
200 is redefined;
201
202 BeforeRemoval (me: mutable)
203 is redefined;
204
205 BeforeForget(me: mutable)
206 is redefined;
207
208 AfterResume(me: mutable)
209 is redefined;
210
211 BeforeUndo (me: mutable; anAttDelta : AttributeDelta from TDF;
212 forceIt : Boolean from Standard = Standard_False)
213 returns Boolean from Standard
214 is redefined;
215
216 AfterUndo (me: mutable; anAttDelta : AttributeDelta from TDF;
217 forceIt : Boolean from Standard = Standard_False)
218 ---Purpose: update AIS viewer according to delta
219 returns Boolean from Standard
220 is redefined;
221
222fields
223
224 myDriverGUID : GUID from Standard;
225 myTransparency : Real from Standard;
226 myColor : NameOfColor from Quantity;
227 myMaterial : NameOfMaterial from Graphic3d;
228 myWidth : Real from Standard;
229 myMode : Integer from Standard;
230 mySelectionMode : Integer from Standard;
231 isDisplayed : Boolean from Standard;
232 hasOwnColor : Boolean from Standard;
233 hasOwnMaterial : Boolean from Standard;
234 hasOwnTransparency : Boolean from Standard;
235 hasOwnWidth : Boolean from Standard;
236 hasOwnMode : Boolean from Standard;
237 hasOwnSelectionMode: Boolean from Standard;
238 myAIS : InteractiveObject from AIS;
239end AISPresentation;
240