bump product version to 5.0.4.1
[LibreOffice.git] / slideshow / source / engine / transitions / parametricpolypolygon.hxx
blobd367429222cdaff3fdabeba679330c2bc9cc0e83
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_TRANSITIONS_PARAMETRICPOLYPOLYGON_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_ENGINE_TRANSITIONS_PARAMETRICPOLYPOLYGON_HXX
23 #include <basegfx/polygon/b2dpolypolygon.hxx>
24 #include <boost/shared_ptr.hpp>
27 /* Definition of ParametricPolyPolygon interface */
29 namespace slideshow
31 namespace internal
33 /** Interface defining a parametric poly-polygon.
35 This interface defines a poly-polygon, whose actual shape
36 is parameterized by a floating point value. This is
37 e.g. used to generically access the various clip polygon
38 generators for transition effects.
40 Since for every parametric poly-polygon, there is a set of
41 variations, which can easily be generated by simple
42 transformations or change in parameter range sweep
43 direction, objects implementing this interface only
44 generate <em>one</em> prototypical instance of the
45 parametric poly-polygon. Generally speaking, the main
46 effect direction should be horizontal, it should make
47 increasingly more area visible (transition 'in'), and when
48 there is a designated direction given, that should be
49 left-to-right.
51 class ParametricPolyPolygon
53 public:
54 virtual ~ParametricPolyPolygon() {}
56 /** Retrieve the poly-polygon for value t.
58 @param t
59 Current parameter value to retrieve the corresponding
60 poly-polygon for. Permissible values for t must be in
61 the range [0,1].
63 @return a poly-polygon corresponding to the given
64 parameter value. The poly-polygon is interpreted as
65 living in the unit rectangle (i.e. [0,1]x[0,1]), but
66 is not necessarily constrained to completely lie in
67 this area (this very much depends on the actual effect
68 to be generated). Although, from a performance
69 perspective, it currently <em>is</em> advantageous to
70 try to keep the poly-polygon within these bounds (at
71 least if there are no hard reasons not to do so),
72 because then reversion or out transformations are
73 potentially faster to compute (see the
74 TransitionInfo::meReverseMethod member in
75 transitionfactory.cxx). Furthermore, if one of the
76 polygon modifications involve subtraction (also see
77 TransitionInfo::meReverseMethod), all generated
78 polygons should be oriented clock-wise
79 (i.e. traversing the polygon vertices with increasing
80 vertex index should generate a clock-wise movement).
82 virtual ::basegfx::B2DPolyPolygon operator()( double t ) = 0;
85 typedef ::boost::shared_ptr< ParametricPolyPolygon > ParametricPolyPolygonSharedPtr;
90 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_TRANSITIONS_PARAMETRICPOLYPOLYGON_HXX
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */