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 #if ! defined INCLUDED_SLIDESHOW_CLIPPINGFUNCTOR_HXX
29 #define INCLUDED_SLIDESHOW_CLIPPINGFUNCTOR_HXX
30 
31 #include <basegfx/numeric/ftools.hxx>
32 #include <basegfx/vector/b2dsize.hxx>
33 #include <basegfx/matrix/b2dhommatrix.hxx>
34 #include <basegfx/polygon/b2dpolypolygontools.hxx>
35 #include <transitioninfo.hxx>
36 #include <parametricpolypolygon.hxx>
37 
38 
39 namespace slideshow
40 {
41     namespace internal
42     {
43         /** Generates the final clipping polygon.
44 
45         	This class serves as the functor, which generates the
46         	final clipping polygon from a given ParametricPolyPolygon
47         	and a TransitionInfo.
48 
49             The ParametricPolyPolygon can be obtained from the
50             ParametricPolyPolygonFactory, see there.
51 
52             The TransitionInfo further parameterizes the polygon
53             generated by the ParametricPolyPolygon, with common
54             modifications such as rotation, flipping, or change of
55             direction. This allows the ParametricPolyPolygonFactory to
56             provide only prototypical shapes, with the ClippingFunctor
57             further customizing the output.
58          */
59         class ClippingFunctor
60         {
61         public:
62             ClippingFunctor(
63                 const ParametricPolyPolygonSharedPtr&   rPolygon,
64                 const TransitionInfo&                   rTransitionInfo,
65                 bool                                    bDirectionForward,
66                 bool                                    bModeIn );
67 
68             /** Generate clip polygon.
69 
70             	@param nValue
71                 Value to generate the polygon for. Must be in the
72                 range [0,1].
73 
74                 @param rTargetSize
75                 Size the clip polygon should cover. This is typically
76                 the size of the object the effect is applied on.
77              */
78             ::basegfx::B2DPolyPolygon operator()( double 					nValue,
79                                                   const ::basegfx::B2DSize& rTargetSize );
80 
81         private:
82             ParametricPolyPolygonSharedPtr     mpParametricPoly;
83             ::basegfx::B2DHomMatrix            maStaticTransformation;
84             // AW: Not needed
85 			// ::basegfx::B2DPolyPolygon          maBackgroundRect;
86             bool                               mbForwardParameterSweep;
87             bool                               mbSubtractPolygon;
88             const bool                         mbScaleIsotrophically;
89             bool                               mbFlip;
90         };
91 
92     }
93 }
94 
95 #endif /* INCLUDED_SLIDESHOW_CLIPPINGFUNCTOR_HXX */
96