cisst-saw
Loading...
Searching...
No Matches
vctPlot2DBase::Signal Class Reference

#include <vctPlot2DBase.h>

Public Member Functions

 Signal (const std::string &name, size_t numberOfPoints, size_t pointDimension=2)
 ~Signal ()
void CISST_DEPRECATED AddPoint (const vctDouble2 &point)
void AppendPoint (const vctDouble2 &point)
bool GetFreeze (void) const
void ComputeDataRangeX (double &min, double &max, bool assumesDataSorted=false) const
void ComputeDataRangeY (double &min, double &max) const
void ComputeDataRangeXY (vctDouble2 &min, vctDouble2 &max) const
void CISST_DEPRECATED SetNumberOfPoints (size_t numberOfPoints)
void CISST_DEPRECATED GetNumberOfPoints (size_t &numberOfPoints, size_t &bufferSize) const
size_t GetSize (void) const
size_t GetNumberOfPoints (void) const
void SetColor (const vctDouble3 &colorInRange0To1)
void SetSize (size_t numberOfPoints)
bool IsVisible (void) const
void SetVisible (const bool visible)
void Resize (size_t numberOfPoints, bool trimOlder=true)
vctPlot2DBase::SignalAddSignal (const std::string &name)
vctPlot2DBase::ScaleGetParent (void)
const std::string & GetName (void) const

Public Attributes

vctDouble2 GetPointAt(size_t index) CISST_THROW(std void SetPointAt(size_t index, const vctDouble2 &point) CISST_THROW(std void SetArrayAt(size_t index, const double *pointArray, size_t arraySize, size_t pointDimension=2) CISST_THROW(std bool PrependArray(const double *pointArray, size_t arraySize, size_t pointDimension=2) CISST_THROW(std bool AppendArray(const double *pointArray, size_t arraySize, size_t pointDimension=2) CISST_THROW(std void Freeze (bool freeze)

Protected Types

typedef vctFixedSizeVectorRef< double, 2, 1 > PointRef

Protected Attributes

ScaleParent
std::string Name
bool Empty
bool Visible
bool Frozen
double * Buffer
size_t PointSize
vctDynamicVector< PointRefData
size_t IndexFirst
size_t IndexLast
vctDouble3 Color
double LineWidth

Friends

class vctPlot2DBase
class vctPlot2DBase::Scale
class vctPlot2DOpenGL
class vctPlot2DVTK

Detailed Description

Storage for a given signal. Each signal stores the data to display in a vector (vctDynamicVector) of points (vctDouble2). To prevent dynamic re-allocation, this class uses a "circular buffer".

Member Typedef Documentation

◆ PointRef

typedef vctFixedSizeVectorRef<double, 2, 1> vctPlot2DBase::Signal::PointRef
protected

Vector of references to the data to add, compute min/max, ...

Constructor & Destructor Documentation

◆ Signal()

vctPlot2DBase::Signal::Signal ( const std::string & name,
size_t numberOfPoints,
size_t pointDimension = 2 )

◆ ~Signal()

vctPlot2DBase::Signal::~Signal ( )

Member Function Documentation

◆ AddPoint()

void CISST_DEPRECATED vctPlot2DBase::Signal::AddPoint ( const vctDouble2 & point)

◆ AddSignal()

vctPlot2DBase::Signal * vctPlot2DBase::Signal::AddSignal ( const std::string & name)

◆ AppendPoint()

void vctPlot2DBase::Signal::AppendPoint ( const vctDouble2 & point)

Insert point at last position and move last position forward. If the circular buffer is full, this methods overwrite the first element.

◆ ComputeDataRangeX()

void vctPlot2DBase::Signal::ComputeDataRangeX ( double & min,
double & max,
bool assumesDataSorted = false ) const

Compute min and max over all points to recenter display. If the buffer contains no point, returns 0.

◆ ComputeDataRangeXY()

void vctPlot2DBase::Signal::ComputeDataRangeXY ( vctDouble2 & min,
vctDouble2 & max ) const

◆ ComputeDataRangeY()

void vctPlot2DBase::Signal::ComputeDataRangeY ( double & min,
double & max ) const

◆ GetFreeze()

bool vctPlot2DBase::Signal::GetFreeze ( void ) const

◆ GetName()

const std::string & vctPlot2DBase::Signal::GetName ( void ) const

◆ GetNumberOfPoints() [1/2]

void CISST_DEPRECATED vctPlot2DBase::Signal::GetNumberOfPoints ( size_t & numberOfPoints,
size_t & bufferSize ) const

◆ GetNumberOfPoints() [2/2]

size_t vctPlot2DBase::Signal::GetNumberOfPoints ( void ) const

Get number of points.

◆ GetParent()

vctPlot2DBase::Scale * vctPlot2DBase::Signal::GetParent ( void )

◆ GetSize()

size_t vctPlot2DBase::Signal::GetSize ( void ) const

Get size of circular buffer.

◆ IsVisible()

bool vctPlot2DBase::Signal::IsVisible ( void ) const

◆ Resize()

void vctPlot2DBase::Signal::Resize ( size_t numberOfPoints,
bool trimOlder = true )

Non destructive resize. If the new buffer is bigger, preserves all points. If the new buffer is smaller, preserves the data at the end by default.

◆ SetColor()

void vctPlot2DBase::Signal::SetColor ( const vctDouble3 & colorInRange0To1)

◆ SetNumberOfPoints()

void CISST_DEPRECATED vctPlot2DBase::Signal::SetNumberOfPoints ( size_t numberOfPoints)

◆ SetSize()

void vctPlot2DBase::Signal::SetSize ( size_t numberOfPoints)

Destructive resize, this method resize the circular buffer and sets the first and last pointers to the buffer's beginning.

◆ SetVisible()

void vctPlot2DBase::Signal::SetVisible ( const bool visible)

◆ vctPlot2DBase

friend class vctPlot2DBase
friend

◆ vctPlot2DBase::Scale

friend class vctPlot2DBase::Scale
friend

◆ vctPlot2DOpenGL

friend class vctPlot2DOpenGL
friend

◆ vctPlot2DVTK

friend class vctPlot2DVTK
friend

Member Data Documentation

◆ Buffer

double* vctPlot2DBase::Signal::Buffer
protected

Actual buffer containing the data, contiguous for rendering

◆ Color

vctDouble3 vctPlot2DBase::Signal::Color
protected

◆ Data

vctDynamicVector<PointRef> vctPlot2DBase::Signal::Data
protected

◆ Empty

bool vctPlot2DBase::Signal::Empty
protected

◆ Freeze

vctDouble2 GetPointAt(size_t index) CISST_THROW(std void SetPointAt(size_t index, const vctDouble2 &point) CISST_THROW(std void SetArrayAt(size_t index, const double *pointArray, size_t arraySize, size_t pointDimension=2) CISST_THROW(std bool PrependArray(const double *pointArray, size_t arraySize, size_t pointDimension=2) CISST_THROW(std bool AppendArray(const double *pointArray, size_t arraySize, size_t pointDimension=2) CISST_THROW(std void vctPlot2DBase::Signal::Freeze(bool freeze)

Get point value in the buffer relative to first element. This method will throw an std::runtime_error if the index is invalid, i.e. greater than the buffer size.

Set point value at a given position, relative to first element. This method will throw an std::runtime_error if the index is invalid, i.e. greater than the buffer size.

Replaces "size" points data starting at "index". This methods assumes that the point size of the user provided buffer matches the internal buffer. If either the point size, index or size of user provided data is incorrect, an exception is thrown.

Prepend user provided data at the beginning of the circular buffer. If the buffer is full or doesn't have enough free space, data will be overwritten at the end of buffer. This method will throw an exception if either the array size or index is invalid.

Append user provided data at the end of the circular buffer. If the buffer is full or doesn't have enough free space, data will be overwritten at the beginning of buffer. This method will throw an exception if either the array size or index is invalid.

◆ Frozen

bool vctPlot2DBase::Signal::Frozen
protected

◆ IndexFirst

size_t vctPlot2DBase::Signal::IndexFirst
protected

◆ IndexLast

size_t vctPlot2DBase::Signal::IndexLast
protected

◆ LineWidth

double vctPlot2DBase::Signal::LineWidth
protected

◆ Name

std::string vctPlot2DBase::Signal::Name
protected

Signal name, used for GUI

◆ Parent

Scale* vctPlot2DBase::Signal::Parent
protected

◆ PointSize

size_t vctPlot2DBase::Signal::PointSize
protected

◆ Visible

bool vctPlot2DBase::Signal::Visible
protected

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