LibreOffice Module svx (master) 1
overlaypolypolygon.cxx
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
28#include <utility>
29
30
31namespace sdr::overlay
32{
34 basegfx::B2DPolyPolygon aLinePolyPolygon,
35 Color const & rLineColor,
36 double fLineWidth,
37 Color const & rFillColor)
38 : OverlayObject(rLineColor)
39 , maLinePolyPolygon(std::move(aLinePolyPolygon))
40 , mfLineWidth(fLineWidth)
41 , maFillColor(rFillColor)
42 {
43 }
44
46
48 {
50
52 {
53 const drawinglayer::attribute::LineAttribute aLineAttribute(getBaseColor().getBColor(), mfLineWidth);
54
57
58 if (maFillColor.GetAlpha() != 0)
59 {
61 }
62
63 sal_uInt8 nTransparency = 255 - getBaseColor().GetAlpha();
64 if (nTransparency > 0)
65 {
67 new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(std::move(aReturnContainer), nTransparency / 255.0));
68 aReturnContainer = drawinglayer::primitive2d::Primitive2DContainer{ aTransparencePrimitive };
69 }
70 }
71
72 return aReturnContainer;
73 }
74
76 {
78
80 {
81 const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
82 const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
83 const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
87 aRGBColorA,
88 aRGBColorB,
89 fStripeLengthPixel));
90
92
93 const basegfx::BColor aHilightColor(SvtOptionsDrawinglayer::getHilightColor().getBColor());
94 const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01);
95
99 aHilightColor,
100 fTransparence,
101 3.0,
102 false));
103
104 aRetval.push_back(aFilled);
105 }
106
107 return aRetval;
108 }
109
111 {
112 // react on OverlayManager's stripe definition change
113 objectChange();
114 }
115
117 basegfx::B2DPolyPolygon aLinePolyPolygon)
119 maLinePolyPolygon(std::move(aLinePolyPolygon))
120 {
121 }
122
124 {
125 }
126
127} // end of namespace
128
129/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
basegfx::BColor getBColor() const
sal_uInt8 GetAlpha() const
const Color & getBaseColor() const
OverlayManager * getOverlayManager() const
virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override
const basegfx::B2DPolyPolygon & getLinePolyPolygon() const
OverlayPolyPolygonStripedAndFilled(basegfx::B2DPolyPolygon aLinePolyPolygon)
OverlayPolyPolygon(basegfx::B2DPolyPolygon aLinePolyPolygon, Color const &rLineColor, double mfLineWidth, Color const &rFillColor)
virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override
virtual ~OverlayPolyPolygon() override
basegfx::B2DPolyPolygon maLinePolyPolygon
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
sal_uInt16 GetTransparentSelectionPercent()
uno::Sequence< double > maFillColor
unsigned char sal_uInt8