31#include <com/sun/star/drawing/LineCap.hpp>
46 const double fDiscreteHalfLineWidth(aDiscreteSize.getLength() * 0.5);
50 rRange.
grow(fDiscreteHalfLineWidth);
67 if (BasePrimitive2D::operator==(rPrimitive))
86 implGrowHairline(aRetval, rViewInformation);
110 if (BasePrimitive2D::operator==(rPrimitive))
128 implGrowHairline(aRetval, rViewInformation);
145 std::vector<basegfx::B2DPoint> aPoints = {
getStart() };
148 rVisitor.
visit(aSequence);
155 rVisitor.
visit(aSequence);
162 , maB2DRange(rB2DRange)
169 if (BasePrimitive2D::operator==(rPrimitive))
186 implGrowHairline(aRetval, rViewInformation);
208 rVisitor.
visit(aSequence);
217 const double fLogicDashLength(aDashVector.
getX());
222 std::vector<double> aDash;
226 aDash.push_back(fLogicDashLength);
227 aDash.push_back(fLogicDashLength);
229 &aDashedPolyPolyB, 2.0 * fLogicDashLength);
231 rContainer.push_back(
233 rContainer.push_back(
245 double fDiscreteDashLength)
247 , maRGBColorA(rRGBColorA)
248 , maRGBColorB(rRGBColorB)
249 , mfDiscreteDashLength(fDiscreteDashLength)
255 if (BufferedDecompositionPrimitive2D::operator==(rPrimitive))
281 const double fDiscreteHalfLineWidth(aDiscreteSize.
getLength() * 0.5);
285 aRetval.
grow(fDiscreteHalfLineWidth);
297 bool bNeedNewDecomposition(
false);
304 bNeedNewDecomposition =
true;
308 if (bNeedNewDecomposition)
350 aHairLinePolyPolygon.
append(aB2DPolygon);
356 &aHairLinePolyPolygon,
nullptr,
360 const sal_uInt32
nCount(aHairLinePolyPolygon.
count());
375 aHairLinePolyPolygon.
getB2DPolygon(
a), fHalfLineWidth, aLineJoin, aLineCap,
377 0.4 , fMiterMinimumAngle));
381 for (sal_uInt32 b(0); b < aAreaPolyPolygon.
count(); b++)
388 rContainer.push_back(
403 , maLineAttribute(rLineAttribute)
404 , maStrokeAttribute(
std::move(aStrokeAttribute))
416 , maLineAttribute(rLineAttribute)
427 if (BufferedDecompositionPrimitive2D::operator==(rPrimitive))
451 bool bUseDecomposition(
false);
457 bUseDecomposition =
true;
460 if (!bUseDecomposition && css::drawing::LineCap_SQUARE ==
getLineAttribute().getLineCap())
481 bUseDecomposition =
true;
484 if (bUseDecomposition)
545 = aTemporaryPrimitiveWithoutStroke
546 ->BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation);
581 const double fDiscreteHalfLineWidth(aDiscreteSize.
getLength() * 0.5);
585 aHairlineRange.
grow(fDiscreteHalfLineWidth);
589 return aHairlineRange;
607 if (bHasWidth && bHasHeight)
626 double fWaveWidth,
double fWaveHeight)
628 , mfWaveWidth(fWaveWidth)
629 , mfWaveHeight(fWaveHeight)
644 double fWaveWidth,
double fWaveHeight)
646 , mfWaveWidth(fWaveWidth)
647 , mfWaveHeight(fWaveHeight)
662 if (PolygonStrokePrimitive2D::operator==(rPrimitive))
716 double fStartOverlap(0.0);
717 double fEndOverlap(0.0);
724 fPolyLength,
getStart().isCentered() ? 0.5 : 0.0, &fStart);
735 aLocalPolygon,
getEnd().getB2DPolyPolygon(),
false,
getEnd().getWidth(),
736 fPolyLength,
getEnd().isCentered() ? 0.5 : 0.0, &fEnd);
742 if (0.0 != fStart || 0.0 != fEnd)
747 fPolyLength - fEnd + fEndOverlap, fPolyLength);
757 rContainer.push_back(
763 rContainer.push_back(
789 if (PolygonStrokePrimitive2D::operator==(rPrimitive))
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
B2DRange const & getB2DRange() const
void removeDoublePoints()
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &rViewInformation) const
The default implementation will use getDecomposition results to create the range.
const Primitive2DContainer & getBuffered2DDecomposition() const
access methods to maBuffered2DDecomposition.
void setBuffered2DDecomposition(Primitive2DContainer &&rNew)
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
The getDecomposition default implementation will on demand use create2DDecomposition() if maBuffered2...
LineRectanglePrimitive2D class.
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
return as PolygonHairlinePrimitive2D
const basegfx::B2DRange & getB2DRange() const
data read access
const basegfx::BColor & getBColor() const
LineRectanglePrimitive2D(const basegfx::B2DRange &rB2DRange, const basegfx::BColor &rBColor)
constructor
PointArrayPrimitive2D class.
PolyPolygonColorPrimitive2D class.
PolyPolygonHairlinePrimitive2D class.
PolygonHairlinePrimitive2D class.
const basegfx::BColor & getBColor() const
PolygonHairlinePrimitive2D(basegfx::B2DPolygon aPolygon, const basegfx::BColor &rBColor)
constructor
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
const basegfx::B2DPolygon & getB2DPolygon() const
data read access
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &rViewInformation) const override
get range
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
PolygonMarkerPrimitive2D class.
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
Override standard getDecomposition to be view-dependent here.
PolygonMarkerPrimitive2D(basegfx::B2DPolygon aPolygon, const basegfx::BColor &rRGBColorA, const basegfx::BColor &rRGBColorB, double fDiscreteDashLength)
constructor
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &rViewInformation) const override
get range
const basegfx::BColor & getRGBColorB() const
const basegfx::B2DPolygon & getB2DPolygon() const
data read access
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const override
local decomposition.
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
double getDiscreteDashLength() const
basegfx::B2DHomMatrix maLastInverseObjectToViewTransformation
decomposition is view-dependent, remember last InverseObjectToViewTransformation
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
const basegfx::BColor & getRGBColorA() const
PolygonStrokeArrowPrimitive2D class.
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const override
local decomposition.
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
const attribute::LineStartEndAttribute & getStart() const
data read access
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
const attribute::LineStartEndAttribute & getEnd() const
PolygonStrokeArrowPrimitive2D(const basegfx::B2DPolygon &rPolygon, const attribute::LineAttribute &rLineAttribute, const attribute::StrokeAttribute &rStrokeAttribute, const attribute::LineStartEndAttribute &rStart, const attribute::LineStartEndAttribute &rEnd)
constructor
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &rViewInformation) const override
get range
PolygonStrokePrimitive2D class.
basegfx::B2DPolygon maPolygon
the line geometry
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
const attribute::StrokeAttribute & getStrokeAttribute() const
PolygonStrokePrimitive2D(basegfx::B2DPolygon aPolygon, const attribute::LineAttribute &rLineAttribute, attribute::StrokeAttribute aStrokeAttribute)
constructor
basegfx::B2DRange maBufferedRange
the buffered result of PolygonStrokePrimitive2D::getB2DRange
const basegfx::B2DPolygon & getB2DPolygon() const
data read access
const attribute::LineAttribute & getLineAttribute() const
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &rViewInformation) const override
get range
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const override
local decomposition.
PolygonWavePrimitive2D class.
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const override
local decomposition.
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
double mfWaveWidth
wave definition
double getWaveHeight() const
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &rViewInformation) const override
get range
double getWaveWidth() const
data read access
PolygonWavePrimitive2D(const basegfx::B2DPolygon &rPolygon, const attribute::LineAttribute &rLineAttribute, const attribute::StrokeAttribute &rStrokeAttribute, double fWaveWidth, double fWaveHeight)
constructor
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
virtual void visit(const Primitive2DReference &)=0
SingleLinePrimitive2D class.
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &rViewInformation) const override
get range
const basegfx::BColor & getBColor() const
const basegfx::B2DPoint & getStart() const
data read access
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
return as PolygonHairlinePrimitive2D
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
const basegfx::B2DPoint & getEnd() const
SingleLinePrimitive2D(const basegfx::B2DPoint &rStart, const basegfx::B2DPoint &rEnd, const basegfx::BColor &rBColor)
constructor
#define PRIMITIVE2D_ID_LINERECTANGLEPRIMITIVE2D
#define PRIMITIVE2D_ID_POLYGONMARKERPRIMITIVE2D
#define PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D
#define PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D
#define PRIMITIVE2D_ID_SINGLELINEPRIMITIVE2D
#define PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D
#define PRIMITIVE2D_ID_POLYGONSTROKEARROWPRIMITIVE2D
double getLength(const B2DPolygon &rCandidate)
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
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))
void applyLineDashing(const B2DPolygon &rCandidate, const std::vector< double > &rDotDashArray, B2DPolyPolygon *pLineTarget, B2DPolyPolygon *pGapTarget, double fDotDashLength)
B2DPolygon createWaveline(const B2DPolygon &rCandidate, double fWaveWidth, double fWaveHeight)
B2DPolygon getSnippetAbsolute(const B2DPolygon &rCandidate, double fFrom, double fTo, double fLength)
B2DPolygon simplifyCurveSegments(const B2DPolygon &rCandidate)
B2DPolyPolygon createAreaGeometryForLineStartEnd(const B2DPolygon &rCandidate, const B2DPolyPolygon &rArrow, bool bStart, double fWidth, double fCandidateLength, double fDockingPosition, double *pConsumedLength=nullptr, double fShift=0.0)
constexpr double deg2rad(double v)