TBTK
TBTK::Canvas2D Class Reference
Inheritance diagram for TBTK::Canvas2D:
TBTK::Canvas< CoordinateType > TBTK::PNGCanvas2D

Public Member Functions

 Canvas2D ()
 
virtual ~Canvas2D ()
 
void setBoundsX (double minX, double maxX)
 
void setBoundsY (double minY, double maxY)
 
void setBounds (double minX, double maxX, double minY, double maxY)
 
double getMinX () const
 
double getMaxX () const
 
double getMinY () const
 
double getMaxY () const
 
void setLabelX (const std::string &labelX)
 
void setLabelY (const std::string &labelY)
 
const std::string & getLabelX () const
 
const std::string & getLabelY () const
 
void setHold (bool hold)
 
void plot (const std::vector< double > &y, const std::string &title="", const std::vector< unsigned char > &color={0, 0, 0}, unsigned int size=1)
 
void plot (const std::vector< double > &x, const std::vector< double > &y, const std::string &title="", const std::vector< unsigned char > &color={0, 0, 0}, unsigned int size=1)
 
virtual void clear ()
 
- Public Member Functions inherited from TBTK::Canvas< CoordinateType >
 Canvas ()
 
virtual ~Canvas ()
 
void setWidth (unsigned int width)
 
double getWidth () const
 
void setHeight (unsigned int height)
 
double getHeight () const
 
void setTitle (const std::string &title)
 
const std::string & getTitle () const
 
 Canvas (unsigned int width, unsigned int height)
 
 ~Canvas ()
 
void setOrigin (CoordinateType x, CoordinateType y)
 
void setBasisVectors (std::initializer_list< std::initializer_list< CoordinateType >> basisVectors)
 
void drawPixel (const RGBA &rgba, CoordinateType x, CoordinateType y)
 
void drawCircle (const RGBA &rgba, CoordinateType x, CoordinateType y, CoordinateType radius)
 
void save (std::string filename) const
 
template<>
void drawPixel (const RGBA &rgba, unsigned int x, unsigned int y)
 
template<>
void drawPixel (const RGBA &rgba, double x, double y)
 
template<>
void drawCircle (const RGBA &rgba, unsigned int x, unsigned int y, unsigned int radius)
 
template<>
void drawCircle (const RGBA &rgba, double x, double y, double radius)
 

Protected Member Functions

unsigned int getNumDataSets () const
 
const std::vector< double > & getX (unsigned int dataSet) const
 
const std::vector< double > & getY (unsigned int dataSet) const
 
const std::string & getTitle (unsigned int dataSet) const
 
const std::vector< unsigned char > & getColor (unsigned int dataSet) const
 
unsigned int getSize (unsigned int dataSet) const
 

Constructor & Destructor Documentation

◆ Canvas2D()

TBTK::Canvas2D::Canvas2D ( )

Constructor.

◆ ~Canvas2D()

virtual TBTK::Canvas2D::~Canvas2D ( )
virtual

Destructor.

Member Function Documentation

◆ clear()

void TBTK::Canvas2D::clear ( )
inlinevirtual

Clear plot.

Reimplemented from TBTK::Canvas< CoordinateType >.

◆ getColor()

const std::vector< unsigned char > & TBTK::Canvas2D::getColor ( unsigned int  dataSet) const
inlineprotected

Get the color for the given data set.

Parameters
dataSetThe data set to get the color for.
Returns
The color for the given data set.

◆ getLabelX()

const std::string & TBTK::Canvas2D::getLabelX ( ) const
inline

Get x-label.

◆ getLabelY()

const std::string & TBTK::Canvas2D::getLabelY ( ) const
inline

Get y-label.

◆ getMaxX()

double TBTK::Canvas2D::getMaxX ( ) const
inline

Get maximum X-value.

◆ getMaxY()

double TBTK::Canvas2D::getMaxY ( ) const
inline

Get maximum Y-value.

◆ getMinX()

double TBTK::Canvas2D::getMinX ( ) const
inline

Get minimum X-value.

◆ getMinY()

double TBTK::Canvas2D::getMinY ( ) const
inline

Get minimum Y-value.

◆ getNumDataSets()

unsigned int TBTK::Canvas2D::getNumDataSets ( ) const
inlineprotected

Get the number of contained data sets.

Returns
The number of contained data sets.

◆ getSize()

unsigned int TBTK::Canvas2D::getSize ( unsigned int  dataSet) const
inlineprotected

Get the size for the given data set.

Parameters
dataSetThe data set to get the size for.
Returns
The size for the data set.

◆ getY()

const std::vector< double > & TBTK::Canvas2D::getY ( unsigned int  dataSet) const
inlineprotected

Get the y-values for the given data set.

Parameters
dataSetThe data set to get the y-values for.
Returns
The y-values for the given data set.

◆ plot() [1/2]

void TBTK::Canvas2D::plot ( const std::vector< double > &  y,
const std::string &  title = "",
const std::vector< unsigned char > &  color = {0, 0, 0},
unsigned int  size = 1 
)
inline

Plot data.

◆ plot() [2/2]

void TBTK::Canvas2D::plot ( const std::vector< double > &  x,
const std::vector< double > &  y,
const std::string &  title = "",
const std::vector< unsigned char > &  color = {0, 0, 0},
unsigned int  size = 1 
)
inline

Plot data.

◆ setBounds()

void TBTK::Canvas2D::setBounds ( double  minX,
double  maxX,
double  minY,
double  maxY 
)
inline

Set bounds.

◆ setBoundsX()

void TBTK::Canvas2D::setBoundsX ( double  minX,
double  maxX 
)
inline

Set bounds.

◆ setBoundsY()

void TBTK::Canvas2D::setBoundsY ( double  minY,
double  maxY 
)
inline

Set bounds.

◆ setHold()

void TBTK::Canvas2D::setHold ( bool  hold)
inline

Set hold.

◆ setLabelX()

void TBTK::Canvas2D::setLabelX ( const std::string &  labelX)
inline

Set x-label.

◆ setLabelY()

void TBTK::Canvas2D::setLabelY ( const std::string &  labelY)
inline

Set y-label.


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