LibreOffice Module basegfx (master) 1
Namespaces | Macros | Functions
b2dpolygontools.cxx File Reference
#include <numeric>
#include <algorithm>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <osl/diagnose.h>
#include <rtl/math.hxx>
#include <sal/log.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/curve/b2dcubicbezier.hxx>
#include <basegfx/point/b3dpoint.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/curve/b2dbeziertools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
Include dependency graph for b2dpolygontools.cxx:

Go to the source code of this file.

Namespaces

namespace  basegfx
 
namespace  basegfx::utils
 

Macros

#define ANGLE_BOUND_START_VALUE   (2.25)
 
#define ANGLE_BOUND_MINIMUM_VALUE   (0.1)
 
#define STEPSPERQUARTER   (3)
 

Functions

void basegfx::utils::openWithGeometryChange (B2DPolygon &rCandidate)
 
void basegfx::utils::closeWithGeometryChange (B2DPolygon &rCandidate)
 
void basegfx::utils::checkClosed (B2DPolygon &rCandidate)
 Check if given polygon is closed. More...
 
sal_uInt32 basegfx::utils::getIndexOfPredecessor (sal_uInt32 nIndex, const B2DPolygon &rCandidate)
 
sal_uInt32 basegfx::utils::getIndexOfSuccessor (sal_uInt32 nIndex, const B2DPolygon &rCandidate)
 
B2VectorOrientation basegfx::utils::getOrientation (const B2DPolygon &rCandidate)
 
B2VectorContinuity basegfx::utils::getContinuityInPoint (const B2DPolygon &rCandidate, sal_uInt32 nIndex)
 
B2DPolygon basegfx::utils::adaptiveSubdivideByDistance (const B2DPolygon &rCandidate, double fDistanceBound, int nRecurseLimit)
 
B2DPolygon basegfx::utils::adaptiveSubdivideByAngle (const B2DPolygon &rCandidate, double fAngleBound)
 
bool basegfx::utils::isInside (const B2DPolygon &rCandidate, const B2DPoint &rPoint, bool bWithBorder)
 
bool basegfx::utils::isInside (const B2DPolygon &rCandidate, const B2DPolygon &rPolygon, bool bWithBorder)
 
B2DRange basegfx::utils::getRange (const B2DPolygon &rCandidate)
 Get the range of a polygon. More...
 
double basegfx::utils::getSignedArea (const B2DPolygon &rCandidate)
 
double basegfx::utils::getArea (const B2DPolygon &rCandidate)
 
double basegfx::utils::getEdgeLength (const B2DPolygon &rCandidate, sal_uInt32 nIndex)
 get length of polygon edge from point nIndex to nIndex + 1 More...
 
double basegfx::utils::getLength (const B2DPolygon &rCandidate)
 get length of polygon More...
 
B2DPoint basegfx::utils::getPositionAbsolute (const B2DPolygon &rCandidate, double fDistance, double fLength)
 
B2DPoint basegfx::utils::getPositionRelative (const B2DPolygon &rCandidate, double fDistance, double fLength)
 
B2DPolygon basegfx::utils::getSnippetAbsolute (const B2DPolygon &rCandidate, double fFrom, double fTo, double fLength)
 
CutFlagValue basegfx::utils::findCut (const B2DPoint &rEdge1Start, const B2DVector &rEdge1Delta, const B2DPoint &rEdge2Start, const B2DVector &rEdge2Delta, CutFlagValue aCutFlags, double *pCut1, double *pCut2)
 
bool basegfx::utils::isPointOnEdge (const B2DPoint &rPoint, const B2DPoint &rEdgeStart, const B2DVector &rEdgeDelta, double *pCut)
 
void basegfx::utils::applyLineDashing (const B2DPolygon &rCandidate, const std::vector< double > &rDotDashArray, B2DPolyPolygon *pLineTarget, B2DPolyPolygon *pGapTarget, double fDotDashLength)
 
static void basegfx::utils::implHandleSnippet (const B2DPolygon &rSnippet, const std::function< void(const basegfx::B2DPolygon &rSnippet)> &rTargetCallback, B2DPolygon &rFirst, B2DPolygon &rLast)
 
static void basegfx::utils::implHandleFirstLast (const std::function< void(const basegfx::B2DPolygon &rSnippet)> &rTargetCallback, B2DPolygon &rFirst, B2DPolygon &rLast)
 
void basegfx::utils::applyLineDashing (const B2DPolygon &rCandidate, const std::vector< double > &rDotDashArray, std::function< void(const basegfx::B2DPolygon &rSnippet)> aLineTargetCallback, std::function< void(const basegfx::B2DPolygon &rSnippet)> aGapTargetCallback=std::function< void(const basegfx::B2DPolygon &)>(), double fDotDashLength=0.0)
 Apply given LineDashing to given polygon. More...
 
bool basegfx::utils::isInEpsilonRange (const B2DPoint &rEdgeStart, const B2DPoint &rEdgeEnd, const B2DPoint &rTestPosition, double fDistance)
 
bool basegfx::utils::isInEpsilonRange (const B2DPolygon &rCandidate, const B2DPoint &rTestPosition, double fDistance)
 
static double basegfx::utils::impDistanceBezierPointToControl (double fAngle)
 
B2DPolygon basegfx::utils::createPolygonFromRect (const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
 Create a polygon from a rectangle. More...
 
B2DPolygon basegfx::utils::createPolygonFromRect (const B2DRectangle &rRect)
 Create a polygon from a rectangle. More...
 
B2DPolygon const & basegfx::utils::createUnitPolygon ()
 Create the unit polygon. More...
 
B2DPolygon basegfx::utils::createPolygonFromCircle (const B2DPoint &rCenter, double fRadius)
 Create a circle polygon with given radius. More...
 
static B2DPolygon basegfx::utils::impCreateUnitCircle (sal_uInt32 nStartQuadrant)
 
B2DPolygon const & basegfx::utils::createHalfUnitCircle ()
 create half circle centered on (0,0) from [0 .. M_PI] More...
 
B2DPolygon const & basegfx::utils::createPolygonFromUnitCircle (sal_uInt32 nStartQuadrant=0)
 create a polygon which describes the unit circle and close it More...
 
B2DPolygon basegfx::utils::createPolygonFromEllipse (const B2DPoint &rCenter, double fRadiusX, double fRadiusY, sal_uInt32 nStartQuadrant=0)
 Create an ellipse polygon with given radii. More...
 
B2DPolygon basegfx::utils::createPolygonFromUnitEllipseSegment (double fStart, double fEnd)
 
B2DPolygon basegfx::utils::createPolygonFromEllipseSegment (const B2DPoint &rCenter, double fRadiusX, double fRadiusY, double fStart, double fEnd)
 Create a unit ellipse polygon with the given angles, from start to end. More...
 
bool basegfx::utils::hasNeutralPoints (const B2DPolygon &rCandidate)
 
B2DPolygon basegfx::utils::removeNeutralPoints (const B2DPolygon &rCandidate)
 
bool basegfx::utils::isConvex (const B2DPolygon &rCandidate)
 
B2VectorOrientation basegfx::utils::getOrientationForIndex (const B2DPolygon &rCandidate, sal_uInt32 nIndex)
 
bool basegfx::utils::isPointOnLine (const B2DPoint &rStart, const B2DPoint &rEnd, const B2DPoint &rCandidate, bool bWithPoints)
 
bool basegfx::utils::isPointOnPolygon (const B2DPolygon &rCandidate, const B2DPoint &rPoint, bool bWithPoints)
 
bool basegfx::utils::isPointInTriangle (const B2DPoint &rA, const B2DPoint &rB, const B2DPoint &rC, const B2DPoint &rCandidate, bool bWithBorder)
 
bool basegfx::utils::arePointsOnSameSideOfLine (const B2DPoint &rStart, const B2DPoint &rEnd, const B2DPoint &rCandidateA, const B2DPoint &rCandidateB, bool bWithLine)
 
void basegfx::utils::addTriangleFan (const B2DPolygon &rCandidate, triangulator::B2DTriangleVector &rTarget)
 
bool basegfx::utils::isRectangle (const B2DPolygon &rPoly)
 Predicate whether a given polygon is a rectangle. More...
 
B3DPolygon basegfx::utils::createB3DPolygonFromB2DPolygon (const B2DPolygon &rCandidate, double fZCoordinate)
 
B2DPolygon basegfx::utils::createB2DPolygonFromB3DPolygon (const B3DPolygon &rCandidate, const B3DHomMatrix &rMat)
 
double basegfx::utils::getSmallestDistancePointToEdge (const B2DPoint &rPointA, const B2DPoint &rPointB, const B2DPoint &rTestPoint, double &rCut)
 
double basegfx::utils::getSmallestDistancePointToPolygon (const B2DPolygon &rCandidate, const B2DPoint &rTestPoint, sal_uInt32 &rEdgeIndex, double &rCut)
 
B2DPoint basegfx::utils::distort (const B2DPoint &rCandidate, const B2DRange &rOriginal, const B2DPoint &rTopLeft, const B2DPoint &rTopRight, const B2DPoint &rBottomLeft, const B2DPoint &rBottomRight)
 
B2DPolygon basegfx::utils::distort (const B2DPolygon &rCandidate, const B2DRange &rOriginal, const B2DPoint &rTopLeft, const B2DPoint &rTopRight, const B2DPoint &rBottomLeft, const B2DPoint &rBottomRight)
 
B2DPolygon basegfx::utils::expandToCurve (const B2DPolygon &rCandidate)
 
bool basegfx::utils::expandToCurveInPoint (B2DPolygon &rCandidate, sal_uInt32 nIndex)
 
bool basegfx::utils::setContinuityInPoint (B2DPolygon &rCandidate, sal_uInt32 nIndex, B2VectorContinuity eContinuity)
 
B2DPolygon basegfx::utils::growInNormalDirection (const B2DPolygon &rCandidate, double fValue)
 
B2DPolygon basegfx::utils::reSegmentPolygon (const B2DPolygon &rCandidate, sal_uInt32 nSegments)
 
B2DPolygon basegfx::utils::interpolate (const B2DPolygon &rOld1, const B2DPolygon &rOld2, double t)
 
B2DPolygon basegfx::utils::simplifyCurveSegments (const B2DPolygon &rCandidate)
 
B2DPolygon basegfx::utils::makeStartPoint (const B2DPolygon &rCandidate, sal_uInt32 nIndexOfNewStatPoint)
 
B2DPolygon basegfx::utils::createEdgesOfGivenLength (const B2DPolygon &rCandidate, double fLength, double fStart=0.0, double fEnd=0.0)
 create edges of given length along given B2DPolygon More...
 
B2DPolygon basegfx::utils::createWaveline (const B2DPolygon &rCandidate, double fWaveWidth, double fWaveHeight)
 Create Waveline along given polygon The implementation is based on createEdgesOfGivenLength and creates a curve segment with the given dimensions for each created line segment. More...
 
B2DPolygon basegfx::utils::snapPointsOfHorizontalOrVerticalEdges (const B2DPolygon &rCandidate)
 snap some polygon coordinates to discrete coordinates More...
 
B2DVector basegfx::utils::getTangentEnteringPoint (const B2DPolygon &rCandidate, sal_uInt32 nIndex)
 get the tangent with which the given point is entered seen from the previous polygon path data. More...
 
B2DVector basegfx::utils::getTangentLeavingPoint (const B2DPolygon &rCandidate, sal_uInt32 nIndex)
 get the tangent with which the given point is left seen from the following polygon path data. More...
 
B2DPolygon basegfx::utils::UnoPointSequenceToB2DPolygon (const css::drawing::PointSequence &rPointSequenceSource)
 converters for css::drawing::PointSequence More...
 
void basegfx::utils::B2DPolygonToUnoPointSequence (const B2DPolygon &rPolygon, css::drawing::PointSequence &rPointSequenceRetval)
 
B2DPolygon basegfx::utils::UnoPolygonBezierCoordsToB2DPolygon (const css::drawing::PointSequence &rPointSequenceSource, const css::drawing::FlagSequence &rFlagSequenceSource)
 
void basegfx::utils::B2DPolygonToUnoPolygonBezierCoords (const B2DPolygon &rPolygon, css::drawing::PointSequence &rPointSequenceRetval, css::drawing::FlagSequence &rFlagSequenceRetval)
 

Macro Definition Documentation

◆ ANGLE_BOUND_MINIMUM_VALUE

#define ANGLE_BOUND_MINIMUM_VALUE   (0.1)

Definition at line 39 of file b2dpolygontools.cxx.

◆ ANGLE_BOUND_START_VALUE

#define ANGLE_BOUND_START_VALUE   (2.25)

Definition at line 38 of file b2dpolygontools.cxx.

◆ STEPSPERQUARTER

#define STEPSPERQUARTER   (3)

Definition at line 40 of file b2dpolygontools.cxx.