AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxRender::Graph::GraphRenderer Class Referenceabstract

Abstract base class that acts as an interface and can render the data from a Graph. More...

#include <Graph.h>

+ Inheritance diagram for agxRender::Graph::GraphRenderer:

Public Member Functions

 GraphRenderer ()
 
virtual void addChannel ()=0
 Setup structures/data for another data channel.
 
virtual void clear ()=0
 Destruction of any data for this graph.
 
virtual void drawData (size_t channelIndex, const Graph::DataVector &data)=0
 Update the line geometry for a specified channel given the data (points)
 
virtual void drawLine (const agx::Vec2 &p1, const agx::Vec2 &p2) const =0
 Draw a line from p1 to p2.
 
virtual void drawText (const agx::Vec2 &pos, const agx::String &str)=0
 
virtual size_t getNumChannels () const =0
 
virtual void postDraw ()=0
 If the rendering of this graph requires some cleanup to be done it can be done in this method.
 
virtual void preDraw ()=0
 If the rendering of this graph requires some pre-state to be set (orthographic projection etc) this can be done in this method.
 
virtual void removeChannel ()=0
 Tear down data for the last added channel.
 
virtual void setColor (const agx::Vec4 &color)=0
 
virtual void setEnable (bool flag)=0
 Implement functionality for enabling/disabling the rendering of this graph.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Protected Member Functions

virtual ~GraphRenderer ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

agx::observer_ptr< Graph > m_graph
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Abstract base class that acts as an interface and can render the data from a Graph.

This class has to be implemented for each rendering engine.

Definition at line 44 of file Graph.h.

Constructor & Destructor Documentation

◆ GraphRenderer()

agxRender::Graph::GraphRenderer::GraphRenderer ( )
inline

Definition at line 47 of file Graph.h.

◆ ~GraphRenderer()

virtual agxRender::Graph::GraphRenderer::~GraphRenderer ( )
inlineprotectedvirtual

Reimplemented in agxOSG::GraphRenderer.

Definition at line 113 of file Graph.h.

Member Function Documentation

◆ addChannel()

virtual void agxRender::Graph::GraphRenderer::addChannel ( )
pure virtual

Setup structures/data for another data channel.

Will later be indexed from the drawData method.

Implemented in agxOSG::GraphRenderer.

◆ clear()

virtual void agxRender::Graph::GraphRenderer::clear ( )
pure virtual

Destruction of any data for this graph.

After this, no more calls to draw will be done.

Implemented in agxOSG::GraphRenderer.

◆ drawData()

virtual void agxRender::Graph::GraphRenderer::drawData ( size_t  channelIndex,
const Graph::DataVector &  data 
)
pure virtual

Update the line geometry for a specified channel given the data (points)

Implemented in agxOSG::GraphRenderer.

◆ drawLine()

virtual void agxRender::Graph::GraphRenderer::drawLine ( const agx::Vec2 &  p1,
const agx::Vec2 &  p2 
) const
pure virtual

Draw a line from p1 to p2.

Implemented in agxOSG::GraphRenderer.

◆ drawText()

virtual void agxRender::Graph::GraphRenderer::drawText ( const agx::Vec2 &  pos,
const agx::String &  str 
)
pure virtual
Called when text should be drawn.
\param pos - position in x,y in the range [0..1]
Parameters
str- text to draw

Implemented in agxOSG::GraphRenderer.

◆ getNumChannels()

virtual size_t agxRender::Graph::GraphRenderer::getNumChannels ( ) const
pure virtual
Returns
number of added channels

Implemented in agxOSG::GraphRenderer.

◆ postDraw()

virtual void agxRender::Graph::GraphRenderer::postDraw ( )
pure virtual

If the rendering of this graph requires some cleanup to be done it can be done in this method.

It will be called AFTER any draw* calls.

Implemented in agxOSG::GraphRenderer.

◆ preDraw()

virtual void agxRender::Graph::GraphRenderer::preDraw ( )
pure virtual

If the rendering of this graph requires some pre-state to be set (orthographic projection etc) this can be done in this method.

It will be called before any draw* methods

Implemented in agxOSG::GraphRenderer.

◆ removeChannel()

virtual void agxRender::Graph::GraphRenderer::removeChannel ( )
pure virtual

Tear down data for the last added channel.

Implemented in agxOSG::GraphRenderer.

◆ setColor()

virtual void agxRender::Graph::GraphRenderer::setColor ( const agx::Vec4 &  color)
pure virtual
Set the current color for items to be drawn next.
Parameters
color- Color to draw

Implemented in agxOSG::GraphRenderer.

◆ setEnable()

virtual void agxRender::Graph::GraphRenderer::setEnable ( bool  flag)
pure virtual

Implement functionality for enabling/disabling the rendering of this graph.

Might involve removing stuff from your specific scenegraph or similar.

Implemented in agxOSG::GraphRenderer.

Member Data Documentation

◆ m_graph

agx::observer_ptr<Graph> agxRender::Graph::GraphRenderer::m_graph
protected

Definition at line 112 of file Graph.h.

Referenced by agxRender::Graph::setRenderer().


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