LibreOffice Module sd (master) 1
fumorph.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include "fupoor.hxx"
24
25#include <vector>
26
27namespace basegfx {
28 class B2DPolygon;
29 class B2DPoint;
30}
31
32namespace sd {
33
34class FuMorph final
35 : public FuPoor
36{
37public:
38
39 static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
40 virtual void DoExecute( SfxRequest& rReq ) override;
41
42private:
43 typedef ::std::vector< ::basegfx::B2DPolyPolygon > B2DPolyPolygonList_impl;
44
45 FuMorph (
46 ViewShell* pViewSh,
47 ::sd::Window* pWin,
48 ::sd::View* pView,
49 SdDrawDocument* pDoc,
50 SfxRequest& rReq);
51
53 B2DPolyPolygonList_impl& rPolyPolyList3D,
54 bool bAttributeFade,
55 const SdrObject* pObj1,
56 const SdrObject* pObj2
57 );
58
59 static ::basegfx::B2DPolyPolygon ImpCreateMorphedPolygon(
60 const ::basegfx::B2DPolyPolygon& rPolyPolyStart,
61 const ::basegfx::B2DPolyPolygon& rPolyPolyEnd,
62 double fMorphingFactor
63 );
64
65 static void ImpMorphPolygons(
66 const ::basegfx::B2DPolyPolygon& rPolyPoly1,
67 const ::basegfx::B2DPolyPolygon& rPolyPoly2,
68 const sal_uInt16 nSteps,
69 B2DPolyPolygonList_impl& rPolyPolyList3D
70 );
71
72 static void ImpAddPolys(
74 const ::basegfx::B2DPolyPolygon& rBigger
75 );
76
77 static void ImpEqualizePolyPointCount(
79 const ::basegfx::B2DPolygon& rBig
80 );
81
82 static sal_uInt32 ImpGetNearestIndex(
83 const ::basegfx::B2DPolygon& rPoly,
84 const ::basegfx::B2DPoint& rPos
85 );
86};
87
88} // end of namespace sd
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static void ImpMorphPolygons(const ::basegfx::B2DPolyPolygon &rPolyPoly1, const ::basegfx::B2DPolyPolygon &rPolyPoly2, const sal_uInt16 nSteps, B2DPolyPolygonList_impl &rPolyPolyList3D)
create morphed PolyPolygons
Definition: fumorph.cxx:471
static void ImpEqualizePolyPointCount(::basegfx::B2DPolygon &rSmall, const ::basegfx::B2DPolygon &rBig)
make the point count of the polygons equal in adding points
Definition: fumorph.cxx:229
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fumorph.cxx:61
void ImpInsertPolygons(B2DPolyPolygonList_impl &rPolyPolyList3D, bool bAttributeFade, const SdrObject *pObj1, const SdrObject *pObj2)
create group object with morphed polygons
Definition: fumorph.cxx:317
::basegfx::B2DPolyPolygon ImpCreateMorphedPolygon(const ::basegfx::B2DPolyPolygon &rPolyPolyStart, const ::basegfx::B2DPolyPolygon &rPolyPolyEnd, double fMorphingFactor)
create single morphed PolyPolygon
Definition: fumorph.cxx:438
FuMorph(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fumorph.cxx:51
static sal_uInt32 ImpGetNearestIndex(const ::basegfx::B2DPolygon &rPoly, const ::basegfx::B2DPoint &rPos)
Definition: fumorph.cxx:262
virtual void DoExecute(SfxRequest &rReq) override
Definition: fumorph.cxx:74
::std::vector< ::basegfx::B2DPolyPolygon > B2DPolyPolygonList_impl
Definition: fumorph.hxx:43
static void ImpAddPolys(::basegfx::B2DPolyPolygon &rSmaller, const ::basegfx::B2DPolyPolygon &rBigger)
add to a point reduced polys until count is same
Definition: fumorph.cxx:287
Base class for all functions.
Definition: fupoor.hxx:48
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45