22#include <rtl/ustring.hxx>
46inline void RotatePoint(Point& rPnt,
const Point& rRef,
double sn,
double cs);
51void MirrorPoint(Point& rPnt,
const Point& rRef1,
const Point& rRef2);
54inline void ShearPoint(Point& rPnt,
const Point& rRef,
double tn,
bool bVShear =
false);
64inline double GetCrookAngle(Point& rPnt,
const Point& rCenter,
const Point& rRad,
bool bVertical);
73double CrookRotateXPoint(Point& rPnt, Point* pC1, Point* pC2,
const Point& rCenter,
74 const Point& rRad,
double& rSin,
double& rCos,
bool bVert);
75double CrookSlantXPoint(Point& rPnt, Point* pC1, Point* pC2,
const Point& rCenter,
76 const Point& rRad,
double& rSin,
double& rCos,
bool bVert);
78 const Point& rRad,
double& rSin,
double& rCos,
bool bVert,
95 double nxFract = xFract.
IsValid() ?
static_cast<double>(xFract) : 1.0;
96 double nyFract = yFract.
IsValid() ?
static_cast<double>(yFract) : 1.0;
97 rPnt.setX(rRef.X() +
FRound( (rPnt.X() - rRef.X()) * nxFract ));
98 rPnt.setY(rRef.Y() +
FRound( (rPnt.Y() - rRef.Y()) * nyFract ));
101inline void RotatePoint(Point& rPnt,
const Point& rRef,
double sn,
double cs)
105 rPnt.setX(
FRound(rRef.X()+dx*cs+dy*sn));
106 rPnt.setY(
FRound(rRef.Y()+dy*cs-dx*sn));
109inline void ShearPoint(Point& rPnt,
const Point& rRef,
double tn,
bool bVShear)
112 if (rPnt.Y()!=rRef.Y()) {
113 rPnt.AdjustX(-
FRound((rPnt.Y()-rRef.Y())*tn));
116 if (rPnt.X()!=rRef.X()) {
117 rPnt.AdjustY(-
FRound((rPnt.X()-rRef.X())*tn));
122inline double GetCrookAngle(Point& rPnt,
const Point& rCenter,
const Point& rRad,
bool bVertical)
127 nAngle=
static_cast<double>(dy)/
static_cast<double>(rRad.Y());
128 rPnt.setY(rCenter.Y());
131 nAngle=
static_cast<double>(dx)/
static_cast<double>(rRad.X());
132 rPnt.setX(rCenter.X());
221void OrthoDistance8(
const Point& rPt0, Point& rPt,
bool bBigOrtho);
222void OrthoDistance4(
const Point& rPt0, Point& rPt,
bool bBigOrtho);
247 return (eU==MapUnit::Map100thMM || eU==MapUnit::Map10thMM || eU==MapUnit::MapMM || eU==MapUnit::MapCM);
251 return (eU==MapUnit::Map1000thInch || eU==MapUnit::Map100thInch || eU==MapUnit::Map10thInch || eU==MapUnit::MapInch ||
252 eU==MapUnit::MapPoint || eU==MapUnit::MapTwip);
256 return (eU == FieldUnit::MM || eU == FieldUnit::CM || eU == FieldUnit::M
257 || eU == FieldUnit::KM || eU == FieldUnit::MM_100TH);
261 return (eU == FieldUnit::TWIP || eU == FieldUnit::POINT
262 || eU == FieldUnit::PICA || eU == FieldUnit::INCH
263 || eU == FieldUnit::FOOT || eU == FieldUnit::MILE);
286 static OUString GetUnitStr(
MapUnit eUnit);
287 static OUString GetUnitStr(
FieldUnit eUnit);
FrPair(tools::Long xMul, tools::Long xDiv, tools::Long yMul, tools::Long yDiv)
const Fraction & X() const
const Fraction & Y() const
FrPair(const Fraction &rBoth)
FrPair(tools::Long nMul, tools::Long nDiv)
FrPair(const Fraction &rX, const Fraction &rY)
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
double mfCosRotationAngle
double mfSinRotationAngle
tools::Long FRound(double fVal)
tools::Rectangle polygonToRectangle(const tools::Polygon &rPolygon, GeoStat &rGeo)
void CrookStretchPoly(XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert, const tools::Rectangle &rRefRect)
void ShearPoint(Point &rPnt, const Point &rRef, double tn, bool bVShear=false)
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
void CrookRotatePoly(XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert)
void ResizeXPoly(XPolygon &rPoly, const Point &rRef, const Fraction &xFact, const Fraction &yFact)
double CrookRotateXPoint(Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert)
The following methods accept a point of an XPolygon, whereas the neighbouring control points of the a...
void OrthoDistance4(const Point &rPt0, Point &rPt, bool bBigOrtho)
tools::Polygon Rect2Poly(const tools::Rectangle &rRect, const GeoStat &rGeo)
void RotateXPoly(XPolygon &rPoly, const Point &rRef, double sn, double cs)
constexpr Degree100 SDRMAXSHEAR(8900)
SVXCORE_DLLPUBLIC Degree100 GetAngle(const Point &rPnt)
The Y axis points down! The function negates the Y axis, when calculating the angle,...
double CrookSlantXPoint(Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert)
SVXCORE_DLLPUBLIC void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &xFact, const Fraction &yFact)
void OrthoDistance8(const Point &rPt0, Point &rPt, bool bBigOrtho)
SVXCORE_DLLPUBLIC void ShearPoly(tools::Polygon &rPoly, const Point &rRef, double tn)
double CrookStretchXPoint(Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert, const tools::Rectangle &rRefRect)
sal_uInt16 GetAngleSector(Degree100 nAngle)
Normalize angle to 0.00..359.99.
void MovePoly(tools::Polygon &rPoly, const Size &S)
void CrookSlantPoly(XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert)
SVXCORE_DLLPUBLIC void RotatePoly(tools::Polygon &rPoly, const Point &rRef, double sn, double cs)
double GetCrookAngle(Point &rPnt, const Point &rCenter, const Point &rRad, bool bVertical)
rPnt.X/rPnt.Y is set to rCenter.X or rCenter.Y! We then only need to rotate rPnt by rCenter.
SVXCORE_DLLPUBLIC FrPair GetMapFactor(MapUnit eS, MapUnit eD)
void MirrorPoint(Point &rPnt, const Point &rRef1, const Point &rRef2)
void ResizePoint(Point &rPnt, const Point &rRef, const Fraction &xFract, const Fraction &yFract)
tools::Long GetLen(const Point &rPnt)
Determine sector within the cartesian coordinate system.
void ResizePoly(tools::Polygon &rPoly, const Point &rRef, const Fraction &xFact, const Fraction &yFact)
void ShearXPoly(XPolygon &rPoly, const Point &rRef, double tn, bool bVShear=false)
void MoveXPoly(XPolygon &rPoly, const Size &S)
SVXCORE_DLLPUBLIC Degree100 NormAngle18000(Degree100 a)
SVXCORE_DLLPUBLIC Degree100 NormAngle36000(Degree100 a)
Normalize angle to -180.00..179.99.
SVXCORE_DLLPUBLIC tools::Long BigMulDiv(tools::Long nVal, tools::Long nMul, tools::Long nDiv)
bool IsMetric(MapUnit eU)
void MirrorXPoly(XPolygon &rPoly, const Point &rRef1, const Point &rRef2)
#define SVXCORE_DLLPUBLIC