DGtal  0.9.3
Public Member Functions | Static Public Member Functions | Protected Attributes
LibBoard::Transform Struct Referenceabstract

#include <Board/Transforms.h>

Inheritance diagram for LibBoard::Transform:

Public Member Functions

 Transform ()
virtual ~Transform ()
virtual double mapX (double x) const
virtual double mapY (double y) const =0
virtual void apply (double &x, double &y) const
virtual double scale (double x) const
virtual double rounded (double x) const
virtual void setBoundingBox (const Rect &rect, const double pageWidth, const double pageHeight, const double margin)=0

Static Public Member Functions

static double round (const double &x)

Protected Attributes

double _scale
double _deltaX
double _deltaY
double _height

Detailed Description

base class for transforms.

The base class for transforms.

Definition at line 31 of file Transforms.h.

Constructor & Destructor Documentation

◆ Transform()

LibBoard::Transform::Transform ( )

Definition at line 6 of file Transforms.h.

21  {

◆ ~Transform()

virtual LibBoard::Transform::~Transform ( )

Definition at line 34 of file Transforms.h.

References apply(), mapX(), mapY(), round(), rounded(), scale(), and setBoundingBox().

34 { };

Member Function Documentation

◆ apply()

void LibBoard::Transform::apply ( double &  x,
double &  y 
) const

Definition at line 51 of file Transforms.cpp.

References mapX(), and mapY().

Referenced by ~Transform().

52 {
53  x = mapX( x );
54  y = mapY( y );
55 }
virtual double mapY(double y) const =0
virtual double mapX(double x) const
Definition: Transforms.cpp:39

◆ mapX()

double LibBoard::Transform::mapX ( double  x) const

Definition at line 39 of file Transforms.cpp.

References _deltaX, _scale, and rounded().

Referenced by apply(), LibBoard::Dot::flushCairo(), LibBoard::Line::flushCairo(), LibBoard::Arrow::flushCairo(), LibBoard::Rectangle::flushCairo(), LibBoard::Image::flushCairo(), LibBoard::QuadraticBezierCurve::flushCairo(), LibBoard::Ellipse::flushCairo(), LibBoard::Circle::flushCairo(), LibBoard::Arc::flushCairo(), LibBoard::Path::flushCairoPoints(), LibBoard::Path::flushFIG(), LibBoard::Group::flushFIG(), LibBoard::Dot::flushFIG(), LibBoard::Line::flushFIG(), LibBoard::Arrow::flushFIG(), LibBoard::Ellipse::flushFIG(), LibBoard::Text::flushFIG(), LibBoard::Path::flushPostscript(), LibBoard::Dot::flushPostscript(), LibBoard::Line::flushPostscript(), LibBoard::Arrow::flushPostscript(), LibBoard::QuadraticBezierCurve::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::Arc::flushPostscript(), LibBoard::Text::flushPostscript(), LibBoard::Dot::flushSVG(), LibBoard::Line::flushSVG(), LibBoard::Arrow::flushSVG(), LibBoard::Rectangle::flushSVG(), LibBoard::Image::flushSVG(), LibBoard::QuadraticBezierCurve::flushSVG(), LibBoard::Ellipse::flushSVG(), LibBoard::Circle::flushSVG(), LibBoard::Arc::flushSVG(), LibBoard::Text::flushSVG(), LibBoard::Path::flushSVGCommands(), LibBoard::Path::flushSVGPoints(), LibBoard::Line::flushTikZ(), LibBoard::Arrow::flushTikZ(), LibBoard::Image::flushTikZ(), LibBoard::QuadraticBezierCurve::flushTikZ(), LibBoard::Ellipse::flushTikZ(), LibBoard::Circle::flushTikZ(), LibBoard::Arc::flushTikZ(), LibBoard::Text::flushTikZ(), LibBoard::Path::flushTikZPoints(), LibBoard::Board::saveEPS(), and ~Transform().

40 {
41  return rounded( x * _scale + _deltaX );
42 }
virtual double rounded(double x) const
Definition: Transforms.cpp:33

◆ mapY()

virtual double LibBoard::Transform::mapY ( double  y) const
pure virtual

◆ round()

double LibBoard::Transform::round ( const double &  x)

◆ rounded()

double LibBoard::Transform::rounded ( double  x) const

Reimplemented in LibBoard::TransformCairo, LibBoard::TransformSVG, and LibBoard::TransformFIG.

Definition at line 33 of file Transforms.cpp.

References round().

Referenced by mapX(), LibBoard::TransformEPS::mapY(), LibBoard::TransformFIG::mapY(), LibBoard::TransformSVG::mapY(), LibBoard::TransformCairo::mapY(), scale(), and ~Transform().

34 {
35  return Transform::round( 1000000*x ) / 1000000;
36 }
static double round(const double &x)
Definition: Transforms.h:15

◆ scale()

double LibBoard::Transform::scale ( double  x) const

◆ setBoundingBox()

virtual void LibBoard::Transform::setBoundingBox ( const Rect rect,
const double  pageWidth,
const double  pageHeight,
const double  margin 
pure virtual

Field Documentation

◆ _deltaX

double LibBoard::Transform::_deltaX

◆ _deltaY

double LibBoard::Transform::_deltaY

◆ _height

double LibBoard::Transform::_height

◆ _scale

double LibBoard::Transform::_scale

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