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_Set_HeaderFile
17 #define BVH_Set_HeaderFile
19 #include <BVH_Box.hxx>
21 //! Set of abstract entities (bounded by BVH boxes). This is
22 //! the minimal geometry interface needed to construct BVH.
23 //! \tparam T Numeric data type
24 //! \tparam N Vector dimension
25 template<class T, int N>
30 typedef BVH_Box<T, N> BVH_BoxNt;
34 //! Creates new abstract set of objects.
37 //! Releases resources of set of objects.
40 //! Returns AABB of the entire set of objects.
41 virtual BVH_Box<T, N> Box() const
44 const Standard_Integer aSize = Size();
45 for (Standard_Integer anIndex = 0; anIndex < aSize; ++anIndex)
47 aBox.Combine (Box (anIndex));
54 //! Returns total number of objects.
55 virtual Standard_Integer Size() const = 0;
57 //! Returns AABB of the given object.
58 virtual BVH_Box<T, N> Box (const Standard_Integer theIndex) const = 0;
60 //! Returns centroid position along the given axis.
61 virtual T Center (const Standard_Integer theIndex,
62 const Standard_Integer theAxis) const = 0;
64 //! Performs transposing the two given objects in the set.
65 virtual void Swap (const Standard_Integer theIndex1,
66 const Standard_Integer theIndex2) = 0;
70 #endif // _BVH_Set_Header