Public Member Functions | Static Public Member Functions | Private Attributes
vgui_matrix_state Class Reference

Stores and retrieves the current projection and modelview matrices. More...

#include <vgui_matrix_state.h>

List of all members.

Public Member Functions

 vgui_matrix_state (bool save_now_restore_on_destroy=true)
 Construct a vgui_matrix_state, and save now.
 ~vgui_matrix_state ()
void save ()
void restore () const
void print (vcl_ostream &)

Static Public Member Functions

static void identity_gl_matrices ()
static void clear_gl_matrices ()
static void zero_out_gl_matrices ()
static bool gl_matrices_are_cleared ()
static vnl_matrix_fixed
< double, 4, 4 > 
projection_matrix ()
static vnl_matrix_fixed
< double, 4, 4 > 
modelview_matrix ()
static vnl_matrix_fixed
< double, 4, 4 > 
total_transformation ()
static void premultiply (vnl_matrix_fixed< double, 4, 4 > const &, GLenum)
 this premultiplies the given matrix by M.
static void premultiply_projection (vnl_matrix_fixed< double, 4, 4 > const &M)
static void premultiply_modelview (vnl_matrix_fixed< double, 4, 4 > const &M)
static void postmultiply (const vnl_matrix_fixed< double, 4, 4 > &M, GLenum matrix)
 This postmultiplies the given matrix by M.
static void postmultiply_projection (vnl_matrix_fixed< double, 4, 4 > const &M)
static void postmultiply_modelview (vnl_matrix_fixed< double, 4, 4 > const &M)

Private Attributes

double P [16]
double M [16]
bool restore_on_destroy

Detailed Description

Stores and retrieves the current projection and modelview matrices.

vgui_matrix_state stores the current OpenGL projection and modelview matrices when save() is called. The matrices are restored to these values on the next call to restore(). Normally, the constructor calls save() and the destructor calls restore(), but this can be overridden.

vgui_matrix_state also has various static convenience methods for GL matrix handling.

Definition at line 31 of file vgui_matrix_state.h.


Constructor & Destructor Documentation

vgui_matrix_state::vgui_matrix_state ( bool  save_now_restore_on_destroy = true)

Construct a vgui_matrix_state, and save now.

Definition at line 17 of file vgui_matrix_state.cxx.

vgui_matrix_state::~vgui_matrix_state ( )

Definition at line 24 of file vgui_matrix_state.cxx.


Member Function Documentation

void vgui_matrix_state::clear_gl_matrices ( ) [static]

Definition at line 65 of file vgui_matrix_state.cxx.

bool vgui_matrix_state::gl_matrices_are_cleared ( ) [static]

Definition at line 78 of file vgui_matrix_state.cxx.

void vgui_matrix_state::identity_gl_matrices ( ) [static]

Definition at line 56 of file vgui_matrix_state.cxx.

vnl_matrix_fixed< double, 4, 4 > vgui_matrix_state::modelview_matrix ( ) [static]

Definition at line 100 of file vgui_matrix_state.cxx.

void vgui_matrix_state::postmultiply ( const vnl_matrix_fixed< double, 4, 4 > &  M,
GLenum  matrix 
) [static]

This postmultiplies the given matrix by M.

Definition at line 137 of file vgui_matrix_state.cxx.

static void vgui_matrix_state::postmultiply_modelview ( vnl_matrix_fixed< double, 4, 4 > const &  M) [inline, static]

Definition at line 64 of file vgui_matrix_state.h.

static void vgui_matrix_state::postmultiply_projection ( vnl_matrix_fixed< double, 4, 4 > const &  M) [inline, static]

Definition at line 63 of file vgui_matrix_state.h.

void vgui_matrix_state::premultiply ( vnl_matrix_fixed< double, 4, 4 > const &  M,
GLenum  matrix 
) [static]

this premultiplies the given matrix by M.

Definition at line 115 of file vgui_matrix_state.cxx.

static void vgui_matrix_state::premultiply_modelview ( vnl_matrix_fixed< double, 4, 4 > const &  M) [inline, static]

Definition at line 60 of file vgui_matrix_state.h.

static void vgui_matrix_state::premultiply_projection ( vnl_matrix_fixed< double, 4, 4 > const &  M) [inline, static]

Definition at line 59 of file vgui_matrix_state.h.

void vgui_matrix_state::print ( vcl_ostream &  s)

Definition at line 46 of file vgui_matrix_state.cxx.

vnl_matrix_fixed< double, 4, 4 > vgui_matrix_state::projection_matrix ( ) [static]

Definition at line 91 of file vgui_matrix_state.cxx.

void vgui_matrix_state::restore ( ) const

Definition at line 36 of file vgui_matrix_state.cxx.

void vgui_matrix_state::save ( )

Definition at line 30 of file vgui_matrix_state.cxx.

vnl_matrix_fixed< double, 4, 4 > vgui_matrix_state::total_transformation ( ) [static]

Definition at line 109 of file vgui_matrix_state.cxx.

static void vgui_matrix_state::zero_out_gl_matrices ( ) [inline, static]

Definition at line 49 of file vgui_matrix_state.h.


Member Data Documentation

double vgui_matrix_state::M[16] [private]

Definition at line 35 of file vgui_matrix_state.h.

double vgui_matrix_state::P[16] [private]

Definition at line 34 of file vgui_matrix_state.h.

Definition at line 36 of file vgui_matrix_state.h.


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