3Depict
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
Plot1D Class Reference

1D Function f(x) More...

#include <plot.h>

Inheritance diagram for Plot1D:
Inheritance graph
[legend]
Collaboration diagram for Plot1D:
Collaboration graph
[legend]

Public Member Functions

 Plot1D ()
 
virtual bool isEmpty () const
 
virtual PlotBaseclone () const
 
void setData (const std::vector< std::pair< float, float > > &v)
 Set the plot data from a pair and symmetric Y error. More...
 
void setData (const std::vector< std::pair< float, float > > &v, const std::vector< float > &symYErr)
 
void setData (const std::vector< float > &vX, const std::vector< float > &vY)
 Set the plot data from two vectors and symmetric Y error. More...
 
void setData (const std::vector< float > &vX, const std::vector< float > &vY, const std::vector< float > &symYErr)
 
void moveRegion (unsigned int region, unsigned int method, float newPos)
 Move a region to a new location. More...
 
virtual void drawPlot (mglGraph *graph) const
 
void drawRegions (mglGraph *graph, const mglPoint &min, const mglPoint &max) const
 
void getRawData (std::vector< std::vector< float > > &rawData, std::vector< std::string > &labels) const
 Retrieve the raw data associated with the currently visible plots. More...
 
bool getRegionIdAtPosition (float x, float y, unsigned int &id) const
 Retrieve the ID of the non-overlapping region in X-Y space. More...
 
void getRegion (unsigned int id, PlotRegion &r) const
 Retrieve a region using its ID. More...
 
void moveRegion (unsigned int regionId, unsigned int method, float newX, float newY) const
 Pass the region movement information to the parent filter object. More...
 
void findRegionLimit (unsigned int regionId, unsigned int movementType, float &limitX, float &limitY) const
 
bool wantLogPlot () const
 
void setLogarithmic (bool p)
 
float getSmallestNonzero () const
 
void setErrMode (PLOT_ERROR newErrMode)
 
- Public Member Functions inherited from PlotBase
 PlotBase ()
 
virtual ~PlotBase ()
 
unsigned int getType () const
 
unsigned int getMode () const
 
virtual void getBounds (float &xMin, float &xMax, float &yMin, float &yMax) const
 Return the true data bounds for this plot. More...
 
void setStrings (const std::string &x, const std::string &y, const std::string &t)
 
void setColour (float rNew, float gNew, float bNew)
 
void setTraceStyle (unsigned int newStyle)
 
std::string getXLabel () const
 
std::string getTitle () const
 
std::string getYLabel () const
 
unsigned int getPlotMode () const
 
void setPlotMode (unsigned int newMode)
 
void getColour (float &r, float &g, float &b) const
 

Additional Inherited Members

- Public Attributes inherited from PlotBase
float minX
 Bounding box for plot. More...
 
float maxX
 
float minY
 
float maxY
 
bool visible
 Is trace visible? More...
 
bool titleAsRawDataLabel
 Use the plot title for Y data label when exporting raw data. More...
 
const void * parentObject
 Pointer to some constant object that generated this plot. More...
 
unsigned int parentPlotIndex
 integer to show which of the n plots that the parent generated More...
 
RegionGroup regionGroup
 
- Protected Member Functions inherited from PlotBase
void copyBase (PlotBase *target) const
 
- Static Protected Member Functions inherited from PlotBase
static void computeDataBounds (const std::vector< float > &d, float &minV, float &maxV)
 
static void computeDataBounds (const std::vector< float > &d, const std::vector< float > &errorBar, float &minV, float &maxV)
 
static void computeDataBounds (const std::vector< std::pair< float, float > > &d, float &minVx, float &maxVx, float &minVy, float &maxVy)
 
- Protected Attributes inherited from PlotBase
unsigned int plotMode
 Type of plot. More...
 
std::string xLabel
 xaxis label More...
 
std::string yLabel
 y axis label More...
 
std::string title
 Plot title. More...
 
float r
 
float g
 
float b
 
unsigned int traceStyle
 

Detailed Description

1D Function f(x)

Constructor & Destructor Documentation

◆ Plot1D()

Plot1D::Plot1D ( )

References PLOT_LINE_LINES, and PLOT_MODE_1D.

Member Function Documentation

◆ clone()

PlotBase * Plot1D::clone ( ) const
virtual

Implements PlotBase.

◆ drawPlot()

void Plot1D::drawPlot ( mglGraph *  graph) const
virtual

Implements PlotBase.

References ASSERT, mglColourCode(), PLOT_LINE_BARS, PLOT_LINE_LINES, PLOT_LINE_POINTS, PLOT_LINE_STEM, and PLOT_LINE_STEPS.

Referenced by PlotWrapper::drawPlot().

Here is the caller graph for this function:

◆ drawRegions()

void Plot1D::drawRegions ( mglGraph *  graph,
const mglPoint &  min,
const mglPoint &  max 
) const

References mglColourCode().

Referenced by PlotWrapper::drawPlot().

Here is the caller graph for this function:

◆ findRegionLimit()

void Plot1D::findRegionLimit ( unsigned int  regionId,
unsigned int  movementType,
float &  limitX,
float &  limitY 
) const

◆ getRawData()

void Plot1D::getRawData ( std::vector< std::vector< float > > &  rawData,
std::vector< std::string > &  labels 
) const
virtual

Retrieve the raw data associated with the currently visible plots.

Implements PlotBase.

References TRANS.

◆ getRegion()

void Plot1D::getRegion ( unsigned int  id,
PlotRegion r 
) const

Retrieve a region using its ID.

◆ getRegionIdAtPosition()

bool Plot1D::getRegionIdAtPosition ( float  x,
float  y,
unsigned int &  id 
) const

Retrieve the ID of the non-overlapping region in X-Y space.

◆ getSmallestNonzero()

float Plot1D::getSmallestNonzero ( ) const

◆ isEmpty()

bool Plot1D::isEmpty ( ) const
virtual

Implements PlotBase.

References ASSERT.

◆ moveRegion() [1/2]

void Plot1D::moveRegion ( unsigned int  region,
unsigned int  method,
float  newPos 
)

Move a region to a new location.

◆ moveRegion() [2/2]

void Plot1D::moveRegion ( unsigned int  regionId,
unsigned int  method,
float  newX,
float  newY 
) const

Pass the region movement information to the parent filter object.

◆ setData() [1/4]

void Plot1D::setData ( const std::vector< std::pair< float, float > > &  v)

Set the plot data from a pair and symmetric Y error.

Referenced by VisController::updateScene().

Here is the caller graph for this function:

◆ setData() [2/4]

void Plot1D::setData ( const std::vector< std::pair< float, float > > &  v,
const std::vector< float > &  symYErr 
)

◆ setData() [3/4]

void Plot1D::setData ( const std::vector< float > &  vX,
const std::vector< float > &  vY 
)

Set the plot data from two vectors and symmetric Y error.

◆ setData() [4/4]

void Plot1D::setData ( const std::vector< float > &  vX,
const std::vector< float > &  vY,
const std::vector< float > &  symYErr 
)

References ASSERT, and AXIS_MIN_TOLERANCE.

◆ setErrMode()

void Plot1D::setErrMode ( PLOT_ERROR  newErrMode)

References ASSERT, PLOT_ERROR_MOVING_AVERAGE, and PLOT_ERROR_NONE.

Referenced by VisController::updateScene().

Here is the caller graph for this function:

◆ setLogarithmic()

void Plot1D::setLogarithmic ( bool  p)
inline

Referenced by VisController::updateScene().

Here is the caller graph for this function:

◆ wantLogPlot()

bool Plot1D::wantLogPlot ( ) const
inline

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