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