3Depict
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
PlotBase Class Referenceabstract

Base class for data plotting. More...

#include <plot.h>

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

Public Member Functions

 PlotBase ()
 
virtual ~PlotBase ()
 
virtual PlotBaseclone () const =0
 
unsigned int getType () const
 
unsigned int getMode () const
 
virtual bool isEmpty () const =0
 
virtual void drawPlot (mglGraph *graph) const =0
 
virtual void getBounds (float &xMin, float &xMax, float &yMin, float &yMax) const
 Return the true data bounds for this plot. More...
 
virtual void getRawData (std::vector< std::vector< float > > &f, std::vector< std::string > &labels) const =0
 
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
 

Public Attributes

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

void copyBase (PlotBase *target) const
 

Static Protected Member Functions

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

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

Base class for data plotting.

Constructor & Destructor Documentation

◆ PlotBase()

PlotBase::PlotBase ( )

◆ ~PlotBase()

virtual PlotBase::~PlotBase ( )
inlinevirtual

Member Function Documentation

◆ clone()

virtual PlotBase* PlotBase::clone ( ) const
pure virtual

Implemented in Plot2DScatter, Plot2DFunc, and Plot1D.

◆ computeDataBounds() [1/3]

void PlotBase::computeDataBounds ( const std::vector< float > &  d,
float &  minV,
float &  maxV 
)
staticprotected

◆ computeDataBounds() [2/3]

void PlotBase::computeDataBounds ( const std::vector< float > &  d,
const std::vector< float > &  errorBar,
float &  minV,
float &  maxV 
)
staticprotected

◆ computeDataBounds() [3/3]

static void PlotBase::computeDataBounds ( const std::vector< std::pair< float, float > > &  d,
float &  minVx,
float &  maxVx,
float &  minVy,
float &  maxVy 
)
staticprotected

◆ copyBase()

void PlotBase::copyBase ( PlotBase target) const
protected

◆ drawPlot()

virtual void PlotBase::drawPlot ( mglGraph *  graph) const
pure virtual

Implemented in Plot2DScatter, Plot2DFunc, and Plot1D.

◆ getBounds()

void PlotBase::getBounds ( float &  xMin,
float &  xMax,
float &  yMin,
float &  yMax 
) const
virtual

Return the true data bounds for this plot.

References ASSERT.

◆ getColour()

void PlotBase::getColour ( float &  r,
float &  g,
float &  b 
) const

Referenced by PlotWrapper::drawPlot().

Here is the caller graph for this function:

◆ getMode()

unsigned int PlotBase::getMode ( ) const

References ASSERT, and PLOT_MODE_ENUM_END.

Referenced by PlotWrapper::drawPlot().

Here is the caller graph for this function:

◆ getPlotMode()

unsigned int PlotBase::getPlotMode ( ) const
inline

◆ getRawData()

virtual void PlotBase::getRawData ( std::vector< std::vector< float > > &  f,
std::vector< std::string > &  labels 
) const
pure virtual

Implemented in Plot2DScatter, Plot2DFunc, and Plot1D.

◆ getTitle()

std::string PlotBase::getTitle ( ) const
inline

Referenced by PlotWrapper::drawPlot().

Here is the caller graph for this function:

◆ getType()

unsigned int PlotBase::getType ( ) const

References ASSERT, and PLOT_TYPE_ENUM_END.

◆ getXLabel()

std::string PlotBase::getXLabel ( ) const
inline

◆ getYLabel()

std::string PlotBase::getYLabel ( ) const
inline

◆ isEmpty()

virtual bool PlotBase::isEmpty ( ) const
pure virtual

Implemented in Plot2DScatter, Plot2DFunc, and Plot1D.

◆ setColour()

void PlotBase::setColour ( float  rNew,
float  gNew,
float  bNew 
)

References ASSERT.

Referenced by VisController::updateScene().

Here is the caller graph for this function:

◆ setPlotMode()

void PlotBase::setPlotMode ( unsigned int  newMode)
inline

◆ setStrings()

void PlotBase::setStrings ( const std::string &  x,
const std::string &  y,
const std::string &  t 
)

Referenced by VisController::updateScene().

Here is the caller graph for this function:

◆ setTraceStyle()

void PlotBase::setTraceStyle ( unsigned int  newStyle)
inline

Referenced by VisController::updateScene().

Here is the caller graph for this function:

Member Data Documentation

◆ b

float PlotBase::b
protected

Referenced by copyBase().

◆ g

float PlotBase::g
protected

Referenced by copyBase().

◆ maxX

float PlotBase::maxX

Referenced by copyBase().

◆ maxY

float PlotBase::maxY

Referenced by copyBase().

◆ minX

float PlotBase::minX

Bounding box for plot.

Referenced by copyBase().

◆ minY

float PlotBase::minY

Referenced by copyBase().

◆ parentObject

const void* PlotBase::parentObject

Pointer to some constant object that generated this plot.

Referenced by copyBase(), and VisController::updateScene().

◆ parentPlotIndex

unsigned int PlotBase::parentPlotIndex

integer to show which of the n plots that the parent generated

Referenced by copyBase(), and VisController::updateScene().

◆ plotMode

unsigned int PlotBase::plotMode
protected

Type of plot.

Referenced by copyBase().

◆ r

float PlotBase::r
protected

Referenced by copyBase().

◆ regionGroup

RegionGroup PlotBase::regionGroup

◆ title

std::string PlotBase::title
protected

Plot title.

Referenced by copyBase().

◆ titleAsRawDataLabel

bool PlotBase::titleAsRawDataLabel

Use the plot title for Y data label when exporting raw data.

Referenced by copyBase(), and VisController::updateScene().

◆ traceStyle

unsigned int PlotBase::traceStyle
protected

Referenced by copyBase().

◆ visible

bool PlotBase::visible

Is trace visible?

Referenced by copyBase(), PlotWrapper::drawPlot(), and PlotWrapper::getRegions().

◆ xLabel

std::string PlotBase::xLabel
protected

xaxis label

Referenced by copyBase().

◆ yLabel

std::string PlotBase::yLabel
protected

y axis label

Referenced by copyBase().


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