1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <drawinglayer/drawinglayerdllapi.h>
23 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
24 #include <drawinglayer/primitive2d/primitivetools2d.hxx>
25 #include <basegfx/polygon/b2dpolypolygon.hxx>
26 #include <basegfx/color/bcolor.hxx>
28 namespace drawinglayer::primitive2d
30 /** PolyPolygonSelectionPrimitive2D class
32 This primitive defines a tools::PolyPolygon which gets filled with a defined color
33 and a defined transparence, but also gets extended ('grown') by the given
34 discrete size (thus being a view-dependent primitive)
36 class DRAWINGLAYER_DLLPUBLIC PolyPolygonSelectionPrimitive2D final
37 : public DiscreteMetricDependentPrimitive2D
40 /// the tools::PolyPolygon geometry
41 basegfx::B2DPolyPolygon maPolyPolygon
;
44 basegfx::BColor maColor
;
46 /// the transparence [0.0 .. 1.0]
47 double mfTransparence
;
49 /// the discrete grow size ('pixels'), only positive values allowed
50 double mfDiscreteGrow
;
52 /// draw polygons filled when fill is set
55 /// local decomposition.
57 create2DDecomposition(Primitive2DContainer
& rContainer
,
58 const geometry::ViewInformation2D
& rViewInformation
) const override
;
62 PolyPolygonSelectionPrimitive2D(const basegfx::B2DPolyPolygon
& rPolyPolygon
,
63 const basegfx::BColor
& rColor
, double fTransparence
,
64 double fDiscreteGrow
, bool bFill
);
67 const basegfx::B2DPolyPolygon
& getB2DPolyPolygon() const { return maPolyPolygon
; }
68 const basegfx::BColor
& getColor() const { return maColor
; }
69 double getTransparence() const { return mfTransparence
; }
70 double getDiscreteGrow() const { return mfDiscreteGrow
; }
71 bool getFill() const { return mbFill
; }
74 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const override
;
77 virtual basegfx::B2DRange
78 getB2DRange(const geometry::ViewInformation2D
& rViewInformation
) const override
;
81 virtual sal_uInt32
getPrimitive2DID() const override
;
83 } // end of namespace primitive2d::drawinglayer
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */