AGX Dynamics  2.37.2.0
agxOSG::GraphRenderer Class Reference

#include <GraphRenderer.h>

+ Inheritance diagram for agxOSG::GraphRenderer:

Classes

struct  OSGChannel
 

Public Member Functions

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

Protected Types

typedef agx::Vector< OSGChannel > Channels
 

Protected Member Functions

virtual ~GraphRenderer ()
 
void updateLineGeometry (size_t channelIndex, const agxRender::Graph::DataVector &data)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

Channels m_channels
 
agx::Vec4 m_currentColor
 
agxRender::RenderManager * m_mgr
 
osg::ref_ptr< osg::Group > m_parent
 
- Protected Attributes inherited from agxRender::Graph::GraphRenderer
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. More...
 

Detailed Description

Definition at line 36 of file GraphRenderer.h.

Member Typedef Documentation

◆ Channels

Definition at line 77 of file GraphRenderer.h.

Constructor & Destructor Documentation

◆ GraphRenderer()

agxOSG::GraphRenderer::GraphRenderer ( agxRender::RenderManager *  renderManager)

◆ ~GraphRenderer()

virtual agxOSG::GraphRenderer::~GraphRenderer ( )
protectedvirtual

Reimplemented from agxRender::Graph::GraphRenderer.

Member Function Documentation

◆ addChannel()

void agxOSG::GraphRenderer::addChannel ( )
virtual

Setup structures/data for another data channel.

Will later be indexed from the drawData method.

Implements agxRender::Graph::GraphRenderer.

◆ clear()

void agxOSG::GraphRenderer::clear ( )
virtual

Destruction of any data for this graph.

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

Implements agxRender::Graph::GraphRenderer.

◆ drawData()

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

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

Implements agxRender::Graph::GraphRenderer.

◆ drawLine()

void agxOSG::GraphRenderer::drawLine ( const agx::Vec2 &  p1,
const agx::Vec2 &  p2 
) const
virtual

Draw a line from p1 to p2.

Implements agxRender::Graph::GraphRenderer.

◆ drawText()

void agxOSG::GraphRenderer::drawText ( const agx::Vec2 &  pos,
const agx::String &  str 
)
virtual

Called when text should be drawn.

Parameters
pos- position in x,y in the range [0..1]
str- text to draw

Implements agxRender::Graph::GraphRenderer.

◆ getNode()

osg::Node* agxOSG::GraphRenderer::getNode ( )
inline

Definition at line 54 of file GraphRenderer.h.

References agxTerrain::Profiler::clear().

◆ getNumChannels()

size_t agxOSG::GraphRenderer::getNumChannels ( ) const
virtual
Returns
number of added channels

Implements agxRender::Graph::GraphRenderer.

◆ postDraw()

void agxOSG::GraphRenderer::postDraw ( )
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.

Implements agxRender::Graph::GraphRenderer.

◆ preDraw()

void agxOSG::GraphRenderer::preDraw ( )
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

Implements agxRender::Graph::GraphRenderer.

◆ removeChannel()

void agxOSG::GraphRenderer::removeChannel ( )
virtual

Tear down data for the last added channel.

Implements agxRender::Graph::GraphRenderer.

◆ setColor()

void agxOSG::GraphRenderer::setColor ( const agx::Vec4 &  color)
virtual

Set the current color for items to be drawn next.

Parameters
color- Color to draw

Implements agxRender::Graph::GraphRenderer.

◆ setEnable()

virtual void agxOSG::GraphRenderer::setEnable ( bool  flag)
virtual

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

Might involve removing stuff from your specific scenegraph or similar.

Implements agxRender::Graph::GraphRenderer.

◆ setRenderManager()

void agxOSG::GraphRenderer::setRenderManager ( agxRender::RenderManager *  mgr)
inline

Definition at line 58 of file GraphRenderer.h.

◆ updateLineGeometry()

void agxOSG::GraphRenderer::updateLineGeometry ( size_t  channelIndex,
const agxRender::Graph::DataVector &  data 
)
protected

Member Data Documentation

◆ m_channels

Channels agxOSG::GraphRenderer::m_channels
protected

Definition at line 78 of file GraphRenderer.h.

◆ m_currentColor

agx::Vec4 agxOSG::GraphRenderer::m_currentColor
protected

Definition at line 67 of file GraphRenderer.h.

◆ m_mgr

agxRender::RenderManager* agxOSG::GraphRenderer::m_mgr
protected

Definition at line 66 of file GraphRenderer.h.

◆ m_parent

osg::ref_ptr<osg::Group> agxOSG::GraphRenderer::m_parent
protected

Definition at line 65 of file GraphRenderer.h.


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