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

OpenTissue::geometry::PlaneBox< math_types > Class Template Reference

#include <geometry_plane_box.h>

List of all members.

Public Types

typedef math_types::value_traits value_traits
typedef math_types::vector3_type vector3_type
typedef math_types::real_type real_type
typedef Plane< math_typesplane_type

Public Member Functions

plane_type const & plane () const
aabb_type const & box () const
vector3_type const & p0 () const
vector3_type const & p1 () const
vector3_type const & p2 () const
vector3_type const & p3 () const
vector3_type const & n () const
 PlaneBox ()
void init (vector3_type const &min_coord, vector3_type const &max_coord)
void increment ()
void decrement ()
void set_x_axis ()
void set_y_axis ()
void set_z_axis ()

Protected Types

typedef AABB< math_typesaabb_type

Protected Member Functions

void update ()

Protected Attributes

aabb_type m_box
plane_type m_plane
int m_max_tick
 The maximum ticks that a side along the box should be divided into (i.e. the number of plane positions).
int m_cur_tick
 The current tick value along the m_axis direction that the plane should be placed at.
int m_axis
 Indicator of which axis the plane is orthogonal to.
vector3_type m_p [4][3]
 Base points of rectangle representing plane.
vector3_type m_n [3]
 Possible normal directions, current direction is chosen by value of m_axis.

Detailed Description

template<typename math_types>
class OpenTissue::geometry::PlaneBox< math_types >

A Plane Box class. This class creates a plane-box. A plane-box is an interactive tool for manipulating an axis-parallel plane.

Such an interactive plane can be quite usefull in visualization of various geometric structures. For instace a tetrahedra mesh can benefit from it as shown in the example below.

Example usage

typedef OpenTissue::math::BasicMathTypes<double,size_t> math_types; typedef OpenTissue::PlaneBox<math_types> plane_box_type;

plane_box_type m_plane_box;

void do_display() { OpenTissue::gl::ColorPicker(0.8,0.1,0.8); OpenTissue::gl::DrawPlaneBox( m_plane_box ); OpenTissue::gl::ColorPicker(0.1,0.8,0.8); OpenTissue::gl::DrawT4MeshCutThrough(my_t4mesh,m_plane_box.plane(),0.95,false); }

void do_action(unsigned char choice) { switch ( choice ) { case 'i': // initialize { vector3_type min_coord; vector3_type max_coord; .... m_plane_box.init( min_coord, max_coord); } break; case '': // toggle plane { static int axis = 0; axis = (axis+1)3; if(axis==0) m_plane_box.set_x_axis(); if(axis==1) m_plane_box.set_y_axis(); if(axis==2) m_plane_box.set_z_axis(); } break; case '+': { m_plane_box.increment(); } break; case '-': { m_plane_box.decrement(); } break; default: std::cout << "You pressed " << choice << std::endl; break; }; }


Member Typedef Documentation

template<typename math_types >
typedef AABB<math_types> OpenTissue::geometry::PlaneBox< math_types >::aabb_type [protected]
template<typename math_types >
typedef Plane<math_types> OpenTissue::geometry::PlaneBox< math_types >::plane_type
template<typename math_types >
typedef math_types::real_type OpenTissue::geometry::PlaneBox< math_types >::real_type

Constructor & Destructor Documentation

template<typename math_types >
OpenTissue::geometry::PlaneBox< math_types >::PlaneBox (  )  [inline]

Member Function Documentation

template<typename math_types >
aabb_type const& OpenTissue::geometry::PlaneBox< math_types >::box (  )  const [inline]
template<typename math_types >
void OpenTissue::geometry::PlaneBox< math_types >::decrement (  )  [inline]
template<typename math_types >
void OpenTissue::geometry::PlaneBox< math_types >::increment (  )  [inline]
template<typename math_types >
void OpenTissue::geometry::PlaneBox< math_types >::init ( vector3_type const &  min_coord,
vector3_type const &  max_coord 
) [inline]
template<typename math_types >
vector3_type const& OpenTissue::geometry::PlaneBox< math_types >::n (  )  const [inline]
template<typename math_types >
vector3_type const& OpenTissue::geometry::PlaneBox< math_types >::p0 (  )  const [inline]
template<typename math_types >
vector3_type const& OpenTissue::geometry::PlaneBox< math_types >::p1 (  )  const [inline]
template<typename math_types >
vector3_type const& OpenTissue::geometry::PlaneBox< math_types >::p2 (  )  const [inline]
template<typename math_types >
vector3_type const& OpenTissue::geometry::PlaneBox< math_types >::p3 (  )  const [inline]
template<typename math_types >
plane_type const& OpenTissue::geometry::PlaneBox< math_types >::plane (  )  const [inline]
template<typename math_types >
void OpenTissue::geometry::PlaneBox< math_types >::set_x_axis (  )  [inline]
template<typename math_types >
void OpenTissue::geometry::PlaneBox< math_types >::set_y_axis (  )  [inline]
template<typename math_types >
void OpenTissue::geometry::PlaneBox< math_types >::set_z_axis (  )  [inline]
template<typename math_types >
void OpenTissue::geometry::PlaneBox< math_types >::update (  )  [inline, protected]

Member Data Documentation

template<typename math_types >
int OpenTissue::geometry::PlaneBox< math_types >::m_axis [protected]

Indicator of which axis the plane is orthogonal to.

template<typename math_types >
aabb_type OpenTissue::geometry::PlaneBox< math_types >::m_box [protected]
template<typename math_types >
int OpenTissue::geometry::PlaneBox< math_types >::m_cur_tick [protected]

The current tick value along the m_axis direction that the plane should be placed at.

template<typename math_types >
int OpenTissue::geometry::PlaneBox< math_types >::m_max_tick [protected]

The maximum ticks that a side along the box should be divided into (i.e. the number of plane positions).

template<typename math_types >
vector3_type OpenTissue::geometry::PlaneBox< math_types >::m_n[3] [protected]

Possible normal directions, current direction is chosen by value of m_axis.

template<typename math_types >
vector3_type OpenTissue::geometry::PlaneBox< math_types >::m_p[4][3] [protected]

Base points of rectangle representing plane.

template<typename math_types >
plane_type OpenTissue::geometry::PlaneBox< math_types >::m_plane [protected]

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