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_Builder_Header
17 #define _BVH_Builder_Header
19 #include <BVH_Set.hxx>
20 #include <BVH_BinaryTree.hxx>
24 //! Minimum node size to split.
25 const Standard_Real THE_NODE_MIN_SIZE = 1e-5;
28 //! Performs construction of BVH tree using bounding
29 //! boxes (AABBs) of abstract objects.
30 //! \tparam T Numeric data type
31 //! \tparam N Vector dimension
32 template<class T, int N>
37 //! Creates new abstract BVH builder.
38 BVH_Builder (const Standard_Integer theLeafNodeSize,
39 const Standard_Integer theMaxTreeDepth);
41 //! Releases resources of BVH builder.
42 virtual ~BVH_Builder();
44 //! Builds BVH using specific algorithm.
45 virtual void Build (BVH_Set<T, N>* theSet,
46 BVH_Tree<T, N>* theBVH,
47 const BVH_Box<T, N>& theBox) = 0;
51 //! Updates depth of constructed BVH tree.
52 void UpdateDepth (BVH_Tree<T, N>* theBVH,
53 const Standard_Integer theLevel)
55 if (theLevel > theBVH->myDepth)
57 theBVH->myDepth = theLevel;
63 Standard_Integer myMaxTreeDepth; //!< Maximum depth of constructed BVH
64 Standard_Integer myLeafNodeSize; //!< Maximum number of objects per leaf
68 #include <BVH_Builder.lxx>
70 #endif // _BVH_Builder_Header