123 float minVal,
float maxVal,
124 float scaleX = 1.0f,
float scaleY = 1.0f );
189 return m_channels.size();
199 if ( idx >= m_channels.size() )
return nullptr;
200 return m_channels[idx];
204 m_renderer = renderer;
227 m_dataVector.clear();
230 m_dataVector.reserve( size );
252 float m_width, m_height;
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXPHYSICS_EXPORT
Internal class for handling data for a channel.
float mapToLimits(float val) const
const agx::Vec4 & getColor() const
void setResolution(size_t r)
Channel(const agx::String &title, const agx::Vec4 &color, float minVal, float maxVal, float scaleX=1.0f, float scaleY=1.0f)
void setEnableMA(bool flag)
void drawTitle(const agx::Vec2 &pos)
Abstract base class that acts as an interface and can render the data from a Graph.
virtual void setColor(const agx::Vec4 &color)=0
virtual void clear()=0
Destruction of any data for this graph.
virtual void addChannel()=0
Setup structures/data for another data channel.
virtual void drawLine(const agx::Vec2 &p1, const agx::Vec2 &p2) const =0
Draw a line from p1 to p2.
virtual void removeChannel()=0
Tear down data for the last added channel.
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 drawText(const agx::Vec2 &pos, const agx::String &str)=0
virtual void preDraw()=0
If the rendering of this graph requires some pre-state to be set (orthographic projection etc) this c...
agx::observer_ptr< Graph > m_graph
virtual void setEnable(bool flag)=0
Implement functionality for enabling/disabling the rendering of this graph.
virtual size_t getNumChannels() const =0
virtual void drawData(size_t channelIndex, const Graph::DataVector &data)=0
Update the line geometry for a specified channel given the data (points)
Class that implements a simple graph for plotting scalar values.
void addPoint(const agx::Vec2 &point)
void setEnable(bool flag)
void addText(const agx::Vec2 &point, const agx::String &str)
Channel * getChannel(size_t idx)
const agx::Vec2 & getOffset() const
void setSize(float width, float height)
GraphRenderer * getRenderer()
void setOffset(const agx::Vec2 &offset)
void addChannel(Channel *channel)
agx::Vector< agx::Vec2 > DataVector
void setRenderer(GraphRenderer *renderer)
bool validate() const
Will check so that the number of channels for the associated GraphRenderer has equal # channels as th...
size_t numChannels() const
const GraphRenderer * getRenderer() const
void drawData(size_t channelIndex) const
void reserve(size_t size)
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)))
Base class providing referencing counted objects.
A class holding 4 dimensional vectors and providing basic arithmetic.
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Smart pointer for handling referenced counted objects.
Namespace containing classes for handling debug rendering of collision geometries,...