LibreOffice Module tools (master) 1
|
#include <poly.hxx>
Public Member Functions | |
PolyPolygon (sal_uInt16 nInitSize=16) | |
PolyPolygon (const tools::Polygon &rPoly) | |
PolyPolygon (const tools::Rectangle &) | |
PolyPolygon (const tools::PolyPolygon &rPolyPoly) | |
PolyPolygon (tools::PolyPolygon &&rPolyPoly) noexcept | |
~PolyPolygon () | |
void | Insert (const tools::Polygon &rPoly, sal_uInt16 nPos=POLYPOLY_APPEND) |
void | Remove (sal_uInt16 nPos) |
void | Replace (const Polygon &rPoly, sal_uInt16 nPos) |
const tools::Polygon & | GetObject (sal_uInt16 nPos) const |
bool | IsRect () const |
void | Clear () |
sal_uInt16 | Count () const |
tools::Rectangle | GetBoundRect () const |
void | Clip (const tools::Rectangle &rRect) |
void | Optimize (PolyOptimizeFlags nOptimizeFlags) |
void | AdaptiveSubdivide (tools::PolyPolygon &rResult) const |
Adaptive subdivision of polygons with curves. More... | |
void | GetIntersection (const tools::PolyPolygon &rPolyPoly, tools::PolyPolygon &rResult) const |
void | GetUnion (const tools::PolyPolygon &rPolyPoly, tools::PolyPolygon &rResult) const |
void | Move (tools::Long nHorzMove, tools::Long nVertMove) |
void | Translate (const Point &rTrans) |
void | Scale (double fScaleX, double fScaleY) |
void | Rotate (const Point &rCenter, double fSin, double fCos) |
void | Rotate (const Point &rCenter, Degree10 nAngle10) |
const tools::Polygon & | operator[] (sal_uInt16 nPos) const |
tools::Polygon & | operator[] (sal_uInt16 nPos) |
tools::PolyPolygon & | operator= (const tools::PolyPolygon &rPolyPoly) |
tools::PolyPolygon & | operator= (tools::PolyPolygon &&rPolyPoly) noexcept |
bool | operator== (const tools::PolyPolygon &rPolyPoly) const |
bool | operator!= (const tools::PolyPolygon &rPolyPoly) const |
void | Read (SvStream &rIStream) |
void | Write (SvStream &rOStream) const |
::basegfx::B2DPolyPolygon | getB2DPolyPolygon () const |
PolyPolygon (const ::basegfx::B2DPolyPolygon &rPolyPolygon) | |
Static Public Member Functions | |
static tools::PolyPolygon | SubdivideBezier (const tools::PolyPolygon &rPolyPoly) |
Private Types | |
enum class | PolyClipOp { INTERSECT , UNION } |
Private Member Functions | |
TOOLS_DLLPRIVATE void | ImplDoOperation (const tools::PolyPolygon &rPolyPoly, tools::PolyPolygon &rResult, PolyClipOp nOperation) const |
Private Attributes | |
o3tl::cow_wrapper< ImplPolyPolygon > | mpImplPolyPolygon |
Friends | |
TOOLS_DLLPUBLIC friend SvStream & | ReadPolyPolygon (SvStream &rIStream, tools::PolyPolygon &rPolyPoly) |
TOOLS_DLLPUBLIC friend SvStream & | WritePolyPolygon (SvStream &rOStream, const tools::PolyPolygon &rPolyPoly) |
|
strongprivate |
|
explicit |
|
explicit |
|
explicit |
tools::PolyPolygon::PolyPolygon | ( | const tools::PolyPolygon & | rPolyPoly | ) |
|
noexcept |
|
explicit |
void tools::PolyPolygon::AdaptiveSubdivide | ( | tools::PolyPolygon & | rResult | ) | const |
Adaptive subdivision of polygons with curves.
This method adaptively subdivides bezier arcs within the polygon to straight line segments and returns the resulting polygon.
rResult | The resulting subdivided polygon |
If the polygon is in device coordinates, then the difference between the subdivided and the original polygon is guaranteed to be smaller than one pixel.
Definition at line 161 of file poly2.cxx.
References Clear(), i, Insert(), and mpImplPolyPolygon.
Referenced by Optimize().
void tools::PolyPolygon::Clear | ( | ) |
Definition at line 101 of file poly2.cxx.
References mpImplPolyPolygon.
Referenced by AdaptiveSubdivide().
void tools::PolyPolygon::Clip | ( | const tools::Rectangle & | rRect | ) |
Definition at line 280 of file poly2.cxx.
References tools::Rectangle::Bottom(), basegfx::utils::clipPolyPolygonOnRange(), getB2DPolyPolygon(), GetObject(), i, tools::Rectangle::Left(), mpImplPolyPolygon, PolyPolygon(), Remove(), tools::Rectangle::Right(), and tools::Rectangle::Top().
sal_uInt16 tools::PolyPolygon::Count | ( | ) | const |
Definition at line 231 of file poly2.cxx.
References mpImplPolyPolygon.
Referenced by GetObject(), IsRect(), operator[](), Optimize(), Remove(), Replace(), and SubdivideBezier().
basegfx::B2DPolyPolygon tools::PolyPolygon::getB2DPolyPolygon | ( | ) | const |
Definition at line 479 of file poly2.cxx.
References a, basegfx::B2DPolyPolygon::append(), tools::Polygon::getB2DPolygon(), and mpImplPolyPolygon.
Referenced by Clip(), and ImplDoOperation().
tools::Rectangle tools::PolyPolygon::GetBoundRect | ( | ) | const |
Definition at line 320 of file poly2.cxx.
References tools::Polygon::GetConstPointAry(), tools::Polygon::GetSize(), i, mpImplPolyPolygon, n, Point::X(), and Point::Y().
Referenced by Optimize().
void tools::PolyPolygon::GetIntersection | ( | const tools::PolyPolygon & | rPolyPoly, |
tools::PolyPolygon & | rResult | ||
) | const |
Definition at line 185 of file poly2.cxx.
References ImplDoOperation(), and INTERSECT.
const tools::Polygon & tools::PolyPolygon::GetObject | ( | sal_uInt16 | nPos | ) | const |
Definition at line 86 of file poly2.cxx.
References Count(), mpImplPolyPolygon, and nPos.
Referenced by Clip(), and SubdivideBezier().
void tools::PolyPolygon::GetUnion | ( | const tools::PolyPolygon & | rPolyPoly, |
tools::PolyPolygon & | rResult | ||
) | const |
Definition at line 190 of file poly2.cxx.
References ImplDoOperation(), and UNION.
|
private |
Definition at line 195 of file poly2.cxx.
References getB2DPolyPolygon(), INTERSECT, basegfx::utils::prepareForPolygonOperation(), basegfx::utils::solvePolygonOperationAnd(), basegfx::utils::solvePolygonOperationOr(), and UNION.
Referenced by GetIntersection(), and GetUnion().
void tools::PolyPolygon::Insert | ( | const tools::Polygon & | rPoly, |
sal_uInt16 | nPos = POLYPOLY_APPEND |
||
) |
Definition at line 62 of file poly2.cxx.
References MAX_POLYGONS, mpImplPolyPolygon, and nPos.
Referenced by AdaptiveSubdivide(), and SubdivideBezier().
bool tools::PolyPolygon::IsRect | ( | ) | const |
Definition at line 93 of file poly2.cxx.
References Count(), and mpImplPolyPolygon.
void tools::PolyPolygon::Move | ( | tools::Long | nHorzMove, |
tools::Long | nVertMove | ||
) |
Definition at line 236 of file poly2.cxx.
References i, and mpImplPolyPolygon.
|
inline |
Definition at line 251 of file poly.hxx.
References operator==().
PolyPolygon & tools::PolyPolygon::operator= | ( | const tools::PolyPolygon & | rPolyPoly | ) |
Definition at line 369 of file poly2.cxx.
References mpImplPolyPolygon.
|
noexcept |
bool tools::PolyPolygon::operator== | ( | const tools::PolyPolygon & | rPolyPoly | ) | const |
Polygon & tools::PolyPolygon::operator[] | ( | sal_uInt16 | nPos | ) |
Definition at line 362 of file poly2.cxx.
References Count(), mpImplPolyPolygon, and nPos.
|
inline |
Definition at line 245 of file poly.hxx.
References GetObject(), and nPos.
void tools::PolyPolygon::Optimize | ( | PolyOptimizeFlags | nOptimizeFlags | ) |
Definition at line 106 of file poly2.cxx.
References a, AdaptiveSubdivide(), Count(), EDGES, GetBoundRect(), tools::Rectangle::GetHeight(), tools::Rectangle::GetWidth(), i, tools::Polygon::ImplReduceEdges(), mpImplPolyPolygon, NO_SAME, and Optimize().
Referenced by Optimize().
void tools::PolyPolygon::Read | ( | SvStream & | rIStream | ) |
Definition at line 432 of file poly2.cxx.
References i, tools::Polygon::ImplRead(), mpImplPolyPolygon, SvStream::ReadUInt16(), SvStream::remainingSize(), and SAL_WARN.
void tools::PolyPolygon::Remove | ( | sal_uInt16 | nPos | ) |
void tools::PolyPolygon::Replace | ( | const Polygon & | rPoly, |
sal_uInt16 | nPos | ||
) |
Definition at line 79 of file poly2.cxx.
References Count(), mpImplPolyPolygon, and nPos.
Definition at line 262 of file poly2.cxx.
References Rotate(), and toRadians().
void tools::PolyPolygon::Rotate | ( | const Point & | rCenter, |
double | fSin, | ||
double | fCos | ||
) |
void tools::PolyPolygon::Scale | ( | double | fScaleX, |
double | fScaleY | ||
) |
Definition at line 255 of file poly2.cxx.
References i, mpImplPolyPolygon, and nCount.
|
static |
Definition at line 174 of file poly2.cxx.
References Count(), GetObject(), i, Insert(), and tools::Polygon::SubdivideBezier().
void tools::PolyPolygon::Translate | ( | const Point & | rTrans | ) |
Definition at line 248 of file poly2.cxx.
References i, mpImplPolyPolygon, and nCount.
void tools::PolyPolygon::Write | ( | SvStream & | rOStream | ) | const |
Definition at line 465 of file poly2.cxx.
References i, mpImplPolyPolygon, and SvStream::WriteUInt16().
|
friend |
|
friend |
|
private |
Definition at line 190 of file poly.hxx.
Referenced by AdaptiveSubdivide(), Clear(), Clip(), Count(), getB2DPolyPolygon(), GetBoundRect(), GetObject(), Insert(), IsRect(), Move(), operator=(), operator==(), operator[](), Optimize(), Read(), Remove(), Replace(), Rotate(), Scale(), Translate(), and Write().