Update ooo320-m1
[ooovba.git] / svx / inc / svx / polypolygoneditor.hxx
blobefcfcfd6ffdb0bbe4148b45ac6983b5b8883ccd5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: polypolygoneditor.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SDR_POLYPOLYGONEDITOR_HXX_
32 #define _SDR_POLYPOLYGONEDITOR_HXX_
34 #include "svx/svxdllapi.h"
36 #include "svx/ipolypolygoneditorcontroller.hxx"
38 #include <basegfx/polygon/b2dpolypolygon.hxx>
39 #include <set>
41 class SdrUShortCont;
43 namespace sdr
46 /** this class implements some helper functions to edit a B2DPolyPolygon */
47 class SVX_DLLPUBLIC PolyPolygonEditor
49 public:
50 PolyPolygonEditor( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed );
52 const basegfx::B2DPolyPolygon& GetPolyPolygon() const { return maPolyPolygon; }
54 /** returns true if the B2DPolyPolygon was changed.
55 Warning: B2DPolyPolygon can be empty after this operation!
57 bool DeletePoints( const std::set< sal_uInt16 >& rAbsPoints );
59 /** returns true if the B2DPolyPolygon was changed.
61 bool SetSegmentsKind(SdrPathSegmentKind eKind, const std::set< sal_uInt16 >& rAbsPoints);
63 /** returns true if the B2DPolyPolygon was changed.
65 bool SetPointsSmooth( basegfx::B2VectorContinuity eFlags, const std::set< sal_uInt16 >& rAbsPoints);
67 /** Outputs the realative position ( polygon number and point number in that polygon ) from the absolut point number.
68 False is returned if the given absolute point is greater not inside this B2DPolyPolygon
70 static bool GetRelativePolyPoint( const basegfx::B2DPolyPolygon& rPoly, sal_uInt32 nAbsPnt, sal_uInt32& rPolyNum, sal_uInt32& rPointNum );
72 private:
73 basegfx::B2DPolyPolygon maPolyPolygon;
74 bool mbIsClosed;
79 #endif