File indexing completed on 2026-09-19 09:27:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _AIS_Selection_HeaderFile
0018 #define _AIS_Selection_HeaderFile
0019
0020 #include <NCollection_Array1.hxx>
0021 #include <SelectMgr_EntityOwner.hxx>
0022 #include <NCollection_List.hxx>
0023 #include <AIS_SelectionScheme.hxx>
0024 #include <AIS_SelectStatus.hxx>
0025 #include <Standard.hxx>
0026 #include <Standard_Type.hxx>
0027
0028 class SelectMgr_Filter;
0029
0030
0031 class AIS_Selection : public Standard_Transient
0032 {
0033 DEFINE_STANDARD_RTTIEXT(AIS_Selection, Standard_Transient)
0034 public:
0035
0036 Standard_EXPORT AIS_Selection();
0037
0038
0039 Standard_EXPORT virtual void Clear();
0040
0041
0042
0043
0044
0045
0046
0047
0048 Standard_EXPORT virtual AIS_SelectStatus Select(
0049 const occ::handle<SelectMgr_EntityOwner>& theOwner,
0050 const occ::handle<SelectMgr_Filter>& theFilter,
0051 const AIS_SelectionScheme theSelScheme,
0052 const bool theIsDetected);
0053
0054
0055
0056 Standard_EXPORT virtual AIS_SelectStatus AddSelect(
0057 const occ::handle<SelectMgr_EntityOwner>& theObject);
0058
0059
0060
0061
0062
0063 virtual void ClearAndSelect(const occ::handle<SelectMgr_EntityOwner>& theObject,
0064 const occ::handle<SelectMgr_Filter>& theFilter,
0065 const bool theIsDetected)
0066 {
0067 Clear();
0068 Select(theObject, theFilter, AIS_SelectionScheme_Add, theIsDetected);
0069 }
0070
0071
0072 bool IsSelected(const occ::handle<SelectMgr_EntityOwner>& theObject) const
0073 {
0074 return myResultMap.IsBound(theObject);
0075 }
0076
0077
0078 const NCollection_List<occ::handle<SelectMgr_EntityOwner>>& Objects() const { return myresult; }
0079
0080
0081 int Extent() const { return myresult.Length(); }
0082
0083
0084 bool IsEmpty() const { return myresult.IsEmpty(); }
0085
0086 public:
0087
0088 void Init()
0089 {
0090 myIterator = NCollection_List<occ::handle<SelectMgr_EntityOwner>>::Iterator(myresult);
0091 }
0092
0093
0094 bool More() const { return myIterator.More(); }
0095
0096
0097 void Next() { myIterator.Next(); }
0098
0099
0100 const occ::handle<SelectMgr_EntityOwner>& Value() const { return myIterator.Value(); }
0101
0102
0103
0104
0105
0106
0107 Standard_EXPORT virtual void SelectOwners(
0108 const NCollection_Array1<occ::handle<SelectMgr_EntityOwner>>& thePickedOwners,
0109 const AIS_SelectionScheme theSelScheme,
0110 const bool theToAllowSelOverlap,
0111 const occ::handle<SelectMgr_Filter>& theFilter);
0112
0113 protected:
0114
0115
0116
0117
0118 Standard_EXPORT virtual AIS_SelectStatus appendOwner(
0119 const occ::handle<SelectMgr_EntityOwner>& theOwner,
0120 const occ::handle<SelectMgr_Filter>& theFilter);
0121
0122 protected:
0123 NCollection_List<occ::handle<SelectMgr_EntityOwner>> myresult;
0124 NCollection_List<occ::handle<SelectMgr_EntityOwner>>::Iterator myIterator;
0125 NCollection_DataMap<occ::handle<SelectMgr_EntityOwner>,
0126 NCollection_List<occ::handle<SelectMgr_EntityOwner>>::Iterator>
0127 myResultMap;
0128 };
0129
0130 #endif