xref: /aoo42x/main/tools/inc/tools/poly.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _TL_POLY_HXX
28*cdf0e10cSrcweir #define _TL_POLY_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include "tools/toolsdllapi.h"
31*cdf0e10cSrcweir #include <tools/gen.hxx>
32*cdf0e10cSrcweir #include <tools/debug.hxx>
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #include <vector>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir // -----------
37*cdf0e10cSrcweir // - Defines -
38*cdf0e10cSrcweir // -----------
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir #define POLY_APPEND				(0xFFFF)
41*cdf0e10cSrcweir #define POLYPOLY_APPEND			(0xFFFF)
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir // ------------------------------------------------------------------------
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir #define POLY_OPTIMIZE_NONE		0x00000000UL
46*cdf0e10cSrcweir #define POLY_OPTIMIZE_OPEN		0x00000001UL
47*cdf0e10cSrcweir #define POLY_OPTIMIZE_CLOSE		0x00000002UL
48*cdf0e10cSrcweir #define POLY_OPTIMIZE_NO_SAME	0x00000004UL
49*cdf0e10cSrcweir #define POLY_OPTIMIZE_REDUCE	0x00000008UL
50*cdf0e10cSrcweir #define POLY_OPTIMIZE_EDGES		0x00000010UL
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir // -------------
53*cdf0e10cSrcweir // - PolyStyle -
54*cdf0e10cSrcweir // -------------
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir enum PolyStyle
57*cdf0e10cSrcweir {
58*cdf0e10cSrcweir     POLY_ARC = 1,
59*cdf0e10cSrcweir     POLY_PIE = 2,
60*cdf0e10cSrcweir     POLY_CHORD = 3
61*cdf0e10cSrcweir };
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir // -------------
64*cdf0e10cSrcweir // - PolyFlags -
65*cdf0e10cSrcweir // -------------
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir #ifndef ENUM_POLYFLAGS_DECLARED
68*cdf0e10cSrcweir #define ENUM_POLYFLAGS_DECLARED
69*cdf0e10cSrcweir enum PolyFlags
70*cdf0e10cSrcweir {
71*cdf0e10cSrcweir     POLY_NORMAL,
72*cdf0e10cSrcweir     POLY_SMOOTH,
73*cdf0e10cSrcweir     POLY_CONTROL,
74*cdf0e10cSrcweir     POLY_SYMMTR
75*cdf0e10cSrcweir };
76*cdf0e10cSrcweir #endif
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir // ----------------
79*cdf0e10cSrcweir // - PolyOptimize -
80*cdf0e10cSrcweir // ----------------
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir class PolyOptimizeData
83*cdf0e10cSrcweir {
84*cdf0e10cSrcweir private:
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 	enum DataType	{ DATA_NONE = 0, DATA_ABSOLUT = 1, DATA_PERCENT = 2 };
87*cdf0e10cSrcweir 	DataType		eType;
88*cdf0e10cSrcweir 	union			{ sal_uIntPtr mnAbsolut; sal_uInt16 mnPercent; };
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir public:
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir 					PolyOptimizeData() : eType( DATA_NONE ) {}
93*cdf0e10cSrcweir 					PolyOptimizeData( sal_uIntPtr nAbsolut ) : eType( DATA_ABSOLUT ), mnAbsolut( nAbsolut ) {}
94*cdf0e10cSrcweir 					PolyOptimizeData( sal_uInt16 nPercent ) : eType( DATA_PERCENT ), mnPercent( nPercent ) {}
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 	sal_uIntPtr			GetAbsValue() const { DBG_ASSERT( eType == DATA_ABSOLUT, "Wrong data type" ); return mnAbsolut; }
97*cdf0e10cSrcweir 	sal_uInt16			GetPercentValue() const { DBG_ASSERT( eType == DATA_PERCENT, "Wrong data type" ); return mnPercent; }
98*cdf0e10cSrcweir };
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir // -----------
101*cdf0e10cSrcweir // - Polygon -
102*cdf0e10cSrcweir // -----------
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir class SvStream;
105*cdf0e10cSrcweir class ImplPolygon;
106*cdf0e10cSrcweir class ImplPolyPolygon;
107*cdf0e10cSrcweir class PolyPolygon;
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir namespace basegfx
110*cdf0e10cSrcweir {
111*cdf0e10cSrcweir 	class B2DPolygon;
112*cdf0e10cSrcweir 	class B2DPolyPolygon;
113*cdf0e10cSrcweir } // end of namespace basegfx
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir class TOOLS_DLLPUBLIC Polygon
116*cdf0e10cSrcweir {
117*cdf0e10cSrcweir private:
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir     ImplPolygon*        mpImplPolygon;
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir     TOOLS_DLLPRIVATE inline void ImplMakeUnique();
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir public:
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     Point*              ImplGetPointAry();
128*cdf0e10cSrcweir     sal_uInt8*               ImplGetFlagAry();
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir 	static void			ImplReduceEdges( Polygon& rPoly, const double& rArea, sal_uInt16 nPercent );
131*cdf0e10cSrcweir 	void				ImplRead( SvStream& rIStream );
132*cdf0e10cSrcweir 	void				ImplWrite( SvStream& rOStream ) const;
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir //#endif // __PRIVATE
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir public:
137*cdf0e10cSrcweir                         Polygon();
138*cdf0e10cSrcweir                         Polygon( sal_uInt16 nSize );
139*cdf0e10cSrcweir                         Polygon( sal_uInt16 nPoints, const Point* pPtAry,
140*cdf0e10cSrcweir                                  const sal_uInt8* pFlagAry = NULL );
141*cdf0e10cSrcweir                         Polygon( const Rectangle& rRect );
142*cdf0e10cSrcweir                         Polygon( const Rectangle& rRect,
143*cdf0e10cSrcweir 								 sal_uIntPtr nHorzRound, sal_uIntPtr nVertRound );
144*cdf0e10cSrcweir                         Polygon( const Point& rCenter,
145*cdf0e10cSrcweir 								 long nRadX, long nRadY,
146*cdf0e10cSrcweir                                  sal_uInt16 nPoints = 0 );
147*cdf0e10cSrcweir                         Polygon( const Rectangle& rBound,
148*cdf0e10cSrcweir                                  const Point& rStart, const Point& rEnd,
149*cdf0e10cSrcweir                                  PolyStyle ePolyStyle = POLY_ARC );
150*cdf0e10cSrcweir 						Polygon( const Point& rBezPt1, const Point& rCtrlPt1,
151*cdf0e10cSrcweir 								 const Point& rBezPt2, const Point& rCtrlPt2,
152*cdf0e10cSrcweir 								 sal_uInt16 nPoints = 0 );
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir                         Polygon( const Polygon& rPoly );
155*cdf0e10cSrcweir                         ~Polygon();
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir     void                SetPoint( const Point& rPt, sal_uInt16 nPos );
158*cdf0e10cSrcweir     const Point&        GetPoint( sal_uInt16 nPos ) const;
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir     void                SetFlags( sal_uInt16 nPos, PolyFlags eFlags );
161*cdf0e10cSrcweir     PolyFlags           GetFlags( sal_uInt16 nPos ) const;
162*cdf0e10cSrcweir 	sal_Bool			HasFlags() const;
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir     sal_Bool                IsControl( sal_uInt16 nPos ) const;
165*cdf0e10cSrcweir     sal_Bool                IsSmooth( sal_uInt16 nPos ) const;
166*cdf0e10cSrcweir 	sal_Bool				IsRect() const;
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir     void                SetSize( sal_uInt16 nNewSize );
169*cdf0e10cSrcweir     sal_uInt16              GetSize() const;
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir     void                Clear();
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir     Rectangle           GetBoundRect() const;
174*cdf0e10cSrcweir     double              GetArea() const;
175*cdf0e10cSrcweir     double              GetSignedArea() const;
176*cdf0e10cSrcweir     sal_Bool                IsInside( const Point& rPt ) const;
177*cdf0e10cSrcweir     sal_Bool                IsRightOrientated() const;
178*cdf0e10cSrcweir     double              CalcDistance( sal_uInt16 nPt1, sal_uInt16 nPt2 );
179*cdf0e10cSrcweir     void                Clip( const Rectangle& rRect, sal_Bool bPolygon = sal_True );
180*cdf0e10cSrcweir 	void				Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData = NULL );
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir     /** Adaptive subdivision of polygons with curves
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir     	This method adaptively subdivides bezier arcs within the
185*cdf0e10cSrcweir     	polygon to straight line segments and returns the resulting
186*cdf0e10cSrcweir     	polygon.
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir         @param rResult
189*cdf0e10cSrcweir         The resulting subdivided polygon
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir         @param d
192*cdf0e10cSrcweir         This parameter controls the amount of subdivision. The
193*cdf0e10cSrcweir         original curve is guaranteed to not differ by more than this
194*cdf0e10cSrcweir         amount per bezier segment from the subdivided
195*cdf0e10cSrcweir         lines. Concretely, if the polygon is in device coordinates and
196*cdf0e10cSrcweir         d equals 1.0, then the difference between the subdivided and
197*cdf0e10cSrcweir         the original polygon is guaranteed to be smaller than one
198*cdf0e10cSrcweir         pixel.
199*cdf0e10cSrcweir      */
200*cdf0e10cSrcweir     void 				AdaptiveSubdivide( Polygon& rResult, const double d = 1.0 ) const;
201*cdf0e10cSrcweir 
202*cdf0e10cSrcweir 	void				GetIntersection( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const;
203*cdf0e10cSrcweir 	void				GetUnion( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const;
204*cdf0e10cSrcweir 	void				GetDifference( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const;
205*cdf0e10cSrcweir 	void				GetXOR( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const;
206*cdf0e10cSrcweir 
207*cdf0e10cSrcweir     void                Move( long nHorzMove, long nVertMove );
208*cdf0e10cSrcweir     void                Translate( const Point& rTrans );
209*cdf0e10cSrcweir     void                Scale( double fScaleX, double fScaleY );
210*cdf0e10cSrcweir     void                Rotate( const Point& rCenter, double fSin, double fCos );
211*cdf0e10cSrcweir     void                Rotate( const Point& rCenter, sal_uInt16 nAngle10 );
212*cdf0e10cSrcweir     void                SlantX( long nYRef, double fSin, double fCos );
213*cdf0e10cSrcweir     void                SlantY( long nXRef, double fSin, double fCos );
214*cdf0e10cSrcweir     void                Distort( const Rectangle& rRefRect, const Polygon& rDistortedRect );
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir     void                Insert( sal_uInt16 nPos, const Point& rPt, PolyFlags eFlags = POLY_NORMAL );
217*cdf0e10cSrcweir     void                Insert( sal_uInt16 nPos, const Polygon& rPoly );
218*cdf0e10cSrcweir     void                Remove( sal_uInt16 nPos, sal_uInt16 nCount );
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir     const Point&        operator[]( sal_uInt16 nPos ) const { return GetPoint( nPos ); }
221*cdf0e10cSrcweir     Point&              operator[]( sal_uInt16 nPos );
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir     Polygon&            operator=( const Polygon& rPoly );
224*cdf0e10cSrcweir     sal_Bool                operator==( const Polygon& rPoly ) const;
225*cdf0e10cSrcweir     sal_Bool                operator!=( const Polygon& rPoly ) const
226*cdf0e10cSrcweir                             { return !(Polygon::operator==( rPoly )); }
227*cdf0e10cSrcweir 	sal_Bool			IsEqual( const Polygon& rPoly ) const;
228*cdf0e10cSrcweir 
229*cdf0e10cSrcweir 	// streaming a Polygon does ignore PolyFlags, so use the Write Or Read
230*cdf0e10cSrcweir 	// method to take care of PolyFlags
231*cdf0e10cSrcweir     TOOLS_DLLPUBLIC friend SvStream&    operator>>( SvStream& rIStream, Polygon& rPoly );
232*cdf0e10cSrcweir     TOOLS_DLLPUBLIC friend SvStream&    operator<<( SvStream& rOStream, const Polygon& rPoly );
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir 	void				Read( SvStream& rIStream );
235*cdf0e10cSrcweir 	void				Write( SvStream& rOStream ) const;
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir     const Point*        GetConstPointAry() const;
238*cdf0e10cSrcweir     const sal_uInt8*         GetConstFlagAry() const;
239*cdf0e10cSrcweir 
240*cdf0e10cSrcweir 	// convert to ::basegfx::B2DPolygon and return
241*cdf0e10cSrcweir 	::basegfx::B2DPolygon getB2DPolygon() const;
242*cdf0e10cSrcweir 
243*cdf0e10cSrcweir 	// constructor to convert from ::basegfx::B2DPolygon
244*cdf0e10cSrcweir 	// #i76339# made explicit
245*cdf0e10cSrcweir 	explicit Polygon(const ::basegfx::B2DPolygon& rPolygon);
246*cdf0e10cSrcweir };
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir // ---------------
249*cdf0e10cSrcweir // - PolyPolygon -
250*cdf0e10cSrcweir // ---------------
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir class TOOLS_DLLPUBLIC PolyPolygon
253*cdf0e10cSrcweir {
254*cdf0e10cSrcweir private:
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir     ImplPolyPolygon*    mpImplPolyPolygon;
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
259*cdf0e10cSrcweir     TOOLS_DLLPRIVATE void  ImplDoOperation( const PolyPolygon& rPolyPoly, PolyPolygon& rResult, sal_uIntPtr nOperation ) const;
260*cdf0e10cSrcweir     TOOLS_DLLPRIVATE void *ImplCreateArtVpath() const;
261*cdf0e10cSrcweir     TOOLS_DLLPRIVATE void  ImplSetFromArtVpath( void *pVpath );
262*cdf0e10cSrcweir //#endif // __PRIVATE
263*cdf0e10cSrcweir 
264*cdf0e10cSrcweir public:
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir                         PolyPolygon( sal_uInt16 nInitSize = 16, sal_uInt16 nResize = 16 );
267*cdf0e10cSrcweir                         PolyPolygon( const Polygon& rPoly );
268*cdf0e10cSrcweir                         PolyPolygon( sal_uInt16 nPoly, const sal_uInt16* pPointCountAry,
269*cdf0e10cSrcweir                                      const Point* pPtAry );
270*cdf0e10cSrcweir                         PolyPolygon( const PolyPolygon& rPolyPoly );
271*cdf0e10cSrcweir                         ~PolyPolygon();
272*cdf0e10cSrcweir 
273*cdf0e10cSrcweir     void                Insert( const Polygon& rPoly, sal_uInt16 nPos = POLYPOLY_APPEND );
274*cdf0e10cSrcweir     void                Remove( sal_uInt16 nPos );
275*cdf0e10cSrcweir     void                Replace( const Polygon& rPoly, sal_uInt16 nPos );
276*cdf0e10cSrcweir     const Polygon&      GetObject( sal_uInt16 nPos ) const;
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir 	sal_Bool				IsRect() const;
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir     void                Clear();
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir     sal_uInt16              Count() const;
283*cdf0e10cSrcweir     Rectangle           GetBoundRect() const;
284*cdf0e10cSrcweir     void                Clip( const Rectangle& rRect );
285*cdf0e10cSrcweir 	void				Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData = NULL );
286*cdf0e10cSrcweir 
287*cdf0e10cSrcweir     /** Adaptive subdivision of polygons with curves
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir     	This method adaptively subdivides bezier arcs within the
290*cdf0e10cSrcweir     	polygon to straight line segments and returns the resulting
291*cdf0e10cSrcweir     	polygon.
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir         @param rResult
294*cdf0e10cSrcweir         The resulting subdivided polygon
295*cdf0e10cSrcweir 
296*cdf0e10cSrcweir         @param d
297*cdf0e10cSrcweir         This parameter controls the amount of subdivision. The
298*cdf0e10cSrcweir         original curve is guaranteed to not differ by more than this
299*cdf0e10cSrcweir         amount per bezier segment from the subdivided
300*cdf0e10cSrcweir         lines. Concretely, if the polygon is in device coordinates and
301*cdf0e10cSrcweir         d equals 1.0, then the difference between the subdivided and
302*cdf0e10cSrcweir         the original polygon is guaranteed to be smaller than one
303*cdf0e10cSrcweir         pixel.
304*cdf0e10cSrcweir      */
305*cdf0e10cSrcweir     void 				AdaptiveSubdivide( PolyPolygon& rResult, const double d = 1.0 ) const;
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir 	void				GetIntersection( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const;
308*cdf0e10cSrcweir 	void				GetUnion( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const;
309*cdf0e10cSrcweir 	void				GetDifference( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const;
310*cdf0e10cSrcweir 	void				GetXOR( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const;
311*cdf0e10cSrcweir 
312*cdf0e10cSrcweir     void                Move( long nHorzMove, long nVertMove );
313*cdf0e10cSrcweir     void                Translate( const Point& rTrans );
314*cdf0e10cSrcweir     void                Scale( double fScaleX, double fScaleY );
315*cdf0e10cSrcweir     void                Rotate( const Point& rCenter, double fSin, double fCos );
316*cdf0e10cSrcweir     void                Rotate( const Point& rCenter, sal_uInt16 nAngle10 );
317*cdf0e10cSrcweir     void                SlantX( long nYRef, double fSin, double fCos );
318*cdf0e10cSrcweir     void                SlantY( long nXRef, double fSin, double fCos );
319*cdf0e10cSrcweir     void                Distort( const Rectangle& rRefRect, const Polygon& rDistortedRect );
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir     const Polygon&      operator[]( sal_uInt16 nPos ) const { return GetObject( nPos ); }
322*cdf0e10cSrcweir     Polygon&            operator[]( sal_uInt16 nPos );
323*cdf0e10cSrcweir 
324*cdf0e10cSrcweir     PolyPolygon&        operator=( const PolyPolygon& rPolyPoly );
325*cdf0e10cSrcweir     sal_Bool                operator==( const PolyPolygon& rPolyPoly ) const;
326*cdf0e10cSrcweir     sal_Bool                operator!=( const PolyPolygon& rPolyPoly ) const
327*cdf0e10cSrcweir                             { return !(PolyPolygon::operator==( rPolyPoly )); }
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir 	sal_Bool			IsEqual( const PolyPolygon& rPolyPoly ) const;
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir     TOOLS_DLLPUBLIC friend SvStream&    operator>>( SvStream& rIStream, PolyPolygon& rPolyPoly );
332*cdf0e10cSrcweir     TOOLS_DLLPUBLIC friend SvStream&    operator<<( SvStream& rOStream, const PolyPolygon& rPolyPoly );
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir 	void				Read( SvStream& rIStream );
335*cdf0e10cSrcweir 	void				Write( SvStream& rOStream ) const;
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir 	// convert to ::basegfx::B2DPolyPolygon and return
338*cdf0e10cSrcweir 	::basegfx::B2DPolyPolygon getB2DPolyPolygon() const;
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir 	// constructor to convert from ::basegfx::B2DPolyPolygon
341*cdf0e10cSrcweir  	// #i76339# made explicit
342*cdf0e10cSrcweir  	explicit PolyPolygon(const ::basegfx::B2DPolyPolygon& rPolyPolygon);
343*cdf0e10cSrcweir };
344*cdf0e10cSrcweir 
345*cdf0e10cSrcweir typedef std::vector< PolyPolygon > PolyPolyVector;
346*cdf0e10cSrcweir 
347*cdf0e10cSrcweir #endif  // _SV_POLY_HXX
348