ug4

tree structures More...

Classes

class  ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >
 organizes vertices in a binary-tree structure. Only for static use! More...
 
class  ug::KDVertexDistance
 used by KDTreeStatic More...
 

Typedefs

typedef std::list< KDVertexDistanceug::KDVertexDistanceList
 
typedef node_tree::SPCollisionTreeRootNode ug::SPOctree
 

Enumerations

enum  ug::KDSplitDimension { ug::KDSD_CIRCULAR , ug::KDSD_LARGEST }
 used by KDTreeStatic More...
 

Functions

template<class TIterator >
SPOctree ug::CreateOctree (Grid &grid, TIterator elemsBegin, TIterator elemsEnd, int maxDepth, int elemThreshold, bool bLoose, APosition &aPos=aPosition)
 Creates an Octree from a list of edges or triangles. More...
 

Detailed Description

tree structures

Trees allow to perform space-partitioning on a grid. This is important if collision-tests, vertex-projection or clustering shall be performed with maximal performance.

Typedef Documentation

◆ KDVertexDistanceList

◆ SPOctree

This typedef is only intended to increase comfort for callers. The Octree can be passed to all traversers to which the original CollisionTreeRootNode could be passed too.

See also
node_tree::SPCollisionTreeRootNode

Enumeration Type Documentation

◆ KDSplitDimension

used by KDTreeStatic

Enumerator
KDSD_CIRCULAR 
KDSD_LARGEST 

Function Documentation

◆ CreateOctree()

template<class TIterator >
SPOctree ug::CreateOctree ( Grid grid,
TIterator  elemsBegin,
TIterator  elemsEnd,
int  maxDepth,
int  elemThreshold,
bool  bLoose,
APosition aPos = aPosition 
)

Creates an Octree from a list of edges or triangles.

This method returns a SmartPointer to an Octree. You may access all public members using the -> operator.

The elements to which the iterators point have to be derivates of ug::Edge or ug::Face and have to represent edges or triangles. Furthermore all elements between elemsBegin and elemsBegin have to be members of the specified grid.

Each element in the resulting octree will store a pointer to the associated edge or triangle of the grid. You may access this pointer using the CollisionEdgesNode::get_edge_id or CollisionTrianglesNode::get_triangle_id method to retreive it.

This method internally uses the ug::node_tree::CreateOctree method.

References ug::Grid::attach_to_vertices(), ug::node_tree::CreateOctree(), ug::Grid::detach_from_vertices(), ug::Grid::has_vertex_attachment(), and UG_LOG.

Referenced by ug::AdjustEdgeLength().