1 // Created on: 2013-12-20
2 // Created by: Denis BOGOLEPOV
3 // Copyright (c) 2013-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _BVH_ObjectSet_Header
17 #define _BVH_ObjectSet_Header
19 #include <BVH_Set.hxx>
20 #include <BVH_Object.hxx>
22 #include <NCollection_Vector.hxx>
24 //! Set of abstract geometric objects to build BVH.
25 template<class T, int N>
26 class BVH_ObjectSet : public BVH_Set<T, N>
30 //! Type for array of geometric objects.
31 typedef NCollection_Vector<NCollection_Handle<BVH_Object<T, N> > > BVH_ObjectList;
35 //! Creates set of geometric objects.
38 //! Releases resources of set of geometric objects.
39 virtual ~BVH_ObjectSet();
43 //! Clears all geometric objects.
46 //! Returns array of geometric objects.
47 BVH_ObjectList& Objects();
49 //! Returns array of geometric objects.
50 const BVH_ObjectList& Objects() const;
54 //! Return total number of objects.
55 virtual Standard_Integer Size() const;
57 //! Returns AABB of specified object.
58 virtual BVH_Box<T, N> Box (const Standard_Integer theIndex) const;
60 //! Returns centroid position in specified axis.
61 virtual T Center (const Standard_Integer theIndex, const Standard_Integer theAxis) const;
63 //! Swaps indices of two specified objects in the set.
64 virtual void Swap (const Standard_Integer theIndex1, const Standard_Integer theIndex2);
68 BVH_ObjectList myObjects; //!< Array of geometric objects
72 #include <BVH_ObjectSet.lxx>
74 #endif // _BVH_ObjectSet_Header