Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type > Class Template Reference

#include <bvh_default_priority_bottom_up_policy.h>

List of all members.

Public Types

typedef BVHGraph< bvh_type > graph_type
typedef graph_type::node_ptr_type node_ptr_type
typedef graph_type::edge_ptr_type edge_ptr_type
typedef graph_type::edge_iterator edge_iterator
typedef
graph_type::edge_ptr_iterator 
edge_ptr_iterator
typedef graph_type::real_type real_type
typedef bvh_type::volume_type volume_type
typedef bvh_type::geometry_type geometry_type

Public Member Functions

virtual ~DefaultPriorityBottomUpPolicy ()
void init (graph_type &graph)
void update (node_ptr_type node)
edge_ptr_type get_next_edge () const
const bool has_more_edges () const
bool should_create_bv (node_ptr_type node)
template<typename geometry_iterator , typename volume_iterator >
volume_type fit (geometry_iterator g0, geometry_iterator g1, volume_iterator v0, volume_iterator v1)

Protected Member Functions

void update_heap ()
virtual real_type priority (edge_ptr_type edge)
virtual const unsigned int degree () const

Protected Attributes

graph_typem_graph
 Pointer to graph that is currently being worked on.

Detailed Description

template<typename bvh_type>
class OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >

Default Priority Bottom Up Policy. This class implements a default bottom-up consruction policy. The order edges are collapsed in is based on increasing priority.

A collapse results in an update of the priorities of all edges topologically affected by the change in the graph.


Member Typedef Documentation

template<typename bvh_type >
typedef bvh_type::geometry_type OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::geometry_type
template<typename bvh_type >
typedef BVHGraph<bvh_type> OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::graph_type
template<typename bvh_type >
typedef graph_type::real_type OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::real_type
template<typename bvh_type >
typedef bvh_type::volume_type OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::volume_type

Constructor & Destructor Documentation

template<typename bvh_type >
virtual OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::~DefaultPriorityBottomUpPolicy (  )  [inline, virtual]

Member Function Documentation

template<typename bvh_type >
virtual const unsigned int OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::degree (  )  const [inline, protected, virtual]

The degree (or branching factor) of BVH. This method is used to decide the maximum branching factor of the generated BVH.

Note this is a virtual-method, this means it can be overriden by inhertance, such that end-user can define a genric branching factor.

See method create_bv(node_type*) for example of usage.

Returns:
The branching factor.
template<typename bvh_type >
template<typename geometry_iterator , typename volume_iterator >
volume_type OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::fit ( geometry_iterator  g0,
geometry_iterator  g1,
volume_iterator  v0,
volume_iterator  v1 
) [inline]

Volume Fitting Method.

Parameters:
g0 An iterator to the first geometric primitive that should be covered by the fitted volume.
g1 An iterator to one position pass the last geometric primitive that should be covered by the fitted volume.
v0 An iterator to the first volume that should be covered by the fitted volume.
v1 An iterator to one position pass the last volume that should be covered by the fitted volume.
Returns:
The fitted volume.
template<typename bvh_type >
edge_ptr_type OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::get_next_edge (  )  const [inline]

Retrive next edge that should be collapsed.

Returns:
A pointer to the graph edge that should be collapsed.
template<typename bvh_type >
const bool OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::has_more_edges (  )  const [inline]

More Edges to Collapse Query.

Returns:
If the graph contains more edges that should be collapsed then the return value is true otherwise it is false.
template<typename bvh_type >
void OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::init ( graph_type graph  )  [inline]

Initialization Method. This method sets up internal data structures, needed for picking edges etc..

Parameters:
graph A reference to the graph that the policiy is working on.
template<typename bvh_type >
virtual real_type OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::priority ( edge_ptr_type  edge  )  [inline, protected, virtual]

Edge Priority Computation. This method is used to assign priorities to edges in the graph.

Note this is a virtual-method, this means it can be overriden by inhertance, such that end-user can define genric priorty strategies.

Default stategy, tries to favor a balanced BVH.

See method update(node_type*) and init(graph_type&) for examples of usage.

Parameters:
edge A pointer to the edge, from which a priority should be computed.
Returns:
The priority of the specified edge.
template<typename bvh_type >
bool OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::should_create_bv ( node_ptr_type  node  )  [inline]

Create BV Decision Method. This method is used by the Bottom-Up-Construction algorithm to determine if an edge-collapse should result in a new BV in the BVH, or if more sub-nodes are merged into the same region.

Default implementation is based on the branching factor. See method degree().

Parameters:
node A pointer to the node, which is the result from a edge-collapse.
Returns:
If a BV should be created then the return value is true otherwise it is false.
template<typename bvh_type >
void OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::update ( node_ptr_type  node  )  [inline]

Update Node after Collapse. This method is intendend to be called on the resulting node after a collapse operation.

Parameters:
node A pointer to the node.
template<typename bvh_type >
void OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::update_heap (  )  [inline, protected]

Update Heap. Internally used method, called whenever edge priorities are changed to re-inforce heap-property.

See method update(node_type*) and init(graph_type&) for examples of usage.


Member Data Documentation

template<typename bvh_type >
graph_type* OpenTissue::bvh::DefaultPriorityBottomUpPolicy< bvh_type >::m_graph [protected]

Pointer to graph that is currently being worked on.


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