LibreOffice Module basegfx (master) 1
Namespaces | Classes | Typedefs | Functions
basegfx::utils Namespace Reference

Namespaces

namespace  RectClipFlags
 

Classes

class  B2DClipState
 This class provides an optimized, symbolic clip state for graphical output. More...
 
class  B2DHomMatrixBufferedDecompose
 
class  B2DHomMatrixBufferedOnDemandDecompose
 
class  ImplB2DClipState
 
class  KeyStopLerp
 Lerp in a vector of key stops. More...
 
class  PointIndex
 Helper class to transport PointIndices to a PolyPolygon, with an operator< for convenient sorting in a std::set usage. More...
 

Typedefs

typedef o3tl::sorted_vector< PointIndexPointIndexSet
 the PointIndexSet itself; it allows to define a 'selection'of points in a tools::PolyPolygon by giving the polygon and point index. More...
 

Functions

::slideshow::internal::RGBColor lerp< ::slideshow::internal::RGBColor > (const ::slideshow::internal::RGBColor &rFrom, const ::slideshow::internal::RGBColor &rTo, double t)
 
sal_Int16 lerp< sal_Int16 > (const sal_Int16 &, const sal_Int16 &rTo, double)
 
OUString lerp< OUString > (const OUString &, const OUString &rTo, double)
 
bool lerp< bool > (const bool &, const bool &rTo, double)
 
BColor rgb2hsl (const BColor &rRGBColor)
 Transform from RGB to HSL. More...
 
static double hsl2rgbHelper (double nValue1, double nValue2, double nHue)
 
BColor hsl2rgb (const BColor &rHSLColor)
 Transform from HSL to RGB. More...
 
BColor rgb2hsv (const BColor &rRGBColor)
 Transform from RGB to HSV. More...
 
BColor hsv2rgb (const BColor &rHSVColor)
 Transform from HSV to RGB. More...
 
void createSinCosOrthogonal (double &o_rSin, double &rCos, double fRadiant)
 If the rotation angle is an approximate multiple of pi/2, force fSin/fCos to -1/0/1, to maintain orthogonality (which might also be advantageous for the other cases, but: for multiples of pi/2, the exact values can be attained. More...
 
B2DHomMatrix createScaleB2DHomMatrix (double fScaleX, double fScaleY)
 Tooling methods for on-the-fly matrix generation e.g. More...
 
B2DHomMatrix createShearXB2DHomMatrix (double fShearX)
 
B2DHomMatrix createShearYB2DHomMatrix (double fShearY)
 
B2DHomMatrix createRotateB2DHomMatrix (double fRadiant)
 
B2DHomMatrix createTranslateB2DHomMatrix (double fTranslateX, double fTranslateY)
 
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix (double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
 Tooling methods for faster completely combined matrix creation when scale, shearX, rotation and translation needs to be done in exactly that order. More...
 
B2DHomMatrix createShearXRotateTranslateB2DHomMatrix (double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
 
B2DHomMatrix createScaleTranslateB2DHomMatrix (double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
 
B2DHomMatrix createRotateAroundPoint (double fPointX, double fPointY, double fRadiant)
 special for the often used case of rotation around a point More...
 
B2DHomMatrix createRotateAroundCenterKeepAspectRatioStayInsideRange (const basegfx::B2DRange &rTargetRange, double fRotate)
 special for creating a mapping for a Range rotated around it's center while keeping AspectRatio unchanged and staying inside the given Range by optimally using the available space (no overlap or outside allowed) More...
 
B2DHomMatrix createSourceRangeTargetRangeTransform (const B2DRange &rSourceRange, const B2DRange &rTargetRange)
 special for the case to map from source range to target range More...
 
B2DHomMatrix createCoordinateSystemTransform (const B2DPoint &rOrigin, const B2DVector &rX, const B2DVector &rY)
 create based on given CoordinateSystem which is defined by origin and x/yaxis More...
 
B2DTuple getColumn (const B2DHomMatrix &rMatrix, sal_uInt16 nCol)
 get column vector from B2dHomMatrix, e.g. to extract coordinate system origin and x/yaxis More...
 
B3DHomMatrix UnoHomogenMatrixToB3DHomMatrix (const com::sun::star::drawing::HomogenMatrix &rMatrixIn)
 
void B3DHomMatrixToUnoHomogenMatrix (const B3DHomMatrix &rMatrixIn, com::sun::star::drawing::HomogenMatrix &rMatrixOut)
 
B2DPolyPolygon createAreaGeometryForLineStartEnd (const B2DPolygon &rCandidate, const B2DPolyPolygon &rArrow, bool bStart, double fWidth, double fCandidateLength, double fDockingPosition, double *pConsumedLength=nullptr, double fShift=0.0)
 Create line start/end geometry element, mostly arrows and things like that. More...
 
B2DPolyPolygon createAreaGeometry (const B2DPolygon &rCandidate, double fHalfLineWidth, B2DLineJoin eJoin, css::drawing::LineCap eCap, double fMaxAllowedAngle=basegfx::deg2rad(12.5), double fMaxPartOfEdge=0.4, double fMiterMinimumAngle=basegfx::deg2rad(15.0))
 create filled polygon geometry for lines with a line width More...
 
B2DPolyPolygon clipPolygonOnParallelAxis (const B2DPolygon &rCandidate, bool bParallelToXAxis, bool bAboveAxis, double fValueOnOtherAxis, bool bStroke)
 
B2DPolyPolygon clipPolyPolygonOnParallelAxis (const B2DPolyPolygon &rCandidate, bool bParallelToXAxis, bool bAboveAxis, double fValueOnOtherAxis, bool bStroke)
 
B2DPolyPolygon clipPolygonOnRange (const B2DPolygon &rCandidate, const B2DRange &rRange, bool bInside, bool bStroke)
 
B2DPolyPolygon clipPolyPolygonOnRange (const B2DPolyPolygon &rCandidate, const B2DRange &rRange, bool bInside, bool bStroke)
 
B2DPolyPolygon clipPolyPolygonOnPolyPolygon (const B2DPolyPolygon &rCandidate, const B2DPolyPolygon &rClip, bool bInside, bool bStroke, size_t *pPointLimit)
 
B2DPolyPolygon clipPolygonOnPolyPolygon (const B2DPolygon &rCandidate, const B2DPolyPolygon &rClip, bool bInside, bool bStroke)
 
static sal_uInt32 scissorLineSegment (::basegfx::B2DPoint *in_vertex, sal_uInt32 in_count, ::basegfx::B2DPoint *out_vertex, scissor_plane const *pPlane, const ::basegfx::B2DRectangle &rR)
 
B2DPolygon clipTriangleListOnRange (const B2DPolygon &rCandidate, const B2DRange &rRange)
 
B2DPolygon addPointsAtCutsAndTouches (const B2DPolygon &rCandidate, size_t *pPointLimit)
 
B2DPolyPolygon addPointsAtCutsAndTouches (const B2DPolyPolygon &rCandidate, size_t *pPointLimit)
 
B2DPolygon addPointsAtCuts (const B2DPolygon &rCandidate, const B2DPoint &rStart, const B2DPoint &rEnd)
 
B2DPolygon addPointsAtCuts (const B2DPolygon &rCandidate, const B2DPolyPolygon &rPolyMask)
 
void openWithGeometryChange (B2DPolygon &rCandidate)
 
void closeWithGeometryChange (B2DPolygon &rCandidate)
 
void checkClosed (B2DPolygon &rCandidate)
 Check if given polygon is closed. More...
 
sal_uInt32 getIndexOfPredecessor (sal_uInt32 nIndex, const B2DPolygon &rCandidate)
 
sal_uInt32 getIndexOfSuccessor (sal_uInt32 nIndex, const B2DPolygon &rCandidate)
 
B2VectorOrientation getOrientation (const B2DPolygon &rCandidate)
 
B2VectorContinuity getContinuityInPoint (const B2DPolygon &rCandidate, sal_uInt32 nIndex)
 
B2DPolygon adaptiveSubdivideByDistance (const B2DPolygon &rCandidate, double fDistanceBound, int nRecurseLimit)
 
B2DPolygon adaptiveSubdivideByAngle (const B2DPolygon &rCandidate, double fAngleBound)
 
bool isInside (const B2DPolygon &rCandidate, const B2DPoint &rPoint, bool bWithBorder)
 
bool isInside (const B2DPolygon &rCandidate, const B2DPolygon &rPolygon, bool bWithBorder)
 
B2DRange getRange (const B2DPolygon &rCandidate)
 Get the range of a polygon. More...
 
double getSignedArea (const B2DPolygon &rCandidate)
 
double getArea (const B2DPolygon &rCandidate)
 
double getEdgeLength (const B2DPolygon &rCandidate, sal_uInt32 nIndex)
 get length of polygon edge from point nIndex to nIndex + 1 More...
 
double getLength (const B2DPolygon &rCandidate)
 get length of polygon More...
 
B2DPoint getPositionAbsolute (const B2DPolygon &rCandidate, double fDistance, double fLength)
 
B2DPoint getPositionRelative (const B2DPolygon &rCandidate, double fDistance, double fLength)
 
B2DPolygon getSnippetAbsolute (const B2DPolygon &rCandidate, double fFrom, double fTo, double fLength)
 
CutFlagValue findCut (const B2DPoint &rEdge1Start, const B2DVector &rEdge1Delta, const B2DPoint &rEdge2Start, const B2DVector &rEdge2Delta, CutFlagValue aCutFlags, double *pCut1, double *pCut2)
 
bool isPointOnEdge (const B2DPoint &rPoint, const B2DPoint &rEdgeStart, const B2DVector &rEdgeDelta, double *pCut)
 
void applyLineDashing (const B2DPolygon &rCandidate, const std::vector< double > &rDotDashArray, B2DPolyPolygon *pLineTarget, B2DPolyPolygon *pGapTarget, double fDotDashLength)
 
static void implHandleSnippet (const B2DPolygon &rSnippet, const std::function< void(const basegfx::B2DPolygon &rSnippet)> &rTargetCallback, B2DPolygon &rFirst, B2DPolygon &rLast)
 
static void implHandleFirstLast (const std::function< void(const basegfx::B2DPolygon &rSnippet)> &rTargetCallback, B2DPolygon &rFirst, B2DPolygon &rLast)
 
void 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 isInEpsilonRange (const B2DPoint &rEdgeStart, const B2DPoint &rEdgeEnd, const B2DPoint &rTestPosition, double fDistance)
 
bool isInEpsilonRange (const B2DPolygon &rCandidate, const B2DPoint &rTestPosition, double fDistance)
 
static double impDistanceBezierPointToControl (double fAngle)
 
B2DPolygon createPolygonFromRect (const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
 Create a polygon from a rectangle. More...
 
B2DPolygon createPolygonFromRect (const B2DRectangle &rRect)
 Create a polygon from a rectangle. More...
 
B2DPolygon const & createUnitPolygon ()
 Create the unit polygon. More...
 
B2DPolygon createPolygonFromCircle (const B2DPoint &rCenter, double fRadius)
 Create a circle polygon with given radius. More...
 
static B2DPolygon impCreateUnitCircle (sal_uInt32 nStartQuadrant)
 
B2DPolygon const & createHalfUnitCircle ()
 create half circle centered on (0,0) from [0 .. M_PI] More...
 
B2DPolygon const & createPolygonFromUnitCircle (sal_uInt32 nStartQuadrant=0)
 create a polygon which describes the unit circle and close it More...
 
B2DPolygon createPolygonFromEllipse (const B2DPoint &rCenter, double fRadiusX, double fRadiusY, sal_uInt32 nStartQuadrant=0)
 Create an ellipse polygon with given radii. More...
 
B2DPolygon createPolygonFromUnitEllipseSegment (double fStart, double fEnd)
 
B2DPolygon 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 hasNeutralPoints (const B2DPolygon &rCandidate)
 
B2DPolygon removeNeutralPoints (const B2DPolygon &rCandidate)
 
bool isConvex (const B2DPolygon &rCandidate)
 
B2VectorOrientation getOrientationForIndex (const B2DPolygon &rCandidate, sal_uInt32 nIndex)
 
bool isPointOnLine (const B2DPoint &rStart, const B2DPoint &rEnd, const B2DPoint &rCandidate, bool bWithPoints)
 
bool isPointOnPolygon (const B2DPolygon &rCandidate, const B2DPoint &rPoint, bool bWithPoints)
 
bool isPointInTriangle (const B2DPoint &rA, const B2DPoint &rB, const B2DPoint &rC, const B2DPoint &rCandidate, bool bWithBorder)
 
bool arePointsOnSameSideOfLine (const B2DPoint &rStart, const B2DPoint &rEnd, const B2DPoint &rCandidateA, const B2DPoint &rCandidateB, bool bWithLine)
 
void addTriangleFan (const B2DPolygon &rCandidate, triangulator::B2DTriangleVector &rTarget)
 
bool isRectangle (const B2DPolygon &rPoly)
 Predicate whether a given polygon is a rectangle. More...
 
B3DPolygon createB3DPolygonFromB2DPolygon (const B2DPolygon &rCandidate, double fZCoordinate)
 
B2DPolygon createB2DPolygonFromB3DPolygon (const B3DPolygon &rCandidate, const B3DHomMatrix &rMat)
 
double getSmallestDistancePointToEdge (const B2DPoint &rPointA, const B2DPoint &rPointB, const B2DPoint &rTestPoint, double &rCut)
 
double getSmallestDistancePointToPolygon (const B2DPolygon &rCandidate, const B2DPoint &rTestPoint, sal_uInt32 &rEdgeIndex, double &rCut)
 
B2DPoint distort (const B2DPoint &rCandidate, const B2DRange &rOriginal, const B2DPoint &rTopLeft, const B2DPoint &rTopRight, const B2DPoint &rBottomLeft, const B2DPoint &rBottomRight)
 
B2DPolygon distort (const B2DPolygon &rCandidate, const B2DRange &rOriginal, const B2DPoint &rTopLeft, const B2DPoint &rTopRight, const B2DPoint &rBottomLeft, const B2DPoint &rBottomRight)
 
B2DPolygon expandToCurve (const B2DPolygon &rCandidate)
 
bool expandToCurveInPoint (B2DPolygon &rCandidate, sal_uInt32 nIndex)
 
bool setContinuityInPoint (B2DPolygon &rCandidate, sal_uInt32 nIndex, B2VectorContinuity eContinuity)
 
B2DPolygon growInNormalDirection (const B2DPolygon &rCandidate, double fValue)
 
B2DPolygon reSegmentPolygon (const B2DPolygon &rCandidate, sal_uInt32 nSegments)
 
B2DPolygon interpolate (const B2DPolygon &rOld1, const B2DPolygon &rOld2, double t)
 
B2DPolygon simplifyCurveSegments (const B2DPolygon &rCandidate)
 
B2DPolygon makeStartPoint (const B2DPolygon &rCandidate, sal_uInt32 nIndexOfNewStatPoint)
 
B2DPolygon createEdgesOfGivenLength (const B2DPolygon &rCandidate, double fLength, double fStart=0.0, double fEnd=0.0)
 create edges of given length along given B2DPolygon More...
 
B2DPolygon 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 snapPointsOfHorizontalOrVerticalEdges (const B2DPolygon &rCandidate)
 snap some polygon coordinates to discrete coordinates More...
 
B2DVector 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 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 UnoPointSequenceToB2DPolygon (const css::drawing::PointSequence &rPointSequenceSource)
 converters for css::drawing::PointSequence More...
 
void B2DPolygonToUnoPointSequence (const B2DPolygon &rPolygon, css::drawing::PointSequence &rPointSequenceRetval)
 
B2DPolygon UnoPolygonBezierCoordsToB2DPolygon (const css::drawing::PointSequence &rPointSequenceSource, const css::drawing::FlagSequence &rFlagSequenceSource)
 
void B2DPolygonToUnoPolygonBezierCoords (const B2DPolygon &rPolygon, css::drawing::PointSequence &rPointSequenceRetval, css::drawing::FlagSequence &rFlagSequenceRetval)
 
B2DPolyPolygon solveCrossovers (const B2DPolyPolygon &rCandidate, size_t *pPointLimit=nullptr)
 Solve all crossovers (aka self-intersections) in a polyPolygon. More...
 
B2DPolyPolygon solveCrossovers (const B2DPolygon &rCandidate)
 Solve all crossovers (aka self-intersections) in a Polygon. More...
 
B2DPolyPolygon stripNeutralPolygons (const B2DPolyPolygon &rCandidate)
 Strip neutral polygons from PolyPolygon. More...
 
B2DPolyPolygon createNonzeroConform (const B2DPolyPolygon &rCandidate)
 Emulate nonzero winding rule filling. More...
 
B2DPolyPolygon stripDispensablePolygons (const B2DPolyPolygon &rCandidate, bool bKeepAboveZero=false)
 Remove unnecessary/non-displayed polygons. More...
 
B2DPolyPolygon prepareForPolygonOperation (const B2DPolygon &rCandidate)
 prep for ops - solve self-intersections and intersections, remove neutral parts and check orientations. More...
 
B2DPolyPolygon prepareForPolygonOperation (const B2DPolyPolygon &rCandidate)
 prep for ops - solve self-intersections and intersections, remove neutral parts and check orientations. More...
 
B2DPolyPolygon solvePolygonOperationOr (const B2DPolyPolygon &rCandidateA, const B2DPolyPolygon &rCandidateB)
 OR: Return all areas where CandidateA or CandidateB exist. More...
 
B2DPolyPolygon solvePolygonOperationXor (const B2DPolyPolygon &rCandidateA, const B2DPolyPolygon &rCandidateB)
 XOR: Return all areas where CandidateA or CandidateB exist, but not both. More...
 
B2DPolyPolygon solvePolygonOperationAnd (const B2DPolyPolygon &rCandidateA, const B2DPolyPolygon &rCandidateB)
 AND: Return all areas where CandidateA and CandidateB exist. More...
 
B2DPolyPolygon solvePolygonOperationDiff (const B2DPolyPolygon &rCandidateA, const B2DPolyPolygon &rCandidateB)
 DIFF: Return all areas where CandidateA is not covered by CandidateB (cut B out of A) More...
 
B2DPolyPolygon mergeToSinglePolyPolygon (const B2DPolyPolygonVector &rInput)
 merge all single PolyPolygons to a single, OR-ed PolyPolygon More...
 
B2DPolyPolygon correctOrientations (const B2DPolyPolygon &rCandidate)
 
B2DPolyPolygon correctOutmostPolygon (const B2DPolyPolygon &rCandidate)
 
B2DPolyPolygon adaptiveSubdivideByDistance (const B2DPolyPolygon &rCandidate, double fDistanceBound, int nRecurseLimit)
 
B2DPolyPolygon adaptiveSubdivideByAngle (const B2DPolyPolygon &rCandidate, double fAngleBound)
 
bool isInside (const B2DPolyPolygon &rCandidate, const B2DPoint &rPoint, bool bWithBorder)
 
B2DRange getRange (const B2DPolyPolygon &rCandidate)
 Get the range of a polyPolygon. More...
 
double getSignedArea (const B2DPolyPolygon &rCandidate)
 
double getArea (const B2DPolyPolygon &rCandidate)
 
void applyLineDashing (const B2DPolyPolygon &rCandidate, const std::vector< double > &rDotDashArray, B2DPolyPolygon *pLineTarget, double fFullDashDotLen)
 
bool isInEpsilonRange (const B2DPolyPolygon &rCandidate, const B2DPoint &rTestPosition, double fDistance)
 
B3DPolyPolygon createB3DPolyPolygonFromB2DPolyPolygon (const B2DPolyPolygon &rCandidate, double fZCoordinate)
 
B2DPolyPolygon createB2DPolyPolygonFromB3DPolyPolygon (const B3DPolyPolygon &rCandidate, const B3DHomMatrix &rMat)
 
double getSmallestDistancePointToPolyPolygon (const B2DPolyPolygon &rCandidate, const B2DPoint &rTestPoint, sal_uInt32 &rPolygonIndex, sal_uInt32 &rEdgeIndex, double &rCut)
 
B2DPolyPolygon distort (const B2DPolyPolygon &rCandidate, const B2DRange &rOriginal, const B2DPoint &rTopLeft, const B2DPoint &rTopRight, const B2DPoint &rBottomLeft, const B2DPoint &rBottomRight)
 
B2DPolyPolygon expandToCurve (const B2DPolyPolygon &rCandidate)
 
B2DPolyPolygon growInNormalDirection (const B2DPolyPolygon &rCandidate, double fValue)
 
B2DPolyPolygon reSegmentPolyPolygon (const B2DPolyPolygon &rCandidate, sal_uInt32 nSegments)
 
B2DPolyPolygon interpolate (const B2DPolyPolygon &rOld1, const B2DPolyPolygon &rOld2, double t)
 
bool isRectangle (const B2DPolyPolygon &rPoly)
 Predicate whether a given poly-polygon is a rectangle. More...
 
B2DPolyPolygon simplifyCurveSegments (const B2DPolyPolygon &rCandidate)
 
B2DPolyPolygon snapPointsOfHorizontalOrVerticalEdges (const B2DPolyPolygon &rCandidate)
 snap some polygon coordinates to discrete coordinates More...
 
B2DPolyPolygon createSevenSegmentPolyPolygon (char cNumber, bool bLitSegments)
 Creates polypolygon for seven-segment display number. More...
 
B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon (const css::drawing::PointSequenceSequence &rPointSequenceSequenceSource)
 converters for css::drawing::PointSequence More...
 
void B2DPolyPolygonToUnoPointSequenceSequence (const B2DPolyPolygon &rPolyPolygon, css::drawing::PointSequenceSequence &rPointSequenceSequenceRetval)
 
B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon (const css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsSource)
 converters for css::drawing::PolyPolygonBezierCoords (curved polygons) More...
 
void B2DPolyPolygonToUnoPolyPolygonBezierCoords (const B2DPolyPolygon &rPolyPolygon, css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsRetval)
 
bool importFromSvgD (B2DPolyPolygon &o_rPolyPoly, std::u16string_view rSvgDAttribute, bool bHandleRelativeNextPointCompatible, PointIndexSet *pHelpPointIndexSet)
 Read poly-polygon from SVG. More...
 
bool importFromSvgPoints (B2DPolygon &o_rPoly, std::u16string_view rSvgPointsAttribute)
 Read poly-polygon from SVG. More...
 
OUString exportToSvgPoints (const B2DPolygon &rPoly)
 Write poly-polygon to SVG. More...
 
OUString exportToSvgD (const B2DPolyPolygon &rPolyPoly, bool bUseRelativeCoordinates, bool bDetectQuadraticBeziers, bool bHandleRelativeNextPointCompatible, bool bOOXMLMotionPath=false)
 Export poly-polygon to SVG. More...
 
void trapezoidSubdivide (B2DTrapezoidVector &ro_Result, const B2DPolyPolygon &rSourcePolyPolygon)
 
void createLineTrapezoidFromEdge (B2DTrapezoidVector &ro_Result, const B2DPoint &rPointA, const B2DPoint &rPointB, double fLineWidth)
 
void createLineTrapezoidFromB2DPolygon (B2DTrapezoidVector &ro_Result, const B2DPolygon &rPolygon, double fLineWidth)
 
void checkClosed (B3DPolygon &rCandidate)
 Check if given polygon is closed. More...
 
sal_uInt32 getIndexOfSuccessor (sal_uInt32 nIndex, const B3DPolygon &rCandidate)
 
B3DRange getRange (const B3DPolygon &rCandidate)
 
double getLength (const B3DPolygon &rCandidate)
 
void applyLineDashing (const B3DPolygon &rCandidate, const std::vector< double > &rDotDashArray, B3DPolyPolygon *pLineTarget, double fDotDashLength)
 
static void implHandleSnippet (const B3DPolygon &rSnippet, const std::function< void(const basegfx::B3DPolygon &rSnippet)> &rTargetCallback, B3DPolygon &rFirst, B3DPolygon &rLast)
 
static void implHandleFirstLast (const std::function< void(const basegfx::B3DPolygon &rSnippet)> &rTargetCallback, B3DPolygon &rFirst, B3DPolygon &rLast)
 
void applyLineDashing (const B3DPolygon &rCandidate, const std::vector< double > &rDotDashArray, std::function< void(const basegfx::B3DPolygon &rSnippet)> aLineTargetCallback, double fDotDashLength=0.0)
 Apply given LineDashing to given polygon. More...
 
B3DPolygon applyDefaultNormalsSphere (const B3DPolygon &rCandidate, const B3DPoint &rCenter)
 Create/replace normals for given 3d geometry with default normals from given center to outside. More...
 
B3DPolygon invertNormals (const B3DPolygon &rCandidate)
 invert normals for given 3d geometry. More...
 
B3DPolygon applyDefaultTextureCoordinatesParallel (const B3DPolygon &rCandidate, const B3DRange &rRange, bool bChangeX, bool bChangeY)
 Create/replace texture coordinates for given 3d geometry with parallel projected one rRange: the full range of the 3d geometry If bChangeX, x texture coordinate will be recalculated. More...
 
B3DPolygon applyDefaultTextureCoordinatesSphere (const B3DPolygon &rCandidate, const B3DPoint &rCenter, bool bChangeX, bool bChangeY)
 Create/replace texture coordinates for given 3d geometry with spherical one rCenter: the centre of the used 3d geometry If bChangeX, x texture coordinate will be recalculated. More...
 
bool isInside (const B3DPolygon &rCandidate, const B3DPoint &rPoint, bool bWithBorder)
 
bool isPointOnLine (const B3DPoint &rStart, const B3DPoint &rEnd, const B3DPoint &rCandidate, bool bWithPoints)
 
bool isPointOnPolygon (const B3DPolygon &rCandidate, const B3DPoint &rPoint)
 
bool getCutBetweenLineAndPlane (const B3DVector &rPlaneNormal, const B3DPoint &rPlanePoint, const B3DPoint &rEdgeStart, const B3DPoint &rEdgeEnd, double &fCut)
 
B3DPolygon snapPointsOfHorizontalOrVerticalEdges (const B3DPolygon &rCandidate)
 snap some polygon coordinates to discrete coordinates More...
 
B3DRange getRange (const B3DPolyPolygon &rCandidate)
 
B3DPolyPolygon const & createUnitCubePolyPolygon ()
 Create a unit 3D line polyPolygon which defines a cube. More...
 
B3DPolyPolygon const & createUnitCubeFillPolyPolygon ()
 Create a unit 3D fill polyPolygon which defines a cube. More...
 
B3DPolyPolygon createCubePolyPolygonFromB3DRange (const B3DRange &rRange)
 Create a 3D line polyPolygon from a B3DRange which defines a cube. More...
 
B3DPolyPolygon createCubeFillPolyPolygonFromB3DRange (const B3DRange &rRange)
 Create a 3D fill polyPolygon from a B3DRange which defines a cube. More...
 
static B3DPoint getPointFromCartesian (double fHor, double fVer)
 
B3DPolyPolygon createUnitSpherePolyPolygon (sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, double fVerStart=M_PI_2, double fVerStop=-M_PI_2, double fHorStart=0.0, double fHorStop=2 *M_PI)
 Create a unit 3D line polyPolygon which defines a sphere with the given count of hor and ver segments. More...
 
B3DPolyPolygon createSpherePolyPolygonFromB3DRange (const B3DRange &rRange, sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, double fVerStart=M_PI_2, double fVerStop=-M_PI_2, double fHorStart=0.0, double fHorStop=2 *M_PI)
 Create a 3D line polyPolygon from a B3DRange which defines a sphere with the given count of hor and ver segments. More...
 
B3DPolyPolygon createUnitSphereFillPolyPolygon (sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, bool bNormals=false, double fVerStart=M_PI_2, double fVerStop=-M_PI_2, double fHorStart=0.0, double fHorStop=2 *M_PI)
 same as createUnitSpherePolyPolygon, but creates filled polygons (closed and oriented) There is one extra, the bool bNormals defines if normals will be set, default is false More...
 
B3DPolyPolygon createSphereFillPolyPolygonFromB3DRange (const B3DRange &rRange, sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, bool bNormals=false, double fVerStart=M_PI_2, double fVerStop=-M_PI_2, double fHorStart=0.0, double fHorStop=2 *M_PI)
 same as createSpherePolyPolygonFromB3DRange, but creates filled polygons (closed and oriented) There is one extra, the bool bNormals defines if normals will be set, default is false More...
 
B3DPolyPolygon applyDefaultNormalsSphere (const B3DPolyPolygon &rCandidate, const B3DPoint &rCenter)
 Create/replace normals for given 3d geometry with default normals from given center to outside. More...
 
B3DPolyPolygon invertNormals (const B3DPolyPolygon &rCandidate)
 invert normals for given 3d geometry. More...
 
B3DPolyPolygon applyDefaultTextureCoordinatesParallel (const B3DPolyPolygon &rCandidate, const B3DRange &rRange, bool bChangeX=true, bool bChangeY=true)
 Create/replace texture coordinates for given 3d geometry with parallel projected one rRange: the full range of the 3d geometry If bChangeX, x texture coordinate will be recalculated. More...
 
B3DPolyPolygon applyDefaultTextureCoordinatesSphere (const B3DPolyPolygon &rCandidate, const B3DPoint &rCenter, bool bChangeX=true, bool bChangeY=true)
 Create/replace texture coordinates for given 3d geometry with spherical one rCenter: the centre of the used 3d geometry If bChangeX, x texture coordinate will be recalculated. More...
 
bool isInside (const B3DPolyPolygon &rCandidate, const B3DPoint &rPoint)
 
B3DPolyPolygon UnoPolyPolygonShape3DToB3DPolyPolygon (const css::drawing::PolyPolygonShape3D &rPolyPolygonShape3DSource)
 converters for css::drawing::PolyPolygonShape3D More...
 
void B3DPolyPolygonToUnoPolyPolygonShape3D (const B3DPolyPolygon &rPolyPolygonSource, css::drawing::PolyPolygonShape3D &rPolyPolygonShape3DRetval)
 
B2DPolyPolygon solveCrossovers (const std::vector< B2DRange > &rRanges, const std::vector< B2VectorOrientation > &rOrientations)
 Extract poly-polygon w/o self-intersections from poly-range. More...
 
void prepareColorStops (const basegfx::BGradient &rGradient, BColorStops &rColorStops, BColor &rSingleColor)
 
void synchronizeColorStops (BColorStops &rColorStops, BColorStops &rAlphaStops, const BColor &rSingleColor, const BColor &rSingleAlpha)
 
sal_uInt32 calculateNumberOfSteps (sal_uInt32 nRequestedSteps, const BColor &rStart, const BColor &rEnd)
 
ODFGradientInfo createLinearODFGradientInfo (const B2DRange &rTargetArea, sal_uInt32 nRequestedSteps, double fBorder, double fAngle)
 Create matrix for ODF's linear gradient definition. More...
 
ODFGradientInfo createAxialODFGradientInfo (const B2DRange &rTargetArea, sal_uInt32 nRequestedSteps, double fBorder, double fAngle)
 Create matrix for ODF's axial gradient definition. More...
 
ODFGradientInfo createRadialODFGradientInfo (const B2DRange &rTargetArea, const B2DVector &rOffset, sal_uInt32 nRequestedSteps, double fBorder)
 Create matrix for ODF's radial gradient definition. More...
 
ODFGradientInfo createEllipticalODFGradientInfo (const B2DRange &rTargetArea, const B2DVector &rOffset, sal_uInt32 nRequestedSteps, double fBorder, double fAngle)
 Create matrix for ODF's elliptical gradient definition. More...
 
ODFGradientInfo createSquareODFGradientInfo (const B2DRange &rTargetArea, const B2DVector &rOffset, sal_uInt32 nRequestedSteps, double fBorder, double fAngle)
 Create matrix for ODF's square gradient definition. More...
 
ODFGradientInfo createRectangularODFGradientInfo (const B2DRange &rTargetArea, const B2DVector &rOffset, sal_uInt32 nRequestedSteps, double fBorder, double fAngle)
 Create matrix for ODF's rectangular gradient definition. More...
 
double getLinearGradientAlpha (const B2DPoint &rUV, const ODFGradientInfo &rGradInfo)
 Calculate linear gradient blend value. More...
 
double getAxialGradientAlpha (const B2DPoint &rUV, const ODFGradientInfo &rGradInfo)
 Calculate axial gradient blend value. More...
 
double getRadialGradientAlpha (const B2DPoint &rUV, const ODFGradientInfo &rGradInfo)
 Calculate radial gradient blend value. More...
 
double getEllipticalGradientAlpha (const B2DPoint &rUV, const ODFGradientInfo &rGradInfo)
 Calculate elliptical gradient blend value. More...
 
double getSquareGradientAlpha (const B2DPoint &rUV, const ODFGradientInfo &rGradInfo)
 Calculate square gradient blend value. More...
 
double getRectangularGradientAlpha (const B2DPoint &rUV, const ODFGradientInfo &rGradInfo)
 Calculate rectangular gradient blend value. More...
 
B2DPolyPolygon number2PolyPolygon (double fVal, sal_Int32 nTotalDigits, sal_Int32 nDecPlaces, bool bLitSegments=true)
 Creates polypolygon with the given number as seven-segment digits. More...
 
void infiniteLineFromParallelogram (::basegfx::B2DPoint &io_rLeftTop, ::basegfx::B2DPoint &io_rLeftBottom, ::basegfx::B2DPoint &io_rRightTop, ::basegfx::B2DPoint &io_rRightBottom, const ::basegfx::B2DRange &rFitTarget)
 Expand given parallelogram, such that it extends beyond bound rect in a given direction. More...
 
B2DHomMatrix createScaleB2DHomMatrix (const B2DTuple &rScale)
 inline versions for parameters as tuples More...
 
B2DHomMatrix createTranslateB2DHomMatrix (const B2DTuple &rTranslate)
 
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix (const B2DTuple &rScale, double fShearX, double fRadiant, const B2DTuple &rTranslate)
 
B2DHomMatrix createShearXRotateTranslateB2DHomMatrix (double fShearX, double fRadiant, const B2DTuple &rTranslate)
 
B2DHomMatrix createScaleTranslateB2DHomMatrix (const B2DTuple &rScale, const B2DTuple &rTranslate)
 
B2DHomMatrix createRotateAroundPoint (const B2DTuple &rPoint, double fRadiant)
 
BASEGFX_DLLPUBLIC void applyLineDashing (const B2DPolygon &rCandidate, const ::std::vector< double > &rDotDashArray, B2DPolyPolygon *pLineTarget, B2DPolyPolygon *pGapTarget=nullptr, double fDotDashLength=0.0)
 
BASEGFX_DLLPUBLIC void applyLineDashing (const B2DPolyPolygon &rCandidate, const ::std::vector< double > &rDotDashArray, B2DPolyPolygon *pLineTarget, double fFullDashDotLen=0.0)
 Apply given LineDashing to given polyPolygon. More...
 
BASEGFX_DLLPUBLIC void applyLineDashing (const B3DPolygon &rCandidate, const ::std::vector< double > &rDotDashArray, B3DPolyPolygon *pLineTarget, double fDotDashLength=0.0)
 
template<typename ValueType >
ValueType lerp (const ValueType &rFrom, const ValueType &rTo, double t)
 Generic linear interpolator. More...
 
template<class Point , class Rect >
sal_uInt32 getCohenSutherlandClipFlags (const Point &rP, const Rect &rR)
 Calc clip mask for Cohen-Sutherland rectangle clip. More...
 
template<class Point >
sal_uInt32 getCohenSutherlandClipFlags (const Point &rP, const B2IBox &rB)
 Cohen-Sutherland mask calculation - overload for boxes. More...
 

Typedef Documentation

◆ PointIndexSet

the PointIndexSet itself; it allows to define a 'selection'of points in a tools::PolyPolygon by giving the polygon and point index.

Adding points double makes no sense, hence the std::set

Definition at line 120 of file b2dpolypolygontools.hxx.

Function Documentation

◆ adaptiveSubdivideByAngle() [1/2]

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::adaptiveSubdivideByAngle ( const B2DPolygon rCandidate,
double  fAngleBound 
)

◆ adaptiveSubdivideByAngle() [2/2]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::adaptiveSubdivideByAngle ( const B2DPolyPolygon rCandidate,
double  fAngleBound 
)

◆ adaptiveSubdivideByDistance() [1/2]

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::adaptiveSubdivideByDistance ( const B2DPolygon rCandidate,
double  fDistanceBound,
int  nRecurseLimit 
)

◆ adaptiveSubdivideByDistance() [2/2]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::adaptiveSubdivideByDistance ( const B2DPolyPolygon rCandidate,
double  fDistanceBound,
int  nRecurseLimit 
)

◆ addPointsAtCuts() [1/2]

B2DPolygon basegfx::utils::addPointsAtCuts ( const B2DPolygon rCandidate,
const B2DPoint rStart,
const B2DPoint rEnd 
)

◆ addPointsAtCuts() [2/2]

B2DPolygon basegfx::utils::addPointsAtCuts ( const B2DPolygon rCandidate,
const B2DPolyPolygon rPolyMask 
)

◆ addPointsAtCutsAndTouches() [1/2]

B2DPolygon basegfx::utils::addPointsAtCutsAndTouches ( const B2DPolygon rCandidate,
size_t *  pPointLimit 
)

Definition at line 854 of file b2dpolygoncutandtouch.cxx.

References basegfx::B2DPolygon::count(), and SAL_WARN.

Referenced by addPointsAtCutsAndTouches().

◆ addPointsAtCutsAndTouches() [2/2]

B2DPolyPolygon basegfx::utils::addPointsAtCutsAndTouches ( const B2DPolyPolygon rCandidate,
size_t *  pPointLimit 
)

◆ addTriangleFan()

void basegfx::utils::addTriangleFan ( const B2DPolygon rCandidate,
triangulator::B2DTriangleVector rTarget 
)

◆ applyDefaultNormalsSphere() [1/2]

B3DPolygon basegfx::utils::applyDefaultNormalsSphere ( const B3DPolygon rCandidate,
const B3DPoint rCenter 
)

Create/replace normals for given 3d geometry with default normals from given center to outside.

rCandidate: the 3d geometry to change rCenter: the center of the 3d geometry

Definition at line 307 of file b3dpolygontools.cxx.

References a, basegfx::B3DPolygon::count(), basegfx::B3DPolygon::getB3DPoint(), basegfx::B3DVector::normalize(), and basegfx::B3DPolygon::setNormal().

Referenced by applyDefaultNormalsSphere().

◆ applyDefaultNormalsSphere() [2/2]

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::applyDefaultNormalsSphere ( const B3DPolyPolygon rCandidate,
const B3DPoint rCenter 
)

Create/replace normals for given 3d geometry with default normals from given center to outside.

rCandidate: the 3d geometry to change rCenter: the center of the 3d geometry

Definition at line 386 of file b3dpolypolygontools.cxx.

References basegfx::B3DPolyPolygon::append(), and applyDefaultNormalsSphere().

◆ applyDefaultTextureCoordinatesParallel() [1/2]

B3DPolygon basegfx::utils::applyDefaultTextureCoordinatesParallel ( const B3DPolygon rCandidate,
const B3DRange rRange,
bool  bChangeX,
bool  bChangeY 
)

Create/replace texture coordinates for given 3d geometry with parallel projected one rRange: the full range of the 3d geometry If bChangeX, x texture coordinate will be recalculated.

If bChangeY, y texture coordinate will be recalculated.

Definition at line 336 of file b3dpolygontools.cxx.

References a, basegfx::B3DPolygon::count(), basegfx::fTools::equalZero(), basegfx::B3DPolygon::getB3DPoint(), basegfx::B3DRange::getHeight(), basegfx::B3DRange::getMinX(), basegfx::B3DRange::getMinY(), basegfx::B3DPolygon::getTextureCoordinate(), basegfx::B3DRange::getWidth(), basegfx::Tuple3D< TYPE >::getX(), basegfx::Tuple3D< TYPE >::getY(), basegfx::B3DPolygon::setTextureCoordinate(), basegfx::Tuple2D< TYPE >::setX(), and basegfx::Tuple2D< TYPE >::setY().

Referenced by applyDefaultTextureCoordinatesParallel().

◆ applyDefaultTextureCoordinatesParallel() [2/2]

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::applyDefaultTextureCoordinatesParallel ( const B3DPolyPolygon rCandidate,
const B3DRange rRange,
bool  bChangeX = true,
bool  bChangeY = true 
)

Create/replace texture coordinates for given 3d geometry with parallel projected one rRange: the full range of the 3d geometry If bChangeX, x texture coordinate will be recalculated.

If bChangeY, y texture coordinate will be recalculated.

Definition at line 410 of file b3dpolypolygontools.cxx.

References basegfx::B3DPolyPolygon::append(), and applyDefaultTextureCoordinatesParallel().

◆ applyDefaultTextureCoordinatesSphere() [1/2]

B3DPolygon basegfx::utils::applyDefaultTextureCoordinatesSphere ( const B3DPolygon rCandidate,
const B3DPoint rCenter,
bool  bChangeX,
bool  bChangeY 
)

◆ applyDefaultTextureCoordinatesSphere() [2/2]

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::applyDefaultTextureCoordinatesSphere ( const B3DPolyPolygon rCandidate,
const B3DPoint rCenter,
bool  bChangeX = true,
bool  bChangeY = true 
)

Create/replace texture coordinates for given 3d geometry with spherical one rCenter: the centre of the used 3d geometry If bChangeX, x texture coordinate will be recalculated.

If bChangeY, y texture coordinate will be recalculated.

Definition at line 422 of file b3dpolypolygontools.cxx.

References basegfx::B3DPolyPolygon::append(), and applyDefaultTextureCoordinatesSphere().

◆ applyLineDashing() [1/8]

BASEGFX_DLLPUBLIC void basegfx::utils::applyLineDashing ( const B2DPolygon rCandidate,
const ::std::vector< double > &  rDotDashArray,
B2DPolyPolygon pLineTarget,
B2DPolyPolygon pGapTarget = nullptr,
double  fDotDashLength = 0.0 
)

◆ applyLineDashing() [2/8]

void basegfx::utils::applyLineDashing ( const B2DPolygon rCandidate,
const std::vector< double > &  rDotDashArray,
B2DPolyPolygon pLineTarget,
B2DPolyPolygon pGapTarget,
double  fDotDashLength 
)

◆ applyLineDashing() [3/8]

BASEGFX_DLLPUBLIC 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.

This method is used to cut down line polygons to the needed pieces when a dashing needs to be applied. It is now capable of keeping contained bezier segments. It is also capable of delivering line and non-line portions depending on what target polygons You provide. This is useful e.g. for dashed lines with two colors. If the last and the first snippet in one of the results have a common start/end ppoint, they will be merged to achieve as view as needed result line snippets. This is also relevant for further processing the results.

Parameters
rCandidateThe polygon based on which the snippets will be created.
rDotDashArrayThe line pattern given as array of length values
pLineTargetThe target for line snippets, e.g. the first entry will be a line segment with length rDotDashArray[0]. The given polygon will be emptied as preparation.
pGapTargetThe target for gap snippets, e.g. the first entry will be a line segment with length rDotDashArray[1]. The given polygon will be emptied as preparation.
fFullDashDotLenThe summed-up length of the rDotDashArray. If zero, it will be calculated internally.

There is now a 2nd version that allows to provide callback functions that get called when a snippet of a line/gap is produced and needs to be added. This allows to use it like a 'pipeline'. When using this (e.g. the 1st version uses this internally to guarantee the same algorithm is used) it is not needed to accumulate a potentially huge number of polygons in the result-polyPolygons, but e.g. consume them directly in the caller. Example is rendering a dashed line but without creating the potentially huge amount of polygons. The 2nd version will also merge first/last line/gap snippets if the input polygon is closed and the start/end-points match accordingly - at the cost that this will be delivered last.

Definition at line 1204 of file b2dpolygontools.cxx.

References a, basegfx::B2DPolygon::append(), basegfx::B2DPolygon::appendBezierSegment(), basegfx::B2DPolygon::clear(), basegfx::B2DPolygon::count(), basegfx::B2DCubicBezierHelper::distanceToRelative(), basegfx::fTools::equalZero(), basegfx::B2DPolygon::getB2DPoint(), basegfx::B2DCubicBezier::getControlPointA(), basegfx::B2DCubicBezier::getControlPointB(), basegfx::B2DCubicBezier::getEdgeLength(), basegfx::B2DCubicBezier::getEndPoint(), basegfx::B2DCubicBezierHelper::getLength(), getLength(), basegfx::B2DPolygon::getNextControlPoint(), basegfx::B2DPolygon::getPrevControlPoint(), basegfx::B2DCubicBezier::getStartPoint(), implHandleFirstLast(), implHandleSnippet(), interpolate(), basegfx::B2DCubicBezier::isBezier(), basegfx::B2DPolygon::isClosed(), basegfx::fTools::less(), basegfx::fTools::lessOrEqual(), basegfx::B2DCubicBezier::setControlPointA(), basegfx::B2DCubicBezier::setControlPointB(), basegfx::B2DCubicBezier::setEndPoint(), basegfx::B2DCubicBezier::setStartPoint(), basegfx::B2DCubicBezier::snippet(), basegfx::B2DCubicBezier::split(), and basegfx::B2DCubicBezier::testAndSolveTrivialBezier().

◆ applyLineDashing() [4/8]

BASEGFX_DLLPUBLIC void basegfx::utils::applyLineDashing ( const B2DPolyPolygon rCandidate,
const ::std::vector< double > &  rDotDashArray,
B2DPolyPolygon pLineTarget,
double  fFullDashDotLen = 0.0 
)

Apply given LineDashing to given polyPolygon.

For a description see applyLineDashing in b2dpolygontoos.hxx

◆ applyLineDashing() [5/8]

void basegfx::utils::applyLineDashing ( const B2DPolyPolygon rCandidate,
const std::vector< double > &  rDotDashArray,
B2DPolyPolygon pLineTarget,
double  fFullDashDotLen 
)

◆ applyLineDashing() [6/8]

BASEGFX_DLLPUBLIC void basegfx::utils::applyLineDashing ( const B3DPolygon rCandidate,
const ::std::vector< double > &  rDotDashArray,
B3DPolyPolygon pLineTarget,
double  fDotDashLength = 0.0 
)

◆ applyLineDashing() [7/8]

void basegfx::utils::applyLineDashing ( const B3DPolygon rCandidate,
const std::vector< double > &  rDotDashArray,
B3DPolyPolygon pLineTarget,
double  fDotDashLength 
)

◆ applyLineDashing() [8/8]

void basegfx::utils::applyLineDashing ( const B3DPolygon rCandidate,
const std::vector< double > &  rDotDashArray,
std::function< void(const basegfx::B3DPolygon &rSnippet)>  aLineTargetCallback,
double  fDotDashLength = 0.0 
)

Apply given LineDashing to given polygon.

For a description see applyLineDashing in b2dpolygontoos.hxx Also 2nd version with callbacks, see comments in 2D version

Definition at line 173 of file b3dpolygontools.cxx.

References a, basegfx::B3DPolygon::append(), basegfx::B3DPolygon::clear(), basegfx::B3DPolygon::count(), basegfx::fTools::equalZero(), basegfx::B3DPolygon::getB3DPoint(), getLength(), implHandleFirstLast(), implHandleSnippet(), interpolate(), basegfx::B3DPolygon::isClosed(), basegfx::fTools::less(), and basegfx::fTools::lessOrEqual().

◆ arePointsOnSameSideOfLine()

bool basegfx::utils::arePointsOnSameSideOfLine ( const B2DPoint rStart,
const B2DPoint rEnd,
const B2DPoint rCandidateA,
const B2DPoint rCandidateB,
bool  bWithLine 
)

Definition at line 2146 of file b2dpolygontools.cxx.

References basegfx::B2DVector::cross().

Referenced by isPointInTriangle().

◆ B2DPolygonToUnoPointSequence()

BASEGFX_DLLPUBLIC void basegfx::utils::B2DPolygonToUnoPointSequence ( const B2DPolygon rPolygon,
css::drawing::PointSequence &  rPointSequenceRetval 
)

◆ B2DPolygonToUnoPolygonBezierCoords()

void basegfx::utils::B2DPolygonToUnoPolygonBezierCoords ( const B2DPolygon rPolygon,
css::drawing::PointSequence &  rPointSequenceRetval,
css::drawing::FlagSequence &  rFlagSequenceRetval 
)

◆ B2DPolyPolygonToUnoPointSequenceSequence()

BASEGFX_DLLPUBLIC void basegfx::utils::B2DPolyPolygonToUnoPointSequenceSequence ( const B2DPolyPolygon rPolyPolygon,
css::drawing::PointSequenceSequence &  rPointSequenceSequenceRetval 
)

◆ B2DPolyPolygonToUnoPolyPolygonBezierCoords()

BASEGFX_DLLPUBLIC void basegfx::utils::B2DPolyPolygonToUnoPolyPolygonBezierCoords ( const B2DPolyPolygon rPolyPolygon,
css::drawing::PolyPolygonBezierCoords &  rPolyPolygonBezierCoordsRetval 
)

◆ B3DHomMatrixToUnoHomogenMatrix()

BASEGFX_DLLPUBLIC void basegfx::utils::B3DHomMatrixToUnoHomogenMatrix ( const B3DHomMatrix rMatrixIn,
com::sun::star::drawing::HomogenMatrix &  rMatrixOut 
)

Definition at line 49 of file b3dhommatrixtools.cxx.

References basegfx::B3DHomMatrix::get().

◆ B3DPolyPolygonToUnoPolyPolygonShape3D()

BASEGFX_DLLPUBLIC void basegfx::utils::B3DPolyPolygonToUnoPolyPolygonShape3D ( const B3DPolyPolygon rPolyPolygonSource,
css::drawing::PolyPolygonShape3D &  rPolyPolygonShape3DRetval 
)

◆ calculateNumberOfSteps()

BASEGFX_DLLPUBLIC sal_uInt32 basegfx::utils::calculateNumberOfSteps ( sal_uInt32  nRequestedSteps,
const BColor rStart,
const BColor rEnd 
)

◆ checkClosed() [1/2]

BASEGFX_DLLPUBLIC void basegfx::utils::checkClosed ( B2DPolygon rCandidate)

Check if given polygon is closed.

This is kind of a 'classic' method to support old polygon definitions. Those old polygon definitions define the closed state of the polygon using identical start and endpoints. This method corrects this (removes double start/end points) and sets the Closed()-state of the polygon correctly.

Definition at line 81 of file b2dpolygontools.cxx.

References closeWithGeometryChange(), basegfx::B2DPolygon::count(), and basegfx::B2DPolygon::getB2DPoint().

Referenced by UnoPointSequenceToB2DPolygon(), UnoPolygonBezierCoordsToB2DPolygon(), and UnoPolyPolygonShape3DToB3DPolyPolygon().

◆ checkClosed() [2/2]

BASEGFX_DLLPUBLIC void basegfx::utils::checkClosed ( B3DPolygon rCandidate)

Check if given polygon is closed.

This is kind of a 'classic' method to support old polygon definitions. Those old polygon definitions define the closed state of the polygon using identical start and endpoints. This method corrects this (removes double start/end points) and sets the Closed()-state of the polygon correctly.

Definition at line 34 of file b3dpolygontools.cxx.

References basegfx::B3DPolygon::count(), basegfx::B3DTuple::equal(), basegfx::B3DPolygon::getB3DPoint(), basegfx::B3DPolygon::remove(), and basegfx::B3DPolygon::setClosed().

◆ clipPolygonOnParallelAxis()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::clipPolygonOnParallelAxis ( const B2DPolygon rCandidate,
bool  bParallelToXAxis,
bool  bAboveAxis,
double  fValueOnOtherAxis,
bool  bStroke 
)

◆ clipPolygonOnPolyPolygon()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::clipPolygonOnPolyPolygon ( const B2DPolygon rCandidate,
const B2DPolyPolygon rClip,
bool  bInside,
bool  bStroke 
)

◆ clipPolygonOnRange()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::clipPolygonOnRange ( const B2DPolygon rCandidate,
const B2DRange rRange,
bool  bInside,
bool  bStroke 
)

◆ clipPolyPolygonOnParallelAxis()

B2DPolyPolygon basegfx::utils::clipPolyPolygonOnParallelAxis ( const B2DPolyPolygon rCandidate,
bool  bParallelToXAxis,
bool  bAboveAxis,
double  fValueOnOtherAxis,
bool  bStroke 
)

◆ clipPolyPolygonOnPolyPolygon()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::clipPolyPolygonOnPolyPolygon ( const B2DPolyPolygon rCandidate,
const B2DPolyPolygon rClip,
bool  bInside,
bool  bStroke,
size_t *  pPointLimit 
)

◆ clipPolyPolygonOnRange()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::clipPolyPolygonOnRange ( const B2DPolyPolygon rCandidate,
const B2DRange rRange,
bool  bInside,
bool  bStroke 
)

◆ clipTriangleListOnRange()

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::clipTriangleListOnRange ( const B2DPolygon rCandidate,
const B2DRange rRange 
)

◆ closeWithGeometryChange()

BASEGFX_DLLPUBLIC void basegfx::utils::closeWithGeometryChange ( B2DPolygon rCandidate)

◆ correctOrientations()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::correctOrientations ( const B2DPolyPolygon rCandidate)

◆ correctOutmostPolygon()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::correctOutmostPolygon ( const B2DPolyPolygon rCandidate)

◆ createAreaGeometry()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::createAreaGeometry ( const B2DPolygon rCandidate,
double  fHalfLineWidth,
B2DLineJoin  eJoin,
css::drawing::LineCap  eCap,
double  fMaxAllowedAngle = basegfx::deg2rad(12.5),
double  fMaxPartOfEdge = 0.4,
double  fMiterMinimumAngle = basegfx::deg2rad(15.0) 
)

create filled polygon geometry for lines with a line width

This method will create bezier based, fillable polygons which will resample the curve if it was extended for the given half line width. It will remove extrema positions from contained bezier segments and get as close as possible and defined by the given parameters to the ideal result.

It will check edges for trivial bezier to avoid unnecessary bezier polygons. Care is taken to produce the in-between polygon points (the ones original on the source polygon) since it has showed that without those, the raster converters leave non-filled gaps.

Parameters
rCandidateThe source polygon defining the hairline polygon path
fHalfLineWidthThe width of the line to one side
eJoinThe LineJoin if the edges meeting in a point do not have a C1 or C2 continuity
eCapThe kind of cap, which is added to the line.
fMaxAllowedAngleAllows to hand over the maximum allowed angle between an edge and it's control vectors. The smaller, the more subdivisions will be needed to create the filled geometry. Allowed range is cropped to [M_PI_2 .. 0.01 * M_PI_2].
fMaxPartOfEdgeAllows to influence from with relative length of a control vector compared to its edge a split is forced. The smaller, the more subdivisions will be needed to create the filled geometry. Allowed range is cropped to [1.0 .. 0.01]
fMiterMinimumAngleThe minimum wanted angle between two edges when edge rounding is using miter. When an edge is smaller than this (tighter) the usual fallback to bevel is used. Allowed range is cropped to [M_PI .. 0.01 * M_PI].

Commit 51b5b93092d6231615de470c62494c24e54828a1 needs revert, we need the triangulation for X11 fat line drawing

Parameters
pTrianglesIf given, the method will additionally add the created geometry as B2DTriangle's
Returns
The tools::PolyPolygon containing the geometry of the extended line by it's line width. Contains bezier segments and edge roundings as needed and defined.

Definition at line 844 of file b2dlinegeometry.cxx.

References a, basegfx::B2DVector::angle(), basegfx::B2DPolyPolygon::append(), basegfx::B2DPolygon::count(), createPolygonFromCircle(), basegfx::fTools::equal(), basegfx::Tuple2D< TYPE >::equalZero(), basegfx::B2DPolygon::getB2DPoint(), basegfx::B2DCubicBezier::getEndPoint(), basegfx::B2DPolygon::getNextControlPoint(), getOrientation(), basegfx::getPerpendicular(), basegfx::B2DPolygon::getPrevControlPoint(), basegfx::B2DCubicBezier::getStartPoint(), basegfx::B2DCubicBezier::getTangent(), basegfx::B2DPolygon::isClosed(), basegfx::Negative, basegfx::Neutral, basegfx::NONE, basegfx::B2DVector::normalize(), basegfx::Positive, basegfx::B2DPolygon::removeDoublePoints(), basegfx::B2DCubicBezier::setControlPointA(), basegfx::B2DCubicBezier::setControlPointB(), basegfx::B2DCubicBezier::setEndPoint(), and basegfx::B2DCubicBezier::setStartPoint().

◆ createAreaGeometryForLineStartEnd()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::createAreaGeometryForLineStartEnd ( const B2DPolygon rCandidate,
const B2DPolyPolygon rArrow,
bool  bStart,
double  fWidth,
double  fCandidateLength,
double  fDockingPosition,
double *  pConsumedLength = nullptr,
double  fShift = 0.0 
)

Create line start/end geometry element, mostly arrows and things like that.

Parameters
rCandidateThe polygon which needs to get that line ends and needs to have two points at least.
rArrowThe line start/end geometry. It is assumed that the tip is pointing upwards. Result will be rotated and scaled to fit.
bStartdescribes if creation is for start or end of candidate.
fWidthdefines the size of the element, it's describing the target width in X of the arrow.
fDockingPositionneeds to be in [0.0 ..1.0] range, where 0.0 means that the tip of the arrow will be aligned with the polygon start, 1.0 means the bottom. The default of 0.5 describes a centered arrow.
pConsumedLengthUsing this parameter it is possible to get back how much from the candidate geometry is overlapped by the created element (consumed).
fCandidateLengthThis should contain the length of rCandidate to allow work without again calculating the length (which may be expensive with beziers). If 0.0 is given, the length is calculated on demand.
fShiftWhen it is necessary to count with the thickness of the line, it makes sense to move the start position slightly - so define the shift.
Returns
The Line start and end polygon, correctly rotated and scaled

Definition at line 37 of file b2dlinegeometry.cxx.

References basegfx::B2DPolyPolygon::append(), basegfx::B2DPolygon::count(), basegfx::B2DPolyPolygon::count(), createTranslateB2DHomMatrix(), basegfx::fTools::equalZero(), basegfx::B2DPolygon::getB2DPoint(), basegfx::B2DRange::getCenter(), getLength(), basegfx::B2DRange::getMaximum(), basegfx::B2DRange::getMinimum(), getPositionAbsolute(), getRange(), basegfx::Range2D< TYPE, TRAITS >::getWidth(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), basegfx::B2DHomMatrix::rotate(), basegfx::B2DHomMatrix::scale(), basegfx::B2DPolyPolygon::setClosed(), basegfx::B2DPolyPolygon::transform(), and basegfx::B2DHomMatrix::translate().

◆ createAxialODFGradientInfo()

BASEGFX_DLLPUBLIC ODFGradientInfo basegfx::utils::createAxialODFGradientInfo ( const B2DRange rTargetArea,
sal_uInt32  nRequestedSteps,
double  fBorder,
double  fAngle 
)

Create matrix for ODF's axial gradient definition.

Note that odf axial gradients are varying in y direction. Note further that you can map the axial gradient to a linear gradient (in case you want or need to avoid an extra gradient renderer), by using createLinearODFGradientInfo() instead, shifting the resulting texture transformation by 0.5 to the top and appending the same stop colors again, but mirrored.

Parameters
o_rGradientInfoReceives the calculated texture transformation matrix (for use with standard [0,1]x[0,1] texture coordinates)
rTargetAreaOutput area, needed for aspect ratio calculations and texture transformation
nRequestedStepsNumber of gradient steps (from ODF)
fBorderWidth of gradient border (from ODF)
fAngleGradient angle (from ODF)

Definition at line 509 of file gradienttools.cxx.

References basegfx::init1DGradientInfo().

◆ createB2DPolygonFromB3DPolygon()

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::createB2DPolygonFromB3DPolygon ( const B3DPolygon rCandidate,
const B3DHomMatrix rMat 
)

◆ createB2DPolyPolygonFromB3DPolyPolygon()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::createB2DPolyPolygonFromB3DPolyPolygon ( const B3DPolyPolygon rCandidate,
const B3DHomMatrix rMat 
)

◆ createB3DPolygonFromB2DPolygon()

BASEGFX_DLLPUBLIC B3DPolygon basegfx::utils::createB3DPolygonFromB2DPolygon ( const B2DPolygon rCandidate,
double  fZCoordinate 
)

◆ createB3DPolyPolygonFromB2DPolyPolygon()

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::createB3DPolyPolygonFromB2DPolyPolygon ( const B2DPolyPolygon rCandidate,
double  fZCoordinate 
)

◆ createCoordinateSystemTransform()

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createCoordinateSystemTransform ( const B2DPoint rOrigin,
const B2DVector rX,
const B2DVector rY 
)

create based on given CoordinateSystem which is defined by origin and x/yaxis

Definition at line 441 of file b2dhommatrixtools.cxx.

References basegfx::Tuple2D< TYPE >::getX(), and basegfx::Tuple2D< TYPE >::getY().

◆ createCubeFillPolyPolygonFromB3DRange()

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::createCubeFillPolyPolygonFromB3DRange ( const B3DRange rRange)

◆ createCubePolyPolygonFromB3DRange()

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::createCubePolyPolygonFromB3DRange ( const B3DRange rRange)

◆ createEdgesOfGivenLength()

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

Parameters
rCandidateThe polygon to move along. Points at the given polygon are created, starting at position fStart and stopping at less or equal to fEnd. The closed state is preserved. The polygon is subdivided if curve segments are included. That subdivision is the base for the newly created points. If the source is closed, the indirectly existing last edge may NOT have the given length. If the source is open, all edges will have the given length. You may use the last point of the original when You want to add the last edge Yourself.
fLengthThe length of the created edges. If less or equal zero, an empty polygon is returned.
fStartThe start distance for the first to be generated point. Use 0.0 to get the original start point. Negative values are truncated to 0.0.
fEndThe maximum distance for the last point. No more points behind this distance will be created. Use 0.0 to process the whole polygon. Negative values are truncated to 0.0. It also needs to be more or equal to fStart, else it is truncated to fStart.
Returns
The newly created polygon

Definition at line 2942 of file b2dpolygontools.cxx.

References a, basegfx::B2DPolygon::append(), basegfx::B2DPolygon::areControlPointsUsed(), basegfx::B2DPolygon::count(), basegfx::fTools::equalZero(), basegfx::B2DPolygon::getB2DPoint(), basegfx::B2DPolygon::getDefaultAdaptiveSubdivision(), basegfx::B2DVector::getLength(), basegfx::B2DPolygon::isClosed(), basegfx::fTools::less(), basegfx::fTools::more(), and basegfx::B2DPolygon::setClosed().

Referenced by createWaveline().

◆ createEllipticalODFGradientInfo()

BASEGFX_DLLPUBLIC ODFGradientInfo basegfx::utils::createEllipticalODFGradientInfo ( const B2DRange rTargetArea,
const B2DVector rOffset,
sal_uInt32  nRequestedSteps,
double  fBorder,
double  fAngle 
)

Create matrix for ODF's elliptical gradient definition.

Parameters
o_rGradientInfoReceives the calculated texture transformation matrix (for use with standard [0,1]x[0,1] texture coordinates)
rTargetAreaOutput area, needed for aspect ratio calculations and texture transformation
rOffsetGradient offset value (from ODF)
nRequestedStepsNumber of gradient steps (from ODF)
fBorderWidth of gradient border (from ODF)
fAngleGradient angle (from ODF)

Definition at line 538 of file gradienttools.cxx.

References basegfx::initEllipticalGradientInfo().

◆ createHalfUnitCircle()

B2DPolygon const & basegfx::utils::createHalfUnitCircle ( )

◆ createLinearODFGradientInfo()

BASEGFX_DLLPUBLIC ODFGradientInfo basegfx::utils::createLinearODFGradientInfo ( const B2DRange rTargetArea,
sal_uInt32  nRequestedSteps,
double  fBorder,
double  fAngle 
)

Create matrix for ODF's linear gradient definition.

Note that odf linear gradients are varying in y direction.

Parameters
o_rGradientInfoReceives the calculated texture transformation matrix (for use with standard [0,1]x[0,1] texture coordinates)
rTargetAreaOutput area, needed for aspect ratio calculations and texture transformation
nRequestedStepsNumber of gradient steps (from ODF)
fBorderWidth of gradient border (from ODF)
fAngleGradient angle (from ODF)

Definition at line 495 of file gradienttools.cxx.

References basegfx::init1DGradientInfo().

◆ createLineTrapezoidFromB2DPolygon()

void basegfx::utils::createLineTrapezoidFromB2DPolygon ( B2DTrapezoidVector ro_Result,
const B2DPolygon rPolygon,
double  fLineWidth 
)

◆ createLineTrapezoidFromEdge()

void basegfx::utils::createLineTrapezoidFromEdge ( B2DTrapezoidVector ro_Result,
const B2DPoint rPointA,
const B2DPoint rPointB,
double  fLineWidth 
)

◆ createNonzeroConform()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::createNonzeroConform ( const B2DPolyPolygon rCandidate)

Emulate nonzero winding rule filling.

Geometrically convert PolyPolygons which are proposed to use nonzero fill rule to a representation where evenodd paint will give the same result. To do this all intersections and self-intersections get solved (the polygons will be rearranged if needed). Then all polygons which are inside another one with the same orientation get deleted

Definition at line 710 of file b2dpolypolygoncutter.cxx.

References a, basegfx::B2DPolyPolygon::append(), basegfx::B2DPolyPolygon::clear(), basegfx::B2DPolyPolygon::count(), basegfx::B2DPolyPolygon::getB2DPolygon(), getOrientation(), getRange(), isInside(), nCount, basegfx::Negative, SAL_WARN, solveCrossovers(), and stripNeutralPolygons().

◆ createPolygonFromCircle()

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::createPolygonFromCircle ( const B2DPoint rCenter,
double  fRadius 
)

Create a circle polygon with given radius.

This method creates a circle approximation consisting of 12 cubic bezier segments, which approximate the given circle with an error of less than 0.5 percent.

Parameters
rCenterCenter point of the circle
fRadiusRadius of the circle

Definition at line 1717 of file b2dpolygontools.cxx.

References createPolygonFromEllipse().

Referenced by createAreaGeometry(), and createSevenSegmentPolyPolygon().

◆ createPolygonFromEllipse()

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::createPolygonFromEllipse ( const B2DPoint rCenter,
double  fRadiusX,
double  fRadiusY,
sal_uInt32  nStartQuadrant = 0 
)

Create an ellipse polygon with given radii.

This method creates an ellipse approximation consisting of 12 cubic bezier segments, which approximate the given ellipse with an error of less than 0.5 percent.

Parameters
rCenterCenter point of the circle
fRadiusXRadius of the ellipse in X direction
fRadiusYRadius of the ellipse in Y direction
nStartQuadrantWith Y down on screens, 0 = 3 o'clock, 1 = 6 o'clock, 2 = 9 o'clock, 3 = 12 o'clock

Definition at line 1810 of file b2dpolygontools.cxx.

References createPolygonFromUnitCircle(), createScaleTranslateB2DHomMatrix(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), and basegfx::B2DPolygon::transform().

Referenced by createPolygonFromCircle(), and createPolygonFromRect().

◆ createPolygonFromEllipseSegment()

BASEGFX_DLLPUBLIC 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.

Definition at line 1920 of file b2dpolygontools.cxx.

References createPolygonFromUnitEllipseSegment(), createScaleTranslateB2DHomMatrix(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), and basegfx::B2DPolygon::transform().

◆ createPolygonFromRect() [1/2]

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::createPolygonFromRect ( const B2DRectangle rRect)

◆ createPolygonFromRect() [2/2]

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::createPolygonFromRect ( const B2DRectangle rRect,
double  fRadiusX,
double  fRadiusY 
)

◆ createPolygonFromUnitCircle()

BASEGFX_DLLPUBLIC B2DPolygon const & basegfx::utils::createPolygonFromUnitCircle ( sal_uInt32  nStartQuadrant = 0)

create a polygon which describes the unit circle and close it

Parameters
nStartQuadrantTo be able to rebuild the old behaviour where the circles started at bottom, this parameter is used. Default is 0 which is the first quadrant and the polygon's start point will be the rightmost one. When using e.g. 1, the first created quadrant will start at the YMax-position (with Y down on screens, this is the lowest one). This is needed since when lines are dashed, toe old geometry started at bottom point, else it would look different.

Definition at line 1780 of file b2dpolygontools.cxx.

References impCreateUnitCircle().

Referenced by createPolygonFromEllipse().

◆ createPolygonFromUnitEllipseSegment()

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::createPolygonFromUnitEllipseSegment ( double  fStart,
double  fEnd 
)

◆ createRadialODFGradientInfo()

BASEGFX_DLLPUBLIC ODFGradientInfo basegfx::utils::createRadialODFGradientInfo ( const B2DRange rTargetArea,
const B2DVector rOffset,
sal_uInt32  nRequestedSteps,
double  fBorder 
)

Create matrix for ODF's radial gradient definition.

Parameters
o_rGradientInfoReceives the calculated texture transformation matrix (for use with standard [0,1]x[0,1] texture coordinates)
rTargetAreaOutput area, needed for aspect ratio calculations and texture transformation
rOffsetGradient offset value (from ODF)
nRequestedStepsNumber of gradient steps (from ODF)
fBorderWidth of gradient border (from ODF)
fAngleGradient angle (from ODF)

Definition at line 523 of file gradienttools.cxx.

References basegfx::initEllipticalGradientInfo().

◆ createRectangularODFGradientInfo()

BASEGFX_DLLPUBLIC ODFGradientInfo basegfx::utils::createRectangularODFGradientInfo ( const B2DRange rTargetArea,
const B2DVector rOffset,
sal_uInt32  nRequestedSteps,
double  fBorder,
double  fAngle 
)

Create matrix for ODF's rectangular gradient definition.

Parameters
o_rGradientInfoReceives the calculated texture transformation matrix (for use with standard [0,1]x[0,1] texture coordinates)
rTargetAreaOutput area, needed for aspect ratio calculations and texture transformation
rOffsetGradient offset value (from ODF)
nRequestedStepsNumber of gradient steps (from ODF)
fBorderWidth of gradient border (from ODF)
fAngleGradient angle (from ODF)

Definition at line 570 of file gradienttools.cxx.

References basegfx::initRectGradientInfo().

◆ createRotateAroundCenterKeepAspectRatioStayInsideRange()

B2DHomMatrix basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange ( const basegfx::B2DRange rTargetRange,
double  fRotate 
)

◆ createRotateAroundPoint() [1/2]

B2DHomMatrix basegfx::utils::createRotateAroundPoint ( const B2DTuple rPoint,
double  fRadiant 
)
inline

◆ createRotateAroundPoint() [2/2]

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createRotateAroundPoint ( double  fPointX,
double  fPointY,
double  fRadiant 
)

◆ createRotateB2DHomMatrix()

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createRotateB2DHomMatrix ( double  fRadiant)

◆ createScaleB2DHomMatrix() [1/2]

B2DHomMatrix basegfx::utils::createScaleB2DHomMatrix ( const B2DTuple rScale)
inline

inline versions for parameters as tuples

Definition at line 54 of file b2dhommatrixtools.hxx.

References createScaleB2DHomMatrix(), basegfx::Tuple2D< TYPE >::getX(), and basegfx::Tuple2D< TYPE >::getY().

◆ createScaleB2DHomMatrix() [2/2]

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createScaleB2DHomMatrix ( double  fScaleX,
double  fScaleY 
)

Tooling methods for on-the-fly matrix generation e.g.

for inline multiplications

Definition at line 69 of file b2dhommatrixtools.cxx.

References basegfx::fTools::equal(), and basegfx::B2DHomMatrix::set().

Referenced by createScaleB2DHomMatrix(), and importFromSvgD().

◆ createScaleShearXRotateTranslateB2DHomMatrix() [1/2]

B2DHomMatrix basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix ( const B2DTuple rScale,
double  fShearX,
double  fRadiant,
const B2DTuple rTranslate 
)
inline

◆ createScaleShearXRotateTranslateB2DHomMatrix() [2/2]

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix ( double  fScaleX,
double  fScaleY,
double  fShearX,
double  fRadiant,
double  fTranslateX,
double  fTranslateY 
)

Tooling methods for faster completely combined matrix creation when scale, shearX, rotation and translation needs to be done in exactly that order.

It's faster since it directly calculates each matrix value based on a symbolic calculation of the three matrix multiplications. Inline versions for parameters as tuples added, too.

no scale, take shortcut

scale used

no shear

no rotate, take shortcut

rotate and scale used, no shear

scale and shear used

scale and shear, but no rotate

scale, shear and rotate used

Definition at line 143 of file b2dhommatrixtools.cxx.

References createScaleTranslateB2DHomMatrix(), createShearXRotateTranslateB2DHomMatrix(), createSinCosOrthogonal(), basegfx::fTools::equal(), and basegfx::fTools::equalZero().

Referenced by createScaleShearXRotateTranslateB2DHomMatrix(), and basegfx::utils::B2DHomMatrixBufferedDecompose::getB2DHomMatrix().

◆ createScaleTranslateB2DHomMatrix() [1/2]

B2DHomMatrix basegfx::utils::createScaleTranslateB2DHomMatrix ( const B2DTuple rScale,
const B2DTuple rTranslate 
)
inline

◆ createScaleTranslateB2DHomMatrix() [2/2]

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createScaleTranslateB2DHomMatrix ( double  fScaleX,
double  fScaleY,
double  fTranslateX,
double  fTranslateY 
)

◆ createSevenSegmentPolyPolygon()

B2DPolyPolygon basegfx::utils::createSevenSegmentPolyPolygon ( char  cNumber,
bool  bLitSegments 
)

Creates polypolygon for seven-segment display number.

This function takes an integer number between 0 and 9 and convert it into the well-known seven-segment display number (like most digital clocks show their numbers). The digit will exactly fit the unit rectangle. The polypolygon will be a line polygon, i.e. if you need the segment parts to have width, use createAreaGeometry() on the result.

Parameters
cNumberNumber from '0' to '9' as ASCII char, or '-', 'E' and '.' to convert to 7 segment code
bLitSegmentsWhen true, return a polygon containing the segments that are 'lit' for the given number. Return un-lit segments otherwise.

Definition at line 418 of file b2dpolypolygontools.cxx.

References basegfx::B2DPolyPolygon::append(), basegfx::B2DPolygon::append(), basegfx::B2DPolygon::clear(), createPolygonFromCircle(), end, i, and start.

Referenced by number2PolyPolygon().

◆ createShearXB2DHomMatrix()

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createShearXB2DHomMatrix ( double  fShearX)

◆ createShearXRotateTranslateB2DHomMatrix() [1/2]

B2DHomMatrix basegfx::utils::createShearXRotateTranslateB2DHomMatrix ( double  fShearX,
double  fRadiant,
const B2DTuple rTranslate 
)
inline

◆ createShearXRotateTranslateB2DHomMatrix() [2/2]

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createShearXRotateTranslateB2DHomMatrix ( double  fShearX,
double  fRadiant,
double  fTranslateX,
double  fTranslateY 
)

no shear

no shear, no rotate, take shortcut

no shear, but rotate used

shear used

no rotate, but shear used

shear and rotate used

Definition at line 224 of file b2dhommatrixtools.cxx.

References createSinCosOrthogonal(), createTranslateB2DHomMatrix(), and basegfx::fTools::equalZero().

Referenced by createScaleShearXRotateTranslateB2DHomMatrix(), and createShearXRotateTranslateB2DHomMatrix().

◆ createShearYB2DHomMatrix()

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createShearYB2DHomMatrix ( double  fShearY)

◆ createSinCosOrthogonal()

void basegfx::utils::createSinCosOrthogonal ( double &  o_rSin,
double &  rCos,
double  fRadiant 
)

If the rotation angle is an approximate multiple of pi/2, force fSin/fCos to -1/0/1, to maintain orthogonality (which might also be advantageous for the other cases, but: for multiples of pi/2, the exact values can be attained.

It would be largely unintuitive, if a 180 degrees rotation would introduce slight roundoff errors, instead of exactly mirroring the coordinate system)

Definition at line 27 of file b2dhommatrixtools.cxx.

References basegfx::fTools::equalZero(), and basegfx::fround().

Referenced by createRotateAroundPoint(), createRotateB2DHomMatrix(), createScaleShearXRotateTranslateB2DHomMatrix(), createShearXRotateTranslateB2DHomMatrix(), and basegfx::B2DHomMatrix::rotate().

◆ createSourceRangeTargetRangeTransform()

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createSourceRangeTargetRangeTransform ( const B2DRange rSourceRange,
const B2DRange rTargetRange 
)

◆ createSphereFillPolyPolygonFromB3DRange()

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::createSphereFillPolyPolygonFromB3DRange ( const B3DRange rRange,
sal_uInt32  nHorSeg,
sal_uInt32  nVerSeg,
bool  bNormals,
double  fVerStart,
double  fVerStop,
double  fHorStart,
double  fHorStop 
)

same as createSpherePolyPolygonFromB3DRange, but creates filled polygons (closed and oriented) There is one extra, the bool bNormals defines if normals will be set, default is false

Definition at line 365 of file b3dpolypolygontools.cxx.

References basegfx::B3DPolyPolygon::count(), createUnitSphereFillPolyPolygon(), basegfx::B3DRange::getDepth(), basegfx::B3DRange::getHeight(), basegfx::B3DRange::getMinX(), basegfx::B3DRange::getMinY(), basegfx::B3DRange::getMinZ(), basegfx::B3DRange::getWidth(), basegfx::B3DHomMatrix::scale(), basegfx::B3DPolyPolygon::transform(), and basegfx::B3DHomMatrix::translate().

◆ createSpherePolyPolygonFromB3DRange()

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::createSpherePolyPolygonFromB3DRange ( const B3DRange rRange,
sal_uInt32  nHorSeg,
sal_uInt32  nVerSeg,
double  fVerStart = M_PI_2,
double  fVerStop = -M_PI_2,
double  fHorStart = 0.0,
double  fHorStop = 2 *M_PI 
)

Create a 3D line polyPolygon from a B3DRange which defines a sphere with the given count of hor and ver segments.

If nHorSeg == 0 and/or nVerSeg == 0, a default will be calculated to have a step at least each 15 degrees. With VerStart, VerStop and hor range in cartesian may be specified to create a partial sphere only.

Definition at line 287 of file b3dpolypolygontools.cxx.

References basegfx::B3DPolyPolygon::count(), createUnitSpherePolyPolygon(), basegfx::B3DRange::getDepth(), basegfx::B3DRange::getHeight(), basegfx::B3DRange::getMinX(), basegfx::B3DRange::getMinY(), basegfx::B3DRange::getMinZ(), basegfx::B3DRange::getWidth(), basegfx::B3DHomMatrix::scale(), basegfx::B3DPolyPolygon::transform(), and basegfx::B3DHomMatrix::translate().

◆ createSquareODFGradientInfo()

BASEGFX_DLLPUBLIC ODFGradientInfo basegfx::utils::createSquareODFGradientInfo ( const B2DRange rTargetArea,
const B2DVector rOffset,
sal_uInt32  nRequestedSteps,
double  fBorder,
double  fAngle 
)

Create matrix for ODF's square gradient definition.

Parameters
o_rGradientInfoReceives the calculated texture transformation matrix (for use with standard [0,1]x[0,1] texture coordinates)
rTargetAreaOutput area, needed for aspect ratio calculations and texture transformation
rOffsetGradient offset value (from ODF)
nRequestedStepsNumber of gradient steps (from ODF)
fBorderWidth of gradient border (from ODF)
fAngleGradient angle (from ODF)

Definition at line 554 of file gradienttools.cxx.

References basegfx::initRectGradientInfo().

◆ createTranslateB2DHomMatrix() [1/2]

B2DHomMatrix basegfx::utils::createTranslateB2DHomMatrix ( const B2DTuple rTranslate)
inline

◆ createTranslateB2DHomMatrix() [2/2]

BASEGFX_DLLPUBLIC B2DHomMatrix basegfx::utils::createTranslateB2DHomMatrix ( double  fTranslateX,
double  fTranslateY 
)

◆ createUnitCubeFillPolyPolygon()

B3DPolyPolygon const & basegfx::utils::createUnitCubeFillPolyPolygon ( )

Create a unit 3D fill polyPolygon which defines a cube.

Definition at line 93 of file b3dpolypolygontools.cxx.

References A, basegfx::B3DPolygon::append(), basegfx::B3DPolyPolygon::append(), B, C, basegfx::B3DPolygon::clear(), D, E, F, G, H, and basegfx::B3DPolygon::setClosed().

Referenced by createCubeFillPolyPolygonFromB3DRange().

◆ createUnitCubePolyPolygon()

B3DPolyPolygon const & basegfx::utils::createUnitCubePolyPolygon ( )

Create a unit 3D line polyPolygon which defines a cube.

Definition at line 49 of file b3dpolypolygontools.cxx.

References basegfx::B3DPolygon::append(), basegfx::B3DPolyPolygon::append(), basegfx::B3DPolygon::clear(), and basegfx::B3DPolygon::setClosed().

Referenced by createCubePolyPolygonFromB3DRange().

◆ createUnitPolygon()

BASEGFX_DLLPUBLIC B2DPolygon const & basegfx::utils::createUnitPolygon ( )

Create the unit polygon.

Definition at line 1699 of file b2dpolygontools.cxx.

References basegfx::B2DPolygon::setClosed().

◆ createUnitSphereFillPolyPolygon()

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::createUnitSphereFillPolyPolygon ( sal_uInt32  nHorSeg,
sal_uInt32  nVerSeg,
bool  bNormals,
double  fVerStart,
double  fVerStop,
double  fHorStart,
double  fHorStop 
)

same as createUnitSpherePolyPolygon, but creates filled polygons (closed and oriented) There is one extra, the bool bNormals defines if normals will be set, default is false

Definition at line 307 of file b3dpolypolygontools.cxx.

References a, basegfx::B3DPolygon::append(), basegfx::B3DPolyPolygon::append(), basegfx::B3DPolygon::count(), basegfx::fround(), basegfx::B3DPolygon::getB3DPoint(), getPointFromCartesian(), nMaxSegments, nMinSegments, basegfx::B3DPolygon::setClosed(), and basegfx::B3DPolygon::setNormal().

Referenced by createSphereFillPolyPolygonFromB3DRange().

◆ createUnitSpherePolyPolygon()

B3DPolyPolygon basegfx::utils::createUnitSpherePolyPolygon ( sal_uInt32  nHorSeg,
sal_uInt32  nVerSeg,
double  fVerStart = M_PI_2,
double  fVerStop = -M_PI_2,
double  fHorStart = 0.0,
double  fHorStop = 2 *M_PI 
)

Create a unit 3D line polyPolygon which defines a sphere with the given count of hor and ver segments.

Result will be centered at (0.0, 0.0, 0.0) and sized [-1.0 .. 1.0] in all dimensions. If nHorSeg == 0 and/or nVerSeg == 0, a default will be calculated to have a step at least each 15 degrees. With VerStart, VerStop and hor range in cartesian may be specified to create a partial sphere only.

Definition at line 208 of file b3dpolypolygontools.cxx.

References a, basegfx::B3DPolygon::append(), basegfx::B3DPolyPolygon::append(), basegfx::fTools::equal(), basegfx::fround(), getPointFromCartesian(), nMaxSegments, nMinSegments, and basegfx::B3DPolygon::setClosed().

Referenced by createSpherePolyPolygonFromB3DRange().

◆ createWaveline()

BASEGFX_DLLPUBLIC 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.

The polygon is treated as if opened (closed state will be ignored) and only for whole edges a curve segment will be created (no rest handling)

Parameters
rCandidateThe polygon along which the waveline will be created
fWaveWidthThe length of a single waveline curve segment
fgWaveHeightThe height of the waveline (amplitude)

Definition at line 3033 of file b2dpolygontools.cxx.

References a, basegfx::B2DPolygon::append(), basegfx::B2DPolygon::appendBezierSegment(), basegfx::B2DPolygon::count(), createEdgesOfGivenLength(), basegfx::fTools::equalZero(), basegfx::B2DPolygon::getB2DPoint(), and basegfx::getNormalizedPerpendicular().

◆ distort() [1/3]

BASEGFX_DLLPUBLIC B2DPoint basegfx::utils::distort ( const B2DPoint rCandidate,
const B2DRange rOriginal,
const B2DPoint rTopLeft,
const B2DPoint rTopRight,
const B2DPoint rBottomLeft,
const B2DPoint rBottomRight 
)

◆ distort() [2/3]

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::distort ( const B2DPolygon rCandidate,
const B2DRange rOriginal,
const B2DPoint rTopLeft,
const B2DPoint rTopRight,
const B2DPoint rBottomLeft,
const B2DPoint rBottomRight 
)

◆ distort() [3/3]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::distort ( const B2DPolyPolygon rCandidate,
const B2DRange rOriginal,
const B2DPoint rTopLeft,
const B2DPoint rTopRight,
const B2DPoint rBottomLeft,
const B2DPoint rBottomRight 
)

Definition at line 309 of file b2dpolypolygontools.cxx.

References basegfx::B2DPolyPolygon::append(), and distort().

◆ expandToCurve() [1/2]

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::expandToCurve ( const B2DPolygon rCandidate)

Definition at line 2531 of file b2dpolygontools.cxx.

References a, basegfx::B2DPolygon::count(), and expandToCurveInPoint().

Referenced by expandToCurve().

◆ expandToCurve() [2/2]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::expandToCurve ( const B2DPolyPolygon rCandidate)

Definition at line 321 of file b2dpolypolygontools.cxx.

References basegfx::B2DPolyPolygon::append(), and expandToCurve().

◆ expandToCurveInPoint()

BASEGFX_DLLPUBLIC bool basegfx::utils::expandToCurveInPoint ( B2DPolygon rCandidate,
sal_uInt32  nIndex 
)

◆ exportToSvgD()

BASEGFX_DLLPUBLIC OUString basegfx::utils::exportToSvgD ( const B2DPolyPolygon rPolyPoly,
bool  bUseRelativeCoordinates,
bool  bDetectQuadraticBeziers,
bool  bHandleRelativeNextPointCompatible,
bool  bOOXMLMotionPath = false 
)

Export poly-polygon to SVG.

This function exports a poly-polygon into an SVG-D statement. Currently, output of relative point sequences is not yet supported (might cause slightly larger output)

Parameters
rPolyPolyThe poly-polygon to export
bUseRelativeCoordinatesWhen true, all coordinate values are exported as relative to the current position. This tends to save some space, since fewer digits needs to be written.
bDetectQuadraticBeziersWhen true, the export tries to detect cubic bezier segments in the input polygon, which can be represented by quadratic bezier segments. Note that the generated string causes versions prior to OOo2.0 to crash.
bHandleRelativeNextPointCompatibleIf set to true, the old error that after a relative 'z' command the current point was not reset to the first point of the current polygon is kept; this is needed to read odf files. If false, pure svg is used; this is needed for svg import.
bOOXMLMotionPathIf set to true, export string format that is acceptable for for animation motion path for PowerPoint: always space delimited, never neglect command char, always end with E, and do not export H or V.
Returns
the generated SVG-D statement (the XML d attribute value alone, without any "<path ...>" or "d="...")

Definition at line 715 of file b2dsvgpolypolygon.cxx.

References basegfx::B2DPolygon::areControlPointsUsed(), basegfx::C2, basegfx::B2DPolygon::count(), basegfx::B2DPolyPolygon::count(), basegfx::Tuple2D< TYPE >::equal(), basegfx::B2DPolygon::getB2DPoint(), basegfx::B2DPolyPolygon::getB2DPolygon(), basegfx::B2DPolygon::getContinuityInPoint(), basegfx::B2DPolygon::getNextControlPoint(), basegfx::B2DPolygon::getPrevControlPoint(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), i, basegfx::B2DPolygon::isClosed(), basegfx::B2DPolygon::isNextControlPointUsed(), basegfx::B2DPolygon::isPrevControlPointUsed(), nCount, and nIndex.

◆ exportToSvgPoints()

BASEGFX_DLLPUBLIC OUString basegfx::utils::exportToSvgPoints ( const B2DPolygon rPoly)

Write poly-polygon to SVG.

This function imports a non-bezier polygon to SVG points (a plain list of coordinate pairs).

Parameters
rPolyThe polygon to export
rSvgPointsAttributeA valid SVG points attribute string
Returns
true, if the string was successfully parsed

Definition at line 692 of file b2dsvgpolypolygon.cxx.

References a, basegfx::B2DPolygon::areControlPointsUsed(), basegfx::B2DPolygon::count(), basegfx::B2DPolygon::getB2DPoint(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), and SAL_WARN_IF.

◆ findCut()

BASEGFX_DLLPUBLIC CutFlagValue basegfx::utils::findCut ( const B2DPoint rEdge1Start,
const B2DVector rEdge1Delta,
const B2DPoint rEdge2Start,
const B2DVector rEdge2Delta,
CutFlagValue  aCutFlags,
double *  pCut1,
double *  pCut2 
)

◆ getArea() [1/2]

BASEGFX_DLLPUBLIC double basegfx::utils::getArea ( const B2DPolygon rCandidate)

◆ getArea() [2/2]

BASEGFX_DLLPUBLIC double basegfx::utils::getArea ( const B2DPolyPolygon rCandidate)

Definition at line 206 of file b2dpolypolygontools.cxx.

References getSignedArea().

◆ getAxialGradientAlpha()

BASEGFX_DLLPUBLIC double basegfx::utils::getAxialGradientAlpha ( const B2DPoint rUV,
const ODFGradientInfo &  rGradInfo 
)

Calculate axial gradient blend value.

This method generates you the lerp alpha value for blending linearly between gradient start and end color, according to the formula (startCol*(1.0-alpha) + endCol*alpha)

Parameters
rUVCurrent uv coordinate. Values outside [0,1] will be clamped. Assumes gradient color varies along the y axis.
rGradInfoGradient info, for transformation and number of steps

Definition at line 609 of file gradienttools.cxx.

References basegfx::Tuple2D< TYPE >::getY().

◆ getCohenSutherlandClipFlags() [1/2]

template<class Point >
sal_uInt32 basegfx::utils::getCohenSutherlandClipFlags ( const Point rP,
const B2IBox rB 
)
inline

Cohen-Sutherland mask calculation - overload for boxes.

Definition at line 59 of file rectcliptools.hxx.

References basegfx::B2IBox::getMaxX(), basegfx::B2IBox::getMaxY(), basegfx::B2IBox::getMinX(), basegfx::B2IBox::getMinY(), Point::getX(), and Point::getY().

◆ getCohenSutherlandClipFlags() [2/2]

template<class Point , class Rect >
sal_uInt32 basegfx::utils::getCohenSutherlandClipFlags ( const Point rP,
const Rect &  rR 
)
inline

Calc clip mask for Cohen-Sutherland rectangle clip.

This function returns a clip mask used for the Cohen-Sutherland rectangle clip method, where one or more of the lower four bits are set, if the given point is outside one or more of the four half planes defining the rectangle (see RectClipFlags for possible values)

Definition at line 45 of file rectcliptools.hxx.

References Point::getX(), and Point::getY().

Referenced by scissorLineSegment().

◆ getColumn()

BASEGFX_DLLPUBLIC B2DTuple basegfx::utils::getColumn ( const B2DHomMatrix rMatrix,
sal_uInt16  nCol 
)

get column vector from B2dHomMatrix, e.g. to extract coordinate system origin and x/yaxis

Definition at line 451 of file b2dhommatrixtools.cxx.

References basegfx::B2DHomMatrix::get().

◆ getContinuityInPoint()

BASEGFX_DLLPUBLIC B2VectorContinuity basegfx::utils::getContinuityInPoint ( const B2DPolygon rCandidate,
sal_uInt32  nIndex 
)

Definition at line 155 of file b2dpolygontools.cxx.

References basegfx::B2DPolygon::getContinuityInPoint(), and nIndex.

◆ getCutBetweenLineAndPlane()

BASEGFX_DLLPUBLIC bool basegfx::utils::getCutBetweenLineAndPlane ( const B3DVector rPlaneNormal,
const B3DPoint rPlanePoint,
const B3DPoint rEdgeStart,
const B3DPoint rEdgeEnd,
double &  fCut 
)

◆ getEdgeLength()

BASEGFX_DLLPUBLIC double basegfx::utils::getEdgeLength ( const B2DPolygon rCandidate,
sal_uInt32  nIndex 
)

◆ getEllipticalGradientAlpha()

BASEGFX_DLLPUBLIC double basegfx::utils::getEllipticalGradientAlpha ( const B2DPoint rUV,
const ODFGradientInfo &  rGradInfo 
)

Calculate elliptical gradient blend value.

This method generates you the lerp alpha value for blending linearly between gradient start and end color, according to the formula (startCol*(1.0-alpha) + endCol*alpha)

Parameters
rUVCurrent uv coordinate. Values outside [0,1] will be clamped.
rGradInfoGradient info, for transformation and number of steps

Definition at line 641 of file gradienttools.cxx.

References basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), and t.

◆ getIndexOfPredecessor()

BASEGFX_DLLPUBLIC sal_uInt32 basegfx::utils::getIndexOfPredecessor ( sal_uInt32  nIndex,
const B2DPolygon rCandidate 
)

Definition at line 94 of file b2dpolygontools.cxx.

References basegfx::B2DPolygon::count(), and nIndex.

Referenced by getOrientationForIndex().

◆ getIndexOfSuccessor() [1/2]

BASEGFX_DLLPUBLIC sal_uInt32 basegfx::utils::getIndexOfSuccessor ( sal_uInt32  nIndex,
const B2DPolygon rCandidate 
)

◆ getIndexOfSuccessor() [2/2]

BASEGFX_DLLPUBLIC sal_uInt32 basegfx::utils::getIndexOfSuccessor ( sal_uInt32  nIndex,
const B3DPolygon rCandidate 
)

Definition at line 44 of file b3dpolygontools.cxx.

References basegfx::B3DPolygon::count(), and nIndex.

◆ getLength() [1/2]

BASEGFX_DLLPUBLIC double basegfx::utils::getLength ( const B2DPolygon rCandidate)

◆ getLength() [2/2]

BASEGFX_DLLPUBLIC double basegfx::utils::getLength ( const B3DPolygon rCandidate)

◆ getLinearGradientAlpha()

BASEGFX_DLLPUBLIC double basegfx::utils::getLinearGradientAlpha ( const B2DPoint rUV,
const ODFGradientInfo &  rGradInfo 
)

Calculate linear gradient blend value.

This method generates you the lerp alpha value for blending linearly between gradient start and end color, according to the formula (startCol*(1.0-alpha) + endCol*alpha)

Parameters
rUVCurrent uv coordinate. Values outside [0,1] will be clamped. Assumes gradient color varies along the y axis.
rGradInfoGradient info, for transformation and number of steps

Definition at line 586 of file gradienttools.cxx.

References basegfx::Tuple2D< TYPE >::getY().

◆ getOrientation()

BASEGFX_DLLPUBLIC B2VectorOrientation basegfx::utils::getOrientation ( const B2DPolygon rCandidate)

◆ getOrientationForIndex()

BASEGFX_DLLPUBLIC B2VectorOrientation basegfx::utils::getOrientationForIndex ( const B2DPolygon rCandidate,
sal_uInt32  nIndex 
)

◆ getPointFromCartesian()

static B3DPoint basegfx::utils::getPointFromCartesian ( double  fHor,
double  fVer 
)
static

◆ getPositionAbsolute()

BASEGFX_DLLPUBLIC B2DPoint basegfx::utils::getPositionAbsolute ( const B2DPolygon rCandidate,
double  fDistance,
double  fLength 
)

◆ getPositionRelative()

BASEGFX_DLLPUBLIC B2DPoint basegfx::utils::getPositionRelative ( const B2DPolygon rCandidate,
double  fDistance,
double  fLength 
)

Definition at line 657 of file b2dpolygontools.cxx.

References basegfx::fTools::equalZero(), getLength(), and getPositionAbsolute().

Referenced by reSegmentPolygon().

◆ getRadialGradientAlpha()

BASEGFX_DLLPUBLIC double basegfx::utils::getRadialGradientAlpha ( const B2DPoint rUV,
const ODFGradientInfo &  rGradInfo 
)

Calculate radial gradient blend value.

This method generates you the lerp alpha value for blending linearly between gradient start and end color, according to the formula (startCol*(1.0-alpha) + endCol*alpha)

Parameters
rUVCurrent uv coordinate. Values outside [0,1] will be clamped.
rGradInfoGradient info, for transformation and number of steps

Definition at line 629 of file gradienttools.cxx.

References basegfx::Tuple2D< TYPE >::getX(), and basegfx::Tuple2D< TYPE >::getY().

◆ getRange() [1/4]

BASEGFX_DLLPUBLIC B2DRange basegfx::utils::getRange ( const B2DPolygon rCandidate)

Get the range of a polygon.

This method creates the outer range of the subdivided bezier curve. For detailed discussion see B2DPolygon::getB2DRange()

Parameters
rCandidateThe B2DPolygon possibly containing bezier segments
Returns
The outer range of the bezier curve

Definition at line 391 of file b2dpolygontools.cxx.

References basegfx::B2DPolygon::getB2DRange().

Referenced by addPointsAtCutsAndTouches(), basegfx::unotools::UnoPolyPolygon::addPolyPolygon(), applyDefaultTextureCoordinatesSphere(), clipPolygonOnParallelAxis(), clipPolygonOnRange(), createAreaGeometryForLineStartEnd(), createNonzeroConform(), getRange(), and stripDispensablePolygons().

◆ getRange() [2/4]

BASEGFX_DLLPUBLIC B2DRange basegfx::utils::getRange ( const B2DPolyPolygon rCandidate)

Get the range of a polyPolygon.

For detailed description look at getRange(const B2DPolygon&). This method just expands by the range of every sub-Polygon.

Parameters
rCandidateThe B2DPolyPolygon possibly containing bezier segments
Returns
The outer range of the polygon

Definition at line 182 of file b2dpolypolygontools.cxx.

References basegfx::Range2D< TYPE, TRAITS >::expand(), and getRange().

◆ getRange() [3/4]

BASEGFX_DLLPUBLIC B3DRange basegfx::utils::getRange ( const B3DPolygon rCandidate)

◆ getRange() [4/4]

BASEGFX_DLLPUBLIC B3DRange basegfx::utils::getRange ( const B3DPolyPolygon rCandidate)

Definition at line 37 of file b3dpolypolygontools.cxx.

References basegfx::B3DRange::expand(), and getRange().

◆ getRectangularGradientAlpha()

BASEGFX_DLLPUBLIC double basegfx::utils::getRectangularGradientAlpha ( const B2DPoint rUV,
const ODFGradientInfo &  rGradInfo 
)

Calculate rectangular gradient blend value.

This method generates you the lerp alpha value for blending linearly between gradient start and end color, according to the formula (startCol*(1.0-alpha) + endCol*alpha)

Parameters
rUVCurrent uv coordinate. Values outside [0,1] will be clamped.
rGradInfoGradient info, for transformation and number of steps

Definition at line 690 of file gradienttools.cxx.

References basegfx::Tuple2D< TYPE >::getX(), and basegfx::Tuple2D< TYPE >::getY().

◆ getSignedArea() [1/2]

BASEGFX_DLLPUBLIC double basegfx::utils::getSignedArea ( const B2DPolygon rCandidate)

◆ getSignedArea() [2/2]

BASEGFX_DLLPUBLIC double basegfx::utils::getSignedArea ( const B2DPolyPolygon rCandidate)

Definition at line 194 of file b2dpolypolygontools.cxx.

References getSignedArea().

◆ getSmallestDistancePointToEdge()

BASEGFX_DLLPUBLIC double basegfx::utils::getSmallestDistancePointToEdge ( const B2DPoint rPointA,
const B2DPoint rPointB,
const B2DPoint rTestPoint,
double &  rCut 
)

◆ getSmallestDistancePointToPolygon()

BASEGFX_DLLPUBLIC double basegfx::utils::getSmallestDistancePointToPolygon ( const B2DPolygon rCandidate,
const B2DPoint rTestPoint,
sal_uInt32 &  rEdgeIndex,
double &  rCut 
)

◆ getSmallestDistancePointToPolyPolygon()

BASEGFX_DLLPUBLIC double basegfx::utils::getSmallestDistancePointToPolyPolygon ( const B2DPolyPolygon rCandidate,
const B2DPoint rTestPoint,
sal_uInt32 &  rPolygonIndex,
sal_uInt32 &  rEdgeIndex,
double &  rCut 
)

◆ getSnippetAbsolute()

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::getSnippetAbsolute ( const B2DPolygon rCandidate,
double  fFrom,
double  fTo,
double  fLength 
)

◆ getSquareGradientAlpha()

BASEGFX_DLLPUBLIC double basegfx::utils::getSquareGradientAlpha ( const B2DPoint rUV,
const ODFGradientInfo &  rGradInfo 
)

Calculate square gradient blend value.

This method generates you the lerp alpha value for blending linearly between gradient start and end color, according to the formula (startCol*(1.0-alpha) + endCol*alpha)

Parameters
rUVCurrent uv coordinate. Values outside [0,1] will be clamped.
rGradInfoGradient info, for transformation and number of steps

Definition at line 670 of file gradienttools.cxx.

References basegfx::Tuple2D< TYPE >::getX(), and basegfx::Tuple2D< TYPE >::getY().

◆ getTangentEnteringPoint()

BASEGFX_DLLPUBLIC 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.

Take into account all stuff like closed state, zero-length edges and others.

Definition at line 3163 of file b2dpolygontools.cxx.

References basegfx::B2DPolygon::count(), basegfx::Tuple2D< TYPE >::equalZero(), basegfx::B2DPolygon::getBezierSegment(), basegfx::B2DCubicBezier::getTangent(), basegfx::B2DPolygon::isClosed(), nCount, and nIndex.

◆ getTangentLeavingPoint()

BASEGFX_DLLPUBLIC 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.

Take into account all stuff like closed state, zero-length edges and others.

Definition at line 3207 of file b2dpolygontools.cxx.

References basegfx::B2DPolygon::count(), basegfx::Tuple2D< TYPE >::equalZero(), basegfx::B2DPolygon::getBezierSegment(), basegfx::B2DCubicBezier::getTangent(), basegfx::B2DPolygon::isClosed(), nCount, and nIndex.

◆ growInNormalDirection() [1/2]

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::growInNormalDirection ( const B2DPolygon rCandidate,
double  fValue 
)

◆ growInNormalDirection() [2/2]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::growInNormalDirection ( const B2DPolyPolygon rCandidate,
double  fValue 
)

◆ hasNeutralPoints()

BASEGFX_DLLPUBLIC bool basegfx::utils::hasNeutralPoints ( const B2DPolygon rCandidate)

◆ hsl2rgb()

BASEGFX_DLLPUBLIC BColor basegfx::utils::hsl2rgb ( const BColor rHSLColor)

◆ hsl2rgbHelper()

static double basegfx::utils::hsl2rgbHelper ( double  nValue1,
double  nValue2,
double  nHue 
)
static

Definition at line 63 of file bcolortools.cxx.

Referenced by hsl2rgb().

◆ hsv2rgb()

BASEGFX_DLLPUBLIC BColor basegfx::utils::hsv2rgb ( const BColor rHSVColor)

◆ impCreateUnitCircle()

static B2DPolygon basegfx::utils::impCreateUnitCircle ( sal_uInt32  nStartQuadrant)
static

◆ impDistanceBezierPointToControl()

static double basegfx::utils::impDistanceBezierPointToControl ( double  fAngle)
static

◆ implHandleFirstLast() [1/2]

static void basegfx::utils::implHandleFirstLast ( const std::function< void(const basegfx::B2DPolygon &rSnippet)> &  rTargetCallback,
B2DPolygon rFirst,
B2DPolygon rLast 
)
static

◆ implHandleFirstLast() [2/2]

static void basegfx::utils::implHandleFirstLast ( const std::function< void(const basegfx::B3DPolygon &rSnippet)> &  rTargetCallback,
B3DPolygon rFirst,
B3DPolygon rLast 
)
static

◆ implHandleSnippet() [1/2]

static void basegfx::utils::implHandleSnippet ( const B2DPolygon rSnippet,
const std::function< void(const basegfx::B2DPolygon &rSnippet)> &  rTargetCallback,
B2DPolygon rFirst,
B2DPolygon rLast 
)
static

◆ implHandleSnippet() [2/2]

static void basegfx::utils::implHandleSnippet ( const B3DPolygon rSnippet,
const std::function< void(const basegfx::B3DPolygon &rSnippet)> &  rTargetCallback,
B3DPolygon rFirst,
B3DPolygon rLast 
)
static

◆ importFromSvgD()

BASEGFX_DLLPUBLIC bool basegfx::utils::importFromSvgD ( B2DPolyPolygon o_rPolyPoly,
std::u16string_view  rSvgDAttribute,
bool  bHandleRelativeNextPointCompatible,
PointIndexSet pHelpPointIndexSet 
)

Read poly-polygon from SVG.

This function imports a poly-polygon from an SVG-D attribute.

Parameters
o_rPolyPolyThe output poly-polygon
rSvgDAttributeA valid SVG-D attribute string
bHandleRelativeNextPointCompatibleIf set to true, the old error that after a relative 'z' command the current point was not reset to the first point of the current polygon is kept; this is needed to read odf files. If false, pure svg is used; this is needed for svg import.
pHelpPointIndexSetIf given, all points created in the target PolyPolygon which are only helper points are added here using their point indices; this are currently points created from import of the 'a' and 'A' svg:d statements which create bezier curve info as representation and maybe points which are no 'real' svg:d points, but helper points. It is necessary to identify these e.g. when markers need to be created in the svg import
Returns
true, if the string was successfully parsed

Definition at line 75 of file b2dsvgpolypolygon.cxx.

References basegfx::B2DPolyPolygon::append(), basegfx::B2DPolygon::append(), basegfx::B2DPolygon::appendBezierSegment(), basegfx::B2DPolygon::appendQuadraticBezierSegment(), basegfx::B2DPolygon::areControlPointsUsed(), basegfx::B2DPolygon::clear(), basegfx::B2DPolyPolygon::clear(), basegfx::B2DPolygon::count(), basegfx::B2DPolyPolygon::count(), createPolygonFromUnitEllipseSegment(), createRotateB2DHomMatrix(), createScaleB2DHomMatrix(), basegfx::deg2rad(), basegfx::Tuple2D< TYPE >::equal(), basegfx::B2DPolygon::flip(), basegfx::B2DPolygon::getB2DPoint(), basegfx::B2DPolygon::getPrevControlPoint(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), basegfx::internal::importDoubleAndSpaces(), basegfx::internal::importFlagAndSpaces(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), basegfx::internal::isOnNumberChar(), basegfx::B2DPolygon::isPrevControlPointUsed(), nIndex, nPos, basegfx::B2DHomMatrix::rotate(), SAL_WARN, basegfx::B2DPolygon::setClosed(), basegfx::Tuple2D< TYPE >::setX(), basegfx::Tuple2D< TYPE >::setY(), basegfx::internal::skipSpaces(), basegfx::B2DPolygon::transform(), and basegfx::B2DHomMatrix::translate().

◆ importFromSvgPoints()

BASEGFX_DLLPUBLIC bool basegfx::utils::importFromSvgPoints ( B2DPolygon o_rPoly,
std::u16string_view  rSvgPointsAttribute 
)

Read poly-polygon from SVG.

This function imports a poly-polygon from an SVG points attribute (a plain list of coordinate pairs).

Parameters
o_rPolyThe output polygon. Note that svg:points can only define a single polygon
rSvgPointsAttributeA valid SVG points attribute string
Returns
true, if the string was successfully parsed

Definition at line 666 of file b2dsvgpolypolygon.cxx.

References basegfx::B2DPolygon::append(), basegfx::B2DPolygon::clear(), basegfx::internal::importDoubleAndSpaces(), nPos, and basegfx::internal::skipSpaces().

◆ infiniteLineFromParallelogram()

BASEGFX_DLLPUBLIC void basegfx::utils::infiniteLineFromParallelogram ( ::basegfx::B2DPoint io_rLeftTop,
::basegfx::B2DPoint io_rLeftBottom,
::basegfx::B2DPoint io_rRightTop,
::basegfx::B2DPoint io_rRightBottom,
const ::basegfx::B2DRange rFitTarget 
)

Expand given parallelogram, such that it extends beyond bound rect in a given direction.

This method is useful when e.g. generating one-dimensional gradients, such as linear or axial gradients: those gradients vary only in one direction, the other has constant color. Most of the time, those gradients extends infinitely in the direction with the constant color, but practically, one always has a limiting bound rect into which the gradient is painted. The method at hand now extends a given parallelogram (e.g. the transformed bounding box of a gradient) virtually into infinity to the top and to the bottom (i.e. normal to the line io_rLeftTop io_rRightTop), such that the given rectangle is guaranteed to be covered in that direction.

Attention: \n There might be some peculiarities with this
method, that might limit its usage to the described gradients. One of them is the fact that when determining how far the parallelogram has to be extended to the top or the bottom, the upper and lower border are assumed to be infinite lines.
Parameters
io_rLeftTopLeft, top edge of the parallelogramm. Note that this need not be the left, top edge geometrically, it's just used when determining the extension direction. Thus, it's perfectly legal to affine-transform a rectangle, and given the transformed point here. On method return, this parameter will contain the adapted output.
io_rLeftBottomLeft, bottom edge of the parallelogramm. Note that this need not be the left, bottom edge geometrically, it's just used when determining the extension direction. Thus, it's perfectly legal to affine-transform a rectangle, and given the transformed point here. On method return, this parameter will contain the adapted output.
io_rRightTopRight, top edge of the parallelogramm. Note that this need not be the right, top edge geometrically, it's just used when determining the extension direction. Thus, it's perfectly legal to affine-transform a rectangle, and given the transformed point here. On method return, this parameter will contain the adapted output.
io_rRightBottomRight, bottom edge of the parallelogramm. Note that this need not be the right, bottom edge geometrically, it's just used when determining the extension direction. Thus, it's perfectly legal to affine-transform a rectangle, and given the transformed point here. On method return, this parameter will contain the adapted output.
rFitTargetThe rectangle to fit the parallelogram into.

Definition at line 77 of file tools.cxx.

References basegfx::B2DVector::normalize().

◆ interpolate() [1/2]

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::interpolate ( const B2DPolygon rOld1,
const B2DPolygon rOld2,
double  t 
)

◆ interpolate() [2/2]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::interpolate ( const B2DPolyPolygon rOld1,
const B2DPolyPolygon rOld2,
double  t 
)

◆ invertNormals() [1/2]

BASEGFX_DLLPUBLIC B3DPolygon basegfx::utils::invertNormals ( const B3DPolygon rCandidate)

◆ invertNormals() [2/2]

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::invertNormals ( const B3DPolyPolygon rCandidate)

invert normals for given 3d geometry.

Definition at line 398 of file b3dpolypolygontools.cxx.

References basegfx::B3DPolyPolygon::append(), and invertNormals().

◆ isConvex()

BASEGFX_DLLPUBLIC bool basegfx::utils::isConvex ( const B2DPolygon rCandidate)

◆ isInEpsilonRange() [1/3]

BASEGFX_DLLPUBLIC bool basegfx::utils::isInEpsilonRange ( const B2DPoint rEdgeStart,
const B2DPoint rEdgeEnd,
const B2DPoint rTestPosition,
double  fDistance 
)

◆ isInEpsilonRange() [2/3]

BASEGFX_DLLPUBLIC bool basegfx::utils::isInEpsilonRange ( const B2DPolygon rCandidate,
const B2DPoint rTestPosition,
double  fDistance 
)

◆ isInEpsilonRange() [3/3]

BASEGFX_DLLPUBLIC bool basegfx::utils::isInEpsilonRange ( const B2DPolyPolygon rCandidate,
const B2DPoint rTestPosition,
double  fDistance 
)

Definition at line 240 of file b2dpolypolygontools.cxx.

References isInEpsilonRange().

◆ isInside() [1/5]

BASEGFX_DLLPUBLIC bool basegfx::utils::isInside ( const B2DPolygon rCandidate,
const B2DPoint rPoint,
bool  bWithBorder 
)

◆ isInside() [2/5]

BASEGFX_DLLPUBLIC bool basegfx::utils::isInside ( const B2DPolygon rCandidate,
const B2DPolygon rPolygon,
bool  bWithBorder 
)

◆ isInside() [3/5]

BASEGFX_DLLPUBLIC bool basegfx::utils::isInside ( const B2DPolyPolygon rCandidate,
const B2DPoint rPoint,
bool  bWithBorder 
)

◆ isInside() [4/5]

BASEGFX_DLLPUBLIC bool basegfx::utils::isInside ( const B3DPolygon rCandidate,
const B3DPoint rPoint,
bool  bWithBorder 
)

◆ isInside() [5/5]

BASEGFX_DLLPUBLIC bool basegfx::utils::isInside ( const B3DPolyPolygon rCandidate,
const B3DPoint rPoint 
)

◆ isPointInTriangle()

BASEGFX_DLLPUBLIC bool basegfx::utils::isPointInTriangle ( const B2DPoint rA,
const B2DPoint rB,
const B2DPoint rC,
const B2DPoint rCandidate,
bool  bWithBorder 
)

Definition at line 2130 of file b2dpolygontools.cxx.

References arePointsOnSameSideOfLine().

◆ isPointOnEdge()

BASEGFX_DLLPUBLIC bool basegfx::utils::isPointOnEdge ( const B2DPoint rPoint,
const B2DPoint rEdgeStart,
const B2DVector rEdgeDelta,
double *  pCut 
)

◆ isPointOnLine() [1/2]

BASEGFX_DLLPUBLIC bool basegfx::utils::isPointOnLine ( const B2DPoint rStart,
const B2DPoint rEnd,
const B2DPoint rCandidate,
bool  bWithPoints 
)

◆ isPointOnLine() [2/2]

BASEGFX_DLLPUBLIC bool basegfx::utils::isPointOnLine ( const B3DPoint rStart,
const B3DPoint rEnd,
const B3DPoint rCandidate,
bool  bWithPoints 
)

◆ isPointOnPolygon() [1/2]

BASEGFX_DLLPUBLIC bool basegfx::utils::isPointOnPolygon ( const B2DPolygon rCandidate,
const B2DPoint rPoint,
bool  bWithPoints 
)

◆ isPointOnPolygon() [2/2]

BASEGFX_DLLPUBLIC bool basegfx::utils::isPointOnPolygon ( const B3DPolygon rCandidate,
const B3DPoint rPoint 
)

◆ isRectangle() [1/2]

BASEGFX_DLLPUBLIC bool basegfx::utils::isRectangle ( const B2DPolygon rPoly)

Predicate whether a given polygon is a rectangle.

Parameters
rPolyPolygon to check
Returns
true, if the polygon describes a rectangle (polygon is closed, and the points are either cw or ccw enumerations of a rectangle's vertices). Note that intermediate points and duplicate points are ignored.

Definition at line 2208 of file b2dpolygontools.cxx.

References basegfx::B2DPolygon::areControlPointsUsed(), basegfx::B2DPolygon::count(), basegfx::B2DPolygon::getB2DPoint(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), i, basegfx::B2DPolygon::isClosed(), and nCount.

Referenced by clipPolyPolygonOnPolyPolygon(), isRectangle(), and solvePolygonOperationAnd().

◆ isRectangle() [2/2]

BASEGFX_DLLPUBLIC bool basegfx::utils::isRectangle ( const B2DPolyPolygon rPoly)

Predicate whether a given poly-polygon is a rectangle.

Parameters
rPolytools::PolyPolygon to check
Returns
true, if the poly-polygon describes a rectangle (contains exactly one polygon, polygon is closed, and the points are either cw or ccw enumerations of a rectangle's vertices). Note that intermediate points and duplicate points are ignored.

Definition at line 377 of file b2dpolypolygontools.cxx.

References basegfx::B2DPolyPolygon::count(), basegfx::B2DPolyPolygon::getB2DPolygon(), and isRectangle().

◆ lerp()

template<typename ValueType >
ValueType basegfx::utils::lerp ( const ValueType rFrom,
const ValueType rTo,
double  t 
)

Generic linear interpolator.

Template parameter: \n ValueType
Must have operator+ and operator* defined, and should have value semantics.
Parameters
tAs usual, t must be in the [0,1] range

Definition at line 33 of file lerp.hxx.

References t.

◆ makeStartPoint()

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::makeStartPoint ( const B2DPolygon rCandidate,
sal_uInt32  nIndexOfNewStatPoint 
)

◆ mergeToSinglePolyPolygon()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::mergeToSinglePolyPolygon ( const B2DPolyPolygonVector rInput)

merge all single PolyPolygons to a single, OR-ed PolyPolygon

Parameters
rInputThe source PolyPolygons
Returns
A single tools::PolyPolygon containing the Or-merged result

Definition at line 1057 of file b2dpolypolygoncutter.cxx.

References a, basegfx::B2DPolyPolygon::append(), basegfx::B2DPolyPolygon::getB2DRange(), basegfx::Range2D< TYPE, TRAITS >::overlaps(), prepareForPolygonOperation(), basegfx::B2DPolyPolygon::reserve(), and solvePolygonOperationOr().

◆ number2PolyPolygon()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::number2PolyPolygon ( double  fVal,
sal_Int32  nTotalDigits,
sal_Int32  nDecPlaces,
bool  bLitSegments = true 
)

Creates polypolygon with the given number as seven-segment digits.

Parameters
fValValue to convert
nTotalDigitsTotal number of digits to display. If less is needed for given number, fill space with blanks.
nDecPlacesDecimal places to show. When 0, display as integer. When negative, fill given number of before-the-decimal point with zero.
bLitSegmentsWhen true, return a polygon containing the segments that are 'lit' for the given number. Return un-lit segments otherwise.

Definition at line 20 of file numbertools.cxx.

References basegfx::B2DPolyPolygon::append(), createSevenSegmentPolyPolygon(), i, basegfx::B2DHomMatrix::identity(), basegfx::B2DPolyPolygon::transform(), and basegfx::B2DHomMatrix::translate().

◆ openWithGeometryChange()

BASEGFX_DLLPUBLIC void basegfx::utils::openWithGeometryChange ( B2DPolygon rCandidate)

◆ prepareColorStops()

BASEGFX_DLLPUBLIC void basegfx::utils::prepareColorStops ( const basegfx::BGradient rGradient,
BColorStops rColorStops,
BColor rSingleColor 
)

◆ prepareForPolygonOperation() [1/2]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::prepareForPolygonOperation ( const B2DPolygon rCandidate)

prep for ops - solve self-intersections and intersections, remove neutral parts and check orientations.

Definition at line 904 of file b2dpolypolygoncutter.cxx.

References correctOrientations(), and stripNeutralPolygons().

Referenced by basegfx::utils::ImplB2DClipState::commitPendingPolygons(), and mergeToSinglePolyPolygon().

◆ prepareForPolygonOperation() [2/2]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::prepareForPolygonOperation ( const B2DPolyPolygon rCandidate)

prep for ops - solve self-intersections and intersections, remove neutral parts and check orientations.

Definition at line 912 of file b2dpolypolygoncutter.cxx.

References correctOrientations(), and stripNeutralPolygons().

◆ removeNeutralPoints()

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::removeNeutralPoints ( const B2DPolygon rCandidate)

◆ reSegmentPolygon()

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::reSegmentPolygon ( const B2DPolygon rCandidate,
sal_uInt32  nSegments 
)

◆ reSegmentPolyPolygon()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::reSegmentPolyPolygon ( const B2DPolyPolygon rCandidate,
sal_uInt32  nSegments 
)

◆ rgb2hsl()

BASEGFX_DLLPUBLIC BColor basegfx::utils::rgb2hsl ( const BColor rRGBColor)

Transform from RGB to HSL.

Definition at line 27 of file bcolortools.cxx.

References d, basegfx::fTools::equalZero(), basegfx::BColor::getBlue(), basegfx::BColor::getGreen(), basegfx::BColor::getRed(), and h.

◆ rgb2hsv()

BASEGFX_DLLPUBLIC BColor basegfx::utils::rgb2hsv ( const BColor rRGBColor)

Transform from RGB to HSV.

Definition at line 104 of file bcolortools.cxx.

References basegfx::fTools::equalZero(), basegfx::BColor::getBlue(), basegfx::BColor::getGreen(), basegfx::BColor::getRed(), h, and v.

◆ scissorLineSegment()

static sal_uInt32 basegfx::utils::scissorLineSegment ( ::basegfx::B2DPoint in_vertex,
sal_uInt32  in_count,
::basegfx::B2DPoint out_vertex,
scissor_plane const *  pPlane,
const ::basegfx::B2DRectangle rR 
)
static

◆ setContinuityInPoint()

BASEGFX_DLLPUBLIC bool basegfx::utils::setContinuityInPoint ( B2DPolygon rCandidate,
sal_uInt32  nIndex,
B2VectorContinuity  eContinuity 
)

◆ simplifyCurveSegments() [1/2]

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::simplifyCurveSegments ( const B2DPolygon rCandidate)

◆ simplifyCurveSegments() [2/2]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::simplifyCurveSegments ( const B2DPolyPolygon rCandidate)

◆ snapPointsOfHorizontalOrVerticalEdges() [1/3]

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::snapPointsOfHorizontalOrVerticalEdges ( const B2DPolygon rCandidate)

snap some polygon coordinates to discrete coordinates

This method allows to snap some polygon points to discrete (integer) values which equals e.g. a snap to discrete coordinates. It will snap points of horizontal and vertical edges

Parameters
rCandidateThe source polygon
Returns
The modified version of the source polygon

Definition at line 3104 of file b2dpolygontools.cxx.

References a, basegfx::B2DPolygon::count(), basegfx::fround(), basegfx::B2DPolygon::getB2DPoint(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), and basegfx::B2DPolygon::setB2DPoint().

Referenced by snapPointsOfHorizontalOrVerticalEdges().

◆ snapPointsOfHorizontalOrVerticalEdges() [2/3]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::snapPointsOfHorizontalOrVerticalEdges ( const B2DPolyPolygon rCandidate)

snap some polygon coordinates to discrete coordinates

This method allows to snap some polygon points to discrete (integer) values which equals e.g. a snap to discrete coordinates. It will snap points of horizontal and vertical edges

Parameters
rCandidateThe source polygon
Returns
The modified version of the source polygon

Definition at line 406 of file b2dpolypolygontools.cxx.

References basegfx::B2DPolyPolygon::append(), and snapPointsOfHorizontalOrVerticalEdges().

◆ snapPointsOfHorizontalOrVerticalEdges() [3/3]

BASEGFX_DLLPUBLIC B3DPolygon basegfx::utils::snapPointsOfHorizontalOrVerticalEdges ( const B3DPolygon rCandidate)

snap some polygon coordinates to discrete coordinates

This method allows to snap some polygon points to discrete (integer) values which equals e.g. a snap to discrete coordinates. It will snap points of horizontal and vertical edges

Parameters
rCandidateThe source polygon
Returns
The modified version of the source polygon

Definition at line 767 of file b3dpolygontools.cxx.

References a, basegfx::B3DPolygon::count(), basegfx::fround(), basegfx::B3DPolygon::getB3DPoint(), basegfx::Tuple3D< TYPE >::getX(), basegfx::Tuple3D< TYPE >::getY(), basegfx::Tuple3D< TYPE >::getZ(), and basegfx::B3DPolygon::setB3DPoint().

◆ solveCrossovers() [1/3]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::solveCrossovers ( const B2DPolygon rCandidate)

Solve all crossovers (aka self-intersections) in a Polygon.

Same as above, but for single polygons. Result will be free of self-intersections. When result contains multiple polygons, it may be necessary to rearrange their orientations since holes may have been created (possibly use correctOrientations).

Definition at line 689 of file b2dpolypolygoncutter.cxx.

◆ solveCrossovers() [2/3]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::solveCrossovers ( const B2DPolyPolygon rCandidate,
size_t *  pPointLimit = nullptr 
)

Solve all crossovers (aka self-intersections) in a polyPolygon.

This re-layouts all contained polygons so that the result will contain only non-cutting polygons. For that reason, points will be added at crossover and touch points and the single Polygons may be re-combined. The orientations of the contained polygons in not changed but used as topological information. Self crossovers of the contained sub-polygons are implicitly handled, but to not lose the topological information, it may be necessary to remove self-intersections of the contained sub-polygons in a preparing step and to explicitly correct their orientations.

Definition at line 676 of file b2dpolypolygoncutter.cxx.

References basegfx::B2DPolyPolygon::count().

Referenced by clipPolyPolygonOnPolyPolygon(), basegfx::utils::ImplB2DClipState::commitPendingPolygons(), createNonzeroConform(), basegfx::ImplB2DPolyRange::solveCrossovers(), solvePolygonOperationAnd(), solvePolygonOperationDiff(), solvePolygonOperationOr(), and solvePolygonOperationXor().

◆ solveCrossovers() [3/3]

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::solveCrossovers ( const std::vector< B2DRange > &  rRanges,
const std::vector< B2VectorOrientation > &  rOrientations 
)

Extract poly-polygon w/o self-intersections from poly-range.

Similar to the solveCrossovers(const B2DPolyPolygon&) method, this one calculates a self-intersection-free poly-polygon with the same topology, and encoding inside/outsidedness via polygon orientation and layering.

Definition at line 836 of file b2drangeclipper.cxx.

References basegfx::B2DPolyPolygon::reserve().

◆ solvePolygonOperationAnd()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::solvePolygonOperationAnd ( const B2DPolyPolygon rCandidateA,
const B2DPolyPolygon rCandidateB 
)

◆ solvePolygonOperationDiff()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::solvePolygonOperationDiff ( const B2DPolyPolygon rCandidateA,
const B2DPolyPolygon rCandidateB 
)

◆ solvePolygonOperationOr()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::solvePolygonOperationOr ( const B2DPolyPolygon rCandidateA,
const B2DPolyPolygon rCandidateB 
)

◆ solvePolygonOperationXor()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::solvePolygonOperationXor ( const B2DPolyPolygon rCandidateA,
const B2DPolyPolygon rCandidateB 
)

◆ stripDispensablePolygons()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::stripDispensablePolygons ( const B2DPolyPolygon rCandidate,
bool  bKeepAboveZero = false 
)

Remove unnecessary/non-displayed polygons.

Works only correct with self-intersection-free polygons. For each polygon, the depth for the PolyPolygon is calculated. The orientation is used to identify holes. Start value for holes is -1, for polygons it's zero. Ech time a polygon is contained in another one, it's depth is increased when inside a polygon, decreased when inside a hole. The result is a depth which e.g. is -1 for holes outside everything, 1 for a polygon covered by another polygon and zero for e.g. holes in a polygon or polygons outside everything else. In the 2nd step, all polygons with depth other than zero are removed. If bKeepAboveZero is used, all polygons < 1 are removed. The bKeepAboveZero mode is useful for clipping, e.g. just append one polygon to another and use this mode -> only parts where two polygons overlapped will be kept. In combination with correct orientation of the input orientations and the SolveCrossover calls this can be combined for logical polygon operations or polygon clipping.

Definition at line 802 of file b2dpolypolygoncutter.cxx.

References a, basegfx::B2DPolyPolygon::append(), basegfx::B2DPolyPolygon::count(), basegfx::B2DPolyPolygon::getB2DPolygon(), getOrientation(), getRange(), isInside(), nCount, basegfx::Negative, and basegfx::Positive.

Referenced by clipPolyPolygonOnPolyPolygon(), basegfx::utils::ImplB2DClipState::commitPendingPolygons(), basegfx::utils::ImplB2DClipState::commitPendingRanges(), solvePolygonOperationAnd(), solvePolygonOperationDiff(), and solvePolygonOperationOr().

◆ stripNeutralPolygons()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::stripNeutralPolygons ( const B2DPolyPolygon rCandidate)

Strip neutral polygons from PolyPolygon.

Neutral polygons are ones who's orientation is neutral, so normally they have no volume -> just closed paths. A polygon with the same positive and negative oriented volume is also neutral, so this may not be wanted. It is safe to call with self-intersection-free polygons, though (that's where it's mostly used).

Definition at line 695 of file b2dpolypolygoncutter.cxx.

References basegfx::B2DPolyPolygon::append(), getOrientation(), and basegfx::Neutral.

Referenced by clipPolyPolygonOnPolyPolygon(), basegfx::utils::ImplB2DClipState::commitPendingPolygons(), basegfx::utils::ImplB2DClipState::commitPendingRanges(), createNonzeroConform(), prepareForPolygonOperation(), solvePolygonOperationAnd(), solvePolygonOperationDiff(), solvePolygonOperationOr(), and solvePolygonOperationXor().

◆ synchronizeColorStops()

BASEGFX_DLLPUBLIC void basegfx::utils::synchronizeColorStops ( BColorStops rColorStops,
BColorStops rAlphaStops,
const BColor rSingleColor,
const BColor rSingleAlpha 
)

◆ trapezoidSubdivide()

BASEGFX_DLLPUBLIC void basegfx::utils::trapezoidSubdivide ( B2DTrapezoidVector ro_Result,
const B2DPolyPolygon rSourcePolyPolygon 
)

Definition at line 939 of file b2dtrapezoid.cxx.

◆ UnoHomogenMatrixToB3DHomMatrix()

BASEGFX_DLLPUBLIC B3DHomMatrix basegfx::utils::UnoHomogenMatrixToB3DHomMatrix ( const com::sun::star::drawing::HomogenMatrix &  rMatrixIn)

Definition at line 25 of file b3dhommatrixtools.cxx.

References basegfx::B3DHomMatrix::set().

◆ UnoPointSequenceSequenceToB2DPolyPolygon()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::UnoPointSequenceSequenceToB2DPolyPolygon ( const css::drawing::PointSequenceSequence &  rPointSequenceSequenceSource)

converters for css::drawing::PointSequence

Definition at line 552 of file b2dpolypolygontools.cxx.

References basegfx::B2DPolyPolygon::append(), basegfx::B2DPolyPolygon::reserve(), and UnoPointSequenceToB2DPolygon().

◆ UnoPointSequenceToB2DPolygon()

BASEGFX_DLLPUBLIC B2DPolygon basegfx::utils::UnoPointSequenceToB2DPolygon ( const css::drawing::PointSequence &  rPointSequenceSource)

converters for css::drawing::PointSequence

Definition at line 3247 of file b2dpolygontools.cxx.

References basegfx::B2DPolygon::append(), checkClosed(), nLength, and basegfx::B2DPolygon::reserve().

Referenced by UnoPointSequenceSequenceToB2DPolyPolygon().

◆ UnoPolygonBezierCoordsToB2DPolygon()

B2DPolygon basegfx::utils::UnoPolygonBezierCoordsToB2DPolygon ( const css::drawing::PointSequence &  rPointSequenceSource,
const css::drawing::FlagSequence &  rFlagSequenceSource 
)

◆ UnoPolyPolygonBezierCoordsToB2DPolyPolygon()

BASEGFX_DLLPUBLIC B2DPolyPolygon basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon ( const css::drawing::PolyPolygonBezierCoords &  rPolyPolygonBezierCoordsSource)

converters for css::drawing::PolyPolygonBezierCoords (curved polygons)

Definition at line 594 of file b2dpolypolygontools.cxx.

References a, basegfx::B2DPolyPolygon::append(), and UnoPolygonBezierCoordsToB2DPolygon().

◆ UnoPolyPolygonShape3DToB3DPolyPolygon()

BASEGFX_DLLPUBLIC B3DPolyPolygon basegfx::utils::UnoPolyPolygonShape3DToB3DPolyPolygon ( const css::drawing::PolyPolygonShape3D &  rPolyPolygonShape3DSource)

converters for css::drawing::PolyPolygonShape3D

Definition at line 461 of file b3dpolypolygontools.cxx.

References a, basegfx::B3DPolygon::append(), basegfx::B3DPolyPolygon::append(), and checkClosed().