Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::OpenGLRenderObject Class Reference

Renders an OpenGL object (vertex-array) in a color and using a transformation/translation matrix. More...

#include <OpenGLRenderObject.h>

Inheritance diagram for sf::OpenGLRenderObject:
Collaboration diagram for sf::OpenGLRenderObject:

Public Types

typedef QList< OpenGLRenderObject * > List
 Type to hold a list of not-owned render objects.
 

Public Member Functions

 OpenGLRenderObject (QObject *parent=nullptr)
 Qt constructor.
 
void render (const std::function< void()> &cb)
 Render the object using a callback lambda function.
 
void setVertexArray (QOpenGLVertexArrayObject *)
 Sets the assigned vertex array.
 
QOpenGLVertexArrayObject * vertexArray () const
 Gets the assigned vertex array.
 
const QMatrix4x4 & getMatrix (bool offset) const
 Gets the reference to the matrix.
 
void setMatrix (const QMatrix4x4 &mtx, bool is_offset)
 Sets the given matrix as transform or offset.
 
QColor & color ()
 Gets the reference to the color to be modified.
 
virtual bool isEnabled ()
 Gets the reference to the enable flag. Can be overridden to implement otherwise.
 
void setEnabled (bool flag)
 Sets the enable flag for this instance.
 
Q_SIGNAL void rendering ()
 Signal emitted just before the render() method is called.
 

Protected Attributes

QOpenGLVertexArrayObject * _vertexArray
 Holds the vertex array type derived object.
 
QMatrix4x4 _matrix
 Holds the matrix to transform and/or translate and defaults to a unit or identity matrix.
 
QMatrix4x4 _offset
 Holds the additional matrix to offset the resulting matrix.
 
QColor _color
 Holds the color to render when the object has no color of itself.
 
bool _enabled
 Holds the flag weather it should be rendered or not.
 

Detailed Description

Renders an OpenGL object (vertex-array) in a color and using a transformation/translation matrix.

Member Typedef Documentation

◆ List

Type to hold a list of not-owned render objects.

Constructor & Destructor Documentation

◆ OpenGLRenderObject()

sf::OpenGLRenderObject::OpenGLRenderObject ( QObject *  parent = nullptr)
explicit

Qt constructor.

Parameters
parent

Member Function Documentation

◆ color()

QColor & sf::OpenGLRenderObject::color ( )

Gets the reference to the color to be modified.

◆ getMatrix()

const QMatrix4x4 & sf::OpenGLRenderObject::getMatrix ( bool  offset) const

Gets the reference to the matrix.

Parameters
offsetDetermines if the initial matrix or offset matrix is referenced.

◆ isEnabled()

virtual bool sf::OpenGLRenderObject::isEnabled ( )
virtual

Gets the reference to the enable flag. Can be overridden to implement otherwise.

◆ render()

void sf::OpenGLRenderObject::render ( const std::function< void()> &  cb)

Render the object using a callback lambda function.

Parameters
cbCallback function.

◆ rendering()

Q_SIGNAL void sf::OpenGLRenderObject::rendering ( )

Signal emitted just before the render() method is called.

◆ setEnabled()

void sf::OpenGLRenderObject::setEnabled ( bool  flag)

Sets the enable flag for this instance.

◆ setMatrix()

void sf::OpenGLRenderObject::setMatrix ( const QMatrix4x4 &  mtx,
bool  is_offset 
)

Sets the given matrix as transform or offset.

Parameters
mtxThe matrix value.
is_offsetDetermines if the initial matrix or offset matrix is set.

◆ setVertexArray()

void sf::OpenGLRenderObject::setVertexArray ( QOpenGLVertexArrayObject *  )

Sets the assigned vertex array.

◆ vertexArray()

QOpenGLVertexArrayObject * sf::OpenGLRenderObject::vertexArray ( ) const

Gets the assigned vertex array.

Member Data Documentation

◆ _color

QColor sf::OpenGLRenderObject::_color
protected

Holds the color to render when the object has no color of itself.

◆ _enabled

bool sf::OpenGLRenderObject::_enabled
protected

Holds the flag weather it should be rendered or not.

◆ _matrix

QMatrix4x4 sf::OpenGLRenderObject::_matrix
protected

Holds the matrix to transform and/or translate and defaults to a unit or identity matrix.

◆ _offset

QMatrix4x4 sf::OpenGLRenderObject::_offset
protected

Holds the additional matrix to offset the resulting matrix.

◆ _vertexArray

QOpenGLVertexArrayObject* sf::OpenGLRenderObject::_vertexArray
protected

Holds the vertex array type derived object.


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