0022627: Change OCCT memory management defaults
[occt.git] / src / AIS / AIS_LocalContext.cdl
CommitLineData
7fd59977 1-- File: AIS_LocalContext.cdl
2-- Created: Wed Sep 4 16:13:24 1996
3-- Author: Robert COUBLANC
4-- <rob@robox.paris1.matra-dtv.fr>
5--
6-- Modified May 20th 98 :
7-- Modification in Management of selected entities
8-- Now we store the selected entity Owner in AIS_Selection.
9-- (no more links with Session...)
10-- Modifications in Management of hilight of detected entities
11-- VTN 23/11/99 BUC60614 Avoid to crash because
12-- myStdFilters array is too short.
13-- GG : BUC60688 25/05/00 Add SetSensitivity() methods
14-- GG : IMP150501 Remove oboslete method DragTo
15-- (See AIS_InteractiveContext)
16-- ZSV : IMP160701 Add InitDetected(),MoreDetected(),NextDetected(),
17-- DetectedCurrentShape(),DetectedCurrentObject()
18-- methods
19--
20---Copyright: Matra Datavision 1996
21
22
1bd2fa67 23class LocalContext from AIS inherits TShared from MMgt
7fd59977 24
25 ---Purpose: Defines a specific context for selection.
26 -- It becomes possible to:
27 -- + Load InteractiveObjects with a mode to be
28 -- activated + associate InteractiveObjects with a
29 -- set of temporary selectable Objects.... + +
30 -- activate StandardMode of selection for Entities
31 -- inheriting BasicShape from AIS (Selection Of
32 -- vertices, edges, wires,faces... + Add Filters
33 -- acting on detected owners of sensitive primitives
34 --
35 --
36 -- - automatically highlight shapes and
37 -- InteractiveObjects (highlight of detected shape +
38 -- highlight of detected selectable...
39 --
40
41uses
42 AsciiString from TCollection,
43 ListOfInteger from TColStd,
44 SequenceOfInteger from TColStd,
45 MapOfTransient from TColStd,
46 Array1OfPnt2d from TColgp,
47 NameOfColor from Quantity,
48 ShapeEnum from TopAbs,
49 Shape from TopoDS,
50 View from V3d,
51 PresentationManager3d from PrsMgr,
52 Projector from Select3D,
53 IndexedMapOfOwner from SelectMgr,
54 EntityOwner from SelectMgr,
55 OrFilter from SelectMgr,
56 Filter from SelectMgr,
57 SelectionManager from SelectMgr,
58 SelectableObject from SelectMgr ,
59 ListOfFilter from SelectMgr,
60 BRepOwner from StdSelect,
61 ViewerSelector3d from StdSelect,
62 InteractiveContext from AIS,
63 ClearMode from AIS,
64 InteractiveObject from AIS,
65 Shape from AIS,
66 DataMapOfSelStat from AIS,
67 LocalStatus from AIS,
68 StatusOfPick from AIS,
69 StatusOfDetection from AIS,
70 SequenceOfInteractive from AIS
71
72is
73
74 Create returns mutable LocalContext from AIS;
75
76
77 Create (aCtx : InteractiveContext from AIS;
78 anIndex : Integer from Standard;
79 LoadDisplayed : Boolean from Standard=Standard_True;
80 AcceptStandardModes : Boolean from Standard=Standard_True;
81 AcceptErase : Boolean from Standard= Standard_False;
82 UseBothViewers : Boolean from Standard= Standard_False)
83 returns mutable LocalContext from AIS;
84 ---Purpose: Constructor By Default, the displayed objects are
85 -- automatically loaded.
86
87
88 AcceptErase(me:mutable;aStatus : Boolean from Standard);
89 ---C++: inline
90 ---Purpose: authorize or not others contexts to erase
91 -- temporary displayed objects here;
92
93 AcceptErase(me) returns Boolean from Standard;
94 ---C++: inline
95
96 SetContext(me:mutable;aCtx:InteractiveContext from AIS);
97
98 SelectionName(me) returns AsciiString from TCollection;
99 ---C++: inline
100 ---C++: return const&
101
102
103 Terminate(me: mutable; updateviewer : Boolean from Standard = Standard_True);
104
105 HasSameProjector(me;aPrj:Projector from Select3D)
106 returns Boolean from Standard;
107 ---Purpose: compares the current projector of the localContext
108 -- with <aPrj>
109 -- returns True if the projectors are identical.
110 -- (no need to update projection of selection primitives
111 -- when closing the local context)....
112
113 Reactivate(me:mutable);
114 ---Purpose: to be called when a upper local context was closed...
115 -- useful to put pack the right projector...
116
117 ---Category: LOAD AND PREPARE
118 -- - INTERACTIVE OBJECTS...
119 -- - FILTERS
120 -- - STANDARD MODES OF ACTIVATION
121
122
123
124
125 Display(me : mutable;
126 anInteractive : InteractiveObject from AIS;
127 DisplayMode : Integer from Standard = 0;
128 AllowShapeDecomposition: Boolean from Standard = Standard_True;
129 ActivationMode : Integer from Standard = 0)
130 returns Boolean from Standard;
131 ---Purpose: returns true if done...
132
133 Load(me : mutable;
134 anInteractive : InteractiveObject from AIS;
135 AllowShapeDecomposition: Boolean from Standard = Standard_True;
136 ActivationMode : Integer from Standard = 0)
137 returns Boolean from Standard;
138 ---Purpose: loads <anInteractive> with nodisplay...
139 -- returns true if done
140
141 Erase(me: mutable;
142 anInteractive : InteractiveObject from AIS)
143 returns Boolean from Standard;
144 ---Purpose: returns true if done...
145
146
147 Remove(me : mutable;
148 aSelectable : InteractiveObject from AIS)
149 returns Boolean from Standard;
150
151
152 ClearPrs (me : mutable;
153 anInteractive : InteractiveObject from AIS;
154 aMode : Integer from Standard)
155 returns Boolean from Standard;
156
157 SetShapeDecomposition(me : mutable;
158 aStoredObject : InteractiveObject from AIS;
159 aStatus : Boolean from Standard);
160 ---Purpose: allows or forbids the shape decomposition into
161 -- Activated Standard Mode for <aStoredObject>
162 -- does nothing if the object doesn't inherits
163 -- BasicShape from AIS
164
165
166 Clear(me:mutable;atype: ClearMode from AIS = AIS_CM_All);
167 ---Purpose: according to <atype> , clears the different parts of
168 -- the selector (filters, modeof activation, objects...)
169
170
171
172
173 ActivateMode (me : mutable;
174 aSelectable: InteractiveObject from AIS;
175 aMode : Integer from Standard );
176 ---Purpose: optional : activation of a mode which is not 0 for a selectable...
177
178 DeactivateMode(me : mutable;
179 aSelectable: InteractiveObject from AIS;
180 aMode : Integer from Standard );
181 Deactivate(me : mutable;
182 aSelectable: InteractiveObject from AIS);
183
184 ActivateStandardMode(me:mutable;aType:ShapeEnum from TopAbs);
185 ---Purpose: decomposition of shapes into <aType>
186
187
188 DeactivateStandardMode(me:mutable;aType:ShapeEnum from TopAbs);
189
190 StandardModes(me) returns ListOfInteger from TColStd;
191 ---C++: return const &
192 ---C++: inline
193
194
195
196 AddFilter(me:mutable;aFilter:Filter from SelectMgr);
197
198 RemoveFilter(me:mutable;aFilter: Filter from SelectMgr);
199
200
201 ListOfFilter(me) returns ListOfFilter from SelectMgr;
202 ---C++: return const &
203 ---C++: inline
204
205 Filter(me) returns any OrFilter from SelectMgr;
206 ---C++: return const &
207 ---C++: inline
208
209
210 SetAutomaticHilight(me:mutable ; aStatus:Boolean) ;
211 ---Purpose: if <aStatus> = True , the shapes or subshapes detected
212 -- by the selector will be automatically hilighted in the
213 -- main viewer.
214 -- Else the user has to manage the detected shape outside the
215 -- Shape Selector....
216 ---C++: inline
217
218
219
220 AutomaticHilight(me) returns Boolean;
221 ---C++: inline
222
223
224
225 ---Category: THE SELECTION PROCESS
226
227
228 MoveTo(me:mutable;Xpix,Ypix : Integer from Standard;
229 aview : View from V3d)
230 returns StatusOfDetection from AIS;
231
232
233 HasNextDetected(me) returns Boolean from Standard;
234 ---C++: inline
235 ---Purpose: returns True if more than one entity
236 -- was detected at the last Mouse position.
237
238 HilightNextDetected(me:mutable;aView:View from V3d)
239 returns Integer from Standard;
240 ---Purpose: returns True if last detected. the next detected will
241 -- be first one (endless loop)
242
243 HilightPreviousDetected(me:mutable;aView:View from V3d)
244 returns Integer from Standard;
245
246
247 UnhilightLastDetected(me:mutable;aView:View from V3d) returns Boolean from Standard;
248 ---Purpose: returns True if something was done...
249
250 Select(me: mutable;updateviewer : Boolean from Standard = Standard_True)
251 returns StatusOfPick from AIS;
252 ---Purpose: returns the number of selected
253
254 ShiftSelect(me: mutable;updateviewer : Boolean from Standard = Standard_True)
255 returns StatusOfPick from AIS;
256
257 Select(me : mutable;
258 XPMin,YPMin,XPMax,YPMax : Integer from Standard;
259 aView : View from V3d;
260 updateviewer : Boolean from Standard = Standard_True)
261 returns StatusOfPick from AIS;
262
263
264 ShiftSelect(me : mutable;
265 XPMin,YPMin,XPMax,YPMax : Integer from Standard;
266 aView : View from V3d;
267 updateviewer : Boolean from Standard = Standard_True)
268 returns StatusOfPick from AIS;
269
270 Select(me : mutable;
271 Polyline : Array1OfPnt2d from TColgp;
272 aView : View from V3d;
273 updateviewer : Boolean from Standard = Standard_True)
274 returns StatusOfPick from AIS;
275
276 ShiftSelect(me : mutable;
277 Polyline : Array1OfPnt2d from TColgp;
278 aView : View from V3d;
279 updateviewer : Boolean from Standard = Standard_True)
280 returns StatusOfPick from AIS;
281
282 HilightPicked(me:mutable;updateviewer:Boolean from Standard =Standard_True) ;
283
284 UnhilightPicked(me:mutable;updateviewer:Boolean from Standard = Standard_True) ;
285
286
287 UpdateSelected (me : mutable;
288 updateviewer : Boolean from Standard = Standard_True);
289
290 UpdateSelected (me : mutable;
291 anobj : InteractiveObject from AIS;
292 updateviewer : Boolean from Standard = Standard_True);
293 ---Purpose: Part of advanced selection highlighting mechanism.
294 -- If no owners belonging to anobj are selected, calls anobj->ClearSelected(),
295 -- otherwise calls anobj->HilightSelected(). This method can be used to avoid
296 -- redrawing the whole selection belonging to several Selectable Objects.
297
298
299 SetSelected(me : mutable;
300 anobj : InteractiveObject from AIS;
301 updateviewer : Boolean from Standard=Standard_True);
302 ---Purpose: useful to update selection with objects coming from
303 -- Collector or stack
304
305 AddOrRemoveSelected(me : mutable;
306 anobj : InteractiveObject from AIS;
307 updateviewer : Boolean from Standard=Standard_True);
308 ---Purpose: useful to update selection with objects coming from
309 -- Collector or stack
310 AddOrRemoveSelected(me : mutable;
311 aShape : Shape from TopoDS;
312 updateviewer : Boolean from Standard=Standard_True);
313
314 AddOrRemoveSelected(me : mutable;
315 Ownr : EntityOwner from SelectMgr;
316 updateviewer : Boolean from Standard=Standard_True);
317
318
319
320 ClearSelected(me:mutable;updateviewer : Boolean from Standard=Standard_True);
321 ---Purpose:
322
323
324 ---Category: GET THE DETECTED
325
326
327 HasDetected (me) returns Boolean from Standard;
328 ---C++: inline
329
330 InitDetected(me: mutable);
331 MoreDetected(me) returns Boolean from Standard;
332 NextDetected(me: mutable);
333 DetectedCurrentShape(me) returns Shape from TopoDS;
334 ---C++: return const &
335 DetectedCurrentObject(me) returns InteractiveObject from AIS;
336
337 HasDetectedShape(me) returns Boolean from Standard;
338 DetectedShape (me) returns Shape from TopoDS;
339 ---C++: return const &
340 DetectedInteractive(me) returns InteractiveObject from AIS;
341 DetectedOwner (me) returns EntityOwner from SelectMgr;
342
343
344 ---Category: GET THE SELECTED
345
346 InitSelected (me: mutable);
347 MoreSelected(me) returns Boolean from Standard;
348 NextSelected(me:mutable);
349 HasShape(me) returns Boolean from Standard;
350 ---Purpose: returns TRUE if the detected entity is a shape
351 -- coming from a Decomposition of an element.
352 SelectedShape(me) returns Shape from TopoDS;
353 ---C++: return const &
354
355 SelectedOwner(me) returns EntityOwner from SelectMgr;
356 IsSelected(me;aniobj: InteractiveObject from AIS) returns Boolean from Standard;
357 IsSelected(me;anOwner: EntityOwner from SelectMgr) returns Boolean from Standard;
358 SelectedInteractive(me) returns InteractiveObject from AIS;
359 HasApplicative (me) returns Boolean from Standard;
360 ---Purpose: returns TRUE if an interactive element
361 -- was associated with the current picked entity.
362 SelectedApplicative(me) returns any Transient from Standard;
363 ---C++: return const &
364
365
366
367
368
369
370 ---Category: Management Of Temporary Attributes
371
372 SetDisplayPriority(me : mutable;
373 anObject: InteractiveObject from AIS;
374 Prior : Integer from Standard);
375
59f45b7c 376 SetZLayer( me : mutable;
377 theIObj : InteractiveObject from AIS;
378 theLayerId : Integer from Standard );
379 ---Purpose: Set Z layer id for interactive object. The layer can be
380 -- specified for displayed object only. The Z layers can be used to display
381 -- temporarily presentations of some object in front of the other objects
382 -- in the scene. The ids for Z layers are generated by V3d_Viewer.
383 -- Note that Z layers differ from under-/overlayer in V3d_View:
384 -- under-/overlayer are intended for specific 2D drawings that appear
385 -- behind/in front of all 3D presentations, while SetZLayer() method
386 -- applies to regular 3D presentations and does not imply any specific
387 -- drawing methods.
388
389 GetZLayer( me;
390 theIObj : InteractiveObject from AIS )
391 returns Integer from Standard;
392 ---Purpose: Get Z layer id set for displayed interactive object.
393 -- If the object doesn't exists in context or has no computed presentations,
394 -- the method returns -1.
395
7fd59977 396 DisplayedObjects(me;theMapToFill : in out MapOfTransient from TColStd)
397 returns Integer from Standard;
398
399 IsIn(me;anObject : InteractiveObject from AIS)
400 returns Boolean from Standard;
401
402
403 IsDisplayed(me;anObject : InteractiveObject from AIS)
404 returns Boolean from Standard;
405
406 IsDisplayed(me;anObject : InteractiveObject from AIS;
407 aMode : Integer from Standard)
408 returns Boolean from Standard;
409
410 SelectionModes(me;anObject:InteractiveObject from AIS)
411 returns ListOfInteger from TColStd;
412 ---C++: return const &
413
414 SubIntensityOn(me:mutable; anObject : InteractiveObject from AIS );
415
416 SubIntensityOff(me:mutable; anObject : InteractiveObject from AIS );
417
418 Hilight(me: mutable; anObject : InteractiveObject from AIS);
419
420 Hilight(me:mutable; anObject : InteractiveObject from AIS;aCol:NameOfColor from Quantity);
421
422 Unhilight(me:mutable; anObject : InteractiveObject from AIS);
423
424 IsHilighted(me;anObject : InteractiveObject from AIS)
425 returns Boolean from Standard;
426
427 IsHilighted(me;
428 anObject : InteractiveObject from AIS;
429 WithColor : out Boolean from Standard;
430 HiCol : out NameOfColor from Quantity)
431 returns Boolean from Standard;
432
433 SetSensitivity(me:mutable;
434 aPrecision: Real from Standard);
435 ---Level: Public
436 ---Purpose: Define the current selection sensitivity for
437 -- this local context according to the view size.
438
439 SetSensitivity(me:mutable;
440 aPrecision: Integer from Standard = 2);
441 ---Level: Public
442 ---Purpose: Define the current selection sensitivity for
443 -- this local context according to the view size.
444
445 ---Category: IMMEDIATE MODE
446
447
448 BeginImmediateDraw (me:mutable) returns Boolean from Standard;
449 ---Purpose: initializes the list of presentations to be displayed
450 -- returns False if No Local COnte
451
452 ImmediateAdd (me:mutable;anIObj:InteractiveObject from AIS;aMode:Integer from Standard=0)
453 returns Boolean from Standard;
454 ---Purpose: returns True if <anIObj> has been stored in the list.
455
456 ImmediateRemove (me:mutable;anIObj:InteractiveObject from AIS;aMode:Integer from Standard=0)
457 returns Boolean from Standard;
458 ---Purpose: returns True if <anIObj> has been removed from the list.
459
460 EndImmediateDraw(me:mutable;aView : View from V3d;DoubleBuf:Boolean from Standard=Standard_False)
461 returns Boolean from Standard;
462 ---Purpose: returns True if the immediate display has been done.
463
464 IsImmediateModeOn(me) returns Boolean from Standard;
465
466 ---Category: INTERNAL METHODS;
467
468 UpdateConversion(me:mutable);
469
470 UpdateSort(me:mutable);
471
472
473
474 Status(me) returns AsciiString from TCollection is private;
475
476 Status(me;anObject : InteractiveObject from AIS)
477 returns any LocalStatus from AIS is private;
478 ---C++: return const&
479
480
481
482 LoadContextObjects(me:mutable);
483
484 UnloadContextObjects(me:mutable);
485
486 Process(me : mutable;
487 anObject : SelectableObject from SelectMgr;
488 WithProj: Boolean from Standard = Standard_True) is static private;
489
490 Process(me:mutable;
491 WithProj: Boolean from Standard = Standard_True) is static private;
492
493
494 ActivateStandardModes(me:mutable;anObject: SelectableObject from SelectMgr;
495 WithProj: Boolean from Standard = Standard_True) is static private;
496
497 ManageDetected(me:mutable;
498 aPickOwner : EntityOwner from SelectMgr;
499 aview : View from V3d) is static private;
500
501 DetectedIndex(me:mutable) returns Integer from Standard is static private;
502 ---C++: inline
503 ---Purpose: returns 0 if the detected entity was Not FilterOK...
504
505 Hilight(me:mutable;Own:EntityOwner from SelectMgr;aview: View from V3d) is static private;
506
507
508 Unhilight(me:mutable;Ownr:EntityOwner from SelectMgr;aview: View from V3d) is static private;
509
510
511 ClearObjects(me:mutable) is static private;
512
513 ClearDetected(me:mutable) is static private;
514
515 IsDecompositionOn(me) returns Boolean from Standard is static private;
516
517 IsShape(me;anIndex:Integer from Standard) returns Boolean from Standard is static private;
518
519 IsValidForSelection(me;anIObj:InteractiveObject from AIS) returns Boolean from Standard is static private;
520
521 IsValidIndex(me;anIndex:Integer from Standard)
522 returns Boolean from Standard is static private;
523 ---C++: inline
524
525 ComesFromDecomposition(me; aPickedIndex : Integer from Standard)
526 returns Boolean from Standard is static private;
527
528
529 DisplayAreas(me:mutable;aviou:View from V3d);
530
531 ClearAreas (me:mutable;
532 aView: View from V3d) is static;
533 ---Level: Internal
534
535 HasFilters(me;aType:ShapeEnum from TopAbs)
536 returns Boolean from Standard is private;
537
538 DisplaySensitive(me:mutable;aView : View from V3d) is static;
539
540 ClearSensitive(me:mutable;aView:View from V3d) is static;
541
542
543
544 MainSelector(me) returns any ViewerSelector3d from StdSelect;
545 ---C++: inline
546 ---C++: return const&
547
548
549 HilightTriangle(me:mutable;Rank:Integer from Standard;aViou:View from V3d) is static private;
550 ---Level: Internal
551
552
553 FindSelectedOwnerFromIO(me;anIObj:InteractiveObject from AIS)
1bd2fa67 554 returns EntityOwner from SelectMgr;
7fd59977 555
556 FindSelectedOwnerFromShape(me;aShape : Shape from TopoDS)
1bd2fa67 557 returns EntityOwner from SelectMgr;
7fd59977 558
559
560
561fields
562
563 myCTX : InteractiveContext from AIS;
564 myLoadDisplayed,myAcceptStdMode : Boolean from Standard;
565 myAcceptErase : Boolean from Standard;
566
567 mySM : SelectionManager from SelectMgr;
568 myMainVS : ViewerSelector3d from StdSelect;
569 myMainPM : PresentationManager3d from PrsMgr;
570 mySelName : AsciiString from TCollection;
571 myCollVS : ViewerSelector3d from StdSelect;
572
573 -- The Objects and their attributes...
574
575 myActiveObjects : DataMapOfSelStat from AIS;
576
577
578 -- The Filters...
579
580 myFilters : OrFilter from SelectMgr;
581 myListOfStandardMode : ListOfInteger from TColStd;
582
583 -- VTN myStdFilters : Filter from SelectMgr [7]; --internal mgt
584 myStdFilters : Filter from SelectMgr [9]; --internal mgt
585
586 -- Selection Process
587
588 myAutoHilight : Boolean from Standard;
589 myMapOfOwner : IndexedMapOfOwner from SelectMgr;
590 mylastindex : Integer from Standard;
591 mylastgood : Integer from Standard;
592 myCurrentOwner : Integer from Standard;
593
594
595 myDetectedSeq : SequenceOfInteger from TColStd;
596 myCurDetected : Integer from Standard;
597
598 -- the detected objects.
599 myAISDetectedSeq : SequenceOfInteractive from AIS;
600 myAISCurDetected : Integer from Standard;
601 -- This variables is used by following functions:
602 -- InitDetected(), MoreDetected(), NextDetected(), DetectedCurrentShape(), DetectedCurrentObject().
603
604friends
605
606 KeepTemporary from InteractiveContext from AIS(me:mutable;anIObj:InteractiveObject from AIS;WhichMode : Integer from Standard = -1)
607
608end LocalContext;
609
610
611
612
613