57 LineInfo::LineInfo(
LineStyle eStyle,
double nWidth )
59 mpImplLineInfo->
meStyle = eStyle;
60 mpImplLineInfo->
mnWidth = nWidth;
63 LineInfo::LineInfo(
const LineInfo& ) =
default;
65 LineInfo::LineInfo(
LineInfo&& ) =
default;
67 LineInfo::~LineInfo() =
default;
73 bool LineInfo::operator==(
const LineInfo& rLineInfo )
const
75 return mpImplLineInfo == rLineInfo.mpImplLineInfo;
78 void LineInfo::SetStyle(
LineStyle eStyle )
80 mpImplLineInfo->
meStyle = eStyle;
83 void LineInfo::SetWidth(
double nWidth )
85 mpImplLineInfo->
mnWidth = nWidth;
88 void LineInfo::SetDashCount( sal_uInt16 nDashCount )
93 void LineInfo::SetDashLen(
double nDashLen )
98 void LineInfo::SetDotCount( sal_uInt16 nDotCount )
103 void LineInfo::SetDotLen(
double nDotLen )
108 void LineInfo::SetDistance(
double nDistance )
118 void LineInfo::SetLineCap(css::drawing::LineCap eLineCap)
123 bool LineInfo::IsDefault()
const
125 return( !mpImplLineInfo->
mnWidth
127 && ( css::drawing::LineCap_BUTT == mpImplLineInfo->
meLineCap));
134 if (!std::isfinite(fTmp) || fTmp < std::numeric_limits<sal_Int32>::min() || fTmp > std::numeric_limits<sal_Int32>::max())
136 SAL_WARN(
"vcl",
"Parsing error: out of range double: " << fTmp);
145 sal_uInt16 nTmp16(0);
151 rLineInfo.mpImplLineInfo->
mnWidth = nTmp32;
157 rLineInfo.mpImplLineInfo->
mnDashLen = nTmp32;
159 rLineInfo.mpImplLineInfo->
mnDotLen = nTmp32;
161 rLineInfo.mpImplLineInfo->
mnDistance = nTmp32;
175 rLineInfo.mpImplLineInfo->
meLineCap =
static_cast<css::drawing::LineCap
>(nTmp16);
220 std::vector< double > LineInfo::GetDotDashArray()
const
222 ::std::vector< double > fDotDashArray;
224 return fDotDashArray;
226 const double fDashLen(GetDashLen());
227 const double fDotLen(GetDotLen());
228 const double fDistance(GetDistance());
230 for(sal_uInt16
a(0);
a < GetDashCount();
a++)
232 fDotDashArray.push_back(fDashLen);
233 fDotDashArray.push_back(fDistance);
236 for(sal_uInt16 b(0); b < GetDotCount(); b++)
238 fDotDashArray.push_back(fDotLen);
239 fDotDashArray.push_back(fDistance);
241 return fDotDashArray;
244 void LineInfo::applyToB2DPolyPolygon(
248 o_rFillPolyPolygon.
clear();
250 if(!io_rLinePolyPolygon.
count())
255 ::std::vector< double > fDotDashArray = GetDotDashArray();
256 const double fAccumulated(::std::accumulate(fDotDashArray.begin(), fDotDashArray.end(), 0.0));
258 if(fAccumulated > 0.0)
262 for(
auto const& rPolygon : std::as_const(io_rLinePolyPolygon))
269 aResult.
append(aLineTarget);
272 io_rLinePolyPolygon = aResult;
276 if(!(GetWidth() > 1 && io_rLinePolyPolygon.
count()))
279 const double fHalfLineWidth((GetWidth() * 0.5) + 0.5);
281 for(
auto const& rPolygon : std::as_const(io_rLinePolyPolygon))
290 io_rLinePolyPolygon.
clear();
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & WriteInt32(sal_Int32 nInt32)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
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), basegfx::triangulator::B2DTriangleVector *pTriangles=nullptr)
exports com.sun.star. drawing
B2IRange fround(const B2DRange &rRange)
void applyLineDashing(const B2DPolygon &rCandidate, const std::vector< double > &rDotDashArray, B2DPolyPolygon *pLineTarget, B2DPolyPolygon *pGapTarget, double fDotDashLength)
SvStream & ReadLineInfo(SvStream &rIStm, LineInfo &rLineInfo)
SvStream & ReadDouble(double &rDouble)
SvStream & ReadInt32(sal_Int32 &rInt32)
bool operator==(const ImplLineInfo &) const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
sal_uInt16 GetVersion() const
basegfx::B2DLineJoin meLineJoin
css::drawing::LineCap meLineCap
static void ReadLimitedDouble(SvStream &rIStm, double &fDest)
#define SAL_WARN(area, stream)
SvStream & WriteDouble(const double &rDouble)
SvStream & WriteLineInfo(SvStream &rOStm, const LineInfo &rLineInfo)