10 #if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
11 #define _USE_MATH_DEFINES
19 #include <QPainterPath>
22 #include "scribusapi.h"
31 bool SCRIBUS_API compareDouble(
double a,
double b);
32 uint SCRIBUS_API getDouble(
const QByteArray in,
bool raw);
35 FPoint SCRIBUS_API projectPointOnLine(
FPoint p, QPointF lineStart, QPointF lineEnd);
36 bool SCRIBUS_API regionContainsRect(
const QRegion& shape, QRect rect);
37 QPolygon SCRIBUS_API FlattenPath(
const FPointArray& ina, QList<uint> &Segs);
38 QList<QPainterPath> SCRIBUS_API decomposePath(QPainterPath &path);
39 QPainterPath SCRIBUS_API RegularPolygonPath(
double w,
double h, uint c,
bool star,
double factor,
double rota,
double factor2 = 0.0,
double innerRot = 0.0,
double factor3 = 0.0);
40 QPainterPath SCRIBUS_API SpiralPath(
double spiralWidth,
double spiralHeight,
double spiralStartAngle,
double spiralEndAngle,
double spiralFactor);
41 inline double SCRIBUS_API xy2Deg(
double x,
double y);
42 inline double SCRIBUS_API sind(
double);
43 inline double SCRIBUS_API cosd(
double);
44 inline double SCRIBUS_API square(
double);
45 inline double SCRIBUS_API
distance(
double,
double);
52 double SCRIBUS_API constrainAngle(
double angle,
double constrain);
59 double SCRIBUS_API getRotationFromMatrix(QTransform& matrix,
double def);
64 double SCRIBUS_API getRotationDFromMatrix(QTransform& matrix);
65 void SCRIBUS_API getScaleFromMatrix(QTransform &matrix,
double &scX,
double &scY);
66 void SCRIBUS_API getTransformValuesFromMatrix(QTransform &matrix,
double &scX,
double &scY,
double &rot,
double &dx,
double &dy);
71 inline double square(
double x)
76 inline double distance(
double x,
double y)
78 return sqrt(x*x + y*y);
81 inline double xy2Deg(
double x,
double y)
83 return atan2(y,x) * (180.0/M_PI);
86 inline double sind(
double alpha)
88 return sin(alpha / (180.0/M_PI));
91 inline double cosd(
double alpha)
93 return cos(alpha / (180.0/M_PI));
97 inline bool isequiv(
const T& v1,
const T& v2) {
return v1 == v2; }
100 inline bool isequiv<double>(
const double& v1,
const double& v2) {
return compareDouble(v1, v2); }
A point with floating point precision.
Definition: fpoint.h:43
Coord distance(Point const &a, Point const &b)
Definition: point.h:205
Definition: fpointarray.h:42