File indexing completed on 2025-01-18 10:02:55
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 <AIS_NArray1OfEntityOwner.hxx>
0021 #include <AIS_NListOfEntityOwner.hxx>
0022 #include <AIS_SelectionScheme.hxx>
0023 #include <AIS_SelectStatus.hxx>
0024 #include <Standard.hxx>
0025 #include <Standard_Type.hxx>
0026
0027 class SelectMgr_Filter;
0028
0029
0030 class AIS_Selection : public Standard_Transient
0031 {
0032 DEFINE_STANDARD_RTTIEXT(AIS_Selection, Standard_Transient)
0033 public:
0034
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 (const Handle(SelectMgr_EntityOwner)& theOwner,
0049 const Handle(SelectMgr_Filter)& theFilter,
0050 const AIS_SelectionScheme theSelScheme,
0051 const Standard_Boolean theIsDetected);
0052
0053
0054
0055 Standard_EXPORT virtual AIS_SelectStatus AddSelect (const Handle(SelectMgr_EntityOwner)& theObject);
0056
0057
0058
0059
0060
0061 virtual void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject,
0062 const Handle(SelectMgr_Filter)& theFilter,
0063 const Standard_Boolean theIsDetected)
0064 {
0065 Clear();
0066 Select (theObject, theFilter, AIS_SelectionScheme_Add, theIsDetected);
0067 }
0068
0069
0070 Standard_Boolean IsSelected (const Handle(SelectMgr_EntityOwner)& theObject) const { return myResultMap.IsBound (theObject); }
0071
0072
0073 const AIS_NListOfEntityOwner& Objects() const { return myresult; }
0074
0075
0076 Standard_Integer Extent() const { return myresult.Size(); }
0077
0078
0079 Standard_Boolean IsEmpty() const { return myresult.IsEmpty(); }
0080
0081 public:
0082
0083
0084 void Init() { myIterator = AIS_NListOfEntityOwner::Iterator(myresult); }
0085
0086
0087 Standard_Boolean More() const { return myIterator.More(); }
0088
0089
0090 void Next() { myIterator.Next(); }
0091
0092
0093 const Handle(SelectMgr_EntityOwner)& Value() const { return myIterator.Value(); }
0094
0095
0096
0097
0098
0099
0100 Standard_EXPORT virtual void SelectOwners (const AIS_NArray1OfEntityOwner& thePickedOwners,
0101 const AIS_SelectionScheme theSelScheme,
0102 const Standard_Boolean theToAllowSelOverlap,
0103 const Handle(SelectMgr_Filter)& theFilter);
0104
0105 protected:
0106
0107
0108
0109
0110
0111 Standard_EXPORT virtual AIS_SelectStatus appendOwner (const Handle(SelectMgr_EntityOwner)& theOwner,
0112 const Handle(SelectMgr_Filter)& theFilter);
0113
0114 protected:
0115
0116 AIS_NListOfEntityOwner myresult;
0117 AIS_NListOfEntityOwner::Iterator myIterator;
0118 NCollection_DataMap<Handle(SelectMgr_EntityOwner), AIS_NListOfEntityOwner::Iterator> myResultMap;
0119
0120 };
0121
0122 DEFINE_STANDARD_HANDLE(AIS_Selection, Standard_Transient)
0123
0124 #endif