1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: transitiontools.cxx,v $
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_slideshow.hxx"
34 #include "transitiontools.hxx"
35 #include <basegfx/point/b2dpoint.hxx>
36 #include <basegfx/polygon/b2dpolygon.hxx>
37 #include <basegfx/polygon/b2dpolygontools.hxx>
38 #include <basegfx/matrix/b2dhommatrix.hxx>
44 // TODO(Q2): Move this to basegfx
45 ::basegfx::B2DPolygon
createUnitRect()
47 return ::basegfx::tools::createPolygonFromRect(
48 ::basegfx::B2DRectangle(0.0,0.0,
52 ::basegfx::B2DPolyPolygon
flipOnYAxis(
53 ::basegfx::B2DPolyPolygon
const & polypoly
)
55 ::basegfx::B2DPolyPolygon
res(polypoly
);
56 ::basegfx::B2DHomMatrix aTransform
;
57 aTransform
.scale( -1.0, 1.0 );
58 aTransform
.translate( 1.0, 0.0 );
59 res
.transform( aTransform
);
64 ::basegfx::B2DPolyPolygon
flipOnXAxis(
65 ::basegfx::B2DPolyPolygon
const & polypoly
)
67 ::basegfx::B2DPolyPolygon
res(polypoly
);
68 ::basegfx::B2DHomMatrix aTransform
;
69 aTransform
.scale( 1.0, -1.0 );
70 aTransform
.translate( 0.0, 1.0 );
71 res
.transform( aTransform
);