17 #ifndef AGXRENDER_GRAPH_H 18 #define AGXRENDER_GRAPH_H 61 virtual void setColor(
const agx::Vec4& color ) = 0;
72 virtual void preDraw() = 0;
78 virtual void postDraw() = 0;
83 virtual void clear() = 0;
89 virtual void setEnable(
bool flag ) = 0;
94 virtual void addChannel() = 0;
97 virtual size_t getNumChannels()
const = 0;
102 virtual void removeChannel() = 0;
124 float minVal,
float maxVal,
125 float scaleX = 1.0f,
float scaleY = 1.0f );
130 void update(
float data );
144 float mapToLimits(
float val )
const;
150 void drawMovingAverage() ;
186 bool validate()
const;
188 void addChannel(
Channel *channel );
190 return m_channels.size();
192 void clearChannels();
194 void setEnable(
bool flag );
200 if ( idx >= m_channels.size() )
return nullptr;
201 return m_channels[idx];
205 m_renderer = renderer;
228 m_dataVector.clear();
231 m_dataVector.reserve( size );
241 void drawData(
size_t channelIndex )
const;
248 ChannelVector m_channels;
253 float m_width, m_height;
255 DataVector m_dataVector;
GraphRenderer * getRenderer()
AGXTERRAIN_EXPORT void clear()
Class that implements a simple graph for plotting scalar values.
agx::observer_ptr< Graph > m_graph
Internal class for handling data for a channel.
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
A class holding 4 dimensional vectors and providing basic arithmetic.
void setResolution(size_t r)
const GraphRenderer * getRenderer() const
void setEnableMA(bool flag)
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Namespace containing classes for handling debug rendering of collision geometries, constraints, contacts and rigid bodies.
Base class providing referencing counted objects.
const agx::Vec2 & getOffset() const
void setRenderer(GraphRenderer *renderer)
Smart pointer for handling referenced counted objects.
const agx::Vec4 & getColor() const
Channel * getChannel(size_t idx)
void setSize(float width, float height)
void setOffset(const agx::Vec2 &offset)
agx::Vector< agx::Vec2 > DataVector
Abstract base class that acts as an interface and can render the data from a Graph.
void reserve(size_t size)
size_t numChannels() const
AGXOSG_EXPORT bool addText(const agxCollide::Geometry *geometry, osg::Group *root, const std::string &text, const agx::Vec3 &relPosition=agx::Vec3(0, 0, 0), const agx::Vec4f &color=agxRender::Color::Yellow(), agx::Real size=0.2)
Add text relative to an geometry.