4#include <QOpenGLVertexArrayObject>
5#include <QtUiPlugin/QDesignerExportWidget>
24 typedef QList<OpenGLRenderObject*>
List;
36 void render(
const std::function<
void()>& cb);
59 void setMatrix(
const QMatrix4x4& mtx,
bool is_offset);
Renders an OpenGL object (vertex-array) in a color and using a transformation/translation matrix.
Definition OpenGLRenderObject.h:17
QColor _color
Holds the color to render when the object has no color of itself.
Definition OpenGLRenderObject.h:90
void setMatrix(const QMatrix4x4 &mtx, bool is_offset)
Sets the given matrix as transform or offset.
QOpenGLVertexArrayObject * _vertexArray
Holds the vertex array type derived object.
Definition OpenGLRenderObject.h:84
bool _enabled
Holds the flag weather it should be rendered or not.
Definition OpenGLRenderObject.h:92
OpenGLRenderObject(QObject *parent=nullptr)
Qt constructor.
void setEnabled(bool flag)
Sets the enable flag for this instance.
void render(const std::function< void()> &cb)
Render the object using a callback lambda function.
QOpenGLVertexArrayObject * vertexArray() const
Gets the assigned vertex array.
QList< OpenGLRenderObject * > List
Type to hold a list of not-owned render objects.
Definition OpenGLRenderObject.h:24
QMatrix4x4 _offset
Holds the additional matrix to offset the resulting matrix.
Definition OpenGLRenderObject.h:88
void setVertexArray(QOpenGLVertexArrayObject *)
Sets the assigned vertex array.
Q_SIGNAL void rendering()
Signal emitted just before the render() method is called.
QColor & color()
Gets the reference to the color to be modified.
QMatrix4x4 _matrix
Holds the matrix to transform and/or translate and defaults to a unit or identity matrix.
Definition OpenGLRenderObject.h:86
const QMatrix4x4 & getMatrix(bool offset) const
Gets the reference to the matrix.
virtual bool isEnabled()
Gets the reference to the enable flag. Can be overridden to implement otherwise.
Definition Application.h:10