1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_SLIDESHOW_PARAMETRICPOLYPOLYGON_HXX
29 #define INCLUDED_SLIDESHOW_PARAMETRICPOLYPOLYGON_HXX
30 
31 #include <basegfx/polygon/b2dpolypolygon.hxx>
32 #include <boost/shared_ptr.hpp>
33 
34 
35 /* Definition of ParametricPolyPolygon interface */
36 
37 namespace slideshow
38 {
39     namespace internal
40     {
41         /** Interface defining a parametric poly-polygon.
42 
43         	This interface defines a poly-polygon, whose actual shape
44         	is parameterized by a floating point value. This is
45         	e.g. used to generically access the various clip polygon
46         	generators for transition effects.
47 
48             Since for every parametric poly-polygon, there is a set of
49             variations, which can easily be generated by simple
50             transformations or change in parameter range sweep
51             direction, objects implementing this interface only
52             generate <em>one</em> prototypical instance of the
53             parametric poly-polygon. Generally speaking, the main
54             effect direction should be horizontal, it should make
55             increasingly more area visible (transition 'in'), and when
56             there is a designated direction given, that should be
57             left-to-right.
58          */
59         class ParametricPolyPolygon
60         {
61         public:
62             virtual ~ParametricPolyPolygon() {}
63 
64             /** Retrieve the poly-polygon for value t.
65 
66                 @param t
67                 Current parameter value to retrieve the corresponding
68                 poly-polygon for. Permissible values for t must be in
69                 the range [0,1].
70 
71                 @return a poly-polygon corresponding to the given
72                 parameter value. The poly-polygon is interpreted as
73                 living in the unit rectangle (i.e. [0,1]x[0,1]), but
74                 is not necessarily constrained to completely lie in
75                 this area (this very much depends on the actual effect
76                 to be generated). Although, from a performance
77                 perspective, it currently <em>is</em> advantageous to
78                 try to keep the poly-polygon within these bounds (at
79                 least if there are no hard reasons not to do so),
80                 because then reversion or out transformations are
81                 potentially faster to compute (see the
82                 TransitionInfo::meReverseMethod member in
83                 transitionfactory.cxx). Furthermore, if one of the
84                 polygon modifications involve subtraction (also see
85                 TransitionInfo::meReverseMethod), all generated
86                 polygons should be oriented clock-wise
87                 (i.e. traversing the polygon vertices with increasing
88                 vertex index should generate a clock-wise movement).
89              */
90             virtual ::basegfx::B2DPolyPolygon operator()( double t ) = 0;
91         };
92 
93         typedef ::boost::shared_ptr< ParametricPolyPolygon > ParametricPolyPolygonSharedPtr;
94 
95     }
96 }
97 
98 #endif /* INCLUDED_SLIDESHOW_PARAMETRICPOLYPOLYGON_HXX */
99