LibreOffice Module tools (master) 1
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
tools::PolyPolygon Class Reference

#include <poly.hxx>

Collaboration diagram for tools::PolyPolygon:
[legend]

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::PolygonGetObject (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::Polygonoperator[] (sal_uInt16 nPos) const
 
tools::Polygonoperator[] (sal_uInt16 nPos)
 
tools::PolyPolygonoperator= (const tools::PolyPolygon &rPolyPoly)
 
tools::PolyPolygonoperator= (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< ImplPolyPolygonmpImplPolyPolygon
 

Friends

TOOLS_DLLPUBLIC friend SvStreamReadPolyPolygon (SvStream &rIStream, tools::PolyPolygon &rPolyPoly)
 
TOOLS_DLLPUBLIC friend SvStreamWritePolyPolygon (SvStream &rOStream, const tools::PolyPolygon &rPolyPoly)
 

Detailed Description

Definition at line 187 of file poly.hxx.

Member Enumeration Documentation

◆ PolyClipOp

enum class tools::PolyPolygon::PolyClipOp
strongprivate
Enumerator
INTERSECT 
UNION 

Definition at line 192 of file poly.hxx.

Constructor & Destructor Documentation

◆ PolyPolygon() [1/6]

tools::PolyPolygon::PolyPolygon ( sal_uInt16  nInitSize = 16)
explicit

Definition at line 34 of file poly2.cxx.

Referenced by Clip().

◆ PolyPolygon() [2/6]

tools::PolyPolygon::PolyPolygon ( const tools::Polygon rPoly)
explicit

Definition at line 39 of file poly2.cxx.

◆ PolyPolygon() [3/6]

tools::PolyPolygon::PolyPolygon ( const tools::Rectangle rRect)
explicit

Definition at line 43 of file poly2.cxx.

◆ PolyPolygon() [4/6]

tools::PolyPolygon::PolyPolygon ( const tools::PolyPolygon rPolyPoly)

Definition at line 48 of file poly2.cxx.

◆ PolyPolygon() [5/6]

tools::PolyPolygon::PolyPolygon ( tools::PolyPolygon &&  rPolyPoly)
noexcept

Definition at line 53 of file poly2.cxx.

◆ ~PolyPolygon()

tools::PolyPolygon::~PolyPolygon ( )

Definition at line 58 of file poly2.cxx.

◆ PolyPolygon() [6/6]

tools::PolyPolygon::PolyPolygon ( const ::basegfx::B2DPolyPolygon rPolyPolygon)
explicit

Member Function Documentation

◆ AdaptiveSubdivide()

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.

Parameters
rResultThe 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().

◆ Clear()

void tools::PolyPolygon::Clear ( )

Definition at line 101 of file poly2.cxx.

References mpImplPolyPolygon.

Referenced by AdaptiveSubdivide().

◆ Clip()

void tools::PolyPolygon::Clip ( const tools::Rectangle rRect)

◆ Count()

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().

◆ getB2DPolyPolygon()

basegfx::B2DPolyPolygon tools::PolyPolygon::getB2DPolyPolygon ( ) const

◆ GetBoundRect()

tools::Rectangle tools::PolyPolygon::GetBoundRect ( ) const

◆ GetIntersection()

void tools::PolyPolygon::GetIntersection ( const tools::PolyPolygon rPolyPoly,
tools::PolyPolygon rResult 
) const

Definition at line 185 of file poly2.cxx.

References ImplDoOperation(), and INTERSECT.

◆ GetObject()

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().

◆ GetUnion()

void tools::PolyPolygon::GetUnion ( const tools::PolyPolygon rPolyPoly,
tools::PolyPolygon rResult 
) const

Definition at line 190 of file poly2.cxx.

References ImplDoOperation(), and UNION.

◆ ImplDoOperation()

void tools::PolyPolygon::ImplDoOperation ( const tools::PolyPolygon rPolyPoly,
tools::PolyPolygon rResult,
PolyClipOp  nOperation 
) const
private

◆ Insert()

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().

◆ IsRect()

bool tools::PolyPolygon::IsRect ( ) const

Definition at line 93 of file poly2.cxx.

References Count(), and mpImplPolyPolygon.

◆ Move()

void tools::PolyPolygon::Move ( tools::Long  nHorzMove,
tools::Long  nVertMove 
)

Definition at line 236 of file poly2.cxx.

References i, and mpImplPolyPolygon.

◆ operator!=()

bool tools::PolyPolygon::operator!= ( const tools::PolyPolygon rPolyPoly) const
inline

Definition at line 251 of file poly.hxx.

References operator==().

◆ operator=() [1/2]

PolyPolygon & tools::PolyPolygon::operator= ( const tools::PolyPolygon rPolyPoly)

Definition at line 369 of file poly2.cxx.

References mpImplPolyPolygon.

◆ operator=() [2/2]

PolyPolygon & tools::PolyPolygon::operator= ( tools::PolyPolygon &&  rPolyPoly)
noexcept

Definition at line 375 of file poly2.cxx.

◆ operator==()

bool tools::PolyPolygon::operator== ( const tools::PolyPolygon rPolyPoly) const

Definition at line 381 of file poly2.cxx.

References mpImplPolyPolygon.

Referenced by operator!=().

◆ operator[]() [1/2]

Polygon & tools::PolyPolygon::operator[] ( sal_uInt16  nPos)

Definition at line 362 of file poly2.cxx.

References Count(), mpImplPolyPolygon, and nPos.

◆ operator[]() [2/2]

const tools::Polygon & tools::PolyPolygon::operator[] ( sal_uInt16  nPos) const
inline

Definition at line 245 of file poly.hxx.

References GetObject(), and nPos.

◆ Optimize()

void tools::PolyPolygon::Optimize ( PolyOptimizeFlags  nOptimizeFlags)

◆ Read()

void tools::PolyPolygon::Read ( SvStream rIStream)

◆ Remove()

void tools::PolyPolygon::Remove ( sal_uInt16  nPos)

Definition at line 72 of file poly2.cxx.

References Count(), mpImplPolyPolygon, and nPos.

Referenced by Clip().

◆ Replace()

void tools::PolyPolygon::Replace ( const Polygon rPoly,
sal_uInt16  nPos 
)

Definition at line 79 of file poly2.cxx.

References Count(), mpImplPolyPolygon, and nPos.

◆ Rotate() [1/2]

void tools::PolyPolygon::Rotate ( const Point rCenter,
Degree10  nAngle10 
)

Definition at line 262 of file poly2.cxx.

References Rotate(), and toRadians().

◆ Rotate() [2/2]

void tools::PolyPolygon::Rotate ( const Point rCenter,
double  fSin,
double  fCos 
)

Definition at line 273 of file poly2.cxx.

References i, mpImplPolyPolygon, and nCount.

Referenced by Rotate().

◆ Scale()

void tools::PolyPolygon::Scale ( double  fScaleX,
double  fScaleY 
)

Definition at line 255 of file poly2.cxx.

References i, mpImplPolyPolygon, and nCount.

◆ SubdivideBezier()

tools::PolyPolygon tools::PolyPolygon::SubdivideBezier ( const tools::PolyPolygon rPolyPoly)
static

Definition at line 174 of file poly2.cxx.

References Count(), GetObject(), i, Insert(), and tools::Polygon::SubdivideBezier().

◆ Translate()

void tools::PolyPolygon::Translate ( const Point rTrans)

Definition at line 248 of file poly2.cxx.

References i, mpImplPolyPolygon, and nCount.

◆ Write()

void tools::PolyPolygon::Write ( SvStream rOStream) const

Definition at line 465 of file poly2.cxx.

References i, mpImplPolyPolygon, and SvStream::WriteUInt16().

Friends And Related Function Documentation

◆ ReadPolyPolygon

TOOLS_DLLPUBLIC friend SvStream & ReadPolyPolygon ( SvStream rIStream,
tools::PolyPolygon rPolyPoly 
)
friend

Definition at line 386 of file poly2.cxx.

◆ WritePolyPolygon

TOOLS_DLLPUBLIC friend SvStream & WritePolyPolygon ( SvStream rOStream,
const tools::PolyPolygon rPolyPoly 
)
friend

Definition at line 419 of file poly2.cxx.

Member Data Documentation

◆ mpImplPolyPolygon

o3tl::cow_wrapper<ImplPolyPolygon> tools::PolyPolygon::mpImplPolyPolygon
private

The documentation for this class was generated from the following files: