xref: /AOO41X/main/basegfx/source/polygon/b2dpolypolygon.cxx (revision 09dbbe930366fe6f99ae3b8ae1cf8690b638dbda)
1*09dbbe93SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*09dbbe93SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*09dbbe93SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*09dbbe93SAndrew Rist  * distributed with this work for additional information
6*09dbbe93SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*09dbbe93SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*09dbbe93SAndrew Rist  * "License"); you may not use this file except in compliance
9*09dbbe93SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*09dbbe93SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*09dbbe93SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*09dbbe93SAndrew Rist  * software distributed under the License is distributed on an
15*09dbbe93SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*09dbbe93SAndrew Rist  * KIND, either express or implied.  See the License for the
17*09dbbe93SAndrew Rist  * specific language governing permissions and limitations
18*09dbbe93SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*09dbbe93SAndrew Rist  *************************************************************/
21*09dbbe93SAndrew Rist 
22*09dbbe93SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_basegfx.hxx"
26cdf0e10cSrcweir #include <basegfx/polygon/b2dpolypolygon.hxx>
27cdf0e10cSrcweir #include <osl/diagnose.h>
28cdf0e10cSrcweir #include <basegfx/polygon/b2dpolygon.hxx>
29cdf0e10cSrcweir #include <basegfx/polygon/b2dpolypolygontools.hxx>
30cdf0e10cSrcweir #include <rtl/instance.hxx>
31cdf0e10cSrcweir #include <basegfx/matrix/b2dhommatrix.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <functional>
34cdf0e10cSrcweir #include <vector>
35cdf0e10cSrcweir #include <algorithm>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class ImplB2DPolyPolygon
40cdf0e10cSrcweir {
41cdf0e10cSrcweir 	typedef ::std::vector< basegfx::B2DPolygon >	PolygonVector;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir 	PolygonVector									maPolygons;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir public:
46cdf0e10cSrcweir 	ImplB2DPolyPolygon() : maPolygons()
47cdf0e10cSrcweir     {
48cdf0e10cSrcweir     }
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	ImplB2DPolyPolygon(const basegfx::B2DPolygon& rToBeCopied) :
51cdf0e10cSrcweir         maPolygons(1,rToBeCopied)
52cdf0e10cSrcweir 	{
53cdf0e10cSrcweir 	}
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 	bool operator==(const ImplB2DPolyPolygon& rPolygonList) const
56cdf0e10cSrcweir 	{
57cdf0e10cSrcweir 		// same polygon count?
58cdf0e10cSrcweir 		if(maPolygons.size() != rPolygonList.maPolygons.size())
59cdf0e10cSrcweir 			return false;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 		// compare polygon content
62cdf0e10cSrcweir 		if(!(maPolygons == rPolygonList.maPolygons))
63cdf0e10cSrcweir 			return false;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 		return true;
66cdf0e10cSrcweir 	}
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	const basegfx::B2DPolygon& getB2DPolygon(sal_uInt32 nIndex) const
69cdf0e10cSrcweir 	{
70cdf0e10cSrcweir 		return maPolygons[nIndex];
71cdf0e10cSrcweir 	}
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	void setB2DPolygon(sal_uInt32 nIndex, const basegfx::B2DPolygon& rPolygon)
74cdf0e10cSrcweir 	{
75cdf0e10cSrcweir 		maPolygons[nIndex] = rPolygon;
76cdf0e10cSrcweir 	}
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	void insert(sal_uInt32 nIndex, const basegfx::B2DPolygon& rPolygon, sal_uInt32 nCount)
79cdf0e10cSrcweir 	{
80cdf0e10cSrcweir 		if(nCount)
81cdf0e10cSrcweir 		{
82cdf0e10cSrcweir 			// add nCount copies of rPolygon
83cdf0e10cSrcweir 			PolygonVector::iterator aIndex(maPolygons.begin());
84cdf0e10cSrcweir 			aIndex += nIndex;
85cdf0e10cSrcweir 			maPolygons.insert(aIndex, nCount, rPolygon);
86cdf0e10cSrcweir 		}
87cdf0e10cSrcweir 	}
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 	void insert(sal_uInt32 nIndex, const basegfx::B2DPolyPolygon& rPolyPolygon)
90cdf0e10cSrcweir 	{
91cdf0e10cSrcweir 		const sal_uInt32 nCount = rPolyPolygon.count();
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 		if(nCount)
94cdf0e10cSrcweir 		{
95cdf0e10cSrcweir 			// add nCount polygons from rPolyPolygon
96cdf0e10cSrcweir 			maPolygons.reserve(maPolygons.size() + nCount);
97cdf0e10cSrcweir 			PolygonVector::iterator aIndex(maPolygons.begin());
98cdf0e10cSrcweir 			aIndex += nIndex;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 			for(sal_uInt32 a(0L); a < nCount; a++)
101cdf0e10cSrcweir 			{
102cdf0e10cSrcweir 				aIndex = maPolygons.insert(aIndex, rPolyPolygon.getB2DPolygon(a));
103cdf0e10cSrcweir 				aIndex++;
104cdf0e10cSrcweir 			}
105cdf0e10cSrcweir 		}
106cdf0e10cSrcweir 	}
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 	void remove(sal_uInt32 nIndex, sal_uInt32 nCount)
109cdf0e10cSrcweir 	{
110cdf0e10cSrcweir 		if(nCount)
111cdf0e10cSrcweir 		{
112cdf0e10cSrcweir 			// remove polygon data
113cdf0e10cSrcweir 			PolygonVector::iterator aStart(maPolygons.begin());
114cdf0e10cSrcweir 			aStart += nIndex;
115cdf0e10cSrcweir 			const PolygonVector::iterator aEnd(aStart + nCount);
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 			maPolygons.erase(aStart, aEnd);
118cdf0e10cSrcweir 		}
119cdf0e10cSrcweir 	}
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 	sal_uInt32 count() const
122cdf0e10cSrcweir 	{
123cdf0e10cSrcweir 		return maPolygons.size();
124cdf0e10cSrcweir 	}
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 	void setClosed(bool bNew)
127cdf0e10cSrcweir 	{
128cdf0e10cSrcweir 		for(sal_uInt32 a(0L); a < maPolygons.size(); a++)
129cdf0e10cSrcweir 		{
130cdf0e10cSrcweir 			maPolygons[a].setClosed(bNew);
131cdf0e10cSrcweir 		}
132cdf0e10cSrcweir 	}
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	void flip()
135cdf0e10cSrcweir 	{
136cdf0e10cSrcweir         std::for_each( maPolygons.begin(),
137cdf0e10cSrcweir                        maPolygons.end(),
138cdf0e10cSrcweir                        std::mem_fun_ref( &basegfx::B2DPolygon::flip ));
139cdf0e10cSrcweir 	}
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 	void removeDoublePoints()
142cdf0e10cSrcweir 	{
143cdf0e10cSrcweir         std::for_each( maPolygons.begin(),
144cdf0e10cSrcweir                        maPolygons.end(),
145cdf0e10cSrcweir                        std::mem_fun_ref( &basegfx::B2DPolygon::removeDoublePoints ));
146cdf0e10cSrcweir 	}
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 	void transform(const basegfx::B2DHomMatrix& rMatrix)
149cdf0e10cSrcweir 	{
150cdf0e10cSrcweir 		for(sal_uInt32 a(0L); a < maPolygons.size(); a++)
151cdf0e10cSrcweir 		{
152cdf0e10cSrcweir 			maPolygons[a].transform(rMatrix);
153cdf0e10cSrcweir 		}
154cdf0e10cSrcweir 	}
155cdf0e10cSrcweir 
156cdf0e10cSrcweir     void makeUnique()
157cdf0e10cSrcweir     {
158cdf0e10cSrcweir         std::for_each( maPolygons.begin(),
159cdf0e10cSrcweir                        maPolygons.end(),
160cdf0e10cSrcweir                        std::mem_fun_ref( &basegfx::B2DPolygon::makeUnique ));
161cdf0e10cSrcweir     }
162cdf0e10cSrcweir 
163cdf0e10cSrcweir     const basegfx::B2DPolygon* begin() const
164cdf0e10cSrcweir     {
165cdf0e10cSrcweir         if(maPolygons.empty())
166cdf0e10cSrcweir             return 0;
167cdf0e10cSrcweir         else
168cdf0e10cSrcweir             return &maPolygons.front();
169cdf0e10cSrcweir     }
170cdf0e10cSrcweir 
171cdf0e10cSrcweir     const basegfx::B2DPolygon* end() const
172cdf0e10cSrcweir     {
173cdf0e10cSrcweir         if(maPolygons.empty())
174cdf0e10cSrcweir             return 0;
175cdf0e10cSrcweir         else
176cdf0e10cSrcweir             return (&maPolygons.back())+1;
177cdf0e10cSrcweir     }
178cdf0e10cSrcweir 
179cdf0e10cSrcweir     basegfx::B2DPolygon* begin()
180cdf0e10cSrcweir     {
181cdf0e10cSrcweir         if(maPolygons.empty())
182cdf0e10cSrcweir             return 0;
183cdf0e10cSrcweir         else
184cdf0e10cSrcweir             return &maPolygons.front();
185cdf0e10cSrcweir     }
186cdf0e10cSrcweir 
187cdf0e10cSrcweir     basegfx::B2DPolygon* end()
188cdf0e10cSrcweir     {
189cdf0e10cSrcweir         if(maPolygons.empty())
190cdf0e10cSrcweir             return 0;
191cdf0e10cSrcweir         else
192cdf0e10cSrcweir             return &(maPolygons.back())+1;
193cdf0e10cSrcweir     }
194cdf0e10cSrcweir };
195cdf0e10cSrcweir 
196cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
197cdf0e10cSrcweir 
198cdf0e10cSrcweir namespace basegfx
199cdf0e10cSrcweir {
200cdf0e10cSrcweir     namespace { struct DefaultPolyPolygon: public rtl::Static<B2DPolyPolygon::ImplType,
201cdf0e10cSrcweir                                                               DefaultPolyPolygon> {}; }
202cdf0e10cSrcweir 
203cdf0e10cSrcweir 	B2DPolyPolygon::B2DPolyPolygon() :
204cdf0e10cSrcweir         mpPolyPolygon(DefaultPolyPolygon::get())
205cdf0e10cSrcweir 	{
206cdf0e10cSrcweir 	}
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 	B2DPolyPolygon::B2DPolyPolygon(const B2DPolyPolygon& rPolyPolygon) :
209cdf0e10cSrcweir         mpPolyPolygon(rPolyPolygon.mpPolyPolygon)
210cdf0e10cSrcweir 	{
211cdf0e10cSrcweir 	}
212cdf0e10cSrcweir 
213cdf0e10cSrcweir 	B2DPolyPolygon::B2DPolyPolygon(const B2DPolygon& rPolygon) :
214cdf0e10cSrcweir         mpPolyPolygon( ImplB2DPolyPolygon(rPolygon) )
215cdf0e10cSrcweir 	{
216cdf0e10cSrcweir 	}
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 	B2DPolyPolygon::~B2DPolyPolygon()
219cdf0e10cSrcweir 	{
220cdf0e10cSrcweir 	}
221cdf0e10cSrcweir 
222cdf0e10cSrcweir 	B2DPolyPolygon& B2DPolyPolygon::operator=(const B2DPolyPolygon& rPolyPolygon)
223cdf0e10cSrcweir 	{
224cdf0e10cSrcweir 		mpPolyPolygon = rPolyPolygon.mpPolyPolygon;
225cdf0e10cSrcweir 		return *this;
226cdf0e10cSrcweir 	}
227cdf0e10cSrcweir 
228cdf0e10cSrcweir     void B2DPolyPolygon::makeUnique()
229cdf0e10cSrcweir     {
230cdf0e10cSrcweir         mpPolyPolygon.make_unique();
231cdf0e10cSrcweir         mpPolyPolygon->makeUnique();
232cdf0e10cSrcweir     }
233cdf0e10cSrcweir 
234cdf0e10cSrcweir 	bool B2DPolyPolygon::operator==(const B2DPolyPolygon& rPolyPolygon) const
235cdf0e10cSrcweir 	{
236cdf0e10cSrcweir 		if(mpPolyPolygon.same_object(rPolyPolygon.mpPolyPolygon))
237cdf0e10cSrcweir 			return true;
238cdf0e10cSrcweir 
239cdf0e10cSrcweir 		return ((*mpPolyPolygon) == (*rPolyPolygon.mpPolyPolygon));
240cdf0e10cSrcweir 	}
241cdf0e10cSrcweir 
242cdf0e10cSrcweir 	bool B2DPolyPolygon::operator!=(const B2DPolyPolygon& rPolyPolygon) const
243cdf0e10cSrcweir 	{
244cdf0e10cSrcweir         return !((*this) == rPolyPolygon);
245cdf0e10cSrcweir 	}
246cdf0e10cSrcweir 
247cdf0e10cSrcweir 	sal_uInt32 B2DPolyPolygon::count() const
248cdf0e10cSrcweir 	{
249cdf0e10cSrcweir 		return mpPolyPolygon->count();
250cdf0e10cSrcweir 	}
251cdf0e10cSrcweir 
252cdf0e10cSrcweir 	B2DPolygon B2DPolyPolygon::getB2DPolygon(sal_uInt32 nIndex) const
253cdf0e10cSrcweir 	{
254cdf0e10cSrcweir 		OSL_ENSURE(nIndex < mpPolyPolygon->count(), "B2DPolyPolygon access outside range (!)");
255cdf0e10cSrcweir 
256cdf0e10cSrcweir 		return mpPolyPolygon->getB2DPolygon(nIndex);
257cdf0e10cSrcweir 	}
258cdf0e10cSrcweir 
259cdf0e10cSrcweir 	void B2DPolyPolygon::setB2DPolygon(sal_uInt32 nIndex, const B2DPolygon& rPolygon)
260cdf0e10cSrcweir 	{
261cdf0e10cSrcweir 		OSL_ENSURE(nIndex < mpPolyPolygon->count(), "B2DPolyPolygon access outside range (!)");
262cdf0e10cSrcweir 
263cdf0e10cSrcweir 		if(getB2DPolygon(nIndex) != rPolygon)
264cdf0e10cSrcweir 			mpPolyPolygon->setB2DPolygon(nIndex, rPolygon);
265cdf0e10cSrcweir 	}
266cdf0e10cSrcweir 
267cdf0e10cSrcweir 	bool B2DPolyPolygon::areControlPointsUsed() const
268cdf0e10cSrcweir 	{
269cdf0e10cSrcweir 		for(sal_uInt32 a(0L); a < mpPolyPolygon->count(); a++)
270cdf0e10cSrcweir 		{
271cdf0e10cSrcweir 			const B2DPolygon& rPolygon = mpPolyPolygon->getB2DPolygon(a);
272cdf0e10cSrcweir 
273cdf0e10cSrcweir 			if(rPolygon.areControlPointsUsed())
274cdf0e10cSrcweir 			{
275cdf0e10cSrcweir 				return true;
276cdf0e10cSrcweir 			}
277cdf0e10cSrcweir 		}
278cdf0e10cSrcweir 
279cdf0e10cSrcweir 		return false;
280cdf0e10cSrcweir 	}
281cdf0e10cSrcweir 
282cdf0e10cSrcweir 	void B2DPolyPolygon::insert(sal_uInt32 nIndex, const B2DPolygon& rPolygon, sal_uInt32 nCount)
283cdf0e10cSrcweir 	{
284cdf0e10cSrcweir 		OSL_ENSURE(nIndex <= mpPolyPolygon->count(), "B2DPolyPolygon Insert outside range (!)");
285cdf0e10cSrcweir 
286cdf0e10cSrcweir 		if(nCount)
287cdf0e10cSrcweir 			mpPolyPolygon->insert(nIndex, rPolygon, nCount);
288cdf0e10cSrcweir 	}
289cdf0e10cSrcweir 
290cdf0e10cSrcweir 	void B2DPolyPolygon::append(const B2DPolygon& rPolygon, sal_uInt32 nCount)
291cdf0e10cSrcweir 	{
292cdf0e10cSrcweir 		if(nCount)
293cdf0e10cSrcweir 			mpPolyPolygon->insert(mpPolyPolygon->count(), rPolygon, nCount);
294cdf0e10cSrcweir 	}
295cdf0e10cSrcweir 
296cdf0e10cSrcweir     B2DPolyPolygon B2DPolyPolygon::getDefaultAdaptiveSubdivision() const
297cdf0e10cSrcweir 	{
298cdf0e10cSrcweir 		B2DPolyPolygon aRetval;
299cdf0e10cSrcweir 
300cdf0e10cSrcweir 		for(sal_uInt32 a(0L); a < mpPolyPolygon->count(); a++)
301cdf0e10cSrcweir 		{
302cdf0e10cSrcweir 			aRetval.append(mpPolyPolygon->getB2DPolygon(a).getDefaultAdaptiveSubdivision());
303cdf0e10cSrcweir 		}
304cdf0e10cSrcweir 
305cdf0e10cSrcweir 		return aRetval;
306cdf0e10cSrcweir 	}
307cdf0e10cSrcweir 
308cdf0e10cSrcweir     B2DRange B2DPolyPolygon::getB2DRange() const
309cdf0e10cSrcweir     {
310cdf0e10cSrcweir 		B2DRange aRetval;
311cdf0e10cSrcweir 
312cdf0e10cSrcweir 		for(sal_uInt32 a(0L); a < mpPolyPolygon->count(); a++)
313cdf0e10cSrcweir 		{
314cdf0e10cSrcweir 			aRetval.expand(mpPolyPolygon->getB2DPolygon(a).getB2DRange());
315cdf0e10cSrcweir 		}
316cdf0e10cSrcweir 
317cdf0e10cSrcweir 		return aRetval;
318cdf0e10cSrcweir     }
319cdf0e10cSrcweir 
320cdf0e10cSrcweir 	void B2DPolyPolygon::insert(sal_uInt32 nIndex, const B2DPolyPolygon& rPolyPolygon)
321cdf0e10cSrcweir 	{
322cdf0e10cSrcweir 		OSL_ENSURE(nIndex <= mpPolyPolygon->count(), "B2DPolyPolygon Insert outside range (!)");
323cdf0e10cSrcweir 
324cdf0e10cSrcweir 		if(rPolyPolygon.count())
325cdf0e10cSrcweir 			mpPolyPolygon->insert(nIndex, rPolyPolygon);
326cdf0e10cSrcweir 	}
327cdf0e10cSrcweir 
328cdf0e10cSrcweir 	void B2DPolyPolygon::append(const B2DPolyPolygon& rPolyPolygon)
329cdf0e10cSrcweir 	{
330cdf0e10cSrcweir 		if(rPolyPolygon.count())
331cdf0e10cSrcweir 			mpPolyPolygon->insert(mpPolyPolygon->count(), rPolyPolygon);
332cdf0e10cSrcweir 	}
333cdf0e10cSrcweir 
334cdf0e10cSrcweir 	void B2DPolyPolygon::remove(sal_uInt32 nIndex, sal_uInt32 nCount)
335cdf0e10cSrcweir 	{
336cdf0e10cSrcweir 		OSL_ENSURE(nIndex + nCount <= mpPolyPolygon->count(), "B2DPolyPolygon Remove outside range (!)");
337cdf0e10cSrcweir 
338cdf0e10cSrcweir 		if(nCount)
339cdf0e10cSrcweir 			mpPolyPolygon->remove(nIndex, nCount);
340cdf0e10cSrcweir 	}
341cdf0e10cSrcweir 
342cdf0e10cSrcweir 	void B2DPolyPolygon::clear()
343cdf0e10cSrcweir 	{
344cdf0e10cSrcweir 		mpPolyPolygon = DefaultPolyPolygon::get();
345cdf0e10cSrcweir 	}
346cdf0e10cSrcweir 
347cdf0e10cSrcweir 	bool B2DPolyPolygon::isClosed() const
348cdf0e10cSrcweir 	{
349cdf0e10cSrcweir 		bool bRetval(true);
350cdf0e10cSrcweir 
351cdf0e10cSrcweir 		// PolyPOlygon is closed when all contained Polygons are closed or
352cdf0e10cSrcweir 		// no Polygon exists.
353cdf0e10cSrcweir 		for(sal_uInt32 a(0L); bRetval && a < mpPolyPolygon->count(); a++)
354cdf0e10cSrcweir 		{
355cdf0e10cSrcweir 			if(!(mpPolyPolygon->getB2DPolygon(a)).isClosed())
356cdf0e10cSrcweir 			{
357cdf0e10cSrcweir 				bRetval = false;
358cdf0e10cSrcweir 			}
359cdf0e10cSrcweir 		}
360cdf0e10cSrcweir 
361cdf0e10cSrcweir 		return bRetval;
362cdf0e10cSrcweir 	}
363cdf0e10cSrcweir 
364cdf0e10cSrcweir 	void B2DPolyPolygon::setClosed(bool bNew)
365cdf0e10cSrcweir 	{
366cdf0e10cSrcweir 		if(bNew != isClosed())
367cdf0e10cSrcweir 			mpPolyPolygon->setClosed(bNew);
368cdf0e10cSrcweir 	}
369cdf0e10cSrcweir 
370cdf0e10cSrcweir 	void B2DPolyPolygon::flip()
371cdf0e10cSrcweir 	{
372cdf0e10cSrcweir 		if(mpPolyPolygon->count())
373cdf0e10cSrcweir 		{
374cdf0e10cSrcweir 			mpPolyPolygon->flip();
375cdf0e10cSrcweir 		}
376cdf0e10cSrcweir 	}
377cdf0e10cSrcweir 
378cdf0e10cSrcweir 	bool B2DPolyPolygon::hasDoublePoints() const
379cdf0e10cSrcweir 	{
380cdf0e10cSrcweir 		bool bRetval(false);
381cdf0e10cSrcweir 
382cdf0e10cSrcweir 		for(sal_uInt32 a(0L); !bRetval && a < mpPolyPolygon->count(); a++)
383cdf0e10cSrcweir 		{
384cdf0e10cSrcweir 			if((mpPolyPolygon->getB2DPolygon(a)).hasDoublePoints())
385cdf0e10cSrcweir 			{
386cdf0e10cSrcweir 				bRetval = true;
387cdf0e10cSrcweir 			}
388cdf0e10cSrcweir 		}
389cdf0e10cSrcweir 
390cdf0e10cSrcweir 		return bRetval;
391cdf0e10cSrcweir 	}
392cdf0e10cSrcweir 
393cdf0e10cSrcweir 	void B2DPolyPolygon::removeDoublePoints()
394cdf0e10cSrcweir 	{
395cdf0e10cSrcweir 		if(hasDoublePoints())
396cdf0e10cSrcweir 			mpPolyPolygon->removeDoublePoints();
397cdf0e10cSrcweir 	}
398cdf0e10cSrcweir 
399cdf0e10cSrcweir 	void B2DPolyPolygon::transform(const B2DHomMatrix& rMatrix)
400cdf0e10cSrcweir 	{
401cdf0e10cSrcweir 		if(mpPolyPolygon->count() && !rMatrix.isIdentity())
402cdf0e10cSrcweir 		{
403cdf0e10cSrcweir 			mpPolyPolygon->transform(rMatrix);
404cdf0e10cSrcweir 		}
405cdf0e10cSrcweir 	}
406cdf0e10cSrcweir 
407cdf0e10cSrcweir     const B2DPolygon* B2DPolyPolygon::begin() const
408cdf0e10cSrcweir     {
409cdf0e10cSrcweir         return mpPolyPolygon->begin();
410cdf0e10cSrcweir     }
411cdf0e10cSrcweir 
412cdf0e10cSrcweir     const B2DPolygon* B2DPolyPolygon::end() const
413cdf0e10cSrcweir     {
414cdf0e10cSrcweir         return mpPolyPolygon->end();
415cdf0e10cSrcweir     }
416cdf0e10cSrcweir 
417cdf0e10cSrcweir     B2DPolygon* B2DPolyPolygon::begin()
418cdf0e10cSrcweir     {
419cdf0e10cSrcweir         return mpPolyPolygon->begin();
420cdf0e10cSrcweir     }
421cdf0e10cSrcweir 
422cdf0e10cSrcweir     B2DPolygon* B2DPolyPolygon::end()
423cdf0e10cSrcweir     {
424cdf0e10cSrcweir         return mpPolyPolygon->end();
425cdf0e10cSrcweir     }
426cdf0e10cSrcweir } // end of namespace basegfx
427cdf0e10cSrcweir 
428cdf0e10cSrcweir // eof
429