Bump version to 6.4-15
[LibreOffice.git] / svx / source / sdr / overlay / overlayline.cxx
blobde5cf042ba1ed4eb0ae6f6469f6e506c2e745d7f
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 <sdr/overlay/overlayline.hxx>
21 #include <vcl/outdev.hxx>
22 #include <basegfx/vector/b2dvector.hxx>
23 #include <basegfx/matrix/b2dhommatrix.hxx>
24 #include <basegfx/polygon/b2dpolygontools.hxx>
25 #include <svx/sdr/overlay/overlaymanager.hxx>
26 #include <basegfx/polygon/b2dpolygon.hxx>
27 #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
30 namespace sdr
32 namespace overlay
34 drawinglayer::primitive2d::Primitive2DContainer OverlayLineStriped::createOverlayObjectPrimitive2DSequence()
36 drawinglayer::primitive2d::Primitive2DContainer aRetval;
38 if(getOverlayManager())
40 const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
41 const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
42 const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
43 basegfx::B2DPolygon aLine;
45 aLine.append(getBasePosition());
46 aLine.append(getSecondPosition());
48 const drawinglayer::primitive2d::Primitive2DReference aReference(
49 new drawinglayer::primitive2d::PolygonMarkerPrimitive2D(
50 aLine,
51 aRGBColorA,
52 aRGBColorB,
53 fStripeLengthPixel));
55 aRetval = drawinglayer::primitive2d::Primitive2DContainer { aReference };
58 return aRetval;
61 void OverlayLineStriped::stripeDefinitionHasChanged()
63 // react on OverlayManager's stripe definition change
64 objectChange();
67 OverlayLineStriped::OverlayLineStriped(
68 const basegfx::B2DPoint& rBasePos,
69 const basegfx::B2DPoint& rSecondPos)
70 : OverlayObjectWithBasePosition(rBasePos, COL_BLACK),
71 maSecondPosition(rSecondPos)
75 OverlayLineStriped::~OverlayLineStriped()
78 } // end of namespace overlay
79 } // end of namespace sdr
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */