LibreOffice Module svx (master)  1
Functions
svdtrans.cxx File Reference
#include <svx/svdtrans.hxx>
#include <math.h>
#include <svx/xpoly.hxx>
#include <rtl/ustrbuf.hxx>
#include <vcl/virdev.hxx>
#include <tools/bigint.hxx>
#include <tools/UnitConversion.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/localedatawrapper.hxx>
#include <sal/log.hxx>
Include dependency graph for svdtrans.cxx:

Go to the source code of this file.

Functions

void MoveXPoly (XPolygon &rPoly, const Size &S)
 
void ResizeRect (tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
 
void ResizePoly (tools::Polygon &rPoly, const Point &rRef, const Fraction &xFact, const Fraction &yFact)
 
void ResizeXPoly (XPolygon &rPoly, const Point &rRef, const Fraction &xFact, const Fraction &yFact)
 
void RotatePoly (tools::Polygon &rPoly, const Point &rRef, double sn, double cs)
 
void RotateXPoly (XPolygon &rPoly, const Point &rRef, double sn, double cs)
 
void RotateXPoly (XPolyPolygon &rPoly, const Point &rRef, double sn, double cs)
 
void MirrorPoint (Point &rPnt, const Point &rRef1, const Point &rRef2)
 
void MirrorXPoly (XPolygon &rPoly, const Point &rRef1, const Point &rRef2)
 
void ShearPoly (tools::Polygon &rPoly, const Point &rRef, double tn)
 
void ShearXPoly (XPolygon &rPoly, const Point &rRef, double tn, bool bVShear)
 
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 actual point are passed in pC1/pC2. More...
 
double CrookSlantXPoint (Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert)
 
double CrookStretchXPoint (Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert, const tools::Rectangle &rRefRect)
 
void CrookRotatePoly (XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert)
 
void CrookSlantPoly (XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert)
 
void CrookStretchPoly (XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert, const tools::Rectangle &rRefRect)
 
void CrookRotatePoly (XPolyPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert)
 
void CrookSlantPoly (XPolyPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert)
 
void CrookStretchPoly (XPolyPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert, const tools::Rectangle &rRefRect)
 
Degree100 GetAngle (const Point &rPnt)
 The Y axis points down! The function negates the Y axis, when calculating the angle, such that GetAngle(Point(0,-1))=90 deg. More...
 
Degree100 NormAngle18000 (Degree100 a)
 
Degree100 NormAngle36000 (Degree100 deg100)
 Normalize angle to -180.00..179.99. More...
 
sal_uInt16 GetAngleSector (Degree100 nAngle)
 Normalize angle to 0.00..359.99. More...
 
tools::Long GetLen (const Point &rPnt)
 Determine sector within the cartesian coordinate system. More...
 
tools::Polygon Rect2Poly (const tools::Rectangle &rRect, const GeoStat &rGeo)
 
void Poly2Rect (const tools::Polygon &rPol, tools::Rectangle &rRect, GeoStat &rGeo)
 
void OrthoDistance8 (const Point &rPt0, Point &rPt, bool bBigOrtho)
 
void OrthoDistance4 (const Point &rPt0, Point &rPt, bool bBigOrtho)
 
tools::Long BigMulDiv (tools::Long nVal, tools::Long nMul, tools::Long nDiv)
 
static FrPair toPair (o3tl::Length eFrom, o3tl::Length eTo)
 
static FrPair GetInchOrMM (MapUnit eU)
 
FrPair GetMapFactor (MapUnit eS, MapUnit eD)
 
FrPair GetMapFactor (FieldUnit eS, FieldUnit eD)
 

Function Documentation

tools::Long BigMulDiv ( tools::Long  nVal,
tools::Long  nMul,
tools::Long  nDiv 
)
void CrookRotatePoly ( XPolygon rPoly,
const Point &  rCenter,
const Point &  rRad,
bool  bVert 
)
void CrookRotatePoly ( XPolyPolygon rPoly,
const Point &  rCenter,
const Point &  rRad,
bool  bVert 
)

Definition at line 362 of file svdtrans.cxx.

References XPolyPolygon::Count(), and CrookRotatePoly().

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 actual point are passed in pC1/pC2.

Via rSin/rCos, sin(nAngle) and cos(nAngle) are returned.

Returns
the returned angle is in rad

Definition at line 163 of file svdtrans.cxx.

References FRound(), GetCrookAngle(), and RotatePoint().

Referenced by CrookRotatePoly(), SdrEditView::ImpCrookObj(), SdrDragCrook::MovAllPoints(), and SdrDragCrook::MovCrookPoint().

void CrookSlantPoly ( XPolygon rPoly,
const Point &  rCenter,
const Point &  rRad,
bool  bVert 
)
void CrookSlantPoly ( XPolyPolygon rPoly,
const Point &  rCenter,
const Point &  rRad,
bool  bVert 
)

Definition at line 370 of file svdtrans.cxx.

References XPolyPolygon::Count(), and CrookSlantPoly().

double CrookSlantXPoint ( Point &  rPnt,
Point *  pC1,
Point *  pC2,
const Point &  rCenter,
const Point &  rRad,
double &  rSin,
double &  rCos,
bool  bVert 
)
void CrookStretchPoly ( XPolygon rPoly,
const Point &  rCenter,
const Point &  rRad,
bool  bVert,
const tools::Rectangle rRefRect 
)
void CrookStretchPoly ( XPolyPolygon rPoly,
const Point &  rCenter,
const Point &  rRad,
bool  bVert,
const tools::Rectangle rRefRect 
)

Definition at line 378 of file svdtrans.cxx.

References XPolyPolygon::Count(), and CrookStretchPoly().

double CrookStretchXPoint ( Point &  rPnt,
Point *  pC1,
Point *  pC2,
const Point &  rCenter,
const Point &  rRad,
double &  rSin,
double &  rCos,
bool  bVert,
const tools::Rectangle rRefRect 
)
Degree100 GetAngle ( const Point &  rPnt)
sal_uInt16 GetAngleSector ( Degree100  nAngle)

Normalize angle to 0.00..359.99.

Definition at line 418 of file svdtrans.cxx.

References NormAngle36000().

Referenced by SdrDragRotate::MoveSdrDrag().

static FrPair GetInchOrMM ( MapUnit  eU)
static
tools::Long GetLen ( const Point &  rPnt)

Determine sector within the cartesian coordinate system.

Calculates the length of (0,0) via a^2 + b^2 = c^2 In order to avoid overflows, we ignore some decimal places.

Definition at line 427 of file svdtrans.cxx.

References FRound(), nx, ny, x, and y.

Referenced by ImpPathForDragAndCreate::getSpecialDragComment(), SdrMeasureObj::ImpCalcGeometrics(), SdrMeasureObj::NbcRotate(), and SdrMeasureObj::TakeRepresentation().

FrPair GetMapFactor ( MapUnit  eS,
MapUnit  eD 
)
FrPair GetMapFactor ( FieldUnit  eS,
FieldUnit  eD 
)

Definition at line 629 of file svdtrans.cxx.

References FieldToO3tlLength(), o3tl::in, o3tl::invalid, IsInch(), o3tl::mm, and toPair().

void MirrorPoint ( Point &  rPnt,
const Point &  rRef1,
const Point &  rRef2 
)
void MirrorXPoly ( XPolygon rPoly,
const Point &  rRef1,
const Point &  rRef2 
)

Definition at line 139 of file svdtrans.cxx.

References XPolygon::GetPointCount(), i, MirrorPoint(), and nCount.

Referenced by SdrEdgeObj::NbcMirror().

void MoveXPoly ( XPolygon rPoly,
const Size S 
)

Definition at line 33 of file svdtrans.cxx.

References Size::Height(), XPolygon::Move(), and Size::Width().

Referenced by SdrEdgeObj::NbcMove().

Degree100 NormAngle18000 ( Degree100  a)
Degree100 NormAngle36000 ( Degree100  deg100)
void OrthoDistance4 ( const Point &  rPt0,
Point &  rPt,
bool  bBigOrtho 
)

Definition at line 547 of file svdtrans.cxx.

Referenced by SdrCreateView::MovCreateObj(), and SdrDragObjOwn::MoveSdrDrag().

void OrthoDistance8 ( const Point &  rPt0,
Point &  rPt,
bool  bBigOrtho 
)
void Poly2Rect ( const tools::Polygon rPol,
tools::Rectangle rRect,
GeoStat rGeo 
)
tools::Polygon Rect2Poly ( const tools::Rectangle rRect,
const GeoStat rGeo 
)
void ResizePoly ( tools::Polygon rPoly,
const Point &  rRef,
const Fraction xFact,
const Fraction yFact 
)

Definition at line 65 of file svdtrans.cxx.

References tools::Polygon::GetSize(), i, nCount, and ResizePoint().

Referenced by SdrCaptionObj::NbcResize().

void ResizeRect ( tools::Rectangle rRect,
const Point &  rRef,
const Fraction rxFact,
const Fraction ryFact 
)
void ResizeXPoly ( XPolygon rPoly,
const Point &  rRef,
const Fraction xFact,
const Fraction yFact 
)

Definition at line 73 of file svdtrans.cxx.

References XPolygon::GetPointCount(), i, nCount, and ResizePoint().

Referenced by SdrEdgeObj::NbcResize().

void RotatePoly ( tools::Polygon rPoly,
const Point &  rRef,
double  sn,
double  cs 
)
void RotateXPoly ( XPolygon rPoly,
const Point &  rRef,
double  sn,
double  cs 
)
void RotateXPoly ( XPolyPolygon rPoly,
const Point &  rRef,
double  sn,
double  cs 
)

Definition at line 97 of file svdtrans.cxx.

References XPolyPolygon::Count(), i, nCount, and RotateXPoly().

void ShearPoly ( tools::Polygon rPoly,
const Point &  rRef,
double  tn 
)
void ShearXPoly ( XPolygon rPoly,
const Point &  rRef,
double  tn,
bool  bVShear 
)

Definition at line 155 of file svdtrans.cxx.

References XPolygon::GetPointCount(), i, nCount, and ShearPoint().

Referenced by SdrRectObj::ImpCalcXPoly(), and SdrEdgeObj::NbcShear().

static FrPair toPair ( o3tl::Length  eFrom,
o3tl::Length  eTo 
)
static

Definition at line 568 of file svdtrans.cxx.

References o3tl::getConversionMulDiv().

Referenced by GetInchOrMM(), and GetMapFactor().