0028368: TKMath, BVH -- Fix invalid tree height in QBVH
[occt.git] / src / BVH / BVH_Set.hxx
CommitLineData
3c4e78f2 1// Created on: 2013-12-20
2// Created by: Denis BOGOLEPOV
d5f74e42 3// Copyright (c) 2013-2014 OPEN CASCADE SAS
3c4e78f2 4//
5// This file is part of Open CASCADE Technology software library.
6//
d5f74e42 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
3c4e78f2 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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _BVH_Set_Header
17#define _BVH_Set_Header
18
19#include <BVH_Box.hxx>
20
679d3878 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
3c4e78f2 25template<class T, int N>
26class BVH_Set
27{
28public:
29
30 typedef BVH_Box<T, N> BVH_BoxNt;
31
32public:
33
34 //! Creates new abstract set of objects.
35 BVH_Set();
36
37 //! Releases resources of set of objects.
38 virtual ~BVH_Set() = 0;
39
679d3878 40 //! Returns AABB of the entire set of objects.
3c4e78f2 41 virtual BVH_Box<T, N> Box() const;
42
43public:
44
679d3878 45 //! Returns total number of objects.
3c4e78f2 46 virtual Standard_Integer Size() const = 0;
47
679d3878 48 //! Returns AABB of the given object.
3c4e78f2 49 virtual BVH_Box<T, N> Box (const Standard_Integer theIndex) const = 0;
50
679d3878 51 //! Returns centroid position along the given axis.
3c4e78f2 52 virtual T Center (const Standard_Integer theIndex,
53 const Standard_Integer theAxis) const = 0;
54
679d3878 55 //! Performs transposing the two given objects in the set.
3c4e78f2 56 virtual void Swap (const Standard_Integer theIndex1,
57 const Standard_Integer theIndex2) = 0;
58
59};
60
61#include <BVH_Set.lxx>
62
63#endif // _BVH_Set_Header