Vis 2 Demo  1.0
Technical illustration type real-time rendering of geometry
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
vis2::QuadTextured Class Reference

This class produces quads for post-processing purposes. More...

Inheritance diagram for vis2::QuadTextured:
vis2::DrawableObject

Public Member Functions

 QuadTextured (glm::mat4 _modelMatrix, ShaderController *_shader_ctrl, bool _b_fill_window)
 Constructor. More...
 
virtual ~QuadTextured ()
 Destructor. More...
 
virtual void update (double _deltaT)
 Empty update function. More...
 
virtual void draw (glm::mat4 &_projectionMatrix)
 The standard drawing function. More...
 
void draw (glm::mat4 &_projectionMatrix, glm::vec3 _edge_color)
 A drawing function for drawing with particular edge color when using edge detecting shaders. More...
 
- Public Member Functions inherited from vis2::DrawableObject
 DrawableObject (glm::mat4 &_modelMatrix)
 Constructor. More...
 
virtual ~DrawableObject ()
 Destructor. More...
 

Private Member Functions

 QuadTextured (const QuadTextured &)
 Hidden copy-constructor. More...
 

Private Attributes

ShaderControllershader_ctrl
 handle to the shader program used by this quad More...
 
bool b_fill_window
 if true the quad fills the window, if false the quad fills the upper left quarter of the window More...
 
GLuint vao_handle
 handle to the vertex array object for the shader program More...
 
bool vao_setup_done
 signifies if the setup for the shader completed More...
 
GLuint position_buffer_handle
 handle to the vertex buffer object containing the vertex coordinates in object space More...
 
GLuint normal_buffer_handle
 handle to the normal buffer object containing the vertex normals in object space More...
 
GLuint uv_buffer_handle
 handle to the uv buffer object containing the vertex texture coordinates in object space More...
 
GLuint index_buffer_handle
 handle to the vertex buffer object containing the face indices for each polygon More...
 

Static Private Attributes

static const float generic_positions [QUAD_TEXTURED_VERTEX_COUNT *3]
 the vertex positions for a generic quad with pivot in (0,0) More...
 
static const float generic_positions_full [QUAD_TEXTURED_VERTEX_COUNT *3]
 the vertex positions for a generic screen-filling quad with pivot in (0,0) More...
 
static const float generic_normlas [QUAD_TEXTURED_VERTEX_COUNT *3]
 the vertex normals for the generic quad More...
 
static const float generic_uv [QUAD_TEXTURED_VERTEX_COUNT *2]
 the vertex uv coordinates for the generic quad More...
 
static const unsigned int generic_indices [QUAD_TEXTURED_INDEX_COUNT]
 the face indices for the generic quad More...
 

Additional Inherited Members

- Protected Attributes inherited from vis2::DrawableObject
glm::mat4 modelMatrix
 holds the current model matrix More...
 

Detailed Description

This class produces quads for post-processing purposes.

Definition at line 15 of file QuadTextured.h.

Constructor & Destructor Documentation

QuadTextured::QuadTextured ( glm::mat4  _modelMatrix,
ShaderController _shader_ctrl,
bool  _b_fill_window 
)

Constructor.

The geometry definition is contained in this class.

Parameters
[in]_modelMatrixis the object model matrix,
[in]_shader_ctrlis the shader controller for passing information btw geometry and environment,
[in]_b_fill_windowis true, if the quad should be rendered over the entire window, false - if it should occupy the upper left quarter for debugging output.

Definition at line 5 of file QuadTextured.cpp.

QuadTextured::~QuadTextured ( )
virtual

Destructor.

Deletes the VBOs and the VAO built in the constructor.

Definition at line 55 of file QuadTextured.cpp.

vis2::QuadTextured::QuadTextured ( const QuadTextured )
private

Hidden copy-constructor.

Member Function Documentation

void QuadTextured::draw ( glm::mat4 &  _projectionMatrix)
virtual

The standard drawing function.

Calls draw(glm::mat4 & _projectionMatrix, glm::vec3 _edge_color).

Parameters
[in]_projectionMatrixpasses the combined view and projectino matrices.

Implements vis2::DrawableObject.

Definition at line 71 of file QuadTextured.cpp.

void QuadTextured::draw ( glm::mat4 &  _projectionMatrix,
glm::vec3  _edge_color 
)

A drawing function for drawing with particular edge color when using edge detecting shaders.

This function activates the shader program, passes the updates to the shader uniform variables,
binds the Vertex Attribute Object (VAO), makes a draw call, then unbinds both the VAO and the shader program.

Parameters
[in]_projectionMatrixis the camera projection matrix,
[in]_edge_coloris the edge color to be used.

Definition at line 76 of file QuadTextured.cpp.

void QuadTextured::update ( double  _deltaT)
virtual

Empty update function.

Implements vis2::DrawableObject.

Definition at line 67 of file QuadTextured.cpp.

Member Data Documentation

bool vis2::QuadTextured::b_fill_window
private

if true the quad fills the window, if false the quad fills the upper left quarter of the window

Definition at line 50 of file QuadTextured.h.

const unsigned int QuadTextured::generic_indices
staticprivate
Initial value:
=
{
0, 3, 2,
0, 1, 3
}

the face indices for the generic quad

Definition at line 64 of file QuadTextured.h.

const float QuadTextured::generic_normlas
staticprivate
Initial value:
=
{
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f
}

the vertex normals for the generic quad

Definition at line 62 of file QuadTextured.h.

const float QuadTextured::generic_positions
staticprivate
Initial value:
=
{
0.0f, 0.0f, 0.1f,
0.0f, 0.5f, 0.1f,
0.5f, 0.0f, 0.1f,
0.5f, 0.5f, 0.1f
}

the vertex positions for a generic quad with pivot in (0,0)

Definition at line 60 of file QuadTextured.h.

const float QuadTextured::generic_positions_full
staticprivate
Initial value:
=
{
0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 1.0f, 0.0f
}

the vertex positions for a generic screen-filling quad with pivot in (0,0)

Definition at line 61 of file QuadTextured.h.

const float QuadTextured::generic_uv
staticprivate
Initial value:
=
{
0.0f, 1.0f,
0.0f, 0.0f,
1.0f, 1.0f,
1.0f, 0.0f
}

the vertex uv coordinates for the generic quad

Definition at line 63 of file QuadTextured.h.

GLuint vis2::QuadTextured::index_buffer_handle
private

handle to the vertex buffer object containing the face indices for each polygon

Definition at line 58 of file QuadTextured.h.

GLuint vis2::QuadTextured::normal_buffer_handle
private

handle to the normal buffer object containing the vertex normals in object space

Definition at line 56 of file QuadTextured.h.

GLuint vis2::QuadTextured::position_buffer_handle
private

handle to the vertex buffer object containing the vertex coordinates in object space

Definition at line 55 of file QuadTextured.h.

ShaderController* vis2::QuadTextured::shader_ctrl
private

handle to the shader program used by this quad

Definition at line 49 of file QuadTextured.h.

GLuint vis2::QuadTextured::uv_buffer_handle
private

handle to the uv buffer object containing the vertex texture coordinates in object space

Definition at line 57 of file QuadTextured.h.

GLuint vis2::QuadTextured::vao_handle
private

handle to the vertex array object for the shader program

Definition at line 52 of file QuadTextured.h.

bool vis2::QuadTextured::vao_setup_done
private

signifies if the setup for the shader completed

Definition at line 53 of file QuadTextured.h.


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