xref: /trunk/main/sd/source/ui/inc/fumorph.hxx (revision 67e470da)
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 SD_FU_MORPH_HXX
25 #define SD_FU_MORPH_HXX
26 
27 #include "fupoor.hxx"
28 
29 #include <math.h>
30 
31 /*************************************************************************
32 |*
33 \************************************************************************/
34 class List;
35 namespace basegfx {
36 	class B2DPolyPolygon;
37 	class B2DPolygon;
38 	class B2DPoint;
39 }
40 
41 namespace sd {
42 
43 class FuMorph
44     : public FuPoor
45 {
46 public:
47 	TYPEINFO();
48 
49 	static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
50 	virtual void DoExecute( SfxRequest& rReq );
51 
52 private:
53 	FuMorph (
54         ViewShell* pViewSh,
55         ::sd::Window* pWin,
56         ::sd::View* pView,
57 		SdDrawDocument* pDoc,
58         SfxRequest& rReq);
59 
60 	void ImpInsertPolygons(List& rPolyPolyList3D, sal_Bool bAttributeFade,
61 		const SdrObject* pObj1, const SdrObject* pObj2);
62 	::basegfx::B2DPolyPolygon* ImpCreateMorphedPolygon(
63 		const ::basegfx::B2DPolyPolygon& rPolyPolyStart,
64 		const ::basegfx::B2DPolyPolygon& rPolyPolyEnd,
65 		double fMorphingFactor);
66 	sal_Bool ImpMorphPolygons(
67 		const ::basegfx::B2DPolyPolygon& rPolyPoly1, const ::basegfx::B2DPolyPolygon& rPolyPoly2,
68 		const sal_uInt16 nSteps, List& rPolyPolyList3D);
69 	void ImpAddPolys(::basegfx::B2DPolyPolygon& rSmaller, const ::basegfx::B2DPolyPolygon& rBigger);
70 	void ImpEqualizePolyPointCount(::basegfx::B2DPolygon& rSmall, const ::basegfx::B2DPolygon& rBig);
71 	sal_uInt32 ImpGetNearestIndex(const ::basegfx::B2DPolygon& rPoly, const ::basegfx::B2DPoint& rPos);
72 };
73 
74 } // end of namespace sd
75 
76 #endif
77