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

OpenTissue::gl::OnScreenDisplay< math_types > Class Template Reference

#include <gl_on_screen_display.h>

List of all members.

Public Types

typedef math_types::real_type real_type

Public Member Functions

 OnScreenDisplay (int x, int y)
 OnScreenDisplay (int pos)
 OnScreenDisplay ()
void set_pos (int pos)
void set_pos (int x, int y)
void set_visibility (bool visible)
bool get_visibility ()
void set_static (bool isstatic)
bool get_static ()
void set_color (float r, float g, float b, float alpha=0.5f)
void printf (char *format,...)
void print (std::string const &str)
void clear ()
void display ()

Protected Member Functions

void renderBitmapString (float x, float y, float z, void *font, const char *string)
void display_text ()

Protected Attributes

int m_pos
int m_pos_x
int m_pos_y
int m_screen_width
int m_screen_height
int m_display_width
int m_display_height
unsigned int m_maxlen
 Max chars present in a single string (only for monospaced fonts).
float m_alpha
float m_red
float m_green
float m_blue
bool m_visible
bool m_static
std::vector< std::stringm_string

Detailed Description

template<typename math_types>
class OpenTissue::gl::OnScreenDisplay< math_types >

On Screen Display Class. This class provides an easy interface for writing textual 2D output on the screen. Uses screen pixel units.


Member Typedef Documentation

template<typename math_types >
typedef math_types::real_type OpenTissue::gl::OnScreenDisplay< math_types >::real_type

Constructor & Destructor Documentation

template<typename math_types >
OpenTissue::gl::OnScreenDisplay< math_types >::OnScreenDisplay ( int  x,
int  y 
) [inline]
Parameters:
x Horizontal pixel position of the top left corner of the display
y Vertical pixel position of the top left corner of the display
template<typename math_types >
OpenTissue::gl::OnScreenDisplay< math_types >::OnScreenDisplay ( int  pos  )  [inline]
Parameters:
m_pos Semantic description of the display position OSD_TOP_LEFT, OSD_TOP_RIGHT....
template<typename math_types >
OpenTissue::gl::OnScreenDisplay< math_types >::OnScreenDisplay (  )  [inline]

Member Function Documentation

template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::clear ( void   )  [inline]
template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::display (  )  [inline]
template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::display_text (  )  [inline, protected]
template<typename math_types >
bool OpenTissue::gl::OnScreenDisplay< math_types >::get_static (  )  [inline]
template<typename math_types >
bool OpenTissue::gl::OnScreenDisplay< math_types >::get_visibility (  )  [inline]
template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::print ( std::string const &  str  )  [inline]
template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::printf ( char *  format,
  ... 
) [inline]

Prints a formatted string to the OSD in standard printf format(see C++ docs)

Parameters:
format The format string
... Variable length argument list for formatting
template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::renderBitmapString ( float  x,
float  y,
float  z,
void *  font,
const char *  string 
) [inline, protected]
template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::set_color ( float  r,
float  g,
float  b,
float  alpha = 0.5f 
) [inline]
template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::set_pos ( int  x,
int  y 
) [inline]

Sets custom screen position of the OSD

Parameters:
x Horizontal pixel position of the top left corner of the display
y Vertical pixel position of the top left corner of the display
template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::set_pos ( int  pos  )  [inline]

Sets the display position using semantic description predefines of the display position i.e. OSD_TOP_LEFT, OSD_TOP_RIGHT ...

Parameters:
m_pos Semantic description predefine
template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::set_static ( bool  isstatic  )  [inline]
template<typename math_types >
void OpenTissue::gl::OnScreenDisplay< math_types >::set_visibility ( bool  visible  )  [inline]

Member Data Documentation

template<typename math_types >
float OpenTissue::gl::OnScreenDisplay< math_types >::m_alpha [protected]
template<typename math_types >
float OpenTissue::gl::OnScreenDisplay< math_types >::m_blue [protected]
template<typename math_types >
int OpenTissue::gl::OnScreenDisplay< math_types >::m_display_height [protected]
template<typename math_types >
int OpenTissue::gl::OnScreenDisplay< math_types >::m_display_width [protected]
template<typename math_types >
float OpenTissue::gl::OnScreenDisplay< math_types >::m_green [protected]
template<typename math_types >
unsigned int OpenTissue::gl::OnScreenDisplay< math_types >::m_maxlen [protected]

Max chars present in a single string (only for monospaced fonts).

template<typename math_types >
int OpenTissue::gl::OnScreenDisplay< math_types >::m_pos [protected]
template<typename math_types >
int OpenTissue::gl::OnScreenDisplay< math_types >::m_pos_x [protected]
template<typename math_types >
int OpenTissue::gl::OnScreenDisplay< math_types >::m_pos_y [protected]
template<typename math_types >
float OpenTissue::gl::OnScreenDisplay< math_types >::m_red [protected]
template<typename math_types >
int OpenTissue::gl::OnScreenDisplay< math_types >::m_screen_height [protected]
template<typename math_types >
int OpenTissue::gl::OnScreenDisplay< math_types >::m_screen_width [protected]
template<typename math_types >
bool OpenTissue::gl::OnScreenDisplay< math_types >::m_static [protected]
template<typename math_types >
std::vector< std::string > OpenTissue::gl::OnScreenDisplay< math_types >::m_string [protected]
template<typename math_types >
bool OpenTissue::gl::OnScreenDisplay< math_types >::m_visible [protected]

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