fast::LineRenderer class

Renders lines stored in Mesh data objects.

Base classes

class Renderer
Abstract base class for Renderers.

Derived classes

class VectorFieldRenderer
Renders a vector field image using lines.

Public functions

auto create(Color color, float lineWidth, bool drawOnTop) -> std::shared_ptr<LineRenderer>
Create instance.
auto addInputConnection(DataChannel::pointer port) -> uint override
auto addInputConnection(DataChannel::pointer port, Color color, float width) -> uint
void setDefaultColor(Color color)
void setDefaultLineWidth(float width)
Set line width in percent (2D mode only atm.)
void setDefaultDrawOnTop(bool drawOnTop)
void setDrawOnTop(uint inputNr, bool drawOnTop)
void setColor(uint inputNr, Color color)
void setWidth(uint inputNr, float width)
void draw(Matrix4f perspectiveMatrix, Matrix4f viewingMatrix, float zNear, float zFar, bool mode2D, int viewWidth, int viewHeight) virtual

Protected variables

float mDefaultLineWidth
Color mDefaultColor
bool mDefaultColorSet
bool mDefaultDrawOnTop
std::unordered_map<uint, float> mInputWidths
std::unordered_map<uint, Color> mInputColors
std::unordered_map<uint, bool> mInputDrawOnTop
std::unordered_map<uint, uint> mVAO

Function documentation

std::shared_ptr<LineRenderer> fast::LineRenderer::create(Color color, float lineWidth, bool drawOnTop)

Create instance.

Parameters
color Color of lines to draw
lineWidth Width of line
drawOnTop Whether to draw on top of everything else or not. This disables the depth check in OpenGL
Returns instance

uint fast::LineRenderer::addInputConnection(DataChannel::pointer port) override

Parameters
port
Returns the input nr of the new connection

Adds a new input connection

void fast::LineRenderer::setDefaultLineWidth(float width)

Set line width in percent (2D mode only atm.)

Parameters
width