fast::Renderer class

Abstract base class for Renderers.

Renderers are process objects which can visualize data in a View, typically using OpenGL. They should inherit from this class.

Base classes

class ProcessObject
Abstract base class for all process objects.

Derived classes

class ImagePyramidRenderer
Renders tiled image pyramids.
class ImageRenderer virtual
Renders 2D Image data objects, both in 2D and 3D.
class LabelColorRenderer virtual
class LineRenderer
Renders lines stored in Mesh data objects.
class TextRenderer
Renders Text data.
class TriangleRenderer
Renders triangle Mesh data.
class VertexRenderer
Renders vertices as a circular points.
class VolumeRenderer
Abstract base class for volume renderers.

Public types

using pointer = std::shared_ptr<Renderer>

Constructors, destructors, conversion operators

Renderer() protected

Public functions

void draw(Matrix4f perspectiveMatrix, Matrix4f viewingMatrix, float zNear, float zFar, bool mode2D, int viewWidth, int viewHeight) pure virtual
void postDraw() virtual
auto addInputConnection(DataChannel::pointer port) -> uint virtual
auto addInputData(DataObject::pointer data) -> uint virtual
auto getBoundingBox(bool transform = true) -> DataBoundingBox virtual
void stopPipeline() virtual
void reset() virtual
void setDisabled(bool disabled) virtual
auto isDisabled() const -> bool virtual
void setView(View* view)
auto is2DOnly() const -> bool
auto is3DOnly() const -> bool
void loadAttributes() override

Protected functions

void execute() override
auto getDataToRender() -> std::unordered_map<uint, std::shared_ptr<SpatialDataObject>>
void clearDataToRender()
void createShaderProgram(std::vector<std::string> shaderFilenames, std::string programName = "default")
void attachShader(std::string filename, std::string programName = "default")
void activateShader(std::string programName = "default")
void deactivateShader()
auto getShaderProgram(std::string programName = "default") -> uint
void setShaderUniform(std::string name, Matrix4f matrix, std::string shaderProgramName = "default")
void setShaderUniform(std::string name, Affine3f matrix, std::string shaderProgramName = "default")
void setShaderUniform(std::string name, Vector3f vector, std::string shaderProgramName = "default")
void setShaderUniform(std::string name, Vector4f vector, std::string shaderProgramName = "default")
void setShaderUniform(std::string name, float value, std::string shaderProgramName = "default")
void setShaderUniform(std::string name, bool value, std::string shaderProgramName = "default")
void setShaderUniform(std::string name, int value, std::string shaderProgramName = "default")
auto getShaderUniformLocation(std::string name, std::string shaderProgramName = "default") -> int

Protected variables

bool mHasRendered
bool mStop
std::mutex mMutex
bool m_disabled
bool m_2Donly
bool m_3Donly
std::unordered_map<uint, SpatialDataObject::pointer> mDataToRender
View* m_view

Function documentation

uint fast::Renderer::addInputConnection(DataChannel::pointer port) virtual

Parameters
port
Returns the input nr of the new connection

Adds a new input connection

uint fast::Renderer::addInputData(DataObject::pointer data) virtual

Parameters
data
Returns the input nr of the new connection

Adds a new input connection to a specific data object

void fast::Renderer::setDisabled(bool disabled) virtual

Parameters
disabled

Set renderer to disabled or enabled. A disabled renderer will not draw.

bool fast::Renderer::isDisabled() const virtual

Get whether this renderer is disabled or not

void fast::Renderer::createShaderProgram(std::vector<std::string> shaderFilenames, std::string programName = "default") protected

Parameters
shaderFilenames
programName

Creates an OpenGL shader program. Should be used in the renderer constructor.

Variable documentation

bool fast::Renderer::m_disabled protected

A disabled renderer will not draw

bool fast::Renderer::m_2Donly protected

Whether this renderer is only capable of 2D rendering

bool fast::Renderer::m_3Donly protected

Whether this renderer is only capable of 3D rendering

std::unordered_map<uint, SpatialDataObject::pointer> fast::Renderer::mDataToRender protected

This holds the current data to render for each input connection