iMSTK
Interactive Medical Simulation Toolkit
OctreeDebugModel.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkDebugGeometryModel.h"
10 
11 namespace imstk
12 {
13 class LooseOctree;
14 class OctreeNode;
15 
22 {
23 public:
25  m_looseOctree(nullptr),
27  m_drawNonEmptyParents(true) { }
28  ~OctreeDebugModel() override = default;
29 
30 public:
35  void debugUpdate(int maxDisplayDepth, bool drawNonEmptyParents = true);
36 
37  void setInputOctree(std::shared_ptr<LooseOctree> octree) { m_looseOctree = octree; }
38 
39 protected:
44  bool updateGeom(OctreeNode* node);
45 
46 protected:
47  std::shared_ptr<LooseOctree> m_looseOctree;
48 
50  bool m_drawNonEmptyParents;
51 };
52 } // namespace imstk
Class for quickly rendering and showing various primivites such as line segments, triangles...
int m_maxDisplayDepth
Maximum level of nodes that will be rendered during debug rendering.
Compound Geometry.
void debugUpdate(int maxDisplayDepth, bool drawNonEmptyParents=true)
Update the geometry.
The OctreeNode class.
bool updateGeom(OctreeNode *node)
Recursively update debug geometry by adding lines drawing bounding boxes of the active nodes...
OctreeDebugModel for debug visualizing an octree.