AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agxRender::Graph Class Reference

Class that implements a simple graph for plotting scalar values. More...

#include <Graph.h>

+ Inheritance diagram for agxRender::Graph:

Classes

class  Channel
 Internal class for handling data for a channel. More...
 
class  GraphRenderer
 Abstract base class that acts as an interface and can render the data from a Graph. More...
 

Public Types

typedef agx::Vector< agx::Vec2 > DataVector
 
typedef agx::observer_ptr< const GraphRenderer > GraphRendererConstObserver
 
typedef agx::ref_ptr< const GraphRenderer > GraphRendererConstRef
 
typedef agx::observer_ptr< GraphRenderer > GraphRendererObserver
 
typedef agx::ref_ptr< GraphRenderer > GraphRendererRef
 

Public Member Functions

 Graph (float width=float(0.9), float height=float(0.2), const agx::Vec2 &offset=agx::Vec2(agx::Real(0.01), agx::Real(0.01)))
 
void addChannel (Channel *channel)
 
void addPoint (const agx::Vec2 &point)
 
void addText (const agx::Vec2 &point, const agx::String &str)
 
void clearChannels ()
 
void clearPoints ()
 
void draw ()
 
Channel * getChannel (size_t idx)
 
bool getEnable () const
 
float getHeight ()
 
const agx::Vec2 & getOffset () const
 
GraphRenderer * getRenderer ()
 
const GraphRenderer * getRenderer () const
 
float getWidth ()
 
size_t numChannels () const
 
void postDraw ()
 
void preDraw ()
 
void reserve (size_t size)
 
void setEnable (bool flag)
 
void setOffset (const agx::Vec2 &offset)
 
void setRenderer (GraphRenderer *renderer)
 
void setSize (float width, float height)
 
bool validate () const
 Will check so that the number of channels for the associated GraphRenderer has equal # channels as 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 ~Graph ()
 
void drawData (size_t channelIndex) const
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

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.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Class that implements a simple graph for plotting scalar values.

Definition at line 32 of file Graph.h.

Member Typedef Documentation

◆ DataVector

Definition at line 36 of file Graph.h.

◆ GraphRendererConstObserver

◆ GraphRendererConstRef

Definition at line 38 of file Graph.h.

◆ GraphRendererObserver

◆ GraphRendererRef

Constructor & Destructor Documentation

◆ Graph()

agxRender::Graph::Graph ( float  width = float(0.9),
float  height = float(0.2),
const agx::Vec2 &  offset = agx::Vec2(agx::Real(0.01), agx::Real(0.01)) 
)

◆ ~Graph()

virtual agxRender::Graph::~Graph ( )
protectedvirtual

Member Function Documentation

◆ addChannel()

void agxRender::Graph::addChannel ( Channel *  channel)

◆ addPoint()

void agxRender::Graph::addPoint ( const agx::Vec2 &  point)

◆ addText()

void agxRender::Graph::addText ( const agx::Vec2 &  point,
const agx::String &  str 
)

◆ clearChannels()

void agxRender::Graph::clearChannels ( )

◆ clearPoints()

void agxRender::Graph::clearPoints ( )
inline

Definition at line 227 of file Graph.h.

◆ draw()

void agxRender::Graph::draw ( )

◆ drawData()

void agxRender::Graph::drawData ( size_t  channelIndex) const
protected

◆ getChannel()

Channel * agxRender::Graph::getChannel ( size_t  idx)
inline

Definition at line 198 of file Graph.h.

◆ getEnable()

bool agxRender::Graph::getEnable ( ) const
inline

Definition at line 194 of file Graph.h.

◆ getHeight()

float agxRender::Graph::getHeight ( )
inline

Definition at line 222 of file Graph.h.

◆ getOffset()

const agx::Vec2 & agxRender::Graph::getOffset ( ) const
inline

Definition at line 215 of file Graph.h.

◆ getRenderer() [1/2]

GraphRenderer * agxRender::Graph::getRenderer ( )
inline

Definition at line 208 of file Graph.h.

◆ getRenderer() [2/2]

const GraphRenderer * agxRender::Graph::getRenderer ( ) const
inline

Definition at line 211 of file Graph.h.

◆ getWidth()

float agxRender::Graph::getWidth ( )
inline

Definition at line 219 of file Graph.h.

◆ numChannels()

size_t agxRender::Graph::numChannels ( ) const
inline

Definition at line 188 of file Graph.h.

◆ postDraw()

void agxRender::Graph::postDraw ( )

◆ preDraw()

void agxRender::Graph::preDraw ( )

◆ reserve()

void agxRender::Graph::reserve ( size_t  size)
inline

Definition at line 230 of file Graph.h.

◆ setEnable()

void agxRender::Graph::setEnable ( bool  flag)

◆ setOffset()

void agxRender::Graph::setOffset ( const agx::Vec2 &  offset)
inline

Definition at line 178 of file Graph.h.

◆ setRenderer()

void agxRender::Graph::setRenderer ( GraphRenderer *  renderer)
inline

Definition at line 203 of file Graph.h.

References agxRender::Graph::GraphRenderer::m_graph.

◆ setSize()

void agxRender::Graph::setSize ( float  width,
float  height 
)
inline

Definition at line 174 of file Graph.h.

◆ validate()

bool agxRender::Graph::validate ( ) const

Will check so that the number of channels for the associated GraphRenderer has equal # channels as this graph.


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