b311480e |
1 | -- Created on: 2000-04-07 |
2 | -- Created by: Tanya COOL |
3 | -- Copyright (c) 2000-2012 OPEN CASCADE SAS |
4 | -- |
5 | -- The content of this file is subject to the Open CASCADE Technology Public |
6 | -- License Version 6.5 (the "License"). You may not use the content of this file |
7 | -- except in compliance with the License. Please obtain a copy of the License |
8 | -- at http://www.opencascade.org and read it completely before using this file. |
9 | -- |
10 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | -- |
13 | -- The Original Code and all software distributed under the License is |
14 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | -- Initial Developer hereby disclaims all such warranties, including without |
16 | -- limitation, any warranties of merchantability, fitness for a particular |
17 | -- purpose or non-infringement. Please see the License for the specific terms |
18 | -- and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | |
21 | class InteractiveObject from AIS2D inherits GraphicObject from Graphic2d |
22 | |
23 | ---Purpose: Class Interactive Object defines a class of objects |
24 | -- with display and selection services. |
25 | -- Using visualization and selection machanisms, |
26 | -- interactive objects are used to display datum, curves, |
27 | -- shapes, markers, dimensions, etc. Interactive objects |
28 | -- also provide links to the interactive context. |
29 | |
30 | uses |
31 | |
32 | Primitive from Graphic2d, |
33 | TypeOfDetection from AIS2D, |
34 | KindOfIO from AIS2D, |
35 | InteractiveContext from AIS2D, |
36 | Drawer from Prs2d, |
37 | AspectRoot from Prs2d, |
38 | AspectName from Prs2d, |
39 | DataMapOfPrimAspects from AIS2D, |
40 | HSequenceOfPrimArchit from AIS2D, |
41 | AsciiString from TCollection, |
42 | FStream from Aspect, |
43 | IFStream from Aspect |
44 | |
45 | is |
46 | |
47 | Create returns mutable InteractiveObject from AIS2D; |
48 | ---Purpose: Initialize the Interactive Object |
49 | |
50 | -------------------------------------------------------------------- |
51 | ---Category: Methods for attributes management |
52 | |
53 | Attributes( me ) returns Drawer from Prs2d; |
54 | ---C++: inline |
55 | ---Level: Public |
56 | ---Purpose: Returns the attributes settings |
57 | |
58 | SetAttributes( me: mutable; aDrawer: Drawer from Prs2d ) is virtual; |
59 | ---Level: Public |
60 | ---Purpose: Initializes the drawing tool <aDrawer> |
61 | |
62 | UnsetAttributes( me: mutable ) is virtual; |
63 | ---Level: Public |
64 | ---Purpose: Clears settings provided by the drawing tool <aDrawer> |
65 | |
66 | SetAspect( me: mutable; anAspect: AspectRoot from Prs2d ); |
67 | ---Level: Public |
68 | ---Purpose: Sets the attributes from Aspect <anAspect> |
69 | -- to all primitives appropriate this Aspect. |
70 | |
71 | SetAspect( me: mutable; anAspect: AspectRoot from Prs2d; |
72 | aPrimitive: Primitive from Graphic2d ); |
73 | ---Level: Public |
74 | ---Purpose: Sets the attributes from Aspect <anAspect> |
75 | -- to primitive <aPrimitive> |
76 | -- Method works only for objects are linked |
77 | -- with InteractiveContext |
78 | |
79 | GetAspect( me; aPrimitive: Primitive from Graphic2d ) |
80 | returns AspectRoot from Prs2d; |
81 | ---Level: Public |
82 | ---Purpose: Returns Aspect for primitive <aPrimitive> |
83 | -- Method works only for objects are linked |
84 | -- with InteractiveContext |
85 | |
86 | HasAspect( me; aPrimitive: Primitive from Graphic2d ) |
87 | returns Boolean from Standard; |
88 | ---Level: Public; |
89 | ---Purpose: Returns true if primitive <aPrimitive> |
90 | -- is linked with an aspect |
91 | -------------------------------------------------------------------- |
92 | ---Category: Link To InteractiveContext |
93 | |
94 | HasInteractiveContext( me ) returns Boolean from Standard; |
95 | ---Level: Public |
96 | ---Purpose: Indicates whether the Interactive Object has a pointer |
97 | -- to an interactive context. |
98 | |
99 | GetContext( me ) returns InteractiveContext from AIS2D; |
100 | ---Level: Public |
101 | ---Purpose: Returns the context pointer to the interactive context. |
102 | |
103 | SetContext( me:mutable; aCntx : InteractiveContext from AIS2D ) is virtual; |
104 | ---Level: Public |
105 | ---Purpose: Places a link to <aCnTx>. The drawer of AIS2D_InteractiveObject |
106 | -- is connected to the Default Drawer Of <aCntx>. |
107 | -- That Means that this method has to be redefined if |
108 | -- computations depend on drawer values. |
109 | |
110 | |
111 | -------------------------------------------------------------------- |
112 | ---Category: Methods for display modes management |
113 | |
114 | DisplayMode( me ) returns Integer; |
115 | ---C++: inline |
116 | ---Level: Public |
117 | ---Purpose: Indicates the display mode of the Interactive Object |
118 | |
119 | HasDisplayMode ( me ) returns Boolean from Standard; |
120 | ---C++: inline |
121 | ---Level: Public |
122 | ---Purpose: Returns True if the Interactive Object has |
123 | -- a display mode setting. Otherwise, it is |
124 | -- displayed in Neutral Point. |
125 | |
126 | SetDisplayMode( me: mutable; aMode: Integer from Standard ); |
127 | ---C++: inline |
128 | ---Level: Public |
129 | ---Purpose: Allows to provide a setting <aMode> for an |
130 | -- Interactive Object's display mode. |
131 | |
132 | UnsetDisplayMode( me: mutable ); |
133 | ---C++: inline |
134 | ---Level: Public |
135 | ---Purpose: Removes display mode settings from the Interactive object |
136 | |
137 | DefaultDisplayMode( me ) returns Integer from Standard is virtual; |
138 | ---C++: inline |
139 | ---Level: Public |
140 | ---Purpose: Returns the default display mode. This method is to be |
141 | -- implemented when the main mode is not mode 0. |
142 | |
143 | AcceptDisplayMode( me; aMode: Integer from Standard ) returns Boolean from Standard is virtual; |
144 | ---C++: inline |
145 | ---Level: Public |
146 | ---Purpose: Returns true if the class of objects accepts the display mode <aMode> |
147 | |
148 | -------------------------------------------------------------------- |
149 | ---Category: Methods for highlight modes management |
150 | |
151 | HighlightMode( me ) returns TypeOfDetection from AIS2D; |
152 | ---C++: inline |
153 | ---Level: Public |
154 | ---Purpose: Returns the setting for highlight mode. |
155 | |
156 | HasHighlightMode( me ) returns Boolean from Standard; |
157 | ---C++: inline |
158 | ---Level: Public |
159 | ---Purpose: Returns true if the Interactive Object is in highlight mode |
160 | |
161 | SetHighlightMode( me: mutable; aMode: TypeOfDetection from AIS2D ); |
162 | ---C++: inline |
163 | ---Level: Public |
164 | ---Purpose: Allows to provide settings for highlight mode. |
165 | |
166 | UnsetHighlightMode( me: mutable ); |
167 | ---C++: inline |
168 | ---Level: Public |
169 | ---Purpose: Removes settings for highlight mode |
170 | |
171 | DefaultHighlightMode( me ) returns TypeOfDetection from AIS2D is virtual; |
172 | ---C++: inline |
173 | ---Level: Public |
174 | ---Purpose: Returns the default highlight mode |
175 | |
176 | -------------------------------------------------------------------- |
177 | ---Category: Methods for selection modes management |
178 | -------------------------------------------------------------------- |
179 | |
180 | SelectionMode( me ) returns Integer from Standard; |
181 | ---C++: inline |
182 | ---Level: Public |
183 | ---Purpose: Indicates the selection mode of the Interactive Object |
184 | |
185 | HasSelectionMode( me ) returns Boolean from Standard; |
186 | ---C++: inline |
187 | ---Level: Public |
188 | ---Purpose: Allows you to change the selection mode of an Interactive Object |
189 | |
190 | SetSelectionMode( me: mutable; aMode: Integer from Standard ); |
191 | ---C++: inline |
192 | ---Level: Public |
193 | ---Purpose: Allows to provide a setting <aMode> for an |
194 | -- Interactive Object's selection mode. |
195 | |
196 | UnsetSelectionMode( me: mutable ); |
197 | ---C++: inline |
198 | ---Level: Public |
199 | ---Purpose: Removes settings for selection mode |
200 | |
201 | DefaultSelectionMode( me ) returns Integer from Standard is virtual; |
202 | ---C++: inline |
203 | ---Level: Public |
204 | ---Purpose: Returns the default selection mode |
205 | |
206 | PrimitiveExist( me; aName: AspectName from Prs2d ) |
207 | returns Boolean from Standard is private; |
208 | ---Level: Internal |
209 | |
210 | State( me ) returns Integer from Standard; |
211 | ---C++: inline |
212 | ---Level: Internal |
213 | ---Purpose: |
214 | |
215 | SetState( me: mutable; aState: Integer from Standard ); |
216 | ---C++: inline |
217 | ---Level: Internal |
218 | ---Purpose: |
219 | |
220 | SelectPrimitive (me : mutable; anIndex: Integer from Standard; |
221 | append: Boolean from Standard ); |
222 | ---Level: Public |
223 | ---Purpose: Selects primitive with index( TOD_PRIMITIVE mode only ) |
224 | |
225 | AddDetectPrim( me: mutable; aPrim: Primitive from Graphic2d; |
226 | anInd: Integer from Standard ) is private; |
227 | ---Level: Internal |
228 | ---Purpose: |
229 | |
230 | AddSelectPrim( me: mutable; aPrim: Primitive from Graphic2d; |
231 | anInd: Integer from Standard ) is private; |
232 | ---Level: Internal |
233 | ---Purpose: |
234 | |
235 | RemoveSelectPrim( me: mutable; aPrim: Primitive from Graphic2d; |
236 | anInd: Integer from Standard ) is private; |
237 | ---Level: Internal |
238 | ---Purpose: |
239 | |
240 | SetSelSeqPrim( me: mutable; aSeq: HSequenceOfPrimArchit from AIS2D ) is private; |
241 | ---Level: Internal |
242 | ---Purpose: |
243 | |
244 | ClearSeqDetPrim( me: mutable ) is private; |
245 | ---Level: Internal |
246 | ---Purpose: |
247 | |
248 | ClearSeqSelPrim( me: mutable ) is private; |
249 | ---Level: Internal |
250 | ---Purpose: |
251 | |
252 | GetDetectSeqPrim( me ) returns HSequenceOfPrimArchit from AIS2D is private; |
253 | ---Level: Internal |
254 | ---Purpose: |
255 | |
256 | GetSelectedSeqPrim( me ) returns HSequenceOfPrimArchit from AIS2D is private; |
257 | ---Level: Internal |
258 | ---Purpose: |
259 | |
260 | -------------------------------------------------------------------- |
261 | |
262 | Save(me; aFStream: in out FStream from Aspect) is virtual; |
263 | Retrieve(me; anIFStream: in out IFStream from Aspect) is virtual; |
264 | |
265 | fields |
266 | |
267 | myICTX : InteractiveContext from AIS2D; |
268 | myDrawer : Drawer from Prs2d is protected; |
269 | myDisplayMode : Integer from Standard; |
270 | myHighlightMode : TypeOfDetection from AIS2D is protected; |
271 | mySelectionMode : Integer from Standard; |
272 | myAspects : DataMapOfPrimAspects from AIS2D; |
273 | myState : Integer from Standard; |
274 | myDetectedPrimSeq : HSequenceOfPrimArchit from AIS2D; |
275 | mySelectedPrimSeq : HSequenceOfPrimArchit from AIS2D; |
276 | |
277 | friends |
278 | |
279 | class InteractiveContext from AIS2D |
280 | |
281 | end InteractiveObject; |