NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FW::VisualizationBVH Class Reference

Class for the BVH visualization. More...

#include <VisualizationBVH.hpp>

Inherits FW::Visualization.

Public Member Functions

 VisualizationBVH (CudaBVH *bvh, Scene *scene, const Array< AABB > &emptyBoxes, const RayBuffer *rays=NULL, Buffer *visibility=NULL)
 Constructor. More...
 
 ~VisualizationBVH (void)
 Destructor. More...
 
virtual bool handleEvent (const Window::Event &ev)
 Handles visualization events - key commands influencing the output. More...
 
void moveToParent ()
 Sets the node to be visualized to be the parent of the currently visualized node. More...
 
void moveToSibling ()
 Sets the node to be visualized to be the sibling of the currently visualized node. More...
 
void moveToLeft ()
 Sets the node to be visualized to be the left child of the currently visualized node. More...
 
void moveToRight ()
 Sets the node to be visualized to be the right child of the currently visualized node. More...
 
void moveUp ()
 Sets the node to be visualized to be the predecesor of the currently visualized node on the set path. More...
 
void moveDown ()
 Sets the node to be visualized to be the succesor of the currently visualized node on the set path. More...
 
void draw (GLContext *gl, CameraControls &camera)
 The method used to draw the current state of visualization to the OpenGL context. More...
 
- Public Member Functions inherited from FW::Visualization
 Visualization (Scene *scene)
 
virtual ~Visualization ()
 
bool isVisible () const
 Return whether the visualization renders its output. More...
 
void setVisible (bool visible)
 Sets whether the visualization should be rendered or not. More...
 
- Public Member Functions inherited from FW::Window::Listener
 Listener (void)
 
virtual ~Listener (void)
 

Additional Inherited Members

- Protected Attributes inherited from FW::Visualization
Array< Stringm_splitPath
 Text representation of the VisualizationBVH::m_nodeStack path. More...
 
S32 m_osahSplits [3]
 Counters of the number of OSAH splits in the subtree under the set node in the x, y and z dimensions. More...
 
S32 m_currentDepth
 Current node's depth information. More...
 
Array< S32m_visibility
 Visibility of individual triangles. More...
 
U32 m_nodeColor
 Color of the current node. More...
 
U32 m_siblingColor
 Color of the sibling of the current node. More...
 
U32 m_leftColor
 Color of the left child of the current node. More...
 
U32 m_leftPrims
 Number of primitives in the left child of the current node. More...
 
U32 m_rightColor
 Color of the right child of the current node. More...
 
U32 m_rightPrims
 Number of primitives in the right child of the current node. More...
 
Buffer m_rays
 Buffer holding some rays as line segments. More...
 
U32 m_rayColor
 Color of the ray line indices. More...
 
Buffer m_boxes
 Buffer holding selected boxes as quad primitives. More...
 
Buffer m_emptyBoxes
 Buffer holding empty boxes as quad primitives. More...
 
Buffer m_emptyColors
 Buffer holding colors of empty boxes as quad primitives. More...
 
Buffer m_emptyLineColors
 Buffer holding line colors of empty boxes as quad primitives. More...
 
Buffer m_invisTris
 Buffer holding visible selected triangles. More...
 
Buffer m_visTris
 Buffer holding invisible selected triangles. More...
 
bool m_visible
 Flag whether to show the BVH visualization. More...
 
bool m_showRays
 Flag whether to show the ray segments. More...
 
bool m_splitColors
 Flag whether to map left/right children colors based on the split type. More...
 
bool m_showChildren
 Flag whether to show children of the current node. More...
 
bool m_showAllOSAH
 Flag whether to show all OSAH split nodes. More...
 
bool m_showEmpty
 Flag whether to show empty nodes. More...
 
bool m_showCurrTris
 Flag whether to show triangles of the current node.};. More...
 
Scenem_scene
 

Detailed Description

Class for the BVH visualization.

In the standard visualization current node's bounding box, its sibling's bounding box and its childrens' bounding boxes are visualized.

Definition at line 47 of file VisualizationBVH.hpp.

Constructor & Destructor Documentation

VisualizationBVH::VisualizationBVH ( CudaBVH bvh,
Scene scene,
const Array< AABB > &  emptyBoxes,
const RayBuffer rays = NULL,
Buffer visibility = NULL 
)
explicit

Constructor.

Parameters
[in]bvhCudaBVH to visualize.
[in]emptyBoxesArray of empty boxes to be visualized.
[in]raysRays to visualize, pass NULL if no rays should be visualized.
[in]visibilityArray of triangle visibility flags.

Definition at line 73 of file VisualizationBVH.cpp.

VisualizationBVH::~VisualizationBVH ( void  )

Destructor.

Definition at line 181 of file VisualizationBVH.cpp.

Member Function Documentation

void VisualizationBVH::draw ( GLContext gl,
CameraControls camera 
)
virtual

The method used to draw the current state of visualization to the OpenGL context.

Parameters
[in]glOpenGL context to draw into.
[in]cameraThe camera for the current frame.

Implements FW::Visualization.

Definition at line 367 of file VisualizationBVH.cpp.

bool VisualizationBVH::handleEvent ( const Window::Event ev)
virtual

Handles visualization events - key commands influencing the output.

Parameters
[in]evEvent to process.
Returns
Returns true if the event has been processed.

Implements FW::Window::Listener.

Definition at line 187 of file VisualizationBVH.cpp.

void VisualizationBVH::moveDown ( )

Sets the node to be visualized to be the succesor of the currently visualized node on the set path.

Unlike moveToLeftChild() or moveToRightChild does not change the current path from root to the lowest discovered node. Only changes which node to visualize on this path.

Definition at line 356 of file VisualizationBVH.cpp.

void VisualizationBVH::moveToLeft ( )

Sets the node to be visualized to be the left child of the currently visualized node.

Definition at line 277 of file VisualizationBVH.cpp.

void VisualizationBVH::moveToParent ( )

Sets the node to be visualized to be the parent of the currently visualized node.

Definition at line 234 of file VisualizationBVH.cpp.

void VisualizationBVH::moveToRight ( )

Sets the node to be visualized to be the right child of the currently visualized node.

Definition at line 311 of file VisualizationBVH.cpp.

void VisualizationBVH::moveToSibling ( )

Sets the node to be visualized to be the sibling of the currently visualized node.

Definition at line 247 of file VisualizationBVH.cpp.

void VisualizationBVH::moveUp ( )

Sets the node to be visualized to be the predecesor of the currently visualized node on the set path.

Unlike moveToParent() does not change the current path from root to the lowest discovered node. Only changes which node to visualize on this path.

Definition at line 345 of file VisualizationBVH.cpp.


The documentation for this class was generated from the following files: