Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::OpenGLRenderer Class Referenceabstract

Pure virtual class to implement rendering separated from the widget and makes the sf::OpenGLWidget the placeholder. More...

#include <OpenGLRenderer.h>

Inheritance diagram for sf::OpenGLRenderer:
Collaboration diagram for sf::OpenGLRenderer:

Public Member Functions

 OpenGLRenderer (OpenGLWidget *widget, QOpenGLShaderProgram *sp)
 Constructor passing the widget which has the OpenGL context. The owner is the shader program object.
 
 ~OpenGLRenderer () override=default
 Virtual destructor.
 
bool setup ()
 Call overridden method generate() after teh shader program has been linked.
 
void render ()
 Call overridden method render() after teh shader program has been linked.
 
OpenGLWidgetgetWidget () const
 Gets the owning widget which is calling the shots.
 
virtual void changedProperty ()=0
 Called by sf::OpenGLWidget when a property has changed.
 
virtual void setIndexValue (int index, QVariant value)=0
 Sets an arbitrary value on the derived- or subclass.
 
bool isMain () const
 Tells if this instance is the first renderer or not.
 

Static Public Member Functions

static void initialize (OpenGLWidget *widget)
 Called by sf::OpenGLWidget::initializeGL to initialize the OpenGL context for derived classes.
 

Protected Member Functions

virtual void generate ()=0
 Called by setup() and (re-)generates the vertices for the drawn 3D-objects.
 
virtual void paint ()=0
 Called by from the render() method.
 
virtual void draw ()=0
 Called by from the render() method.
 

Protected Attributes

const QMatrix4x4 & _projectionMatrix
 Easy of access reference to the projection matrix from the widget.
 
const QMatrix4x4 & _cameraMatrix
 Easy of access reference to the camera matrix from the sf::OpenGLWidget.
 
const QMatrix4x4 & _lightPositionMatrix
 Easy of access reference to the light position matrix from the sf::OpenGLWidget.
 
const QMatrix4x4 & _lightDirectionMatrix
 Easy of access reference to the light direction matrix from the sf::OpenGLWidget.
 
const QMatrix4x4 & _modelMatrix
 Easy of access reference to the model matrix from the sf::OpenGLWidget.
 

Detailed Description

Pure virtual class to implement rendering separated from the widget and makes the sf::OpenGLWidget the placeholder.

Constructor & Destructor Documentation

◆ OpenGLRenderer()

sf::OpenGLRenderer::OpenGLRenderer ( OpenGLWidget widget,
QOpenGLShaderProgram *  sp 
)
explicit

Constructor passing the widget which has the OpenGL context. The owner is the shader program object.

◆ ~OpenGLRenderer()

sf::OpenGLRenderer::~OpenGLRenderer ( )
overridedefault

Virtual destructor.

Member Function Documentation

◆ changedProperty()

virtual void sf::OpenGLRenderer::changedProperty ( )
pure virtual

Called by sf::OpenGLWidget when a property has changed.

Implemented in sf::xgl::DemoRenderer, and sf::xgl::NipscanRenderer.

◆ draw()

virtual void sf::OpenGLRenderer::draw ( )
protectedpure virtual

Called by from the render() method.

Implemented in sf::xgl::DemoRenderer, and sf::xgl::NipscanRenderer.

◆ generate()

virtual void sf::OpenGLRenderer::generate ( )
protectedpure virtual

Called by setup() and (re-)generates the vertices for the drawn 3D-objects.

Implemented in sf::xgl::DemoRenderer, and sf::xgl::NipscanRenderer.

◆ getWidget()

OpenGLWidget * sf::OpenGLRenderer::getWidget ( ) const

Gets the owning widget which is calling the shots.

◆ initialize()

static void sf::OpenGLRenderer::initialize ( OpenGLWidget widget)
static

Called by sf::OpenGLWidget::initializeGL to initialize the OpenGL context for derived classes.

◆ isMain()

bool sf::OpenGLRenderer::isMain ( ) const

Tells if this instance is the first renderer or not.

Returns

◆ paint()

virtual void sf::OpenGLRenderer::paint ( )
protectedpure virtual

Called by from the render() method.

Implemented in sf::xgl::DemoRenderer, and sf::xgl::NipscanRenderer.

◆ render()

void sf::OpenGLRenderer::render ( )

Call overridden method render() after teh shader program has been linked.

◆ setIndexValue()

virtual void sf::OpenGLRenderer::setIndexValue ( int  index,
QVariant  value 
)
pure virtual

Sets an arbitrary value on the derived- or subclass.

Parameters
indexIndex like in an array.
valueVariant able to accept any value.

Implemented in sf::xgl::DemoRenderer, and sf::xgl::NipscanRenderer.

◆ setup()

bool sf::OpenGLRenderer::setup ( )

Call overridden method generate() after teh shader program has been linked.

Member Data Documentation

◆ _cameraMatrix

const QMatrix4x4& sf::OpenGLRenderer::_cameraMatrix
protected

Easy of access reference to the camera matrix from the sf::OpenGLWidget.

◆ _lightDirectionMatrix

const QMatrix4x4& sf::OpenGLRenderer::_lightDirectionMatrix
protected

Easy of access reference to the light direction matrix from the sf::OpenGLWidget.

◆ _lightPositionMatrix

const QMatrix4x4& sf::OpenGLRenderer::_lightPositionMatrix
protected

Easy of access reference to the light position matrix from the sf::OpenGLWidget.

◆ _modelMatrix

const QMatrix4x4& sf::OpenGLRenderer::_modelMatrix
protected

Easy of access reference to the model matrix from the sf::OpenGLWidget.

◆ _projectionMatrix

const QMatrix4x4& sf::OpenGLRenderer::_projectionMatrix
protected

Easy of access reference to the projection matrix from the widget.


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