File indexing completed on 2025-01-18 10:02:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _AIS_InteractiveContext_HeaderFile
0018 #define _AIS_InteractiveContext_HeaderFile
0019
0020 #include <AIS_DataMapOfIOStatus.hxx>
0021 #include <AIS_DisplayMode.hxx>
0022 #include <AIS_DisplayStatus.hxx>
0023 #include <AIS_KindOfInteractive.hxx>
0024 #include <AIS_ListOfInteractive.hxx>
0025 #include <AIS_Selection.hxx>
0026 #include <AIS_SelectionModesConcurrency.hxx>
0027 #include <AIS_SelectionScheme.hxx>
0028 #include <AIS_StatusOfDetection.hxx>
0029 #include <AIS_StatusOfPick.hxx>
0030 #include <AIS_TypeOfIso.hxx>
0031 #include <Aspect_TypeOfFacingModel.hxx>
0032 #include <Graphic3d_Vec2.hxx>
0033 #include <Prs3d_Drawer.hxx>
0034 #include <Prs3d_TypeOfHighlight.hxx>
0035 #include <PrsMgr_PresentationManager.hxx>
0036 #include <SelectMgr_AndOrFilter.hxx>
0037 #include <SelectMgr_IndexedMapOfOwner.hxx>
0038 #include <SelectMgr_ListOfFilter.hxx>
0039 #include <SelectMgr_PickingStrategy.hxx>
0040 #include <SelectMgr_SelectionManager.hxx>
0041 #include <StdSelect_ViewerSelector3d.hxx>
0042 #include <TCollection_AsciiString.hxx>
0043 #include <TColgp_Array1OfPnt2d.hxx>
0044 #include <TColStd_ListOfInteger.hxx>
0045 #include <TColStd_SequenceOfInteger.hxx>
0046 #include <Quantity_Color.hxx>
0047
0048 class V3d_Viewer;
0049 class V3d_View;
0050 class TopLoc_Location;
0051 class TCollection_ExtendedString;
0052 class Prs3d_LineAspect;
0053 class Prs3d_BasicAspect;
0054 class TopoDS_Shape;
0055 class SelectMgr_Filter;
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066 class AIS_InteractiveContext : public Standard_Transient
0067 {
0068 DEFINE_STANDARD_RTTIEXT(AIS_InteractiveContext, Standard_Transient)
0069 public:
0070
0071
0072 Standard_EXPORT AIS_InteractiveContext(const Handle(V3d_Viewer)& MainViewer);
0073
0074
0075 Standard_EXPORT virtual ~AIS_InteractiveContext();
0076
0077
0078
0079
0080
0081
0082
0083 Standard_EXPORT PrsMgr_DisplayStatus DisplayStatus (const Handle(AIS_InteractiveObject)& anIobj) const;
0084
0085
0086 Standard_EXPORT void Status (const Handle(AIS_InteractiveObject)& anObj, TCollection_ExtendedString& astatus) const;
0087
0088
0089 Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(AIS_InteractiveObject)& anIobj) const;
0090
0091 Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Integer aMode) const;
0092
0093
0094 void SetAutoActivateSelection (const Standard_Boolean theIsAuto) { myIsAutoActivateSelMode = theIsAuto; }
0095
0096
0097 Standard_Boolean GetAutoActivateSelection() const { return myIsAutoActivateSelMode; }
0098
0099
0100
0101
0102 Standard_EXPORT void Display (const Handle(AIS_InteractiveObject)& theIObj,
0103 const Standard_Boolean theToUpdateViewer);
0104
0105
0106
0107 Standard_EXPORT void Display (const Handle(AIS_InteractiveObject)& theIObj,
0108 const Standard_Integer theDispMode,
0109 const Standard_Integer theSelectionMode,
0110 const Standard_Boolean theToUpdateViewer,
0111 const PrsMgr_DisplayStatus theDispStatus = PrsMgr_DisplayStatus_None);
0112
0113
0114
0115
0116 Standard_EXPORT void Load (const Handle(AIS_InteractiveObject)& theObj, const Standard_Integer theSelectionMode = -1);
0117
0118
0119
0120 Standard_EXPORT void Erase (const Handle(AIS_InteractiveObject)& theIObj,
0121 const Standard_Boolean theToUpdateViewer);
0122
0123
0124
0125 Standard_EXPORT void EraseAll (const Standard_Boolean theToUpdateViewer);
0126
0127
0128 Standard_EXPORT void DisplayAll (const Standard_Boolean theToUpdateViewer);
0129
0130
0131
0132 Standard_EXPORT void EraseSelected (const Standard_Boolean theToUpdateViewer);
0133
0134
0135 Standard_EXPORT void DisplaySelected (const Standard_Boolean theToUpdateViewer);
0136
0137
0138
0139 void ClearPrs (const Handle(AIS_InteractiveObject)& theIObj,
0140 const Standard_Integer theMode,
0141 const Standard_Boolean theToUpdateViewer) { ClearGlobalPrs (theIObj, theMode, theToUpdateViewer); }
0142
0143
0144 Standard_EXPORT void Remove (const Handle(AIS_InteractiveObject)& theIObj,
0145 const Standard_Boolean theToUpdateViewer);
0146
0147
0148 Standard_EXPORT void RemoveAll (const Standard_Boolean theToUpdateViewer);
0149
0150
0151
0152 Standard_EXPORT void Redisplay (const Handle(AIS_InteractiveObject)& theIObj,
0153 const Standard_Boolean theToUpdateViewer,
0154 const Standard_Boolean theAllModes = Standard_False);
0155
0156
0157
0158 Standard_EXPORT void Redisplay (const AIS_KindOfInteractive theTypeOfObject,
0159 const Standard_Integer theSignature,
0160 const Standard_Boolean theToUpdateViewer);
0161
0162
0163
0164 Standard_EXPORT void RecomputePrsOnly (const Handle(AIS_InteractiveObject)& theIObj,
0165 const Standard_Boolean theToUpdateViewer,
0166 const Standard_Boolean theAllModes = Standard_False);
0167
0168
0169
0170 Standard_EXPORT void RecomputeSelectionOnly (const Handle(AIS_InteractiveObject)& anIObj);
0171
0172
0173
0174
0175 Standard_EXPORT void Update (const Handle(AIS_InteractiveObject)& theIObj,
0176 const Standard_Boolean theUpdateViewer);
0177
0178 public:
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209 const Handle(Prs3d_Drawer)& HighlightStyle (const Prs3d_TypeOfHighlight theStyleType) const { return myStyles[theStyleType]; }
0210
0211
0212
0213
0214
0215
0216
0217 void SetHighlightStyle (const Prs3d_TypeOfHighlight theStyleType,
0218 const Handle(Prs3d_Drawer)& theStyle)
0219 {
0220 myStyles[theStyleType] = theStyle;
0221 if (theStyleType == Prs3d_TypeOfHighlight_None)
0222 {
0223 myDefaultDrawer = theStyle;
0224 }
0225 }
0226
0227
0228
0229 const Handle(Prs3d_Drawer)& HighlightStyle() const
0230 {
0231 return myStyles[Prs3d_TypeOfHighlight_Dynamic];
0232 }
0233
0234
0235
0236 void SetHighlightStyle (const Handle(Prs3d_Drawer)& theStyle) { myStyles[Prs3d_TypeOfHighlight_Dynamic] = theStyle; }
0237
0238
0239
0240 const Handle(Prs3d_Drawer)& SelectionStyle() const
0241 {
0242 return myStyles[Prs3d_TypeOfHighlight_Selected];
0243 }
0244
0245
0246
0247 void SetSelectionStyle (const Handle(Prs3d_Drawer)& theStyle) { myStyles[Prs3d_TypeOfHighlight_Selected] = theStyle; }
0248
0249
0250
0251 Standard_EXPORT Standard_Boolean HighlightStyle (const Handle(AIS_InteractiveObject)& theObj,
0252 Handle(Prs3d_Drawer)& theStyle) const;
0253
0254
0255
0256 Standard_EXPORT Standard_Boolean HighlightStyle (const Handle(SelectMgr_EntityOwner)& theOwner,
0257 Handle(Prs3d_Drawer)& theStyle) const;
0258
0259
0260
0261 Standard_EXPORT Standard_Boolean IsHilighted (const Handle(AIS_InteractiveObject)& theObj) const;
0262
0263
0264
0265 Standard_EXPORT Standard_Boolean IsHilighted (const Handle(SelectMgr_EntityOwner)& theOwner) const;
0266
0267
0268 Standard_EXPORT void HilightWithColor (const Handle(AIS_InteractiveObject)& theObj,
0269 const Handle(Prs3d_Drawer)& theStyle,
0270 const Standard_Boolean theToUpdateViewer);
0271
0272
0273 Standard_EXPORT void Unhilight (const Handle(AIS_InteractiveObject)& theIObj,
0274 const Standard_Boolean theToUpdateViewer);
0275
0276 public:
0277
0278
0279 Standard_EXPORT Graphic3d_DisplayPriority DisplayPriority (const Handle(AIS_InteractiveObject)& theIObj) const;
0280
0281
0282 Standard_EXPORT void SetDisplayPriority (const Handle(AIS_InteractiveObject)& theIObj,
0283 const Graphic3d_DisplayPriority thePriority);
0284
0285 Standard_DEPRECATED("Deprecated since OCCT7.7, Graphic3d_DisplayPriority should be passed instead of integer number to SetDisplayPriority()")
0286 void SetDisplayPriority (const Handle(AIS_InteractiveObject)& theIObj,
0287 const Standard_Integer thePriority) { SetDisplayPriority (theIObj, (Graphic3d_DisplayPriority )thePriority); }
0288
0289
0290 Standard_EXPORT Graphic3d_ZLayerId GetZLayer (const Handle(AIS_InteractiveObject)& theIObj) const;
0291
0292
0293
0294
0295 Standard_EXPORT void SetZLayer (const Handle(AIS_InteractiveObject)& theIObj, const Graphic3d_ZLayerId theLayerId);
0296
0297
0298
0299 Standard_EXPORT void SetViewAffinity (const Handle(AIS_InteractiveObject)& theIObj, const Handle(V3d_View)& theView, const Standard_Boolean theIsVisible);
0300
0301 public:
0302
0303
0304 Standard_Integer DisplayMode() const { return myDefaultDrawer->DisplayMode(); }
0305
0306
0307 Standard_EXPORT void SetDisplayMode (const Standard_Integer theMode,
0308 const Standard_Boolean theToUpdateViewer);
0309
0310
0311
0312 Standard_EXPORT void SetDisplayMode (const Handle(AIS_InteractiveObject)& theIObj,
0313 const Standard_Integer theMode,
0314 const Standard_Boolean theToUpdateViewer);
0315
0316
0317 Standard_EXPORT void UnsetDisplayMode (const Handle(AIS_InteractiveObject)& theIObj,
0318 const Standard_Boolean theToUpdateViewer);
0319
0320 public:
0321
0322
0323 Standard_EXPORT void SetLocation (const Handle(AIS_InteractiveObject)& theObject, const TopLoc_Location& theLocation);
0324
0325
0326 Standard_EXPORT void ResetLocation (const Handle(AIS_InteractiveObject)& theObject);
0327
0328
0329 Standard_EXPORT Standard_Boolean HasLocation (const Handle(AIS_InteractiveObject)& theObject) const;
0330
0331
0332 Standard_EXPORT TopLoc_Location Location (const Handle(AIS_InteractiveObject)& theObject) const;
0333
0334
0335 Standard_EXPORT void SetTransformPersistence (const Handle(AIS_InteractiveObject)& theObject,
0336 const Handle(Graphic3d_TransformPers)& theTrsfPers);
0337
0338 public:
0339
0340
0341
0342 Standard_EXPORT void SetPixelTolerance (const Standard_Integer thePrecision = 2);
0343
0344
0345
0346
0347 Standard_EXPORT Standard_Integer PixelTolerance() const;
0348
0349
0350
0351
0352 Standard_EXPORT void SetSelectionSensitivity (const Handle(AIS_InteractiveObject)& theObject,
0353 const Standard_Integer theMode,
0354 const Standard_Integer theNewSensitivity);
0355
0356
0357 Standard_EXPORT Handle(V3d_View) LastActiveView() const;
0358
0359
0360
0361
0362
0363
0364
0365
0366 Standard_EXPORT AIS_StatusOfDetection MoveTo (const Standard_Integer theXPix,
0367 const Standard_Integer theYPix,
0368 const Handle(V3d_View)& theView,
0369 const Standard_Boolean theToRedrawOnUpdate);
0370
0371
0372
0373
0374
0375 Standard_EXPORT AIS_StatusOfDetection MoveTo (const gp_Ax1& theAxis,
0376 const Handle(V3d_View)& theView,
0377 const Standard_Boolean theToRedrawOnUpdate);
0378
0379
0380
0381
0382 Standard_EXPORT Standard_Boolean ClearDetected (Standard_Boolean theToRedrawImmediate = Standard_False);
0383
0384
0385
0386 Standard_Boolean HasDetected() const { return !myLastPicked.IsNull(); }
0387
0388
0389
0390
0391 const Handle(SelectMgr_EntityOwner)& DetectedOwner() const { return myLastPicked; }
0392
0393
0394
0395
0396 Handle(AIS_InteractiveObject) DetectedInteractive() const { return Handle(AIS_InteractiveObject)::DownCast (myLastPicked->Selectable()); }
0397
0398
0399
0400 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
0401 Standard_EXPORT Standard_Boolean HasDetectedShape() const;
0402
0403
0404
0405 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
0406 Standard_EXPORT const TopoDS_Shape& DetectedShape() const;
0407
0408
0409
0410 Standard_Boolean HasNextDetected() const { return !myDetectedSeq.IsEmpty() && myCurHighlighted <= myDetectedSeq.Upper(); }
0411
0412
0413
0414
0415
0416
0417
0418 Standard_EXPORT Standard_Integer HilightNextDetected (const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate = Standard_True);
0419
0420
0421
0422 Standard_EXPORT Standard_Integer HilightPreviousDetected (const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate = Standard_True);
0423
0424 public:
0425
0426
0427
0428
0429 void InitDetected()
0430 {
0431 if (!myDetectedSeq.IsEmpty())
0432 {
0433 myCurDetected = myDetectedSeq.Lower();
0434 }
0435 }
0436
0437
0438
0439
0440 Standard_Boolean MoreDetected() const { return myCurDetected >= myDetectedSeq.Lower() && myCurDetected <= myDetectedSeq.Upper(); }
0441
0442
0443
0444 void NextDetected() { ++myCurDetected; }
0445
0446
0447
0448
0449 Standard_EXPORT Handle(SelectMgr_EntityOwner) DetectedCurrentOwner() const;
0450
0451 public:
0452
0453
0454 Standard_EXPORT AIS_StatusOfPick AddSelect (const Handle(SelectMgr_EntityOwner)& theObject);
0455
0456
0457 AIS_StatusOfPick AddSelect (const Handle(AIS_InteractiveObject)& theObject)
0458 {
0459 return AddSelect (theObject->GlobalSelOwner());
0460 }
0461
0462
0463
0464
0465
0466
0467
0468
0469
0470 Standard_EXPORT AIS_StatusOfPick SelectRectangle (const Graphic3d_Vec2i& thePntMin,
0471 const Graphic3d_Vec2i& thePntMax,
0472 const Handle(V3d_View)& theView,
0473 const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
0474
0475
0476
0477
0478
0479
0480
0481 Standard_EXPORT AIS_StatusOfPick SelectPolygon (const TColgp_Array1OfPnt2d& thePolyline,
0482 const Handle(V3d_View)& theView,
0483 const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
0484
0485
0486
0487
0488
0489
0490
0491 Standard_EXPORT AIS_StatusOfPick SelectPoint (const Graphic3d_Vec2i& thePnt,
0492 const Handle(V3d_View)& theView,
0493 const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
0494
0495
0496
0497
0498
0499
0500
0501
0502
0503 Standard_EXPORT AIS_StatusOfPick SelectDetected (const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
0504
0505
0506 Standard_EXPORT Bnd_Box BoundingBoxOfSelection (const Handle(V3d_View)& theView) const;
0507
0508 Standard_DEPRECATED ("BoundingBoxOfSelection() should be called with View argument")
0509 Bnd_Box BoundingBoxOfSelection() const { return BoundingBoxOfSelection (Handle(V3d_View)()); }
0510
0511
0512
0513
0514
0515 Standard_EXPORT AIS_StatusOfPick Select (const AIS_NArray1OfEntityOwner& theOwners,
0516 const AIS_SelectionScheme theSelScheme);
0517
0518
0519
0520 Standard_EXPORT void FitSelected (const Handle(V3d_View)& theView,
0521 const Standard_Real theMargin,
0522 const Standard_Boolean theToUpdate);
0523
0524
0525
0526 Standard_EXPORT void FitSelected (const Handle(V3d_View)& theView);
0527
0528
0529
0530 Standard_Boolean ToHilightSelected() const { return myToHilightSelected; }
0531
0532
0533
0534
0535 void SetToHilightSelected (const Standard_Boolean toHilight) { myToHilightSelected = toHilight; }
0536
0537
0538
0539 Standard_Boolean AutomaticHilight() const { return myAutoHilight; }
0540
0541
0542
0543
0544
0545
0546
0547
0548
0549
0550
0551
0552
0553 void SetAutomaticHilight (Standard_Boolean theStatus) { myAutoHilight = theStatus; }
0554
0555
0556
0557
0558 Standard_EXPORT void SetSelected (const Handle(SelectMgr_EntityOwner)& theOwners,
0559 const Standard_Boolean theToUpdateViewer);
0560
0561
0562
0563 Standard_EXPORT void SetSelected (const Handle(AIS_InteractiveObject)& theObject,
0564 const Standard_Boolean theToUpdateViewer);
0565
0566
0567 Standard_EXPORT void AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& theObject,
0568 const Standard_Boolean theToUpdateViewer);
0569
0570
0571
0572
0573
0574
0575 Standard_EXPORT Standard_Boolean SetSelectedState (const Handle(SelectMgr_EntityOwner)& theOwner,
0576 const Standard_Boolean theIsSelected);
0577
0578
0579 Standard_EXPORT void HilightSelected (const Standard_Boolean theToUpdateViewer);
0580
0581
0582 Standard_EXPORT void UnhilightSelected (const Standard_Boolean theToUpdateViewer);
0583
0584
0585
0586
0587 void UpdateSelected (Standard_Boolean theToUpdateViewer) { HilightSelected (theToUpdateViewer); }
0588
0589
0590 Standard_EXPORT void ClearSelected (const Standard_Boolean theToUpdateViewer);
0591
0592
0593 Standard_EXPORT void AddOrRemoveSelected (const Handle(SelectMgr_EntityOwner)& theOwner,
0594 const Standard_Boolean theToUpdateViewer);
0595
0596
0597 Standard_Boolean IsSelected (const Handle(SelectMgr_EntityOwner)& theOwner) const { return !theOwner.IsNull() && theOwner->IsSelected(); }
0598
0599
0600 Standard_EXPORT Standard_Boolean IsSelected (const Handle(AIS_InteractiveObject)& theObj) const;
0601
0602
0603 Standard_EXPORT Handle(AIS_InteractiveObject) FirstSelectedObject() const;
0604
0605
0606
0607 Standard_Integer NbSelected() { return mySelection->Extent(); }
0608
0609
0610
0611 void InitSelected() { mySelection->Init(); }
0612
0613
0614
0615 Standard_Boolean MoreSelected() const { return mySelection->More(); }
0616
0617
0618
0619 void NextSelected() { mySelection->Next(); }
0620
0621
0622
0623 Handle(SelectMgr_EntityOwner) SelectedOwner() const
0624 {
0625 return !mySelection->More()
0626 ? Handle(SelectMgr_EntityOwner)()
0627 : mySelection->Value();
0628 }
0629
0630
0631
0632 Handle(AIS_InteractiveObject) SelectedInteractive() const
0633 {
0634 return !mySelection->More()
0635 ? Handle(AIS_InteractiveObject)()
0636 : Handle(AIS_InteractiveObject)::DownCast (mySelection->Value()->Selectable());
0637 }
0638
0639
0640
0641 Standard_EXPORT Standard_Boolean HasSelectedShape() const;
0642
0643
0644
0645
0646
0647
0648
0649
0650
0651 Standard_EXPORT TopoDS_Shape SelectedShape() const;
0652
0653
0654
0655 Standard_Boolean HasApplicative() const { return SelectedInteractive()->HasOwner(); }
0656
0657
0658
0659 Handle(Standard_Transient) Applicative() const { return SelectedInteractive()->GetOwner(); }
0660
0661 public:
0662
0663
0664
0665 Standard_EXPORT Standard_Boolean BeginImmediateDraw();
0666
0667
0668 Standard_EXPORT Standard_Boolean ImmediateAdd (const Handle(AIS_InteractiveObject)& theObj, const Standard_Integer theMode = 0);
0669
0670
0671 Standard_EXPORT Standard_Boolean EndImmediateDraw (const Handle(V3d_View)& theView);
0672
0673
0674
0675 Standard_EXPORT Standard_Boolean EndImmediateDraw();
0676
0677 Standard_EXPORT Standard_Boolean IsImmediateModeOn() const;
0678
0679
0680 void RedrawImmediate (const Handle(V3d_Viewer)& theViewer) { myMainPM->RedrawImmediate (theViewer); }
0681
0682 public:
0683
0684
0685
0686
0687
0688
0689
0690
0691
0692
0693
0694
0695
0696
0697
0698
0699 Standard_EXPORT void SetSelectionModeActive (const Handle(AIS_InteractiveObject)& theObj,
0700 const Standard_Integer theMode,
0701 const Standard_Boolean theToActivate,
0702 const AIS_SelectionModesConcurrency theConcurrency = AIS_SelectionModesConcurrency_Multiple,
0703 const Standard_Boolean theIsForce = Standard_False);
0704
0705
0706 void Activate (const Handle(AIS_InteractiveObject)& theObj, const Standard_Integer theMode = 0, const Standard_Boolean theIsForce = Standard_False)
0707 {
0708 SetSelectionModeActive (theObj, theMode, Standard_True, AIS_SelectionModesConcurrency_GlobalOrLocal, theIsForce);
0709 }
0710
0711
0712 Standard_EXPORT void Activate (const Standard_Integer theMode,
0713 const Standard_Boolean theIsForce = Standard_False);
0714
0715
0716 void Deactivate (const Handle(AIS_InteractiveObject)& theObj)
0717 {
0718 SetSelectionModeActive (theObj, -1, Standard_False, AIS_SelectionModesConcurrency_Single);
0719 }
0720
0721
0722 void Deactivate (const Handle(AIS_InteractiveObject)& theObj, const Standard_Integer theMode)
0723 {
0724 SetSelectionModeActive (theObj, theMode, Standard_False);
0725 }
0726
0727
0728 Standard_EXPORT void Deactivate (const Standard_Integer theMode);
0729
0730
0731 Standard_EXPORT void Deactivate();
0732
0733
0734 Standard_EXPORT void ActivatedModes (const Handle(AIS_InteractiveObject)& anIobj, TColStd_ListOfInteger& theList) const;
0735
0736
0737 Standard_EXPORT void EntityOwners (Handle(SelectMgr_IndexedMapOfOwner)& theOwners,
0738 const Handle(AIS_InteractiveObject)& theIObj,
0739 const Standard_Integer theMode = -1) const;
0740
0741 public:
0742
0743
0744 SelectMgr_FilterType FilterType() const { return myFilters->FilterType(); }
0745
0746
0747
0748
0749 void SetFilterType (const SelectMgr_FilterType theFilterType)
0750 { myFilters->SetFilterType (theFilterType); }
0751
0752
0753 const SelectMgr_ListOfFilter& Filters() const { return myFilters->StoredFilters(); }
0754
0755
0756 const Handle(SelectMgr_AndOrFilter)& GlobalFilter() const { return myFilters; }
0757
0758
0759 void AddFilter (const Handle(SelectMgr_Filter)& theFilter) { myFilters->Add (theFilter); }
0760
0761
0762 void RemoveFilter (const Handle(SelectMgr_Filter)& theFilter) { myFilters->Remove (theFilter); }
0763
0764
0765 void RemoveFilters() { myFilters->Clear(); }
0766
0767
0768
0769 SelectMgr_PickingStrategy PickingStrategy() const { return myPickingStrategy; }
0770
0771
0772
0773
0774
0775
0776
0777
0778
0779
0780
0781
0782
0783 void SetPickingStrategy (const SelectMgr_PickingStrategy theStrategy)
0784 {
0785 myPickingStrategy = theStrategy;
0786 }
0787
0788 public:
0789
0790
0791
0792 const Handle(Prs3d_Drawer)& DefaultDrawer() const { return myDefaultDrawer; }
0793
0794
0795
0796 void SetDefaultDrawer (const Handle(Prs3d_Drawer)& theDrawer)
0797 {
0798 myDefaultDrawer = theDrawer;
0799 myStyles[Prs3d_TypeOfHighlight_None] = myDefaultDrawer;
0800 }
0801
0802
0803 const Handle(V3d_Viewer)& CurrentViewer() const { return myMainVwr; }
0804
0805 const Handle(SelectMgr_SelectionManager)& SelectionManager() const { return mgrSelector; }
0806
0807 const Handle(PrsMgr_PresentationManager)& MainPrsMgr() const { return myMainPM; }
0808
0809 const Handle(StdSelect_ViewerSelector3d)& MainSelector() const { return mgrSelector->Selector(); }
0810
0811
0812 Standard_EXPORT void UpdateCurrentViewer();
0813
0814
0815
0816 Standard_EXPORT void DisplayedObjects (AIS_ListOfInteractive& aListOfIO) const;
0817
0818
0819
0820 Standard_EXPORT void DisplayedObjects (const AIS_KindOfInteractive theWhichKind, const Standard_Integer theWhichSignature, AIS_ListOfInteractive& theListOfIO) const;
0821
0822
0823
0824 Standard_EXPORT void ErasedObjects (AIS_ListOfInteractive& theListOfIO) const;
0825
0826
0827
0828 Standard_EXPORT void ErasedObjects (const AIS_KindOfInteractive theWhichKind, const Standard_Integer theWhichSignature, AIS_ListOfInteractive& theListOfIO) const;
0829
0830
0831
0832 Standard_EXPORT void ObjectsByDisplayStatus (const PrsMgr_DisplayStatus theStatus, AIS_ListOfInteractive& theListOfIO) const;
0833
0834
0835
0836 Standard_EXPORT void ObjectsByDisplayStatus (const AIS_KindOfInteractive WhichKind,
0837 const Standard_Integer WhichSignature,
0838 const PrsMgr_DisplayStatus theStatus,
0839 AIS_ListOfInteractive& theListOfIO) const;
0840
0841
0842
0843
0844 Standard_EXPORT void ObjectsInside (AIS_ListOfInteractive& aListOfIO,
0845 const AIS_KindOfInteractive WhichKind = AIS_KindOfInteractive_None,
0846 const Standard_Integer WhichSignature = -1) const;
0847
0848
0849 AIS_DataMapIteratorOfDataMapOfIOStatus ObjectIterator() const
0850 {
0851 return AIS_DataMapIteratorOfDataMapOfIOStatus (myObjects);
0852 }
0853
0854
0855 Standard_EXPORT void RebuildSelectionStructs();
0856
0857
0858 Standard_EXPORT void Disconnect (const Handle(AIS_InteractiveObject)& theAssembly, const Handle(AIS_InteractiveObject)& theObjToDisconnect = NULL);
0859
0860
0861 Standard_EXPORT void ObjectsForView (AIS_ListOfInteractive& theListOfIO,
0862 const Handle(V3d_View)& theView,
0863 const Standard_Boolean theIsVisibleInView,
0864 const PrsMgr_DisplayStatus theStatus = PrsMgr_DisplayStatus_None) const;
0865
0866
0867 Standard_EXPORT virtual gp_Pnt GravityPoint (const Handle(V3d_View)& theView) const;
0868
0869 public:
0870
0871
0872 Standard_EXPORT void DisplayActiveSensitive (const Handle(V3d_View)& aView);
0873
0874
0875 Standard_EXPORT void ClearActiveSensitive (const Handle(V3d_View)& aView);
0876
0877
0878 Standard_EXPORT void DisplayActiveSensitive (const Handle(AIS_InteractiveObject)& anObject, const Handle(V3d_View)& aView);
0879
0880 public:
0881
0882
0883 Standard_EXPORT void SetLocalAttributes (const Handle(AIS_InteractiveObject)& theIObj,
0884 const Handle(Prs3d_Drawer)& theDrawer,
0885 const Standard_Boolean theToUpdateViewer);
0886
0887
0888 Standard_EXPORT void UnsetLocalAttributes (const Handle(AIS_InteractiveObject)& theIObj,
0889 const Standard_Boolean theToUpdateViewer);
0890
0891
0892
0893 Standard_EXPORT void SetCurrentFacingModel (const Handle(AIS_InteractiveObject)& aniobj, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
0894
0895
0896 Standard_EXPORT Standard_Boolean HasColor (const Handle(AIS_InteractiveObject)& aniobj) const;
0897
0898
0899 Standard_EXPORT void Color (const Handle(AIS_InteractiveObject)& aniobj, Quantity_Color& acolor) const;
0900
0901
0902 Standard_EXPORT void SetColor (const Handle(AIS_InteractiveObject)& theIObj,
0903 const Quantity_Color& theColor,
0904 const Standard_Boolean theToUpdateViewer);
0905
0906
0907 Standard_EXPORT void UnsetColor (const Handle(AIS_InteractiveObject)& theIObj,
0908 const Standard_Boolean theToUpdateViewer);
0909
0910
0911 Standard_EXPORT virtual Standard_Real Width (const Handle(AIS_InteractiveObject)& aniobj) const;
0912
0913
0914 Standard_EXPORT virtual void SetWidth (const Handle(AIS_InteractiveObject)& theIObj,
0915 const Standard_Real theValue,
0916 const Standard_Boolean theToUpdateViewer);
0917
0918
0919 Standard_EXPORT virtual void UnsetWidth (const Handle(AIS_InteractiveObject)& theIObj,
0920 const Standard_Boolean theToUpdateViewer);
0921
0922
0923 Standard_EXPORT void SetMaterial (const Handle(AIS_InteractiveObject)& theIObj,
0924 const Graphic3d_MaterialAspect& theMaterial,
0925 const Standard_Boolean theToUpdateViewer);
0926
0927
0928 Standard_EXPORT void UnsetMaterial (const Handle(AIS_InteractiveObject)& theIObj,
0929 const Standard_Boolean theToUpdateViewer);
0930
0931
0932
0933 Standard_EXPORT void SetTransparency (const Handle(AIS_InteractiveObject)& theIObj,
0934 const Standard_Real theValue,
0935 const Standard_Boolean theToUpdateViewer);
0936
0937
0938 Standard_EXPORT void UnsetTransparency (const Handle(AIS_InteractiveObject)& theIObj,
0939 const Standard_Boolean theToUpdateViewer);
0940
0941
0942
0943 Standard_EXPORT void SetPolygonOffsets (const Handle(AIS_InteractiveObject)& theIObj,
0944 const Standard_Integer theMode,
0945 const Standard_ShortReal theFactor,
0946 const Standard_ShortReal theUnits,
0947 const Standard_Boolean theToUpdateViewer);
0948
0949
0950 Standard_EXPORT Standard_Boolean HasPolygonOffsets (const Handle(AIS_InteractiveObject)& anObj) const;
0951
0952
0953 Standard_EXPORT void PolygonOffsets (const Handle(AIS_InteractiveObject)& anObj, Standard_Integer& aMode, Standard_ShortReal& aFactor, Standard_ShortReal& aUnits) const;
0954
0955 public:
0956
0957
0958
0959
0960
0961 Standard_EXPORT void SetTrihedronSize (const Standard_Real theSize,
0962 const Standard_Boolean theToUpdateViewer);
0963
0964
0965 Standard_EXPORT Standard_Real TrihedronSize() const;
0966
0967 public:
0968
0969
0970 Standard_EXPORT void SetPlaneSize (const Standard_Real theSizeX,
0971 const Standard_Real theSizeY,
0972 const Standard_Boolean theToUpdateViewer);
0973
0974
0975 Standard_EXPORT void SetPlaneSize (const Standard_Real theSize,
0976 const Standard_Boolean theToUpdateViewer);
0977
0978
0979 Standard_EXPORT Standard_Boolean PlaneSize (Standard_Real& XSize, Standard_Real& YSize) const;
0980
0981 public:
0982
0983
0984
0985
0986
0987
0988
0989
0990
0991
0992
0993
0994
0995 Standard_EXPORT void SetDeviationCoefficient (const Handle(AIS_InteractiveObject)& theIObj,
0996 const Standard_Real theCoefficient,
0997 const Standard_Boolean theToUpdateViewer);
0998
0999 Standard_EXPORT void SetDeviationAngle (const Handle(AIS_InteractiveObject)& theIObj,
1000 const Standard_Real theAngle,
1001 const Standard_Boolean theToUpdateViewer);
1002
1003
1004 Standard_EXPORT void SetAngleAndDeviation (const Handle(AIS_InteractiveObject)& theIObj,
1005 const Standard_Real theAngle,
1006 const Standard_Boolean theToUpdateViewer);
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020 void SetDeviationCoefficient (const Standard_Real theCoefficient) { myDefaultDrawer->SetDeviationCoefficient (theCoefficient); }
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034 Standard_Real DeviationCoefficient() const { return myDefaultDrawer->DeviationCoefficient(); }
1035
1036
1037 void SetDeviationAngle (const Standard_Real theAngle) { myDefaultDrawer->SetDeviationAngle (theAngle); }
1038
1039 Standard_Real DeviationAngle() const { return myDefaultDrawer->DeviationAngle(); }
1040
1041 public:
1042
1043
1044
1045
1046
1047
1048 const Handle(Prs3d_LineAspect)& HiddenLineAspect() const { return myDefaultDrawer->HiddenLineAspect(); }
1049
1050
1051
1052 void SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect) const { myDefaultDrawer->SetHiddenLineAspect (theAspect); }
1053
1054
1055
1056 Standard_Boolean DrawHiddenLine() const { return myDefaultDrawer->DrawHiddenLine(); }
1057
1058 void EnableDrawHiddenLine() const { myDefaultDrawer->EnableDrawHiddenLine(); }
1059
1060 void DisableDrawHiddenLine() const { myDefaultDrawer->DisableDrawHiddenLine(); }
1061
1062 public:
1063
1064
1065 Standard_EXPORT void SetIsoNumber (const Standard_Integer NbIsos, const AIS_TypeOfIso WhichIsos = AIS_TOI_Both);
1066
1067
1068 Standard_EXPORT Standard_Integer IsoNumber (const AIS_TypeOfIso WhichIsos = AIS_TOI_Both);
1069
1070
1071 void IsoOnPlane (const Standard_Boolean theToSwitchOn) { myDefaultDrawer->SetIsoOnPlane (theToSwitchOn); }
1072
1073
1074
1075 Standard_Boolean IsoOnPlane() const { return myDefaultDrawer->IsoOnPlane(); }
1076
1077
1078
1079 Standard_EXPORT void IsoOnTriangulation (const Standard_Boolean theIsEnabled,
1080 const Handle(AIS_InteractiveObject)& theObject);
1081
1082
1083
1084 void IsoOnTriangulation (const Standard_Boolean theToSwitchOn) { myDefaultDrawer->SetIsoOnTriangulation (theToSwitchOn); }
1085
1086
1087 Standard_Boolean IsoOnTriangulation() const { return myDefaultDrawer->IsoOnTriangulation(); }
1088
1089
1090 public:
1091
1092 Standard_DEPRECATED("Deprecated method Display() with obsolete argument theToAllowDecomposition")
1093 void Display (const Handle(AIS_InteractiveObject)& theIObj,
1094 const Standard_Integer theDispMode,
1095 const Standard_Integer theSelectionMode,
1096 const Standard_Boolean theToUpdateViewer,
1097 const Standard_Boolean theToAllowDecomposition,
1098 const PrsMgr_DisplayStatus theDispStatus = PrsMgr_DisplayStatus_None)
1099 {
1100 (void )theToAllowDecomposition;
1101 Display (theIObj, theDispMode, theSelectionMode, theToUpdateViewer, theDispStatus);
1102 }
1103
1104 Standard_DEPRECATED("Deprecated method Load() with obsolete last argument theToAllowDecomposition")
1105 void Load (const Handle(AIS_InteractiveObject)& theObj, Standard_Integer theSelectionMode, Standard_Boolean ) { Load (theObj, theSelectionMode); }
1106
1107
1108
1109
1110 Standard_DEPRECATED("Deprecated method Hilight()")
1111 void Hilight (const Handle(AIS_InteractiveObject)& theObj,
1112 const Standard_Boolean theIsToUpdateViewer)
1113 {
1114 return HilightWithColor (theObj, myStyles[Prs3d_TypeOfHighlight_Dynamic], theIsToUpdateViewer);
1115 }
1116
1117
1118 Standard_DEPRECATED ("Deprecated method - presentation attributes should be assigned directly to object")
1119 Standard_EXPORT void SetSelectedAspect (const Handle(Prs3d_BasicAspect)& theAspect,
1120 const Standard_Boolean theToUpdateViewer);
1121
1122
1123
1124 Standard_DEPRECATED("This method is deprecated - SelectRectangle() taking AIS_SelectionScheme_Replace should be called instead")
1125 Standard_EXPORT AIS_StatusOfPick Select (const Standard_Integer theXPMin,
1126 const Standard_Integer theYPMin,
1127 const Standard_Integer theXPMax,
1128 const Standard_Integer theYPMax,
1129 const Handle(V3d_View)& theView,
1130 const Standard_Boolean theToUpdateViewer);
1131
1132
1133 Standard_DEPRECATED("This method is deprecated - SelectPolygon() taking AIS_SelectionScheme_Replace should be called instead")
1134 Standard_EXPORT AIS_StatusOfPick Select (const TColgp_Array1OfPnt2d& thePolyline,
1135 const Handle(V3d_View)& theView,
1136 const Standard_Boolean theToUpdateViewer);
1137
1138
1139
1140 Standard_DEPRECATED("This method is deprecated - SelectDetected() taking AIS_SelectionScheme_Replace should be called instead")
1141 Standard_EXPORT AIS_StatusOfPick Select (const Standard_Boolean theToUpdateViewer);
1142
1143
1144
1145
1146 Standard_DEPRECATED("This method is deprecated - SelectDetected() taking AIS_SelectionScheme_XOR should be called instead")
1147 Standard_EXPORT AIS_StatusOfPick ShiftSelect (const Standard_Boolean theToUpdateViewer);
1148
1149
1150
1151 Standard_DEPRECATED("This method is deprecated - SelectPolygon() taking AIS_SelectionScheme_XOR should be called instead")
1152 Standard_EXPORT AIS_StatusOfPick ShiftSelect (const TColgp_Array1OfPnt2d& thePolyline,
1153 const Handle(V3d_View)& theView,
1154 const Standard_Boolean theToUpdateViewer);
1155
1156
1157
1158 Standard_DEPRECATED("This method is deprecated - SelectRectangle() taking AIS_SelectionScheme_XOR should be called instead")
1159 Standard_EXPORT AIS_StatusOfPick ShiftSelect (const Standard_Integer theXPMin,
1160 const Standard_Integer theYPMin,
1161 const Standard_Integer theXPMax,
1162 const Standard_Integer theYPMax,
1163 const Handle(V3d_View)& theView,
1164 const Standard_Boolean theToUpdateViewer);
1165
1166 public:
1167
1168
1169
1170 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1171 void SetCurrentObject (const Handle(AIS_InteractiveObject)& theIObj,
1172 const Standard_Boolean theToUpdateViewer) { SetSelected (theIObj, theToUpdateViewer); }
1173
1174
1175
1176
1177
1178 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1179 void AddOrRemoveCurrentObject (const Handle(AIS_InteractiveObject)& theObj,
1180 const Standard_Boolean theIsToUpdateViewer) { AddOrRemoveSelected (theObj, theIsToUpdateViewer); }
1181
1182
1183
1184 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1185 void UpdateCurrent() { UpdateSelected (Standard_True); }
1186
1187
1188
1189
1190 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1191 Standard_Boolean IsCurrent (const Handle(AIS_InteractiveObject)& theObject) const { return IsSelected (theObject); }
1192
1193
1194
1195 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1196 void InitCurrent() { InitSelected(); }
1197
1198
1199
1200 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1201 Standard_Boolean MoreCurrent() const { return MoreSelected(); }
1202
1203
1204
1205 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1206 void NextCurrent() { NextSelected(); }
1207
1208
1209
1210 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1211 Handle(AIS_InteractiveObject) Current() const { return SelectedInteractive(); }
1212
1213 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1214 Standard_Integer NbCurrents() { return NbSelected(); }
1215
1216
1217
1218 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1219 void HilightCurrents (const Standard_Boolean theToUpdateViewer) { HilightSelected (theToUpdateViewer); }
1220
1221
1222
1223 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1224 void UnhilightCurrents (const Standard_Boolean theToUpdateViewer) { UnhilightSelected (theToUpdateViewer); }
1225
1226
1227
1228 Standard_DEPRECATED ("Local Context is deprecated - local selection should be used without Local Context")
1229 void ClearCurrents (const Standard_Boolean theToUpdateViewer) { ClearSelected (theToUpdateViewer); }
1230
1231
1232
1233
1234 Standard_DEPRECATED ("Local Context is deprecated - ::DetectedCurrentOwner() should be called instead")
1235 Standard_EXPORT const TopoDS_Shape& DetectedCurrentShape() const;
1236
1237
1238
1239 Standard_DEPRECATED ("Local Context is deprecated - ::DetectedCurrentOwner() should be called instead")
1240 Standard_EXPORT Handle(AIS_InteractiveObject) DetectedCurrentObject() const;
1241
1242 public:
1243
1244
1245
1246
1247
1248 const Quantity_Color& SubIntensityColor() const
1249 {
1250 return myStyles[Prs3d_TypeOfHighlight_SubIntensity]->Color();
1251 }
1252
1253
1254
1255
1256
1257 void SetSubIntensityColor (const Quantity_Color& theColor)
1258 {
1259 myStyles[Prs3d_TypeOfHighlight_SubIntensity]->SetColor (theColor);
1260 }
1261
1262
1263
1264
1265
1266 Standard_EXPORT void SubIntensityOn (const Handle(AIS_InteractiveObject)& theIObj,
1267 const Standard_Boolean theToUpdateViewer);
1268
1269
1270
1271 Standard_EXPORT void SubIntensityOff (const Handle(AIS_InteractiveObject)& theIObj,
1272 const Standard_Boolean theToUpdateViewer);
1273
1274
1275 const Handle(AIS_Selection)& Selection() const { return mySelection; }
1276
1277
1278
1279 void SetSelection (const Handle(AIS_Selection)& theSelection) { mySelection = theSelection; }
1280
1281
1282 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
1283
1284 protected:
1285
1286 Standard_EXPORT void GetDefModes (const Handle(AIS_InteractiveObject)& anIobj, Standard_Integer& Dmode, Standard_Integer& HiMod, Standard_Integer& SelMode) const;
1287
1288 Standard_EXPORT void EraseGlobal (const Handle(AIS_InteractiveObject)& theIObj,
1289 const Standard_Boolean theToUpdateViewer);
1290
1291 Standard_EXPORT void ClearGlobal (const Handle(AIS_InteractiveObject)& theIObj,
1292 const Standard_Boolean theToUpdateViewer);
1293
1294 Standard_EXPORT void ClearGlobalPrs (const Handle(AIS_InteractiveObject)& theObj,
1295 const Standard_Integer theMode,
1296 const Standard_Boolean theToUpdateViewer);
1297
1298 Standard_EXPORT void InitAttributes();
1299
1300
1301
1302 Standard_EXPORT AIS_StatusOfDetection moveTo (const Handle(V3d_View)& theView,
1303 const Standard_Boolean theToRedrawOnUpdate);
1304
1305
1306 Standard_EXPORT Standard_Boolean isDetected (const Handle(AIS_InteractiveObject)& theObject);
1307
1308
1309 Standard_EXPORT void unselectOwners (const Handle(AIS_InteractiveObject)& theObject);
1310
1311
1312
1313 Standard_EXPORT void highlightWithColor (const Handle(SelectMgr_EntityOwner)& theOwner,
1314 const Handle(V3d_Viewer)& theViewer = NULL);
1315
1316
1317
1318 Standard_EXPORT void highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner);
1319
1320
1321
1322
1323 Standard_EXPORT void highlightOwners (const AIS_NListOfEntityOwner& theOwners,
1324 const Handle(Prs3d_Drawer)& theStyle);
1325
1326
1327
1328
1329 Standard_EXPORT void highlightGlobal (const Handle(AIS_InteractiveObject)& theObj,
1330 const Handle(Prs3d_Drawer)& theStyle,
1331 const Standard_Integer theDispMode);
1332
1333
1334
1335
1336
1337 Standard_EXPORT void unhighlightSelected (const Standard_Boolean theIsToHilightSubIntensity = Standard_False);
1338
1339
1340
1341 Standard_EXPORT void unhighlightOwners (const AIS_NListOfEntityOwner& theOwners,
1342 const Standard_Boolean theIsToHilightSubIntensity = Standard_False);
1343
1344
1345
1346 Standard_EXPORT void unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj);
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356 Standard_EXPORT void turnOnSubintensity (const Handle(AIS_InteractiveObject)& theObject = NULL,
1357 const Standard_Integer theDispMode = -1,
1358 const Standard_Boolean theIsDisplayedOnly = Standard_True) const;
1359
1360
1361
1362
1363 Standard_EXPORT void highlightWithSubintensity (const Handle(AIS_InteractiveObject)& theObject,
1364 const Standard_Integer theMode) const;
1365
1366
1367
1368
1369 Standard_EXPORT void highlightWithSubintensity (const Handle(SelectMgr_EntityOwner)& theOwner,
1370 const Standard_Integer theMode) const;
1371
1372
1373
1374
1375
1376 const Handle(Prs3d_Drawer)& getHiStyle (const Handle(AIS_InteractiveObject)& theObj,
1377 const Handle(SelectMgr_EntityOwner)& theOwner) const
1378 {
1379 const Handle(Prs3d_Drawer)& aHiDrawer = theObj->DynamicHilightAttributes();
1380 if (!aHiDrawer.IsNull())
1381 {
1382 return aHiDrawer;
1383 }
1384
1385 return myStyles[!theOwner.IsNull() && theOwner->ComesFromDecomposition() ? Prs3d_TypeOfHighlight_LocalDynamic : Prs3d_TypeOfHighlight_Dynamic];
1386 }
1387
1388
1389 Standard_EXPORT Standard_Boolean isSlowHiStyle (const Handle(SelectMgr_EntityOwner)& theOwner,
1390 const Handle(V3d_Viewer)& theViewer) const;
1391
1392
1393
1394
1395
1396 const Handle(Prs3d_Drawer)& getSelStyle (const Handle(AIS_InteractiveObject)& theObj,
1397 const Handle(SelectMgr_EntityOwner)& theOwner) const
1398 {
1399 const Handle(Prs3d_Drawer)& aHiDrawer = theObj->HilightAttributes();
1400 if (!aHiDrawer.IsNull())
1401 {
1402 return aHiDrawer;
1403 }
1404
1405 return myStyles[!theOwner.IsNull() && theOwner->ComesFromDecomposition() ? Prs3d_TypeOfHighlight_LocalSelected : Prs3d_TypeOfHighlight_Selected];
1406 }
1407
1408
1409 Standard_EXPORT void setContextToObject (const Handle(AIS_InteractiveObject)& theObj);
1410
1411
1412 Standard_Integer getHilightMode (const Handle(AIS_InteractiveObject)& theObj,
1413 const Handle(Prs3d_Drawer)& theStyle,
1414 const Standard_Integer theDispMode) const
1415 {
1416 if (!theStyle.IsNull()
1417 && theStyle->DisplayMode() != -1
1418 && theObj->AcceptDisplayMode (theStyle->DisplayMode()))
1419 {
1420 return theStyle->DisplayMode();
1421 }
1422 else if (theDispMode != -1)
1423 {
1424 return theDispMode;
1425 }
1426 else if (theObj->HasDisplayMode())
1427 {
1428 return theObj->DisplayMode();
1429 }
1430 return myDefaultDrawer->DisplayMode();
1431 }
1432
1433
1434 void clearDynamicHighlight() const
1435 {
1436 if (myLastPicked.IsNull())
1437 return;
1438
1439 myLastPicked->Selectable()->ClearDynamicHighlight (myMainPM);
1440 }
1441
1442
1443
1444
1445 Standard_EXPORT void setObjectStatus (const Handle(AIS_InteractiveObject)& theIObj,
1446 const PrsMgr_DisplayStatus theStatus,
1447 const Standard_Integer theDispyMode,
1448 const Standard_Integer theSelectionMode);
1449
1450 protected:
1451
1452 AIS_DataMapOfIOStatus myObjects;
1453 Handle(SelectMgr_SelectionManager) mgrSelector;
1454 Handle(PrsMgr_PresentationManager) myMainPM;
1455 Handle(V3d_Viewer) myMainVwr;
1456 V3d_View* myLastActiveView;
1457 Handle(SelectMgr_EntityOwner) myLastPicked;
1458 Standard_Boolean myToHilightSelected;
1459 Handle(AIS_Selection) mySelection;
1460 Handle(SelectMgr_AndOrFilter) myFilters;
1461
1462 Handle(Prs3d_Drawer) myDefaultDrawer;
1463 Handle(Prs3d_Drawer) myStyles[Prs3d_TypeOfHighlight_NB];
1464 TColStd_SequenceOfInteger myDetectedSeq;
1465 Standard_Integer myCurDetected;
1466 Standard_Integer myCurHighlighted;
1467 SelectMgr_PickingStrategy myPickingStrategy;
1468 Standard_Boolean myAutoHilight;
1469 Standard_Boolean myIsAutoActivateSelMode;
1470
1471 };
1472
1473 DEFINE_STANDARD_HANDLE(AIS_InteractiveContext, Standard_Transient)
1474
1475 #endif