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

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

#include <bvh_binary_matching_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::node_iterator node_iterator
typedef
graph_type::edge_ptr_container 
edge_ptr_container
typedef graph_type::real_type real_type
typedef bvh_type::volume_type volume_type
typedef bvh_type::geometry_type geometry_type

Public Member Functions

void init (graph_type &graph)
void update (node_ptr_type)
edge_ptr_type get_next_edge ()
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 match_edges ()
const unsigned int degree () const

Protected Attributes

graph_typem_graph
 Pointer to graph that is currently being worked on.
edge_ptr_container m_matched
 binary matched edges, that are up for collapsing.

Detailed Description

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

Trying to match nodes into pairs, which must all have been collapsed before a new matching can be done.


Member Typedef Documentation

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

Member Function Documentation

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

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 should_create_bv(node_type*) for example of usage.

Returns:
The branching factor.

Reimplemented in OpenTissue::aabb_tree::BottomUpConstructorPolicy< aabb_tree_geometry >.

template<typename bvh_type>
template<typename geometry_iterator , typename volume_iterator >
volume_type OpenTissue::bvh::BinaryMatchBottomUpPolicy< 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::BinaryMatchBottomUpPolicy< bvh_type >::get_next_edge (  )  [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::BinaryMatchBottomUpPolicy< 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::BinaryMatchBottomUpPolicy< 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>
void OpenTissue::bvh::BinaryMatchBottomUpPolicy< bvh_type >::match_edges (  )  [inline, protected]
template<typename bvh_type>
bool OpenTissue::bvh::BinaryMatchBottomUpPolicy< 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::BinaryMatchBottomUpPolicy< bvh_type >::update ( node_ptr_type   )  [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.

Member Data Documentation

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

Pointer to graph that is currently being worked on.

template<typename bvh_type>
edge_ptr_container OpenTissue::bvh::BinaryMatchBottomUpPolicy< bvh_type >::m_matched [protected]

binary matched edges, that are up for collapsing.


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