tdf#165005 Fix URL to community forum in readme
[LibreOffice.git] / include / drawinglayer / primitive2d / PolyPolygonSelectionPrimitive2D.hxx
blobe1e64c2c0450da8ea08d242169551efa43fd0745
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
22 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
25 #include <drawinglayer/primitive2d/primitivetools2d.hxx>
26 #include <basegfx/polygon/b2dpolypolygon.hxx>
27 #include <basegfx/color/bcolor.hxx>
29 namespace drawinglayer::primitive2d
31 /** PolyPolygonSelectionPrimitive2D class
33 This primitive defines a tools::PolyPolygon which gets filled with a defined color
34 and a defined transparence, but also gets extended ('grown') by the given
35 discrete size (thus being a view-dependent primitive)
37 class DRAWINGLAYER_DLLPUBLIC PolyPolygonSelectionPrimitive2D final
38 : public DiscreteMetricDependentPrimitive2D
40 private:
41 /// the tools::PolyPolygon geometry
42 basegfx::B2DPolyPolygon maPolyPolygon;
44 /// the color
45 basegfx::BColor maColor;
47 /// the transparence [0.0 .. 1.0]
48 double mfTransparence;
50 /// the discrete grow size ('pixels'), only positive values allowed
51 double mfDiscreteGrow;
53 /// draw polygons filled when fill is set
54 bool mbFill : 1;
56 /// local decomposition.
57 virtual Primitive2DReference
58 create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override;
60 public:
61 /// constructor
62 PolyPolygonSelectionPrimitive2D(basegfx::B2DPolyPolygon aPolyPolygon,
63 const basegfx::BColor& rColor, double fTransparence,
64 double fDiscreteGrow, bool bFill);
66 /// data read access
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; }
73 /// compare operator
74 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
76 /// get range
77 virtual basegfx::B2DRange
78 getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
80 /// provide unique ID
81 virtual sal_uInt32 getPrimitive2DID() const override;
83 } // end of namespace primitive2d::drawinglayer
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */