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

#include <NipscanRenderer.h>

Inheritance diagram for sf::xgl::NipscanRenderer:
Collaboration diagram for sf::xgl::NipscanRenderer:

Public Types

enum  FragmentProgram : int { fpPassthrough = 0 , fpSpotlight = 1 }
 Enumeration of available shader inner programs passed to ShaderProgram::Uniform::uProgram uniform. More...
 
typedef TClosure< void, NipscanRenderer * > HandlerType
 Closure type to handle rendering.
 

Public Member Functions

 NipscanRenderer (OpenGLWidget *widget, ShaderProgram *sp)
 Initializing constructor.
 
 ~NipscanRenderer () override
 Virtual overridden destructor.
 
void setHandler (const HandlerType &handler)
 Callback function for setting the axis positions and sizing the element and tool. Code to create an instance to pass to this method.
 
void setToolInformation (const ToolInformation &info)
 Sets the tool information.
 
void setElementInformation (const ElementInformation &)
 Sets the element information.
 
- Public Member Functions inherited from sf::OpenGLRenderer
 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 the shader program has been linked.
 
void render ()
 Call overridden method render() after the shader program has been linked.
 
OpenGLWidgetgetWidget () const
 Gets the owning widget which is calling the shots.
 
QOpenGLShaderProgram * getShaderProgram ()
 Gets shader program given in the constructor.
 
virtual void addRenderObject (OpenGLRenderObject *ro, bool append=true)
 Adds an object to be rendered. The order of addition determines the outcome when transparency is involved. When an object is destroyed, it is removed from the list using the 'destroyed' signal.
 

Protected Member Functions

void generate () override
 Called by setup() and (re-)generates the vertices for the drawn 3D-objects.
 
void paint () override
 Called by from the render() method.
 
void renderObjects ()
 
void draw () override
 Called by from the render() method.
 
void changedProperty () override
 Called by sf::OpenGLWidget when a property has changed.
 
void setIndexValue (int index, QVariant value) override
 Sets an arbitrary value on the derived- or subclass.
 
void renderNipscan (bool solid, double x_axis, double y_axis, double z_axis, double a_axis, double b_axis, double c_axis)
 

Properties

QColor lightColor
 
float cutoffAngle
 
float ambientStrength
 
float diffuseStrength
 
float specularStrength
 
float shininess
 
FragmentProgram fragmentProgram
 

Additional Inherited Members

- Static Public Member Functions inherited from sf::OpenGLRenderer
static void initialize (OpenGLWidget *widget)
 Called by sf::OpenGLWidget::initializeGL to initialize the OpenGL context for derived classes.
 
- Protected Attributes inherited from sf::OpenGLRenderer
QList< OpenGLRenderObject * > _renderObjects
 Holds the list of objects to render.
 
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.
 

Member Typedef Documentation

◆ HandlerType

Closure type to handle rendering.

Member Enumeration Documentation

◆ FragmentProgram

Enumeration of available shader inner programs passed to ShaderProgram::Uniform::uProgram uniform.

Enumerator
fpPassthrough 

No manipulation by the fragment shader.

fpSpotlight 

Applies the spotlight defined by ShaderProgram::Uniform::uLightPosition and other uniforms.

Constructor & Destructor Documentation

◆ NipscanRenderer()

sf::xgl::NipscanRenderer::NipscanRenderer ( OpenGLWidget widget,
ShaderProgram sp 
)
explicit

Initializing constructor.

◆ ~NipscanRenderer()

sf::xgl::NipscanRenderer::~NipscanRenderer ( )
override

Virtual overridden destructor.

Member Function Documentation

◆ changedProperty()

void sf::xgl::NipscanRenderer::changedProperty ( )
overrideprotectedvirtual

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

Implements sf::OpenGLRenderer.

◆ draw()

void sf::xgl::NipscanRenderer::draw ( )
overrideprotectedvirtual

Called by from the render() method.

Implements sf::OpenGLRenderer.

◆ generate()

void sf::xgl::NipscanRenderer::generate ( )
overrideprotectedvirtual

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

Implements sf::OpenGLRenderer.

◆ paint()

void sf::xgl::NipscanRenderer::paint ( )
overrideprotectedvirtual

Called by from the render() method.

Implements sf::OpenGLRenderer.

◆ renderNipscan()

void sf::xgl::NipscanRenderer::renderNipscan ( bool  solid,
double  x_axis,
double  y_axis,
double  z_axis,
double  a_axis,
double  b_axis,
double  c_axis 
)
protected

◆ renderObjects()

void sf::xgl::NipscanRenderer::renderObjects ( )
protected

◆ setElementInformation()

void sf::xgl::NipscanRenderer::setElementInformation ( const ElementInformation )

Sets the element information.

◆ setHandler()

void sf::xgl::NipscanRenderer::setHandler ( const HandlerType handler)

Callback function for setting the axis positions and sizing the element and tool. Code to create an instance to pass to this method.

setHandler(NipscanRenderer::HandlerType().assign(this, &MyClass::myMethod, std::placeholders::_1));
void setHandler(const HandlerType &handler)
Callback function for setting the axis positions and sizing the element and tool. Code to create an i...

◆ setIndexValue()

void sf::xgl::NipscanRenderer::setIndexValue ( int  index,
QVariant  value 
)
overrideprotectedvirtual

Sets an arbitrary value on the derived- or subclass.

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

Implements sf::OpenGLRenderer.

◆ setToolInformation()

void sf::xgl::NipscanRenderer::setToolInformation ( const ToolInformation info)

Sets the tool information.

Property Documentation

◆ ambientStrength

float sf::xgl::NipscanRenderer::ambientStrength
readwrite

◆ cutoffAngle

float sf::xgl::NipscanRenderer::cutoffAngle
readwrite

◆ diffuseStrength

float sf::xgl::NipscanRenderer::diffuseStrength
readwrite

◆ fragmentProgram

FragmentProgram sf::xgl::NipscanRenderer::fragmentProgram
readwrite

◆ lightColor

QColor sf::xgl::NipscanRenderer::lightColor
readwrite

◆ shininess

float sf::xgl::NipscanRenderer::shininess
readwrite

◆ specularStrength

float sf::xgl::NipscanRenderer::specularStrength
readwrite

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