1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <tools/diagnose_ex.h>
23 #include <com/sun/star/animations/TransitionType.hpp>
24 #include <com/sun/star/animations/TransitionSubType.hpp>
26 #include "parametricpolypolygonfactory.hxx"
27 #include "barwipepolypolygon.hxx"
28 #include "boxwipe.hxx"
29 #include "fourboxwipe.hxx"
30 #include "barndoorwipe.hxx"
31 #include "doublediamondwipe.hxx"
32 #include "veewipe.hxx"
33 #include "iriswipe.hxx"
34 #include "ellipsewipe.hxx"
35 #include "checkerboardwipe.hxx"
36 #include "randomwipe.hxx"
37 #include "waterfallwipe.hxx"
38 #include "clockwipe.hxx"
39 #include "fanwipe.hxx"
40 #include "pinwheelwipe.hxx"
41 #include "snakewipe.hxx"
42 #include "spiralwipe.hxx"
43 #include "sweepwipe.hxx"
44 #include "figurewipe.hxx"
45 #include "zigzagwipe.hxx"
48 using namespace ::com::sun::star
;
54 ParametricPolyPolygonSharedPtr
55 ParametricPolyPolygonFactory::createClipPolyPolygon(
56 sal_Int16 nType
, sal_Int16 nSubType
)
58 using namespace ::com::sun::star::animations::TransitionType
;
59 using namespace ::com::sun::star::animations::TransitionSubType
;
64 return ParametricPolyPolygonSharedPtr(
65 new BarWipePolyPolygon
);
67 return ParametricPolyPolygonSharedPtr(
68 new BarWipePolyPolygon( 6 ) );
70 return ParametricPolyPolygonSharedPtr(
71 new BoxWipe( nSubType
== LEFTCENTER
||
72 nSubType
== TOPCENTER
||
73 nSubType
== RIGHTCENTER
||
74 nSubType
== BOTTOMCENTER
) );
76 return ParametricPolyPolygonSharedPtr(
77 new FourBoxWipe( nSubType
== CORNERSOUT
) );
79 return ParametricPolyPolygonSharedPtr(
82 return ParametricPolyPolygonSharedPtr(
83 new BarWipePolyPolygon
);
85 return ParametricPolyPolygonSharedPtr(
88 return ParametricPolyPolygonSharedPtr(
91 return ParametricPolyPolygonSharedPtr(
92 new EllipseWipe(nSubType
) );
93 case CHECKERBOARDWIPE
:
94 return ParametricPolyPolygonSharedPtr(
95 new CheckerBoardWipe
);
97 return ParametricPolyPolygonSharedPtr(
98 new RandomWipe( 128, true /* bars */ ) );
100 return ParametricPolyPolygonSharedPtr(
101 new RandomWipe( 16 * 16, // for now until dxcanvas is faster
102 // 64 * 64 /* elements */,
103 false /* dissolve */ ) );
105 return ParametricPolyPolygonSharedPtr(
109 nSubType
== VERTICALRIGHT
||
110 nSubType
== HORIZONTALLEFT
) );
112 return ParametricPolyPolygonSharedPtr(
115 return ParametricPolyPolygonSharedPtr(
116 new FanWipe( // center:
117 nSubType
== CENTERTOP
||
118 nSubType
== CENTERRIGHT
) );
138 return ParametricPolyPolygonSharedPtr(
139 new PinWheelWipe( blades
) );
142 return ParametricPolyPolygonSharedPtr(
147 nSubType
== TOPLEFTDIAGONAL
||
148 nSubType
== TOPRIGHTDIAGONAL
||
149 nSubType
== BOTTOMRIGHTDIAGONAL
||
150 nSubType
== BOTTOMLEFTDIAGONAL
,
152 nSubType
== TOPLEFTVERTICAL
||
153 nSubType
== TOPRIGHTDIAGONAL
||
154 nSubType
== BOTTOMLEFTDIAGONAL
156 case PARALLELSNAKESWIPE
:
157 return ParametricPolyPolygonSharedPtr(
158 new ParallelSnakesWipe(
162 nSubType
== DIAGONALBOTTOMLEFTOPPOSITE
||
163 nSubType
== DIAGONALTOPLEFTOPPOSITE
,
165 nSubType
== VERTICALBOTTOMLEFTOPPOSITE
||
166 nSubType
== HORIZONTALTOPLEFTOPPOSITE
||
167 nSubType
== DIAGONALTOPLEFTOPPOSITE
,
169 nSubType
== VERTICALTOPLEFTOPPOSITE
||
170 nSubType
== VERTICALBOTTOMLEFTOPPOSITE
||
171 nSubType
== HORIZONTALTOPLEFTOPPOSITE
||
172 nSubType
== HORIZONTALTOPRIGHTOPPOSITE
||
173 nSubType
== DIAGONALBOTTOMLEFTOPPOSITE
||
174 nSubType
== DIAGONALTOPLEFTOPPOSITE
177 return ParametricPolyPolygonSharedPtr(
182 nSubType
== TOPLEFTCOUNTERCLOCKWISE
||
183 nSubType
== TOPRIGHTCOUNTERCLOCKWISE
||
184 nSubType
== BOTTOMRIGHTCOUNTERCLOCKWISE
||
185 nSubType
== BOTTOMLEFTCOUNTERCLOCKWISE
) );
187 return ParametricPolyPolygonSharedPtr(
192 nSubType
== FOURBOXVERTICAL
||
193 nSubType
== FOURBOXHORIZONTAL
) );
194 case SINGLESWEEPWIPE
:
195 return ParametricPolyPolygonSharedPtr(
198 nSubType
== CLOCKWISETOP
||
199 nSubType
== CLOCKWISERIGHT
||
200 nSubType
== CLOCKWISEBOTTOM
||
201 nSubType
== CLOCKWISELEFT
,
207 nSubType
== COUNTERCLOCKWISEBOTTOMLEFT
||
208 nSubType
== COUNTERCLOCKWISETOPRIGHT
210 case DOUBLESWEEPWIPE
:
211 return ParametricPolyPolygonSharedPtr(
214 nSubType
== PARALLELVERTICAL
||
215 nSubType
== PARALLELDIAGONAL
||
216 nSubType
== OPPOSITEVERTICAL
||
217 nSubType
== OPPOSITEHORIZONTAL
,
221 nSubType
== OPPOSITEVERTICAL
||
222 nSubType
== OPPOSITEHORIZONTAL
,
226 return ParametricPolyPolygonSharedPtr(
233 nSubType
== FANINVERTICAL
||
234 nSubType
== FANINHORIZONTAL
) );
236 return ParametricPolyPolygonSharedPtr(
237 FigureWipe::createTriangleWipe() );
239 return ParametricPolyPolygonSharedPtr(
240 FigureWipe::createArrowHeadWipe() );
242 return ParametricPolyPolygonSharedPtr(
243 FigureWipe::createPentagonWipe() );
245 return ParametricPolyPolygonSharedPtr(
246 FigureWipe::createHexagonWipe() );
260 return ParametricPolyPolygonSharedPtr(
261 FigureWipe::createStarWipe(points
) );
263 case MISCDIAGONALWIPE
: {
266 return ParametricPolyPolygonSharedPtr(
267 new BarnDoorWipe( true /* doubled */ ) );
269 return ParametricPolyPolygonSharedPtr(
270 new DoubleDiamondWipe
);
275 return ParametricPolyPolygonSharedPtr( new ZigZagWipe(5) );
277 return ParametricPolyPolygonSharedPtr( new BarnZigZagWipe(5) );
286 // for now, map to barwipe transition
287 return ParametricPolyPolygonSharedPtr(
288 new BarWipePolyPolygon
);
294 ENSURE_OR_THROW( false,
295 "createShapeClipPolyPolygonAnimation(): Transition type mismatch" );
298 return ParametricPolyPolygonSharedPtr();
303 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */