1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_SLIDESHOW_PARAMETRICPOLYPOLYGON_HXX
25 #define INCLUDED_SLIDESHOW_PARAMETRICPOLYPOLYGON_HXX
26 
27 #include <basegfx/polygon/b2dpolypolygon.hxx>
28 #include <boost/shared_ptr.hpp>
29 
30 
31 /* Definition of ParametricPolyPolygon interface */
32 
33 namespace slideshow
34 {
35     namespace internal
36     {
37         /** Interface defining a parametric poly-polygon.
38 
39         	This interface defines a poly-polygon, whose actual shape
40         	is parameterized by a floating point value. This is
41         	e.g. used to generically access the various clip polygon
42         	generators for transition effects.
43 
44             Since for every parametric poly-polygon, there is a set of
45             variations, which can easily be generated by simple
46             transformations or change in parameter range sweep
47             direction, objects implementing this interface only
48             generate <em>one</em> prototypical instance of the
49             parametric poly-polygon. Generally speaking, the main
50             effect direction should be horizontal, it should make
51             increasingly more area visible (transition 'in'), and when
52             there is a designated direction given, that should be
53             left-to-right.
54          */
55         class ParametricPolyPolygon
56         {
57         public:
~ParametricPolyPolygon()58             virtual ~ParametricPolyPolygon() {}
59 
60             /** Retrieve the poly-polygon for value t.
61 
62                 @param t
63                 Current parameter value to retrieve the corresponding
64                 poly-polygon for. Permissible values for t must be in
65                 the range [0,1].
66 
67                 @return a poly-polygon corresponding to the given
68                 parameter value. The poly-polygon is interpreted as
69                 living in the unit rectangle (i.e. [0,1]x[0,1]), but
70                 is not necessarily constrained to completely lie in
71                 this area (this very much depends on the actual effect
72                 to be generated). Although, from a performance
73                 perspective, it currently <em>is</em> advantageous to
74                 try to keep the poly-polygon within these bounds (at
75                 least if there are no hard reasons not to do so),
76                 because then reversion or out transformations are
77                 potentially faster to compute (see the
78                 TransitionInfo::meReverseMethod member in
79                 transitionfactory.cxx). Furthermore, if one of the
80                 polygon modifications involve subtraction (also see
81                 TransitionInfo::meReverseMethod), all generated
82                 polygons should be oriented clock-wise
83                 (i.e. traversing the polygon vertices with increasing
84                 vertex index should generate a clock-wise movement).
85              */
86             virtual ::basegfx::B2DPolyPolygon operator()( double t ) = 0;
87         };
88 
89         typedef ::boost::shared_ptr< ParametricPolyPolygon > ParametricPolyPolygonSharedPtr;
90 
91     }
92 }
93 
94 #endif /* INCLUDED_SLIDESHOW_PARAMETRICPOLYPOLYGON_HXX */
95