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

Classes

class  Pixel
 
class  RGBA
 

Public Member Functions

 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
 
virtual void clear ()
 
 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)
 

Constructor & Destructor Documentation

◆ Canvas() [1/2]

template<typename CoordinateType >
TBTK::Canvas< CoordinateType >::Canvas ( )

Constructor.

◆ ~Canvas() [1/2]

template<typename CoordinateType >
TBTK::Canvas< CoordinateType >::~Canvas ( )
virtual

Destructor.

◆ Canvas() [2/2]

template<typename CoordinateType >
TBTK::Canvas< CoordinateType >::Canvas ( unsigned int  width,
unsigned int  height 
)

Constructor.

◆ ~Canvas() [2/2]

template<typename CoordinateType >
TBTK::Canvas< CoordinateType >::~Canvas ( )

Destructor.

Member Function Documentation

◆ clear()

template<typename CoordinateType >
void TBTK::Canvas< CoordinateType >::clear ( )
inlinevirtual

Clear plot.

Reimplemented in TBTK::Canvas3D, and TBTK::Canvas2D.

◆ drawCircle()

template<typename CoordinateType >
void TBTK::Canvas< CoordinateType >::drawCircle ( const RGBA rgba,
CoordinateType  x,
CoordinateType  y,
CoordinateType  radius 
)

Draw circle.

◆ drawPixel()

template<typename CoordinateType >
void TBTK::Canvas< CoordinateType >::drawPixel ( const RGBA rgba,
CoordinateType  x,
CoordinateType  y 
)

Draw pixel.

◆ getHeight()

template<typename CoordinateType >
double TBTK::Canvas< CoordinateType >::getHeight ( ) const
inline

Get height.

◆ getTitle()

template<typename CoordinateType >
const std::string & TBTK::Canvas< CoordinateType >::getTitle ( ) const
inline

Get the title.

◆ getWidth()

template<typename CoordinateType >
double TBTK::Canvas< CoordinateType >::getWidth ( ) const
inline

Get width.

◆ save()

template<typename CoordinateType >
void TBTK::Canvas< CoordinateType >::save ( std::string  filename) const
inline

Save canvas to file.

◆ setBasisVectors()

template<typename CoordinateType >
void TBTK::Canvas< CoordinateType >::setBasisVectors ( std::initializer_list< std::initializer_list< CoordinateType >>  basisVectors)
inline

Set basis vectors.

◆ setHeight()

template<typename CoordinateType >
void TBTK::Canvas< CoordinateType >::setHeight ( unsigned int  height)
inline

Set height.

◆ setOrigin()

template<typename CoordinateType >
void TBTK::Canvas< CoordinateType >::setOrigin ( CoordinateType  x,
CoordinateType  y 
)

Set origin.

◆ setTitle()

template<typename CoordinateType >
void TBTK::Canvas< CoordinateType >::setTitle ( const std::string &  title)
inline

Set the title.

◆ setWidth()

template<typename CoordinateType >
void TBTK::Canvas< CoordinateType >::setWidth ( unsigned int  width)
inline

Set width.


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