Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
GpuHelper Class Reference

#include <gpuhelper.h>

List of all members.

Public Types

enum  ProjectionMode2D { PM_Normalized = 1, PM_Viewport = 2 }

Public Member Functions

void draw (GLenum mode, uint nofElement)
 draw the nofElement first elements
void draw (GLenum mode, uint start, uint end)
 draw a range of elements
void draw (GLenum mode, const std::vector< uint > *pIndexes)
 draw an indexed subset
void drawUnitCube (void)
void drawUnitSphere (int level=0)
void drawVector (const Vector3f &position, const Vector3f &vec, const Color &color, float aspect=50.)
void drawVectorBox (const Vector3f &position, const Vector3f &vec, const Color &color, float aspect=50.)
void forceMatrixTarget (GLenum matrixTarget)
 GpuHelper ()
template<typename Scalar , int _Flags>
void loadMatrix (const Eigen::Matrix< Scalar, 4, 4, _Flags, 4, 4 > &mat, GLenum matrixTarget)
template<typename Scalar , typename Derived >
void loadMatrix (const Eigen::CwiseNullaryOp< Eigen::internal::scalar_identity_op< Scalar >, Derived > &, GLenum matrixTarget)
template<typename Scalar , int _Flags>
void multMatrix (const Matrix< Scalar, 4, 4, _Flags, 4, 4 > &mat, GLenum matrixTarget)
void popMatrix (GLenum matrixTarget)
void popProjectionMode2D ()
template<typename Scalar , int _Flags>
void pushMatrix (const Matrix< Scalar, 4, 4, _Flags, 4, 4 > &mat, GLenum matrixTarget)
template<typename Scalar , typename Derived >
void pushMatrix (const Eigen::CwiseNullaryOp< Eigen::internal::scalar_identity_op< Scalar >, Derived > &, GLenum matrixTarget)
void pushMatrix (GLenum matrixTarget)
void pushProjectionMode2D (ProjectionMode2D pm)
void setMatrixTarget (GLenum matrixTarget)
 ~GpuHelper ()

Protected Member Functions

void update (void)

Protected Attributes

GLuint mColorBufferId
GLenum mCurrentMatrixTarget
bool mInitialized
int mVpHeight
int mVpWidth

Detailed Description

Definition at line 36 of file gpuhelper.h.


Member Enumeration Documentation

Enumerator:
PM_Normalized 
PM_Viewport 

Definition at line 44 of file gpuhelper.h.


Constructor & Destructor Documentation

Definition at line 35 of file gpuhelper.cpp.

Definition at line 42 of file gpuhelper.cpp.


Member Function Documentation

void GpuHelper::draw ( GLenum  mode,
uint  nofElement 
) [inline]

draw the nofElement first elements

Definition at line 206 of file gpuhelper.h.

void GpuHelper::draw ( GLenum  mode,
uint  start,
uint  end 
) [inline]

draw a range of elements

Definition at line 217 of file gpuhelper.h.

void GpuHelper::draw ( GLenum  mode,
const std::vector< uint > *  pIndexes 
) [inline]

draw an indexed subset

Definition at line 212 of file gpuhelper.h.

void GpuHelper::drawUnitCube ( void  )

Definition at line 113 of file gpuhelper.cpp.

void GpuHelper::drawUnitSphere ( int  level = 0)

Definition at line 135 of file gpuhelper.cpp.

void GpuHelper::drawVector ( const Vector3f &  position,
const Vector3f &  vec,
const Color color,
float  aspect = 50. 
)

Definition at line 71 of file gpuhelper.cpp.

void GpuHelper::drawVectorBox ( const Vector3f &  position,
const Vector3f &  vec,
const Color color,
float  aspect = 50. 
)

Definition at line 92 of file gpuhelper.cpp.

void GpuHelper::forceMatrixTarget ( GLenum  matrixTarget) [inline]

Make the matrix matrixTarget the current OpenGL matrix target. Call this function before loadMatrix() or multMatrix() if you cannot guarantee that glMatrixMode() has never been called after the last loadMatrix() or multMatrix() calls.

Todo:
provides a debug mode checking the sanity of the cached matrix mode.

Definition at line 78 of file gpuhelper.h.

template<typename Scalar , int _Flags>
void GpuHelper::loadMatrix ( const Eigen::Matrix< Scalar, 4, 4, _Flags, 4, 4 > &  mat,
GLenum  matrixTarget 
)

Load the matrix mat to the OpenGL matrix matrixTarget. Essentially, this helper function automatically calls glMatrixMode(matrixTarget) if required and does a proper call to the right glLoadMatrix*() or glLoadIdentity() function according to the scalar type and storage order.

Warning:
glMatrixMode() must never be called directly. If your're unsure, use forceMatrixMode().
See also:
Matrix, multMatrix(), forceMatrixMode()

Definition at line 172 of file gpuhelper.h.

template<typename Scalar , typename Derived>
void GpuHelper::loadMatrix ( const Eigen::CwiseNullaryOp< Eigen::internal::scalar_identity_op< Scalar >, Derived > &  ,
GLenum  matrixTarget 
)

Definition at line 163 of file gpuhelper.h.

template<typename Scalar , int _Flags>
void GpuHelper::multMatrix ( const Matrix< Scalar, 4, 4, _Flags, 4, 4 > &  mat,
GLenum  matrixTarget 
)

Multiply the OpenGL matrix matrixTarget by the matrix mat. Essentially, this helper function automatically calls glMatrixMode(matrixTarget) if required and does a proper call to the right glMultMatrix*() function according to the scalar type and storage order.

Warning:
glMatrixMode() must never be called directly. If your're unsure, use forceMatrixMode().
See also:
Matrix, loadMatrix(), forceMatrixMode()

Definition at line 156 of file gpuhelper.h.

void GpuHelper::popMatrix ( GLenum  matrixTarget) [inline]

Pop the OpenGL matrix matrixTarget

Definition at line 200 of file gpuhelper.h.

Definition at line 65 of file gpuhelper.cpp.

template<typename Scalar , int _Flags>
void GpuHelper::pushMatrix ( const Matrix< Scalar, 4, 4, _Flags, 4, 4 > &  mat,
GLenum  matrixTarget 
) [inline]

Push the OpenGL matrix matrixTarget and load mat.

Definition at line 185 of file gpuhelper.h.

template<typename Scalar , typename Derived>
void GpuHelper::pushMatrix ( const Eigen::CwiseNullaryOp< Eigen::internal::scalar_identity_op< Scalar >, Derived > &  ,
GLenum  matrixTarget 
)

Definition at line 192 of file gpuhelper.h.

void GpuHelper::pushMatrix ( GLenum  matrixTarget) [inline]

Push and clone the OpenGL matrix matrixTarget

Definition at line 178 of file gpuhelper.h.

Definition at line 46 of file gpuhelper.cpp.

void GpuHelper::setMatrixTarget ( GLenum  matrixTarget) [inline]

Definition at line 149 of file gpuhelper.h.

void GpuHelper::update ( void  ) [protected]

Member Data Documentation

GLuint GpuHelper::mColorBufferId [protected]

Definition at line 118 of file gpuhelper.h.

GLenum GpuHelper::mCurrentMatrixTarget [protected]

Definition at line 120 of file gpuhelper.h.

Definition at line 121 of file gpuhelper.h.

int GpuHelper::mVpHeight [protected]

Definition at line 119 of file gpuhelper.h.

int GpuHelper::mVpWidth [protected]

Definition at line 119 of file gpuhelper.h.


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


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:34:09