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