Atoms Crowd  7.0.0
KdTreeAccel.h
1 /*
2  Copyright (c) 2010 University of Illinois
3  All rights reserved.
4 
5  Developed by: DeNovo group, Graphis@Illinois
6  University of Illinois
7  http://denovo.cs.illinois.edu
8  http://graphics.cs.illinois.edu
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the
12  "Software"), to deal with the Software without restriction, including
13  without limitation the rights to use, copy, modify, merge, publish,
14  distribute, sublicense, and/or sell copies of the Software, and to
15  permit persons to whom the Software is furnished to do so, subject to
16  the following conditions:
17 
18  * Redistributions of source code must retain the above copyright
19  notice, this list of conditions and the following disclaimers.
20 
21  * Redistributions in binary form must reproduce the above
22  copyright notice, this list of conditions and the following disclaimers
23  in the documentation and/or other materials provided with the
24  distribution.
25 
26  * Neither the names of DeNovo group, Graphics@Illinois,
27  University of Illinois, nor the names of its contributors may be used to
28  endorse or promote products derived from this Software without specific
29  prior written permission.
30 
31  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
32  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
34  IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
35  ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
36  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
37  SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
38 */
39 
40 #pragma once
41 #include <AtomsUtils/Globals.h>
42 #include <vector>
43 #include <ostream>
44 
45 #include <AtomsUtils/KdTree/KdTreeAccel_base.h>
46 #include <AtomsUtils/KdTree/Common.h>
47 #include <AtomsUtils/Mesh.h>
48 
49 
50 
51 namespace AtomsUtils
52 {
53  class Mesh;
54 
55  class ATOMSUTILS_EXPORT KdTreeAccel : public KdTreeAccel_base
56  {
57  public:
58  KdTreeAccel(Mesh *_mesh, unsigned int numThreads, unsigned int max_depth = 4);
59 
60  ~KdTreeAccel() { for (KdTreeNode* node : m_nodes) delete node; }
61 
62 
63  void build();
64 
65  KdTreeNode * buildTree_boxEdges(const AtomsMath::Box3f& nodeExtent,
66  vv_BoxEdge& boxEdgeList,
67  int maxDepth);
68  };
69 }
Definition: KdTreeAccel_base.h:55
Definition: KdTreeAccel.h:56
Definition: KdTreeNode.h:49
Mesh class.
Definition: Mesh.h:30
AtomsCore namespace.
Definition: Base64.h:13