DGtal  0.9.3beta
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

LibBoard::Transform::Transform ( )

Definition at line 6 of file Transforms.h.

21  {
virtual LibBoard::Transform::~Transform ( )

Definition at line 34 of file Transforms.h.

34 { };

Member Function Documentation

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

Definition at line 51 of file Transforms.cpp.

References mapX(), and mapY().

52 {
53  x = mapX( x );
54  y = mapY( y );
55 }
virtual double mapX(double x) const
Definition: Transforms.cpp:39
virtual double mapY(double y) const =0
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(), and LibBoard::Board::saveEPS().

40 {
41  return rounded( x * _scale + _deltaX );
42 }
virtual double rounded(double x) const
Definition: Transforms.cpp:33
virtual double LibBoard::Transform::mapY ( double  y) const
pure virtual
double LibBoard::Transform::round ( const double &  x)
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(), and scale().

34 {
35  return Transform::round( 1000000*x ) / 1000000;
36 }
static double round(const double &x)
Definition: Transforms.h:15
double LibBoard::Transform::scale ( double  x) const
virtual void LibBoard::Transform::setBoundingBox ( const Rect rect,
const double  pageWidth,
const double  pageHeight,
const double  margin 
pure virtual

Field Documentation

double LibBoard::Transform::_deltaX
double LibBoard::Transform::_deltaY
double LibBoard::Transform::_height
double LibBoard::Transform::_scale

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