Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:19

0001 // Created on: 2016-06-20
0002 // Created by: Denis BOGOLEPOV
0003 // Copyright (c) 2016 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _BVH_QuadTree_Header
0017 #define _BVH_QuadTree_Header
0018 
0019 #include <BVH_Tree.hxx>
0020 
0021 //! Specialization of quad BVH (QBVH) tree.
0022 template<class T, int N>
0023 class BVH_Tree<T, N, BVH_QuadTree> : public BVH_TreeBase<T, N>
0024 {
0025 public: //! @name general methods
0026 
0027   //! Creates new empty BVH tree.
0028   BVH_Tree() : BVH_TreeBase<T, N>() { }
0029 
0030   //! Returns index of the K-th child of the given inner node.
0031   //! \tparam K the index of node child (from 0 to 3)
0032   template<int K>
0033   int Child (const int theNodeIndex) const
0034   {
0035     return BVH::Array<int, 4>::Value (this->myNodeInfoBuffer, theNodeIndex).y() + K;
0036   }
0037 
0038 };
0039 
0040 #endif // _BVH_QuadTree_Header