Update ooo320-m1
[ooovba.git] / basegfx / source / tools / canvastools.cxx
blobc7f1860a8d50588789ec067560512d5e596cecbc
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: canvastools.cxx,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_basegfx.hxx"
34 #include <com/sun/star/geometry/RealSize2D.hpp>
35 #include <com/sun/star/geometry/RealPoint2D.hpp>
36 #include <com/sun/star/geometry/RealRectangle2D.hpp>
37 #include <com/sun/star/geometry/RealRectangle3D.hpp>
38 #include <com/sun/star/geometry/RealBezierSegment2D.hpp>
39 #include <com/sun/star/geometry/AffineMatrix2D.hpp>
40 #include <com/sun/star/geometry/AffineMatrix3D.hpp>
41 #include <com/sun/star/geometry/Matrix2D.hpp>
42 #include <com/sun/star/geometry/IntegerSize2D.hpp>
43 #include <com/sun/star/geometry/IntegerPoint2D.hpp>
44 #include <com/sun/star/geometry/IntegerRectangle2D.hpp>
45 #include <com/sun/star/rendering/XPolyPolygon2D.hpp>
46 #include <com/sun/star/rendering/XGraphicDevice.hpp>
47 #include <com/sun/star/awt/Size.hpp>
48 #include <com/sun/star/awt/Point.hpp>
49 #include <com/sun/star/awt/Rectangle.hpp>
50 #include <basegfx/tools/unopolypolygon.hxx>
51 #include <basegfx/matrix/b2dhommatrix.hxx>
52 #include <basegfx/matrix/b3dhommatrix.hxx>
53 #include <basegfx/vector/b2dsize.hxx>
54 #include <basegfx/point/b2dpoint.hxx>
55 #include <basegfx/range/b2drectangle.hxx>
56 #include <basegfx/range/b3drange.hxx>
57 #include <basegfx/vector/b2isize.hxx>
58 #include <basegfx/point/b2ipoint.hxx>
59 #include <basegfx/range/b2irectangle.hxx>
60 #include <basegfx/polygon/b2dpolygon.hxx>
61 #include <basegfx/polygon/b2dpolypolygon.hxx>
62 #include <basegfx/tools/canvastools.hxx>
63 #include <limits>
65 using namespace ::com::sun::star;
67 namespace basegfx
70 namespace unotools
72 namespace
74 uno::Sequence< geometry::RealBezierSegment2D > bezierSequenceFromB2DPolygon(const ::basegfx::B2DPolygon& rPoly)
76 const sal_uInt32 nPointCount(rPoly.count());
77 uno::Sequence< geometry::RealBezierSegment2D > outputSequence(nPointCount);
78 geometry::RealBezierSegment2D* pOutput = outputSequence.getArray();
80 // fill sequences and imply clodes polygon on this implementation layer
81 for(sal_uInt32 a(0); a < nPointCount; a++)
83 const basegfx::B2DPoint aStart(rPoly.getB2DPoint(a));
84 const basegfx::B2DPoint aControlA(rPoly.getNextControlPoint(a));
85 const basegfx::B2DPoint aControlB(rPoly.getPrevControlPoint((a + 1) % nPointCount));
87 pOutput[a] = geometry::RealBezierSegment2D(
88 aStart.getX(), aStart.getY(),
89 aControlA.getX(), aControlA.getY(),
90 aControlB.getX(), aControlB.getY());
93 return outputSequence;
96 uno::Sequence< geometry::RealPoint2D > pointSequenceFromB2DPolygon( const ::basegfx::B2DPolygon& rPoly )
98 const sal_uInt32 nNumPoints( rPoly.count() );
100 uno::Sequence< geometry::RealPoint2D > outputSequence( nNumPoints );
101 geometry::RealPoint2D* pOutput = outputSequence.getArray();
103 // fill sequence from polygon
104 sal_uInt32 i;
105 for( i=0; i<nNumPoints; ++i )
107 const ::basegfx::B2DPoint aPoint( rPoly.getB2DPoint(i) );
109 pOutput[i] = geometry::RealPoint2D( aPoint.getX(),
110 aPoint.getY() );
113 return outputSequence;
117 //---------------------------------------------------------------------------------------
119 uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > > bezierSequenceSequenceFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly )
121 const sal_uInt32 nNumPolies( rPolyPoly.count() );
122 sal_uInt32 i;
124 uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > > outputSequence( nNumPolies );
125 uno::Sequence< geometry::RealBezierSegment2D >* pOutput = outputSequence.getArray();
127 for( i=0; i<nNumPolies; ++i )
129 pOutput[i] = bezierSequenceFromB2DPolygon( rPolyPoly.getB2DPolygon(i) );
132 return outputSequence;
135 //---------------------------------------------------------------------------------------
137 uno::Sequence< uno::Sequence< geometry::RealPoint2D > > pointSequenceSequenceFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly )
139 const sal_uInt32 nNumPolies( rPolyPoly.count() );
140 sal_uInt32 i;
142 uno::Sequence< uno::Sequence< geometry::RealPoint2D > > outputSequence( nNumPolies );
143 uno::Sequence< geometry::RealPoint2D >* pOutput = outputSequence.getArray();
145 for( i=0; i<nNumPolies; ++i )
147 pOutput[i] = pointSequenceFromB2DPolygon( rPolyPoly.getB2DPolygon(i) );
150 return outputSequence;
153 //---------------------------------------------------------------------------------------
155 uno::Reference< rendering::XPolyPolygon2D > xPolyPolygonFromB2DPolygon( const uno::Reference< rendering::XGraphicDevice >& xGraphicDevice,
156 const ::basegfx::B2DPolygon& rPoly )
158 uno::Reference< rendering::XPolyPolygon2D > xRes;
160 if( !xGraphicDevice.is() )
161 return xRes;
163 if( rPoly.areControlPointsUsed() )
165 uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > > outputSequence( 1 );
166 outputSequence[0] = bezierSequenceFromB2DPolygon( rPoly );
168 xRes.set( xGraphicDevice->createCompatibleBezierPolyPolygon( outputSequence ),
169 uno::UNO_QUERY );
171 else
173 uno::Sequence< uno::Sequence< geometry::RealPoint2D > > outputSequence( 1 );
174 outputSequence[0] = pointSequenceFromB2DPolygon( rPoly );
176 xRes.set( xGraphicDevice->createCompatibleLinePolyPolygon( outputSequence ),
177 uno::UNO_QUERY );
180 if( xRes.is() && rPoly.isClosed() )
181 xRes->setClosed( 0, sal_True );
183 return xRes;
186 //---------------------------------------------------------------------------------------
188 uno::Reference< rendering::XPolyPolygon2D > xPolyPolygonFromB2DPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& xGraphicDevice,
189 const ::basegfx::B2DPolyPolygon& rPolyPoly )
191 uno::Reference< rendering::XPolyPolygon2D > xRes;
193 if( !xGraphicDevice.is() )
194 return xRes;
196 const sal_uInt32 nNumPolies( rPolyPoly.count() );
197 sal_uInt32 i;
199 if( rPolyPoly.areControlPointsUsed() )
201 xRes.set( xGraphicDevice->createCompatibleBezierPolyPolygon(
202 bezierSequenceSequenceFromB2DPolyPolygon( rPolyPoly ) ),
203 uno::UNO_QUERY );
205 else
207 xRes.set( xGraphicDevice->createCompatibleLinePolyPolygon(
208 pointSequenceSequenceFromB2DPolyPolygon( rPolyPoly ) ),
209 uno::UNO_QUERY );
212 for( i=0; i<nNumPolies; ++i )
214 xRes->setClosed( i, rPolyPoly.getB2DPolygon(i).isClosed() );
217 return xRes;
220 //---------------------------------------------------------------------------------------
222 ::basegfx::B2DPolygon polygonFromPoint2DSequence( const uno::Sequence< geometry::RealPoint2D >& points )
224 const sal_Int32 nCurrSize( points.getLength() );
226 ::basegfx::B2DPolygon aPoly;
228 for( sal_Int32 nCurrPoint=0; nCurrPoint<nCurrSize; ++nCurrPoint )
229 aPoly.append( b2DPointFromRealPoint2D( points[nCurrPoint] ) );
231 return aPoly;
234 //---------------------------------------------------------------------------------------
236 ::basegfx::B2DPolyPolygon polyPolygonFromPoint2DSequenceSequence( const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points )
238 ::basegfx::B2DPolyPolygon aRes;
240 for( sal_Int32 nCurrPoly=0; nCurrPoly<points.getLength(); ++nCurrPoly )
242 aRes.append( polygonFromPoint2DSequence( points[nCurrPoly] ) );
245 return aRes;
248 //---------------------------------------------------------------------------------------
250 ::basegfx::B2DPolygon polygonFromBezier2DSequence( const uno::Sequence< geometry::RealBezierSegment2D >& curves )
252 const sal_Int32 nSize(curves.getLength());
253 basegfx::B2DPolygon aRetval;
255 if(nSize)
257 // prepare start with providing a start point. Use the first point from
258 // the sequence for this
259 const geometry::RealBezierSegment2D& rFirstSegment(curves[0]); // #i79917# first segment, not last
260 aRetval.append(basegfx::B2DPoint(rFirstSegment.Px, rFirstSegment.Py));
262 for(sal_Int32 a(0); a < nSize; a++)
264 const geometry::RealBezierSegment2D& rCurrSegment(curves[a]);
265 const geometry::RealBezierSegment2D& rNextSegment(curves[(a + 1) % nSize]);
267 // append curved edge with the control points and the next point
268 aRetval.appendBezierSegment(
269 basegfx::B2DPoint(rCurrSegment.C1x, rCurrSegment.C1y),
270 basegfx::B2DPoint(rCurrSegment.C2x, rCurrSegment.C2y), // #i79917# Argh! An x for an y!!
271 basegfx::B2DPoint(rNextSegment.Px, rNextSegment.Py));
274 // rescue the control point and remove the now double-added point
275 aRetval.setPrevControlPoint(0, aRetval.getPrevControlPoint(aRetval.count() - 1));
276 aRetval.remove(aRetval.count() - 1);
279 return aRetval;
282 //---------------------------------------------------------------------------------------
284 ::basegfx::B2DPolyPolygon polyPolygonFromBezier2DSequenceSequence( const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& curves )
286 ::basegfx::B2DPolyPolygon aRes;
288 for( sal_Int32 nCurrPoly=0; nCurrPoly<curves.getLength(); ++nCurrPoly )
290 aRes.append( polygonFromBezier2DSequence( curves[nCurrPoly] ) );
293 return aRes;
296 //---------------------------------------------------------------------------------------
298 ::basegfx::B2DPolyPolygon b2DPolyPolygonFromXPolyPolygon2D( const uno::Reference< rendering::XPolyPolygon2D >& xPoly )
300 ::basegfx::unotools::UnoPolyPolygon* pPolyImpl =
301 dynamic_cast< ::basegfx::unotools::UnoPolyPolygon* >( xPoly.get() );
303 if( pPolyImpl )
305 return pPolyImpl->getPolyPolygon();
307 else
309 // not a known implementation object - try data source
310 // interfaces
311 const sal_Int32 nPolys( xPoly->getNumberOfPolygons() );
313 uno::Reference< rendering::XBezierPolyPolygon2D > xBezierPoly(
314 xPoly,
315 uno::UNO_QUERY );
317 if( xBezierPoly.is() )
319 return ::basegfx::unotools::polyPolygonFromBezier2DSequenceSequence(
320 xBezierPoly->getBezierSegments( 0,
321 nPolys,
323 -1 ) );
325 else
327 uno::Reference< rendering::XLinePolyPolygon2D > xLinePoly(
328 xPoly,
329 uno::UNO_QUERY );
331 // no implementation class and no data provider
332 // found - contract violation.
333 if( !xLinePoly.is() )
335 throw lang::IllegalArgumentException(
336 ::rtl::OUString::createFromAscii(
337 "basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(): Invalid input"
338 "poly-polygon, cannot retrieve vertex data"),
339 uno::Reference< uno::XInterface >(),
340 0 );
343 return ::basegfx::unotools::polyPolygonFromPoint2DSequenceSequence(
344 xLinePoly->getPoints( 0,
345 nPolys,
347 -1 ));
352 //---------------------------------------------------------------------------------------
354 ::basegfx::B2DHomMatrix& homMatrixFromAffineMatrix( ::basegfx::B2DHomMatrix& output,
355 const geometry::AffineMatrix2D& input )
357 // ensure last row is [0,0,1] (and optimized away)
358 output.identity();
360 output.set(0,0, input.m00);
361 output.set(0,1, input.m01);
362 output.set(0,2, input.m02);
363 output.set(1,0, input.m10);
364 output.set(1,1, input.m11);
365 output.set(1,2, input.m12);
367 return output;
370 ::basegfx::B2DHomMatrix homMatrixFromAffineMatrix( const geometry::AffineMatrix2D& input )
372 ::basegfx::B2DHomMatrix output;
374 output.set(0,0, input.m00);
375 output.set(0,1, input.m01);
376 output.set(0,2, input.m02);
377 output.set(1,0, input.m10);
378 output.set(1,1, input.m11);
379 output.set(1,2, input.m12);
381 return output;
384 ::basegfx::B3DHomMatrix homMatrixFromAffineMatrix3D( const ::com::sun::star::geometry::AffineMatrix3D& input )
386 ::basegfx::B3DHomMatrix output;
388 output.set(0,0, input.m00);
389 output.set(0,1, input.m01);
390 output.set(0,2, input.m02);
391 output.set(0,3, input.m03);
393 output.set(1,0, input.m10);
394 output.set(1,1, input.m11);
395 output.set(1,2, input.m12);
396 output.set(1,3, input.m13);
398 output.set(2,0, input.m20);
399 output.set(2,1, input.m21);
400 output.set(2,2, input.m22);
401 output.set(2,3, input.m23);
403 return output;
406 geometry::AffineMatrix2D& affineMatrixFromHomMatrix( geometry::AffineMatrix2D& output,
407 const ::basegfx::B2DHomMatrix& input)
409 output.m00 = input.get(0,0);
410 output.m01 = input.get(0,1);
411 output.m02 = input.get(0,2);
412 output.m10 = input.get(1,0);
413 output.m11 = input.get(1,1);
414 output.m12 = input.get(1,2);
416 return output;
419 geometry::AffineMatrix3D& affineMatrixFromHomMatrix3D(
420 geometry::AffineMatrix3D& output,
421 const ::basegfx::B3DHomMatrix& input)
423 output.m00 = input.get(0,0);
424 output.m01 = input.get(0,1);
425 output.m02 = input.get(0,2);
426 output.m03 = input.get(0,3);
428 output.m10 = input.get(1,0);
429 output.m11 = input.get(1,1);
430 output.m12 = input.get(1,2);
431 output.m13 = input.get(1,3);
433 output.m20 = input.get(2,0);
434 output.m21 = input.get(2,1);
435 output.m22 = input.get(2,2);
436 output.m23 = input.get(2,3);
438 return output;
441 //---------------------------------------------------------------------------------------
443 ::basegfx::B2DHomMatrix& homMatrixFromMatrix( ::basegfx::B2DHomMatrix& output,
444 const geometry::Matrix2D& input )
446 // ensure last row is [0,0,1] (and optimized away)
447 output.identity();
449 output.set(0,0, input.m00);
450 output.set(0,1, input.m01);
451 output.set(1,0, input.m10);
452 output.set(1,1, input.m11);
454 return output;
457 //---------------------------------------------------------------------------------------
459 geometry::RealSize2D size2DFromB2DSize( const ::basegfx::B2DVector& rVec )
461 return geometry::RealSize2D( rVec.getX(),
462 rVec.getY() );
465 geometry::RealPoint2D point2DFromB2DPoint( const ::basegfx::B2DPoint& rPoint )
467 return geometry::RealPoint2D( rPoint.getX(),
468 rPoint.getY() );
471 geometry::RealRectangle2D rectangle2DFromB2DRectangle( const ::basegfx::B2DRange& rRect )
473 return geometry::RealRectangle2D( rRect.getMinX(),
474 rRect.getMinY(),
475 rRect.getMaxX(),
476 rRect.getMaxY() );
479 geometry::RealRectangle3D rectangle3DFromB3DRectangle( const ::basegfx::B3DRange& rRect )
481 return geometry::RealRectangle3D( rRect.getMinX(),
482 rRect.getMinY(),
483 rRect.getMinZ(),
484 rRect.getMaxX(),
485 rRect.getMaxY(),
486 rRect.getMaxZ());
489 ::basegfx::B2DVector b2DSizeFromRealSize2D( const geometry::RealSize2D& rSize )
491 return ::basegfx::B2DVector( rSize.Width,
492 rSize.Height );
495 ::basegfx::B2DPoint b2DPointFromRealPoint2D( const geometry::RealPoint2D& rPoint )
497 return ::basegfx::B2DPoint( rPoint.X,
498 rPoint.Y );
501 ::basegfx::B2DRange b2DRectangleFromRealRectangle2D( const geometry::RealRectangle2D& rRect )
503 return ::basegfx::B2DRange( rRect.X1,
504 rRect.Y1,
505 rRect.X2,
506 rRect.Y2 );
509 ::basegfx::B3DRange b3DRectangleFromRealRectangle3D( const geometry::RealRectangle3D& rRect )
511 return ::basegfx::B3DRange( rRect.X1,
512 rRect.Y1,
513 rRect.Z1,
514 rRect.X2,
515 rRect.Y2,
516 rRect.Z2);
519 geometry::IntegerSize2D integerSize2DFromB2ISize( const ::basegfx::B2IVector& rSize )
521 return geometry::IntegerSize2D( rSize.getX(),
522 rSize.getY() );
525 geometry::IntegerPoint2D integerPoint2DFromB2IPoint( const ::basegfx::B2IPoint& rPoint )
527 return geometry::IntegerPoint2D( rPoint.getX(),
528 rPoint.getY() );
531 geometry::IntegerRectangle2D integerRectangle2DFromB2IRectangle( const ::basegfx::B2IRange& rRectangle )
533 return geometry::IntegerRectangle2D( rRectangle.getMinX(), rRectangle.getMinY(),
534 rRectangle.getMaxX(), rRectangle.getMaxY() );
537 ::basegfx::B2IVector b2ISizeFromIntegerSize2D( const geometry::IntegerSize2D& rSize )
539 return ::basegfx::B2IVector( rSize.Width,
540 rSize.Height );
543 ::basegfx::B2IPoint b2IPointFromIntegerPoint2D( const geometry::IntegerPoint2D& rPoint )
545 return ::basegfx::B2IPoint( rPoint.X,
546 rPoint.Y );
549 ::basegfx::B2IRange b2IRectangleFromIntegerRectangle2D( const geometry::IntegerRectangle2D& rRectangle )
551 return ::basegfx::B2IRange( rRectangle.X1, rRectangle.Y1,
552 rRectangle.X2, rRectangle.Y2 );
555 awt::Size awtSizeFromB2ISize( const ::basegfx::B2IVector& rVec )
557 return awt::Size( rVec.getX(),
558 rVec.getY() );
561 awt::Point awtPointFromB2IPoint( const ::basegfx::B2IPoint& rPoint )
563 return awt::Point( rPoint.getX(),
564 rPoint.getY() );
567 awt::Rectangle awtRectangleFromB2IRectangle( const ::basegfx::B2IRange& rRect )
569 OSL_ENSURE( rRect.getWidth() < ::std::numeric_limits< sal_Int32 >::max() &&
570 rRect.getWidth() > ::std::numeric_limits< sal_Int32 >::min(),
571 "awtRectangleFromB2IRectangle(): width overflow" );
572 OSL_ENSURE( rRect.getHeight() < ::std::numeric_limits< sal_Int32 >::max() &&
573 rRect.getHeight() > ::std::numeric_limits< sal_Int32 >::min(),
574 "awtRectangleFromB2IRectangle(): height overflow" );
576 return awt::Rectangle( rRect.getMinX(),
577 rRect.getMinY(),
578 static_cast< sal_Int32 >(rRect.getWidth()),
579 static_cast< sal_Int32 >(rRect.getHeight()) );
582 ::basegfx::B2IVector b2ISizeFromAwtSize( const awt::Size& rSize )
584 return ::basegfx::B2IVector( rSize.Width,
585 rSize.Height );
588 ::basegfx::B2IPoint b2IPointFromAwtPoint( const awt::Point& rPoint )
590 return ::basegfx::B2IPoint( rPoint.X,
591 rPoint.Y );
594 ::basegfx::B2IRange b2IRectangleFromAwtRectangle( const awt::Rectangle& rRect )
596 return ::basegfx::B2IRange( rRect.X,
597 rRect.Y,
598 rRect.X + rRect.Width,
599 rRect.Y + rRect.Height );
602 ::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange )
604 return ::basegfx::B2IRange( static_cast<sal_Int32>( floor(rRange.getMinX()) ),
605 static_cast<sal_Int32>( floor(rRange.getMinY()) ),
606 static_cast<sal_Int32>( ceil(rRange.getMaxX()) ),
607 static_cast<sal_Int32>( ceil(rRange.getMaxY()) ) );
610 ::basegfx::B2DRange b2DSurroundingIntegerRangeFromB2DRange( const ::basegfx::B2DRange& rRange )
612 return ::basegfx::B2DRange( floor(rRange.getMinX()),
613 floor(rRange.getMinY()),
614 ceil(rRange.getMaxX()),
615 ceil(rRange.getMaxY()) );
618 // Geometry comparisons
619 // ===================================================================
621 bool RealSize2DAreEqual( const ::com::sun::star::geometry::RealSize2D& rA, const ::com::sun::star::geometry::RealSize2D& rB )
623 return (rA.Width == rB.Width && rA.Height == rB.Height);
626 bool RealPoint2DAreEqual( const ::com::sun::star::geometry::RealPoint2D& rA, const ::com::sun::star::geometry::RealPoint2D& rB )
628 return (rA.X == rB.X && rA.Y == rB.Y);
631 bool RealRectangle2DAreEqual( const ::com::sun::star::geometry::RealRectangle2D& rA, const ::com::sun::star::geometry::RealRectangle2D& rB )
633 return (rA.X1 == rB.X1 && rA.Y1 == rB.Y1 && rA.X2 == rB.X2 && rA.Y2 == rB.Y2);
636 bool RealRectangle3DAreEqual( const ::com::sun::star::geometry::RealRectangle3D& rA, const ::com::sun::star::geometry::RealRectangle3D& rB )
638 return (rA.X1 == rB.X1 && rA.Y1 == rB.Y1 && rA.Z1 == rB.Z1 && rA.X2 == rB.X2 && rA.Y2 == rB.Y2 && rA.Z2 == rB.Z2);
641 bool AffineMatrix2DAreEqual( const ::com::sun::star::geometry::AffineMatrix2D& rA, const ::com::sun::star::geometry::AffineMatrix2D& rB )
643 return (rA.m00 == rB.m00 && rA.m01 == rB.m01 && rA.m02 == rB.m02 && rA.m10 == rB.m10 && rA.m11 == rB.m11 && rA.m12 == rB.m12);
646 bool IntegerSize2DAreEqual( const ::com::sun::star::geometry::IntegerSize2D& rA, const ::com::sun::star::geometry::IntegerSize2D& rB )
648 return (rA.Width == rB.Width && rA.Height == rB.Height);
651 bool IntegerPoint2DAreEqual( const ::com::sun::star::geometry::IntegerPoint2D& rA, const ::com::sun::star::geometry::IntegerPoint2D& rB )
653 return (rA.X == rB.X && rA.Y == rB.Y);
656 bool IntegerRectangle2DAreEqual( const ::com::sun::star::geometry::IntegerRectangle2D& rA, const ::com::sun::star::geometry::IntegerRectangle2D& rB )
658 return (rA.X1 == rB.X1 && rA.Y1 == rB.Y1 && rA.X2 == rB.X2 && rA.Y2 == rB.Y2);
661 bool awtSizeAreEqual( const ::com::sun::star::awt::Size& rA, const ::com::sun::star::awt::Size& rB )
663 return (rA.Width == rB.Width && rA.Height == rB.Height);
666 bool awtPointAreEqual( const ::com::sun::star::awt::Point& rA, const ::com::sun::star::awt::Point& rB )
668 return (rA.X == rB.X && rA.Y == rB.Y);
671 bool awtRectangleAreEqual( const ::com::sun::star::awt::Rectangle& rA, const ::com::sun::star::awt::Rectangle& rB )
673 return (rA.X == rB.X && rA.Y == rB.Y && rA.Width == rB.Width && rA.Height == rB.Height);
675 } // namespace bgfxtools
677 } // namespace canvas