merge the formfield patch from ooo-build
[ooovba.git] / slideshow / source / engine / transitions / parametricpolypolygon.hxx
blobec26681acbdaa699f6115426e9ffa1bba1284616
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: parametricpolypolygon.hxx,v $
10 * $Revision: 1.6 $
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 #ifndef INCLUDED_SLIDESHOW_PARAMETRICPOLYPOLYGON_HXX
32 #define INCLUDED_SLIDESHOW_PARAMETRICPOLYPOLYGON_HXX
34 #include <basegfx/polygon/b2dpolypolygon.hxx>
35 #include <boost/shared_ptr.hpp>
38 /* Definition of ParametricPolyPolygon interface */
40 namespace slideshow
42 namespace internal
44 /** Interface defining a parametric poly-polygon.
46 This interface defines a poly-polygon, whose actual shape
47 is parameterized by a floating point value. This is
48 e.g. used to generically access the various clip polygon
49 generators for transition effects.
51 Since for every parametric poly-polygon, there is a set of
52 variations, which can easily be generated by simple
53 transformations or change in parameter range sweep
54 direction, objects implementing this interface only
55 generate <em>one</em> prototypical instance of the
56 parametric poly-polygon. Generally speaking, the main
57 effect direction should be horizontal, it should make
58 increasingly more area visible (transition 'in'), and when
59 there is a designated direction given, that should be
60 left-to-right.
62 class ParametricPolyPolygon
64 public:
65 virtual ~ParametricPolyPolygon() {}
67 /** Retrieve the poly-polygon for value t.
69 @param t
70 Current parameter value to retrieve the corresponding
71 poly-polygon for. Permissible values for t must be in
72 the range [0,1].
74 @return a poly-polygon corresponding to the given
75 parameter value. The poly-polygon is interpreted as
76 living in the unit rectangle (i.e. [0,1]x[0,1]), but
77 is not necessarily constrained to completely lie in
78 this area (this very much depends on the actual effect
79 to be generated). Although, from a performance
80 perspective, it currently <em>is</em> advantageous to
81 try to keep the poly-polygon within these bounds (at
82 least if there are no hard reasons not to do so),
83 because then reversion or out transformations are
84 potentially faster to compute (see the
85 TransitionInfo::meReverseMethod member in
86 transitionfactory.cxx). Furthermore, if one of the
87 polygon modifications involve subtraction (also see
88 TransitionInfo::meReverseMethod), all generated
89 polygons should be oriented clock-wise
90 (i.e. traversing the polygon vertices with increasing
91 vertex index should generate a clock-wise movement).
93 virtual ::basegfx::B2DPolyPolygon operator()( double t ) = 0;
96 typedef ::boost::shared_ptr< ParametricPolyPolygon > ParametricPolyPolygonSharedPtr;
101 #endif /* INCLUDED_SLIDESHOW_PARAMETRICPOLYPOLYGON_HXX */