LibreOffice Module svx (master) 1
Classes | Functions
svdtrans.hxx File Reference
#include <rtl/ustring.hxx>
#include <svx/svxdllapi.h>
#include <tools/degree.hxx>
#include <tools/fldunit.hxx>
#include <tools/fract.hxx>
#include <tools/gen.hxx>
#include <tools/helpers.hxx>
#include <tools/mapunit.hxx>
#include <tools/poly.hxx>
Include dependency graph for svdtrans.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GeoStat
 The transformation of a rectangle into a polygon, by using angle parameters from GeoStat. More...
 
class  FrPair
 
class  SdrFormatter
 

Functions

constexpr Degree100 SDRMAXSHEAR (8900)
 
void MovePoly (tools::Polygon &rPoly, const Size &S)
 
void MoveXPoly (XPolygon &rPoly, const Size &S)
 
SVXCORE_DLLPUBLIC void ResizeRect (tools::Rectangle &rRect, const Point &rRef, const Fraction &xFact, const Fraction &yFact)
 
void ResizePoint (Point &rPnt, const Point &rRef, const Fraction &xFract, const Fraction &yFract)
 
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 RotatePoint (Point &rPnt, const Point &rRef, double sn, double cs)
 
SVXCORE_DLLPUBLIC 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 ShearPoint (Point &rPnt, const Point &rRef, double tn, bool bVShear=false)
 
SVXCORE_DLLPUBLIC void ShearPoly (tools::Polygon &rPoly, const Point &rRef, double tn)
 
void ShearXPoly (XPolygon &rPoly, const Point &rRef, double tn, bool bVShear=false)
 
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. More...
 
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)
 
SVXCORE_DLLPUBLIC 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...
 
SVXCORE_DLLPUBLIC Degree100 NormAngle18000 (Degree100 a)
 
SVXCORE_DLLPUBLIC Degree100 NormAngle36000 (Degree100 a)
 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)
 
SVXCORE_DLLPUBLIC tools::Long BigMulDiv (tools::Long nVal, tools::Long nMul, tools::Long nDiv)
 
SVXCORE_DLLPUBLIC FrPair GetMapFactor (MapUnit eS, MapUnit eD)
 
FrPair GetMapFactor (FieldUnit eS, FieldUnit eD)
 
bool IsMetric (MapUnit eU)
 
bool IsInch (MapUnit eU)
 
bool IsMetric (FieldUnit eU)
 
bool IsInch (FieldUnit eU)
 

Function Documentation

◆ BigMulDiv()

SVXCORE_DLLPUBLIC tools::Long BigMulDiv ( tools::Long  nVal,
tools::Long  nMul,
tools::Long  nDiv 
)

◆ CrookRotatePoly() [1/2]

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

◆ CrookRotatePoly() [2/2]

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().

◆ CrookRotateXPoint()

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().

◆ CrookSlantPoly() [1/2]

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

◆ CrookSlantPoly() [2/2]

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().

◆ CrookSlantXPoint()

double CrookSlantXPoint ( Point &  rPnt,
Point *  pC1,
Point *  pC2,
const Point &  rCenter,
const Point &  rRad,
double &  rSin,
double &  rCos,
bool  bVert 
)

◆ CrookStretchPoly() [1/2]

void CrookStretchPoly ( XPolygon rPoly,
const Point &  rCenter,
const Point &  rRad,
bool  bVert,
const tools::Rectangle rRefRect 
)

◆ CrookStretchPoly() [2/2]

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().

◆ CrookStretchXPoint()

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

◆ GetAngle()

SVXCORE_DLLPUBLIC Degree100 GetAngle ( const Point &  rPnt)

◆ GetAngleSector()

sal_uInt16 GetAngleSector ( Degree100  nAngle)

Normalize angle to 0.00..359.99.

Definition at line 416 of file svdtrans.cxx.

References NormAngle36000().

Referenced by SdrDragRotate::MoveSdrDrag().

◆ GetCrookAngle()

double GetCrookAngle ( Point &  rPnt,
const Point &  rCenter,
const Point &  rRad,
bool  bVertical 
)
inline

rPnt.X/rPnt.Y is set to rCenter.X or rCenter.Y! We then only need to rotate rPnt by rCenter.

Returns
the returned angle is in rad

Definition at line 122 of file svdtrans.hxx.

Referenced by CrookRotateXPoint(), and CrookSlantXPoint().

◆ GetLen()

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 418 of file svdtrans.cxx.

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

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

◆ GetMapFactor() [1/2]

FrPair GetMapFactor ( FieldUnit  eS,
FieldUnit  eD 
)

Definition at line 620 of file svdtrans.cxx.

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

◆ GetMapFactor() [2/2]

SVXCORE_DLLPUBLIC FrPair GetMapFactor ( MapUnit  eS,
MapUnit  eD 
)

◆ IsInch() [1/2]

bool IsInch ( FieldUnit  eU)
inline

Definition at line 256 of file svdtrans.hxx.

◆ IsInch() [2/2]

bool IsInch ( MapUnit  eU)
inline

Definition at line 246 of file svdtrans.hxx.

Referenced by GetMapFactor().

◆ IsMetric() [1/2]

bool IsMetric ( FieldUnit  eU)
inline

Definition at line 251 of file svdtrans.hxx.

◆ IsMetric() [2/2]

bool IsMetric ( MapUnit  eU)
inline

◆ MirrorPoint()

void MirrorPoint ( Point &  rPnt,
const Point &  rRef1,
const Point &  rRef2 
)

◆ MirrorXPoly()

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().

◆ MovePoly()

void MovePoly ( tools::Polygon rPoly,
const Size S 
)
inline

Definition at line 38 of file svdtrans.hxx.

References tools::Polygon::Move(), and S.

Referenced by SdrCaptionObj::NbcMove().

◆ MoveXPoly()

void MoveXPoly ( XPolygon rPoly,
const Size S 
)

Definition at line 33 of file svdtrans.cxx.

References XPolygon::Move(), and S.

Referenced by SdrEdgeObj::NbcMove().

◆ NormAngle18000()

SVXCORE_DLLPUBLIC Degree100 NormAngle18000 ( Degree100  a)

◆ NormAngle36000()

SVXCORE_DLLPUBLIC Degree100 NormAngle36000 ( Degree100  a)

◆ OrthoDistance4()

void OrthoDistance4 ( const Point &  rPt0,
Point &  rPt,
bool  bBigOrtho 
)

Definition at line 538 of file svdtrans.cxx.

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

◆ OrthoDistance8()

void OrthoDistance8 ( const Point &  rPt0,
Point &  rPt,
bool  bBigOrtho 
)

◆ Poly2Rect()

void Poly2Rect ( const tools::Polygon rPol,
tools::Rectangle rRect,
GeoStat rGeo 
)

◆ Rect2Poly()

tools::Polygon Rect2Poly ( const tools::Rectangle rRect,
const GeoStat rGeo 
)

◆ ResizePoint()

void ResizePoint ( Point &  rPnt,
const Point &  rRef,
const Fraction xFract,
const Fraction yFract 
)
inline

◆ ResizePoly()

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().

◆ ResizeRect()

SVXCORE_DLLPUBLIC void ResizeRect ( tools::Rectangle rRect,
const Point &  rRef,
const Fraction xFact,
const Fraction yFact 
)

◆ ResizeXPoly()

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().

◆ RotatePoint()

void RotatePoint ( Point &  rPnt,
const Point &  rRef,
double  sn,
double  cs 
)
inline

Definition at line 101 of file svdtrans.hxx.

References FRound().

Referenced by SdrCircObj::AddToHdlList(), SdrRectObj::AddToHdlList(), SdrTextObj::AddToHdlList(), SdrTextObj::AdjustTextFrameWidthAndHeight(), SdrObjCustomShape::AdjustTextFrameWidthAndHeight(), SdrCircObj::applySpecialDrag(), SdrRectObj::applySpecialDrag(), SdrTextObj::applySpecialDrag(), EnhancedCustomShape3d::Create3DObject(), CrookRotateXPoint(), CrookSlantXPoint(), SdrObjCustomShape::DragResizeCustomShape(), SvxGrafAttrHelper::ExecuteGrafAttr(), SdrRectObj::GetCornerGluePoint(), EnhancedCustomShape2d::GetHandlePosition(), SvxIMapInfo::GetHitIMapObject(), SdrTextObj::GetSnapPoint(), SdrRectObj::getSpecialDragComment(), SdrObjCustomShape::GetVertexGluePoint(), SdrRectObj::GetVertexGluePoint(), SdrMeasureObj::ImpCalcGeometrics(), SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded(), SdrTextObj::ImpDragCalcRect(), SdrMeasureObj::ImpEvalDrag(), ImpRotate(), MirrorPoint(), SdrDragMovHdl::MoveSdrDrag(), SdrCircObj::NbcMirror(), SdrEdgeObj::NbcRotate(), SdrObjGroup::NbcRotate(), SdrMeasureObj::NbcRotate(), SdrTextObj::NbcRotate(), Poly2Rect(), SdrObjGroup::Rotate(), SdrGluePoint::Rotate(), RotatePoly(), RotateXPoly(), EnhancedCustomShape2d::SetHandleControllerPosition(), SdrTextObj::TakeTextAnchorRect(), SdrObjCustomShape::TakeTextAnchorRect(), SdrTextObj::TakeTextEditArea(), SdrObjCustomShape::TakeTextEditArea(), SdrTextObj::TakeTextRect(), SdrObjCustomShape::TakeTextRect(), SdrCircObj::TakeUnrotatedSnapRect(), SdrMeasureObj::TakeUnrotatedSnapRect(), SdrPathObj::TakeUnrotatedSnapRect(), and SdrRectObj::TakeUnrotatedSnapRect().

◆ RotatePoly()

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

◆ RotateXPoly() [1/2]

void RotateXPoly ( XPolygon rPoly,
const Point &  rRef,
double  sn,
double  cs 
)

◆ RotateXPoly() [2/2]

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().

◆ SDRMAXSHEAR()

constexpr Degree100 SDRMAXSHEAR ( 8900  )
constexpr

◆ ShearPoint()

void ShearPoint ( Point &  rPnt,
const Point &  rRef,
double  tn,
bool  bVShear = false 
)
inline

◆ ShearPoly()

SVXCORE_DLLPUBLIC void ShearPoly ( tools::Polygon rPoly,
const Point &  rRef,
double  tn 
)

◆ ShearXPoly()

void ShearXPoly ( XPolygon rPoly,
const Point &  rRef,
double  tn,
bool  bVShear = false 
)

Definition at line 155 of file svdtrans.cxx.

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

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