Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Octree Class Reference

Represents an octree for fast classification. More...

#include <octree.h>

Collaboration diagram for Octree:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Octree (byte *volumeData, int maxX, int maxY, int maxZ)
 Constructor.
 ~Octree ()
 Destructor.
void remove (Node *tree)
 Removes the octree.
Nodebuild (int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int count)
 Builds the octree.
byte getData (int x, int y, int z)
 Get the value of a voxel with given coordinates.
void classify (SummedAreaTable *sat)
 Classifies the octree.
void classify (SummedAreaTable *sat, Node *tree)
 Does the classification.
int skip (int x, int y, int z, int mainViewingDir)
 Finds out the number of voxels that can be skipped.
int skip (int x, int y, int z, int mainViewingDir, Node *tree)
 Find out the number of voxels that can be skipped rekursively.

Private Attributes

Noderoot
 Pointer to the root of the total octree.
bytedata
 Pointer to the volume data.
int width
 Width of the octree.
int height
 Height of the octree.
int depth
 Depth of the octree.
int step_dim3
 Stores the value of dim1Size*dim2Size.

Detailed Description

Represents an octree for fast classification.

Using this octree speeds up classification. When used, the volume needn't be runlength-encoded each time after the transfer-function is changed.

Definition at line 87 of file octree.h.


Constructor & Destructor Documentation

Octree::Octree byte volumeData,
int  maxX,
int  maxY,
int  maxZ
 

Constructor.

Parameters:
volumeData a pointer to the whole volume data
maxX maximum size of the volume in X
maxY maximum size of the volume in Y
maxZ maximum size of the volume in Z

Definition at line 19 of file octree.cpp.

References build(), data, depth, height, max, root, step_dim3, and width.

Here is the call graph for this function:

Octree::~Octree  ) 
 

Destructor.

Calls remove() to free memory.

Definition at line 41 of file octree.cpp.

References remove(), and root.

Here is the call graph for this function:


Member Function Documentation

Node * Octree::build int  minX,
int  minY,
int  minZ,
int  maxX,
int  maxY,
int  maxZ,
int  count
 

Builds the octree.

Parameters:
minX lower boundary of subvolume in X
minY lower boundary of subvolume in Y
minZ lower boundary of subvolume in Z
maxX upper boundary of subvolume in X
maxY upper boundary of subvolume in Y
maxZ upper boundary of subvolume in Z
Returns:
the tree representing the given subvolume.

Definition at line 62 of file octree.cpp.

References byte, Node::children, data, Node::max, Node::maxX, Node::maxY, Node::maxZ, Node::min, Node::minX, Node::minY, Node::minZ, Node::noChildren, and width.

Referenced by Octree().

void Octree::classify SummedAreaTable sat,
Node tree
 

Does the classification.

Recursively classifies the octree.

Parameters:
sat the pointer to the summed area table.
tree the pointer to the root-node of the octree.

Definition at line 180 of file octree.cpp.

References Node::children, Node::classification, classify(), Node::max, Node::min, and SummedAreaTable::transparent().

Here is the call graph for this function:

void Octree::classify SummedAreaTable sat  ) 
 

Classifies the octree.

Calls classify(SumedAreaTable *, Node *).

Parameters:
sat a pointer to the summed area table.

Definition at line 170 of file octree.cpp.

References root.

Referenced by FastClassification::classify(), and classify().

byte Octree::getData int  x,
int  y,
int  z
 

Get the value of a voxel with given coordinates.

Parameters:
x the x-coordinate of the voxel
y the y-coordinate of the voxel
z the z-coordinate of the voxel
Returns:
the value of a voxel with given coordinates

void Octree::remove Node tree  ) 
 

Removes the octree.

Frees memory from the octree.

Parameters:
tree pointer to the root of the octree.

Definition at line 49 of file octree.cpp.

References Node::children.

Referenced by ~Octree().

int Octree::skip int  x,
int  y,
int  z,
int  mainViewingDir,
Node tree
 

Find out the number of voxels that can be skipped rekursively.

Parameters:
x the x-coordinate of the current position.
y the y-coordinate of the current position.
z the z-coordinate of the current position.
mainViewingDir the main viewing direction.
tree the pointer to the root of the octree.
Returns:
the number of voxels that can be skipped.

Definition at line 206 of file octree.cpp.

References Node::children, Node::classification, Node::maxX, Node::maxY, Node::maxZ, Node::minX, Node::minY, Node::minZ, skip(), XDIR, YDIR, and ZDIR.

Here is the call graph for this function:

int Octree::skip int  x,
int  y,
int  z,
int  mainViewingDir
 

Finds out the number of voxels that can be skipped.

The number of voxels that can be skipped is determinded.

Parameters:
x the x-coordinate of the current position.
y the y-coordinate of the current position.
z the z-coordinate of the current position.
mainViewingDir the main viewing direction (can either be X, Y or Z)
Returns:
the number of voxels that can be skipped.

Definition at line 198 of file octree.cpp.

References root.

Referenced by FastClassification::skip(), and skip().


Member Data Documentation

byte* Octree::data [private]
 

Pointer to the volume data.

Definition at line 186 of file octree.h.

Referenced by build(), and Octree().

int Octree::depth [private]
 

Depth of the octree.

Definition at line 193 of file octree.h.

Referenced by Octree().

int Octree::height [private]
 

Height of the octree.

Definition at line 191 of file octree.h.

Referenced by Octree().

Node* Octree::root [private]
 

Pointer to the root of the total octree.

Definition at line 183 of file octree.h.

Referenced by classify(), Octree(), skip(), and ~Octree().

int Octree::step_dim3 [private]
 

Stores the value of dim1Size*dim2Size.

Is used for computing indices.

Definition at line 199 of file octree.h.

Referenced by Octree().

int Octree::width [private]
 

Width of the octree.

Definition at line 189 of file octree.h.

Referenced by build(), and Octree().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:20:58 2004 for vuVolume by  doxygen 1.3.9.1