File indexing completed on 2025-01-18 10:03:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef BVH_ObjectSet_HeaderFile
0017 #define BVH_ObjectSet_HeaderFile
0018
0019 #include <BVH_Set.hxx>
0020 #include <BVH_Object.hxx>
0021
0022
0023
0024
0025 template<class T, int N>
0026 class BVH_ObjectSet : public BVH_Set<T, N>
0027 {
0028 public:
0029
0030
0031 typedef NCollection_Vector<opencascade::handle<BVH_Object<T, N> > > BVH_ObjectList;
0032
0033 public:
0034
0035
0036 BVH_ObjectSet() {}
0037
0038
0039 virtual ~BVH_ObjectSet() {}
0040
0041 public:
0042
0043
0044 virtual void Clear()
0045 {
0046 for (typename BVH_ObjectList::Iterator anObjectIter (myObjects); anObjectIter.More(); anObjectIter.Next())
0047 {
0048 anObjectIter.ChangeValue().Nullify();
0049 }
0050 myObjects.Clear();
0051 }
0052
0053
0054 BVH_ObjectList& Objects() { return myObjects; }
0055
0056
0057 const BVH_ObjectList& Objects() const { return myObjects; }
0058
0059 public:
0060
0061
0062 virtual Standard_Integer Size() const Standard_OVERRIDE { return myObjects.Size(); }
0063
0064
0065 using BVH_Set<T, N>::Box;
0066
0067
0068 virtual BVH_Box<T, N> Box (const Standard_Integer theIndex) const Standard_OVERRIDE { return myObjects.Value (theIndex)->Box(); }
0069
0070
0071 virtual T Center (const Standard_Integer theIndex, const Standard_Integer theAxis) const Standard_OVERRIDE
0072 {
0073
0074 return BVH::CenterAxis<T, N>::Center (myObjects.Value (theIndex)->Box(), theAxis);
0075 }
0076
0077
0078 virtual void Swap (const Standard_Integer theIndex1, const Standard_Integer theIndex2) Standard_OVERRIDE
0079 {
0080 std::swap (myObjects.ChangeValue (theIndex1),
0081 myObjects.ChangeValue (theIndex2));
0082 }
0083
0084 protected:
0085
0086 BVH_ObjectList myObjects;
0087
0088 };
0089
0090 #endif