Bump version to 6.4-15
[LibreOffice.git] / svx / source / sdr / overlay / overlaypolypolygon.cxx
blobdda687298a31171428de4b6f75d221a68e8bae2a
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 #include <svx/sdr/overlay/overlaypolypolygon.hxx>
21 #include <vcl/outdev.hxx>
22 #include <basegfx/matrix/b2dhommatrix.hxx>
23 #include <basegfx/polygon/b2dpolypolygontools.hxx>
24 #include <svx/sdr/overlay/overlaymanager.hxx>
25 #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
28 namespace sdr
30 namespace overlay
32 drawinglayer::primitive2d::Primitive2DContainer OverlayPolyPolygonStripedAndFilled::createOverlayObjectPrimitive2DSequence()
34 drawinglayer::primitive2d::Primitive2DContainer aRetval;
36 if(getOverlayManager())
38 const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
39 const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
40 const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
41 const drawinglayer::primitive2d::Primitive2DReference aStriped(
42 new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
43 getLinePolyPolygon(),
44 aRGBColorA,
45 aRGBColorB,
46 fStripeLengthPixel));
48 aRetval = drawinglayer::primitive2d::Primitive2DContainer { aStriped };
50 const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
51 const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
52 const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
54 const drawinglayer::primitive2d::Primitive2DReference aFilled(
55 new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D(
56 getLinePolyPolygon(),
57 aHilightColor,
58 fTransparence,
59 3.0,
60 false));
62 aRetval.push_back(aFilled);
65 return aRetval;
68 void OverlayPolyPolygonStripedAndFilled::stripeDefinitionHasChanged()
70 // react on OverlayManager's stripe definition change
71 objectChange();
74 OverlayPolyPolygonStripedAndFilled::OverlayPolyPolygonStripedAndFilled(
75 const basegfx::B2DPolyPolygon& rLinePolyPolygon)
76 : OverlayObject(COL_BLACK),
77 maLinePolyPolygon(rLinePolyPolygon)
81 OverlayPolyPolygonStripedAndFilled::~OverlayPolyPolygonStripedAndFilled()
84 } // end of namespace overlay
85 } // end of namespace sdr
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */