CDRTransforms.h
Go to the documentation of this file.
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* This file is part of the libcdr project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef __CDRTRANSFORMS_H__
#define __CDRTRANSFORMS_H__
#include <vector>
#include <librevenge/librevenge.h>
namespace libcdr
{
class CDRTransform
{
public:
CDRTransform();
CDRTransform(double v0, double v1, double x0, double v3, double v4, double y0);
CDRTransform(const CDRTransform &trafo) = default;
CDRTransform &operator=(const CDRTransform &trafo) = default;
void applyToPoint(double &x, double &y) const;
void applyToArc(double &rx, double &ry, double &rotation, bool &sweep, double &endx, double &endy) const;
double getScaleX() const;
double getScaleY() const;
double getTranslateX() const;
double getTranslateY() const;
bool getFlipX() const;
bool getFlipY() const;
librevenge::RVNGString toString() const;
private:
double _getScaleX() const;
double _getScaleY() const;
double m_v0;
double m_v1;
double m_x0;
double m_v3;
double m_v4;
double m_y0;
};
class CDRTransforms
{
public:
CDRTransforms();
CDRTransforms(const CDRTransforms &trafos) = default;
~CDRTransforms();
CDRTransforms &operator=(const CDRTransforms &trafo) = default;
void append(double v0, double v1, double x0, double v3, double v4, double y0);
void append(const CDRTransform &trafo);
void clear();
bool empty() const;
void applyToPoint(double &x, double &y) const;
void applyToArc(double &rx, double &ry, double &rotation, bool &sweep, double &x, double &y) const;
double getScaleX() const;
double getScaleY() const;
double getTranslateX() const;
double getTranslateY() const;
bool getFlipX() const;
bool getFlipY() const;
private:
double _getScaleX() const;
double _getScaleY() const;
std::vector<CDRTransform> m_trafos;
};
} // namespace libcdr
#endif /* __CDRTRANSFORMS_H__ */
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libcdr::CDRTransform
Definition CDRTransforms.h:20
libcdr::CDRTransform::CDRTransform
CDRTransform()
Definition CDRTransforms.cpp:15
libcdr::CDRTransform::getTranslateY
double getTranslateY() const
Definition CDRTransforms.cpp:199
libcdr::CDRTransform::getScaleX
double getScaleX() const
Definition CDRTransforms.cpp:160
libcdr::CDRTransform::m_v3
double m_v3
Definition CDRTransforms.h:45
libcdr::CDRTransform::m_y0
double m_y0
Definition CDRTransforms.h:47
libcdr::CDRTransform::applyToPoint
void applyToPoint(double &x, double &y) const
Definition CDRTransforms.cpp:26
libcdr::CDRTransform::applyToArc
void applyToArc(double &rx, double &ry, double &rotation, bool &sweep, double &endx, double &endy) const
Definition CDRTransforms.cpp:33
libcdr::CDRTransform::operator=
CDRTransform & operator=(const CDRTransform &trafo)=default
libcdr::CDRTransform::_getScaleX
double _getScaleX() const
Definition CDRTransforms.cpp:149
libcdr::CDRTransform::m_v1
double m_v1
Definition CDRTransforms.h:43
libcdr::CDRTransform::getFlipY
bool getFlipY() const
Definition CDRTransforms.cpp:186
libcdr::CDRTransform::getTranslateX
double getTranslateX() const
Definition CDRTransforms.cpp:191
libcdr::CDRTransform::m_v4
double m_v4
Definition CDRTransforms.h:46
libcdr::CDRTransform::m_x0
double m_x0
Definition CDRTransforms.h:44
libcdr::CDRTransform::getFlipX
bool getFlipX() const
Definition CDRTransforms.cpp:165
libcdr::CDRTransform::getScaleY
double getScaleY() const
Definition CDRTransforms.cpp:181
libcdr::CDRTransform::m_v0
double m_v0
Definition CDRTransforms.h:42
libcdr::CDRTransform::toString
librevenge::RVNGString toString() const
Definition CDRTransforms.cpp:207
libcdr::CDRTransform::_getScaleY
double _getScaleY() const
Definition CDRTransforms.cpp:170
libcdr::CDRTransform::CDRTransform
CDRTransform(const CDRTransform &trafo)=default
libcdr::CDRTransforms::~CDRTransforms
~CDRTransforms()
Definition CDRTransforms.cpp:220
libcdr::CDRTransforms::getTranslateX
double getTranslateX() const
Definition CDRTransforms.cpp:298
libcdr::CDRTransforms::m_trafos
std::vector< CDRTransform > m_trafos
Definition CDRTransforms.h:76
libcdr::CDRTransforms::applyToArc
void applyToArc(double &rx, double &ry, double &rotation, bool &sweep, double &x, double &y) const
Definition CDRTransforms.cpp:250
libcdr::CDRTransforms::operator=
CDRTransforms & operator=(const CDRTransforms &trafo)=default
libcdr::CDRTransforms::clear
void clear()
Definition CDRTransforms.cpp:234
libcdr::CDRTransforms::CDRTransforms
CDRTransforms(const CDRTransforms &trafos)=default
libcdr::CDRTransforms::applyToPoint
void applyToPoint(double &x, double &y) const
Definition CDRTransforms.cpp:244
libcdr::CDRTransforms::empty
bool empty() const
Definition CDRTransforms.cpp:239
libcdr::CDRTransforms::getFlipX
bool getFlipX() const
Definition CDRTransforms.cpp:272
libcdr::CDRTransforms::getTranslateY
double getTranslateY() const
Definition CDRTransforms.cpp:306
libcdr::CDRTransforms::getFlipY
bool getFlipY() const
Definition CDRTransforms.cpp:293
libcdr::CDRTransforms::getScaleX
double getScaleX() const
Definition CDRTransforms.cpp:267
libcdr::CDRTransforms::_getScaleX
double _getScaleX() const
Definition CDRTransforms.cpp:256
libcdr::CDRTransforms::getScaleY
double getScaleY() const
Definition CDRTransforms.cpp:288
libcdr::CDRTransforms::_getScaleY
double _getScaleY() const
Definition CDRTransforms.cpp:277
libcdr::CDRTransforms::CDRTransforms
CDRTransforms()
Definition CDRTransforms.cpp:215
libcdr::CDRTransforms::append
void append(double v0, double v1, double x0, double v3, double v4, double y0)
Definition CDRTransforms.cpp:224
libcdr
Definition CDRCollector.h:25