AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxPlot::Curve Class Reference

Definition of a plot curve. More...

#include <Curve.h>

+ Inheritance diagram for agxPlot::Curve:

Public Types

enum  Line { LINE_SOLID = 0 , LINE_DASHED = 1 , LINE_NONE = 2 }
 
enum  Symbol { SYMBOL_CROSS = 0 , SYMBOL_CIRCLE = 1 , SYMBOl_DOT = 2 , SYMBOl_NONE = 3 }
 

Public Member Functions

 Curve (agxPlot::DataSeries *xValues, agxPlot::DataSeries *yValues, const agx::String &name="")
 
CurvePointVector getAllValues () const
 Get all currently generated values from the two DataSeries.
 
const agx::Vec4f & getColor () const
 
CurveID getCurveID () const
 A generated ID for the curve.
 
agxPlot::DataSeries * getDataSeriesX () const
 
agxPlot::DataSeries * getDataSeriesY () const
 
void getDescription (agxJson::Value &root) const
 Retrieves the description of the curve.
 
Line getLineType () const
 
agx::Real getLineWidth () const
 
const agx::String & getName () const
 
CurvePointVector getNewValues () const
 Get all values from the DataSeries that have been generated since the last update call.
 
CurvePointVector getOldValues () const
 Get all values from the DataSeries that have been generated before the last update call.
 
Symbol getSymbol () const
 
void setColor (const agx::Vec4f &color)
 The color of the curve.
 
void setFromDescription (const agxJson::Value &root, System *system)
 Sets the curve to match that of a description of the format from getDescription.
 
void setLineType (Line line)
 The type of line used.
 
void setLineWidth (agx::Real lineWidth)
 The width of the line in pixels.
 
void setName (const agx::String &name)
 The name/legend of the curve.
 
void setSymbol (Symbol symbol)
 The type of symbol used.
 
- 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.
 

Public Attributes

agx::Event representationChanged
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- 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

Definition of a plot curve.

Definition at line 36 of file Curve.h.

Member Enumeration Documentation

◆ Line

Enumerator
LINE_SOLID 
LINE_DASHED 
LINE_NONE 

Definition at line 39 of file Curve.h.

◆ Symbol

Enumerator
SYMBOL_CROSS 
SYMBOL_CIRCLE 
SYMBOl_DOT 
SYMBOl_NONE 

Definition at line 45 of file Curve.h.

Constructor & Destructor Documentation

◆ Curve()

agxPlot::Curve::Curve ( agxPlot::DataSeries *  xValues,
agxPlot::DataSeries *  yValues,
const agx::String &  name = "" 
)

Member Function Documentation

◆ getAllValues()

CurvePointVector agxPlot::Curve::getAllValues ( ) const

Get all currently generated values from the two DataSeries.

Returns
a list of all plot points in the curve

◆ getColor()

const agx::Vec4f & agxPlot::Curve::getColor ( ) const

◆ getCurveID()

CurveID agxPlot::Curve::getCurveID ( ) const

A generated ID for the curve.

No two curves should have the same ID.

◆ getDataSeriesX()

agxPlot::DataSeries * agxPlot::Curve::getDataSeriesX ( ) const

◆ getDataSeriesY()

agxPlot::DataSeries * agxPlot::Curve::getDataSeriesY ( ) const

◆ getDescription()

void agxPlot::Curve::getDescription ( agxJson::Value &  root) const

Retrieves the description of the curve.

["name"] = the name of the curve ["id"] = the unique id of the curve ["color_r"] = the red value of the line color ["color_g"] = the green value of the line color ["color_b"] = the blue value of the line color ["color_a"] = the alpha value of the line color ["lineType"] = an int describing the type of line ["lineWidth"] = the width of the line in pixels ["symbol"] = an int describing the type of symbol ["xAxis"] = the description of the X axis ["yAxis"] = the description of the Y axis

◆ getLineType()

Line agxPlot::Curve::getLineType ( ) const

◆ getLineWidth()

agx::Real agxPlot::Curve::getLineWidth ( ) const

◆ getName()

const agx::String & agxPlot::Curve::getName ( ) const

◆ getNewValues()

CurvePointVector agxPlot::Curve::getNewValues ( ) const

Get all values from the DataSeries that have been generated since the last update call.

Returns
a list of all new plot points in the curve

◆ getOldValues()

CurvePointVector agxPlot::Curve::getOldValues ( ) const

Get all values from the DataSeries that have been generated before the last update call.

Returns
a list of all old plot points in the curve

◆ getSymbol()

Symbol agxPlot::Curve::getSymbol ( ) const

◆ setColor()

void agxPlot::Curve::setColor ( const agx::Vec4f &  color)

The color of the curve.

◆ setFromDescription()

void agxPlot::Curve::setFromDescription ( const agxJson::Value &  root,
System *  system 
)

Sets the curve to match that of a description of the format from getDescription.

Send system to be able to fetch DataSeries by ID

◆ setLineType()

void agxPlot::Curve::setLineType ( Line  line)

The type of line used.

◆ setLineWidth()

void agxPlot::Curve::setLineWidth ( agx::Real  lineWidth)

The width of the line in pixels.

◆ setName()

void agxPlot::Curve::setName ( const agx::String &  name)

The name/legend of the curve.

◆ setSymbol()

void agxPlot::Curve::setSymbol ( Symbol  symbol)

The type of symbol used.

Member Data Documentation

◆ representationChanged

agx::Event agxPlot::Curve::representationChanged

Definition at line 140 of file Curve.h.


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