LibreOffice Module slideshow (master) 1
clockwipe.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
24#include "clockwipe.hxx"
25
26
27namespace slideshow::internal {
28
30{
32 ::basegfx::B2DHomMatrix aTransform;
33 aTransform.rotate( t * 2.0 * M_PI );
34 const double MAX_EDGE = 2.0;
35 ::basegfx::B2DPoint p( 0.0, -MAX_EDGE );
36 p *= aTransform;
37 poly.append( p );
38 if (t >= 0.875)
39 poly.append( ::basegfx::B2DPoint( -e, -e ) );
40 if (t >= 0.625)
41 poly.append( ::basegfx::B2DPoint( -e, e ) );
42 if (t >= 0.375)
43 poly.append( ::basegfx::B2DPoint( e, e ) );
44 if (t >= 0.125)
45 poly.append( ::basegfx::B2DPoint( e, -e ) );
46 poly.append( ::basegfx::B2DPoint( 0.0, -e ) );
47 poly.append( ::basegfx::B2DPoint( 0.0, 0.0 ) );
48 poly.setClosed(true);
49 return poly;
50}
51
53{
56 poly.transform( aTransform );
57 return ::basegfx::B2DPolyPolygon(poly);
58}
59
60}
61
62/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XPropertyListType t
void rotate(double fRadiant)
void transform(const basegfx::B2DHomMatrix &rMatrix)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
::basegfx::B2DPolygon calcCenteredClock(double t, double e=1.0)
0,1 to 1,1 to 1,0 to 0,-1 to -1,0 to 0,1:
Definition: clockwipe.cxx:29
virtual ::basegfx::B2DPolyPolygon operator()(double t) override
Retrieve the poly-polygon for value t.
Definition: clockwipe.cxx:52
void * p
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)