AGXDynamics  2.31.1.0
agxPlot::Curve Class Reference

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

Static Public Member Functions

template<typename T >
static bool ValidateCast (const Referenced *object)
 

Public Attributes

agx::Event representationChanged
 

Protected Member Functions

void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Static Protected Member Functions

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...
 

Protected Attributes

Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Definition at line 34 of file Curve.h.

Member Enumeration Documentation

◆ Line

Enumerator
LINE_SOLID 
LINE_DASHED 
LINE_NONE 

Definition at line 37 of file Curve.h.

◆ Symbol

Enumerator
SYMBOL_CROSS 
SYMBOL_CIRCLE 
SYMBOl_DOT 
SYMBOl_NONE 

Definition at line 43 of file Curve.h.

Constructor & Destructor Documentation

◆ Curve()

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

Member Function Documentation

◆ allocateObserverVector()

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited

◆ as() [1/2]

template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().

◆ as() [2/2]

template<typename T >
const T* agx::Referenced::as ( ) const
inherited

◆ asSafe() [1/2]

template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

◆ asSafe() [2/2]

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited

◆ deleteUsingDeleteHandler()

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited

◆ 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::Vec4& 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

◆ getDeleteHandler()

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.

◆ 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

◆ getReferenceCount()

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.

◆ getSymbol()

Symbol agxPlot::Curve::getSymbol ( ) const

◆ is()

template<typename T >
bool agx::Referenced::is ( ) const
inherited

◆ reference()

void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

◆ setColor()

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

The color of the curve.

◆ setDeleteHandler()

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

◆ 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.

◆ 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.

◆ unreference()

void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().

◆ unreference_nodelete()

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

◆ ValidateCast()

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

◆ m_mutex

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

◆ m_observers

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

◆ m_refCount

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

◆ representationChanged

agx::Event agxPlot::Curve::representationChanged

Definition at line 134 of file Curve.h.


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