public abstract

Inheritance Graph

graph BT
	TriangleTree
	kDTree --> TriangleTree
	Octree --> TriangleTree
	click TriangleTree "classMinSG_1_1TriangleTrees_1_1TriangleTree"
	click kDTree "classMinSG_1_1TriangleTrees_1_1kDTree"
	click Octree "classMinSG_1_1TriangleTrees_1_1Octree"

Description

Abstract base class for trees working with triangles.

Author: Benjamin Eikel

Date: 2011-07-29

Public Functions

   
   
  TriangleTree( Rendering::Mesh * mesh)
   
  ~TriangleTree()
Empty destructor.
   
const Geometry::Box & getBound() const
   
uint8_t getLevel() const
   
bool isLeaf() const
   
std::vector< const TriangleTree * > getChildren() const
   
const TriangleAccessor & getTriangle(uint32_t index) const
   
uint32_t getTriangleCount() const
   
uint32_t countTriangles() const
   
uint32_t countInnerTriangles() const
   
uint32_t countTrianglesOutside() const
   
bool contains(const TriangleAccessor & triangle) const
   
void fetchAttributes( Util::AttributeProvider * container) const

Protected Functions

   
   
  TriangleTree( Geometry::Box childBound, const TriangleTree & parent)
   
void setBound(const Geometry::Box & newBound)

Documentation

function
MinSG::TriangleTrees::TriangleTree::TriangleTree

public explicit
     
     
TriangleTree( Rendering::Mesh * mesh )

Create a TriangleTree root node and get the bounding box from the given mesh.

Parameters

mesh
Mesh containing the triangles.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:46


function
MinSG::TriangleTrees::TriangleTree::~TriangleTree

public virtual
   
   
~TriangleTree( )

Empty destructor.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:49


function
MinSG::TriangleTrees::TriangleTree::getBound

public const inline
   
   
const Geometry::Box & getBound( ) const

Return the bounding box of this node.

Returns

Axis-aligned bounding box.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:56


function
MinSG::TriangleTrees::TriangleTree::getLevel

public const inline
   
   
uint8_t getLevel( ) const

Return the level in the tree. The root node has level zero.

Returns

Level of the node.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:65


function
MinSG::TriangleTrees::TriangleTree::isLeaf

public const virtual
   
   
bool isLeaf( ) const

Tell if the node is a leaf node.

Returns

trueif the node is a leaf andfalseif it is an inner node.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:74


function
MinSG::TriangleTrees::TriangleTree::getChildren

public const virtual
   
   
std::vector< const TriangleTree * > getChildren( ) const

Retrieve to the child nodes.

Returns

Pointers to children.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:81


function
MinSG::TriangleTrees::TriangleTree::getTriangle

public const virtual
     
     
const TriangleAccessor & getTriangle( uint32_t index ) const

Return one triangle.

Parameters

index
Index of triangle stored in this node.

Returns

Constant accessor for the triangle.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:89


function
MinSG::TriangleTrees::TriangleTree::getTriangleCount

public const virtual
   
   
uint32_t getTriangleCount( ) const

Return the number of triangles that are stored in this tree node.

Returns

Triangle count

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:96


function
MinSG::TriangleTrees::TriangleTree::countTriangles

public const
   
   
uint32_t countTriangles( ) const

Return the overall number of triangles stored in the subtree. If this is an inner node, return the number of triangles stored in this node plus the sum of the children. Otherwise return the number of triangles stored in this leaf.

Returns

Triangle count

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:105


function
MinSG::TriangleTrees::TriangleTree::countInnerTriangles

public const
   
   
uint32_t countInnerTriangles( ) const

Return the number of triangles that are stored in inner nodes of the subtree. If this is an inner node, return the number of triangles stored in this node and recurse into children. Otherwise return zero.

Returns

Number of triangles that are stored in inner nodes.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:114


function
MinSG::TriangleTrees::TriangleTree::countTrianglesOutside

public const
   
   
uint32_t countTrianglesOutside( ) const

Return the number of triangles that are outside the bounding box of the node they are stored in. If this is an inner node, return the number of triangles stored in this node and recurse into children. Otherwise count the number of triangles that are stored in this node and are outside the bounding box.

Returns

Number of triangles outside the bounding box.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:123


function
MinSG::TriangleTrees::TriangleTree::contains

public const virtual
     
     
bool contains( const TriangleAccessor & triangle ) const

Check if the triangle fits into the bounding box of this tree node.

Parameters

triangle
Triangle to check.

Returns

trueif the triangle is inside this node, otherwisefalse.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:131


function
MinSG::TriangleTrees::TriangleTree::fetchAttributes

public const virtual
     
     
void fetchAttributes( Util::AttributeProvider * container ) const

Add attributes specific to this tree node to the given container.

Parameters

container
Container for attributes.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:138


function
MinSG::TriangleTrees::TriangleTree::TriangleTree

protected explicit
     
     
TriangleTree( Geometry::Box childBound,
  const TriangleTree & parent
)    

Create a new TriangleTree node and assign variables from the parent node.

Parameters

childBound
Axis-aligned bounding box for the child.
parent
Parent node which is used to copy the parameters from.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:157


function
MinSG::TriangleTrees::TriangleTree::setBound

protected inline
     
     
void setBound( const Geometry::Box & newBound )

Set the bounding box of this node.

Parameters

newBound
Axis-aligned bounding box.

Defined in MinSG/Ext/TriangleTrees/TriangleTree.h:164