Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
TissueForge::rendering::ArrowRenderer Struct Reference

Vector renderer. More...

#include <tfArrowRenderer.h>

Inheritance diagram for TissueForge::rendering::ArrowRenderer:
Collaboration diagram for TissueForge::rendering::ArrowRenderer:

Public Member Functions

 ArrowRenderer (const ArrowRenderer &other)
 
HRESULT start (const std::vector< fVector4 > &clipPlanes) override
 Starts the renderer.
 
HRESULT draw (ArcBallCamera *camera, const iVector2 &viewportSize, const fMatrix4 &modelViewMat) override
 Updates visualization.
 
const unsigned addClipPlaneEquation (const Magnum::Vector4 &pe) override
 Adds a clip plane equation.
 
const unsigned removeClipPlaneEquation (const unsigned int &id) override
 Removes a clip plane equation.
 
void setClipPlaneEquation (unsigned id, const Magnum::Vector4 &pe) override
 Sets a clip plane equation.
 
void setAmbientColor (const Magnum::Color3 &color) override
 Sets the ambient color.
 
void setDiffuseColor (const Magnum::Color3 &color) override
 Set the diffuse color.
 
void setSpecularColor (const Magnum::Color3 &color) override
 Set the specular color.
 
void setShininess (float shininess) override
 Sets the shininess.
 
void setLightDirection (const fVector3 &lightDir) override
 Sets the light direction.
 
void setLightColor (const Magnum::Color3 &color) override
 Sets the light color.
 
int addArrow (ArrowData *arrow)
 Adds a vector visualization specification.
 
std::pair< int, ArrowData * > addArrow (const fVector3 &position, const fVector3 &components, const Style &style, const float &scale=1.0)
 Adds a vector visualization specification.
 
HRESULT removeArrow (const int &arrowId)
 Removes a vector visualization specification.
 
ArrowDatagetArrow (const int &arrowId)
 Gets a vector visualization specification.
 

Static Public Member Functions

static ArrowRendererget ()
 Gets the global instance of the renderer.
 

Public Attributes

int nr_arrows
 
std::vector< ArrowData * > arrows
 

Detailed Description

Vector renderer.

Vector visualization specification can be passed dynamically. Visualization specs are not managed by the renderer. It is the responsibility of the client to manage specs appropriately.

By default, a vector is visualized with the same orientation as its underlying data, where one unit of magnitude of the vector corresponds to a visualized arrow with a length of one in the scene.

Member Function Documentation

◆ addArrow() [1/2]

int TissueForge::rendering::ArrowRenderer::addArrow ( ArrowData * arrow)

Adds a vector visualization specification.

The passed pointer is borrowed. The client is responsible for maintaining the underlying data. The returned integer can be used to reference the arrow when doing subsequent operations with the renderer (e.g., removing an arrow from the scene).

Parameters
arrowpointer to visualization specs
Returns
id of arrow according to the renderer

◆ addArrow() [2/2]

std::pair< int, ArrowData * > TissueForge::rendering::ArrowRenderer::addArrow ( const fVector3 & position,
const fVector3 & components,
const Style & style,
const float & scale = 1.0 )

Adds a vector visualization specification.

The passed pointer is borrowed. The client is responsible for maintaining the underlying data. The returned integer can be used to reference the arrow when doing subsequent operations with the renderer (e.g., removing an arrow from the scene).

Parameters
positionposition of vector
componentscomponents of vector
stylestyle of vector
scalescale of vector; defaults to 1.0
Returns
id of arrow according to the renderer and arrow

◆ addClipPlaneEquation()

const unsigned TissueForge::rendering::ArrowRenderer::addClipPlaneEquation ( const Magnum::Vector4 & pe)
overridevirtual

Adds a clip plane equation.

Parameters
peclip plane equation
Returns
const unsigned

Reimplemented from TissueForge::rendering::SubRenderer.

◆ draw()

HRESULT TissueForge::rendering::ArrowRenderer::draw ( ArcBallCamera * camera,
const iVector2 & viewportSize,
const fMatrix4 & modelViewMat )
overridevirtual

Updates visualization.

Parameters
camerascene camera
viewportSizescene viewport size
modelViewMatscene model view matrix
Returns
HRESULT

Implements TissueForge::rendering::SubRenderer.

◆ get()

static ArrowRenderer * TissueForge::rendering::ArrowRenderer::get ( )
static

Gets the global instance of the renderer.

Cannot be used until the universe renderer has been initialized.

◆ getArrow()

ArrowData * TissueForge::rendering::ArrowRenderer::getArrow ( const int & arrowId)

Gets a vector visualization specification.

Parameters
arrowIdid of arrow according to the renderer

◆ removeArrow()

HRESULT TissueForge::rendering::ArrowRenderer::removeArrow ( const int & arrowId)

Removes a vector visualization specification.

The removed pointer is only forgotten. The client is responsible for clearing the underlying data.

Parameters
arrowIdid of arrow according to the renderer

◆ removeClipPlaneEquation()

const unsigned TissueForge::rendering::ArrowRenderer::removeClipPlaneEquation ( const unsigned int & id)
overridevirtual

Removes a clip plane equation.

Parameters
idid of clip plane equation
Returns
const unsigned

Reimplemented from TissueForge::rendering::SubRenderer.

◆ setAmbientColor()

void TissueForge::rendering::ArrowRenderer::setAmbientColor ( const Magnum::Color3 & color)
overridevirtual

Sets the ambient color.

Parameters
color

Reimplemented from TissueForge::rendering::SubRenderer.

◆ setClipPlaneEquation()

void TissueForge::rendering::ArrowRenderer::setClipPlaneEquation ( unsigned id,
const Magnum::Vector4 & pe )
overridevirtual

Sets a clip plane equation.

Parameters
idid of clip plane equation
peclip plane equation

Reimplemented from TissueForge::rendering::SubRenderer.

◆ setDiffuseColor()

void TissueForge::rendering::ArrowRenderer::setDiffuseColor ( const Magnum::Color3 & color)
overridevirtual

Set the diffuse color.

Parameters
color

Reimplemented from TissueForge::rendering::SubRenderer.

◆ setLightColor()

void TissueForge::rendering::ArrowRenderer::setLightColor ( const Magnum::Color3 & color)
overridevirtual

Sets the light color.

Parameters
color

Reimplemented from TissueForge::rendering::SubRenderer.

◆ setLightDirection()

void TissueForge::rendering::ArrowRenderer::setLightDirection ( const fVector3 & lightDir)
overridevirtual

Sets the light direction.

Parameters
lightDir

Reimplemented from TissueForge::rendering::SubRenderer.

◆ setShininess()

void TissueForge::rendering::ArrowRenderer::setShininess ( float shininess)
overridevirtual

Sets the shininess.

Parameters
shininess

Reimplemented from TissueForge::rendering::SubRenderer.

◆ setSpecularColor()

void TissueForge::rendering::ArrowRenderer::setSpecularColor ( const Magnum::Color3 & color)
overridevirtual

Set the specular color.

Parameters
color

Reimplemented from TissueForge::rendering::SubRenderer.

◆ start()

HRESULT TissueForge::rendering::ArrowRenderer::start ( const std::vector< fVector4 > & clipPlanes)
overridevirtual

Starts the renderer.

Called by parent renderer once backend is initialized.

Parameters
clipPlanesclip plane specification
Returns
HRESULT

Implements TissueForge::rendering::SubRenderer.


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