Public Types | Public Member Functions | Protected Attributes

OpenTissue::psys::GeometryHolder< types > Class Template Reference

#include <psys_geometry_holder.h>

List of all members.

Public Types

enum  type_index {
  UNDEFINED, SPHERE, PLANE, SDF,
  AABB_TREE
}
typedef types::math_types math_types
typedef math_types::real_type real_type
typedef types::sphere_type sphere_type
typedef types::plane_type plane_type
typedef types::sdf_geometry_type sdf_geometry_type
typedef types::aabb_tree_type aabb_tree_type

Public Member Functions

void * geometry ()
type_index const & type ()
 GeometryHolder ()
bool operator== (GeometryHolder const &geometry)
void set (sphere_type *sphere)
void set (plane_type *plane)
void set (sdf_geometry_type *sdf)
void set (aabb_tree_type *aabb_tree)
void clear ()
template<typename particle_system , typename contact_point_container >
void dispatch (particle_system &psys, contact_point_container &contacts)

Protected Attributes

type_index m_type
void * m_geometry

Detailed Description

template<typename types>
class OpenTissue::psys::GeometryHolder< types >

Introducing the concept of a geometry holder seems to be a really good idea. We no longer need to write ``geometry wrappers'' for each new type of geometry we add to the particle system library. Instead we just need to add a set-method to the geometry holder class and extend the dispatch method with a corresponding entry.

One more benefit is that we have completely removed the need for a particle system to know anything about geometries...

Observe further more that particle systems can not share instances of the geometry holder, but they can easily share the actually geometry.

One major drawback remains, one have to edit existing code (the geometry holder) when extending with new geometry types:-(


Member Typedef Documentation

template<typename types >
typedef types::aabb_tree_type OpenTissue::psys::GeometryHolder< types >::aabb_tree_type
template<typename types >
typedef types::math_types OpenTissue::psys::GeometryHolder< types >::math_types
template<typename types >
typedef types::plane_type OpenTissue::psys::GeometryHolder< types >::plane_type
template<typename types >
typedef types::sdf_geometry_type OpenTissue::psys::GeometryHolder< types >::sdf_geometry_type
template<typename types >
typedef types::sphere_type OpenTissue::psys::GeometryHolder< types >::sphere_type

Member Enumeration Documentation

template<typename types >
enum OpenTissue::psys::GeometryHolder::type_index
Enumerator:
UNDEFINED 
SPHERE 
PLANE 
SDF 
AABB_TREE 

Constructor & Destructor Documentation

template<typename types >
OpenTissue::psys::GeometryHolder< types >::GeometryHolder (  )  [inline]

Member Function Documentation

template<typename types >
void OpenTissue::psys::GeometryHolder< types >::clear ( void   )  [inline]
template<typename types >
template<typename particle_system , typename contact_point_container >
void OpenTissue::psys::GeometryHolder< types >::dispatch ( particle_system &  psys,
contact_point_container &  contacts 
) [inline]
template<typename types >
void* OpenTissue::psys::GeometryHolder< types >::geometry (  )  [inline]
template<typename types >
bool OpenTissue::psys::GeometryHolder< types >::operator== ( GeometryHolder< types > const &  geometry  )  [inline]
template<typename types >
void OpenTissue::psys::GeometryHolder< types >::set ( sdf_geometry_type sdf  )  [inline]
template<typename types >
void OpenTissue::psys::GeometryHolder< types >::set ( plane_type plane  )  [inline]
template<typename types >
void OpenTissue::psys::GeometryHolder< types >::set ( sphere_type sphere  )  [inline]
template<typename types >
void OpenTissue::psys::GeometryHolder< types >::set ( aabb_tree_type aabb_tree  )  [inline]
template<typename types >
type_index const& OpenTissue::psys::GeometryHolder< types >::type (  )  [inline]

Member Data Documentation

template<typename types >
void* OpenTissue::psys::GeometryHolder< types >::m_geometry [protected]
template<typename types >
type_index OpenTissue::psys::GeometryHolder< types >::m_type [protected]

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