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

OpenTissue::mbd::SweepNPrune< types > Class Template Reference

#include <mbd_sweep_and_prune.h>

List of all members.

Classes

class  constraint_traits
class  edge_traits
class  node_traits

Public Member Functions

 SweepNPrune ()
void clear ()
void init (configuration_type &configuration)
void add (body_type *body)
void remove (body_type *body)
void run (edge_ptr_container &edges)
const real_type getMin (CoordinateAxis &axis)
const real_type getMax (CoordinateAxis &axis)
const bool isConsistent (CoordinateAxis &axis)

Protected Types

typedef IntervalEndpoint< typesEndPoint
typedef std::list< EndPoint * > CoordinateAxis
typedef
types::math_policy::real_type 
real_type
typedef types::configuration_type configuration_type
typedef types::contact_type contact_type
typedef types::body_type body_type
typedef types::edge_type edge_type
typedef types::edge_ptr_container edge_ptr_container

Protected Member Functions

void sort (CoordinateAxis &axis)
const bool isWrong (EndPoint *left, EndPoint *right)
void swapAction (EndPoint *left, EndPoint *right)

Protected Attributes

CoordinateAxis m_axisX
 X-Axe. The x-coordinates of AABB interval endpoints.
CoordinateAxis m_axisY
 Y-Axe. The y-coordinates of AABB interval endpoints.
CoordinateAxis m_axisZ
 Z-Axe. The z-coordinates of AABB interval endpoints.
configuration_typem_configuration
edge_ptr_container m_reported
 A list containing the currently reported overlaps.

Detailed Description

template<typename types>
class OpenTissue::mbd::SweepNPrune< types >

The Sweep N' Prune Broad Phase Collision Detection Algorithm.


Member Typedef Documentation

template<typename types >
typedef types::body_type OpenTissue::mbd::SweepNPrune< types >::body_type [protected]
template<typename types >
typedef types::configuration_type OpenTissue::mbd::SweepNPrune< types >::configuration_type [protected]
template<typename types >
typedef types::contact_type OpenTissue::mbd::SweepNPrune< types >::contact_type [protected]
template<typename types >
typedef std::list<EndPoint *> OpenTissue::mbd::SweepNPrune< types >::CoordinateAxis [protected]
template<typename types >
typedef types::edge_ptr_container OpenTissue::mbd::SweepNPrune< types >::edge_ptr_container [protected]
template<typename types >
typedef types::edge_type OpenTissue::mbd::SweepNPrune< types >::edge_type [protected]
template<typename types >
typedef IntervalEndpoint<types> OpenTissue::mbd::SweepNPrune< types >::EndPoint [protected]
template<typename types >
typedef types::math_policy::real_type OpenTissue::mbd::SweepNPrune< types >::real_type [protected]

Constructor & Destructor Documentation

template<typename types >
OpenTissue::mbd::SweepNPrune< types >::SweepNPrune (  )  [inline]

Member Function Documentation

template<typename types >
void OpenTissue::mbd::SweepNPrune< types >::add ( body_type body  )  [inline]
template<typename types >
void OpenTissue::mbd::SweepNPrune< types >::clear (  )  [inline]
template<typename types >
const real_type OpenTissue::mbd::SweepNPrune< types >::getMax ( CoordinateAxis axis  )  [inline]
template<typename types >
const real_type OpenTissue::mbd::SweepNPrune< types >::getMin ( CoordinateAxis axis  )  [inline]
template<typename types >
void OpenTissue::mbd::SweepNPrune< types >::init ( configuration_type configuration  )  [inline]
template<typename types >
const bool OpenTissue::mbd::SweepNPrune< types >::isConsistent ( CoordinateAxis axis  )  [inline]

Consistency Test Method. This method should be used for debugging purpose only. It runs through all the endpoints in the list and determines if the list is sorted correctly.

Parameters:
axis Coordinate Axis to be tested.
Returns:
If the list is consistent then the return value is true otherwise it is false.
template<typename types >
const bool OpenTissue::mbd::SweepNPrune< types >::isWrong ( EndPoint left,
EndPoint right 
) [inline, protected]

Wrongly Sorted Query Method. This method determines whatever the two end points appears in the proper order along a coordinate axe.

It is invoked by the method "sort(...)".

Parameters:
left A pointer to the endpoint that has the left position in the list (head is assumed to be left most and tail rightmost).
right A pointer to the endpoint that has the right position in the list.
Returns:
If left and right should be swapped then the return value it true otherwise it is false.
template<typename types >
void OpenTissue::mbd::SweepNPrune< types >::remove ( body_type body  )  [inline]
template<typename types >
void OpenTissue::mbd::SweepNPrune< types >::run ( edge_ptr_container edges  )  [inline]

Run SweepNPrune Algorithm.

Parameters:
edges A pointer to a list which upon return contains all the detected overlaps, as pointers to the respective contact graph edges.
template<typename types >
void OpenTissue::mbd::SweepNPrune< types >::sort ( CoordinateAxis axis  )  [inline, protected]

Coordinate Sorting Algorithm. Temporal Coherence indicates that insertion sort is cabaple of sorting the endpoints from the previous iteration in expected linear time.

This method encapsylates the inertion sort algorithm.

Parameters:
axis Coordinate Axis that should be sorted upon return.
template<typename types >
void OpenTissue::mbd::SweepNPrune< types >::swapAction ( EndPoint left,
EndPoint right 
) [inline, protected]

Swap Action. This method is supposed to be called by the insetion sort algorithm whenever it swaps two endpoints.

NOTE: The method is called before the actual swap!!!

The method is assumed to perform all the appropriate semantic actions, corresponding to the swap.

The method is invoked by the method "sort(...)".

Parameters:
left A pointer to the endpoint that has the left position in the list (head is assumed to be left most and tail rightmost).
right A pointer to the endpoint that has the right position in the list.

Member Data Documentation

template<typename types >
CoordinateAxis OpenTissue::mbd::SweepNPrune< types >::m_axisX [protected]

X-Axe. The x-coordinates of AABB interval endpoints.

template<typename types >
CoordinateAxis OpenTissue::mbd::SweepNPrune< types >::m_axisY [protected]

Y-Axe. The y-coordinates of AABB interval endpoints.

template<typename types >
CoordinateAxis OpenTissue::mbd::SweepNPrune< types >::m_axisZ [protected]

Z-Axe. The z-coordinates of AABB interval endpoints.

template<typename types >
configuration_type* OpenTissue::mbd::SweepNPrune< types >::m_configuration [protected]

A pointer to the configuration that holds the configuration that the broad phase collision detection algorithm is intended to work on.

template<typename types >
edge_ptr_container OpenTissue::mbd::SweepNPrune< types >::m_reported [protected]

A list containing the currently reported overlaps.


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