LibreOffice Module drawinglayer (master) 1
PolyPolygonMarkerPrimitive2D.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
22
25#include <utility>
26
27using namespace com::sun::star;
28
30{
32 Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*rViewInformation*/) const
33{
34 const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon());
35 const sal_uInt32 nCount(aPolyPolygon.count());
36
37 if (nCount)
38 {
39 for (sal_uInt32 a(0); a < nCount; a++)
40 {
41 rContainer.push_back(new PolygonMarkerPrimitive2D(aPolyPolygon.getB2DPolygon(a),
44 }
45 }
46}
47
49 const basegfx::BColor& rRGBColorA,
50 const basegfx::BColor& rRGBColorB,
51 double fDiscreteDashLength)
52 : maPolyPolygon(std::move(aPolyPolygon))
53 , maRGBColorA(rRGBColorA)
54 , maRGBColorB(rRGBColorB)
55 , mfDiscreteDashLength(fDiscreteDashLength)
56{
57}
58
60{
61 if (BufferedDecompositionPrimitive2D::operator==(rPrimitive))
62 {
63 const PolyPolygonMarkerPrimitive2D& rCompare
64 = static_cast<const PolyPolygonMarkerPrimitive2D&>(rPrimitive);
65
66 return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
67 && getRGBColorA() == rCompare.getRGBColorA()
68 && getRGBColorB() == rCompare.getRGBColorB()
70 }
71
72 return false;
73}
74
76 const geometry::ViewInformation2D& /*rViewInformation*/) const
77{
78 // return range
80}
81
82// provide unique ID
84{
86}
87
88} // end drawinglayer::primitive2d namespace
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
sal_uInt32 count() const
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &rViewInformation) const override
get range
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const override
local decomposition.
PolyPolygonMarkerPrimitive2D(basegfx::B2DPolyPolygon aPolyPolygon, const basegfx::BColor &rRGBColorA, const basegfx::BColor &rRGBColorB, double fDiscreteDashLength)
constructor
int nCount
#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D
uno_Any a
B2DRange getRange(const B2DPolygon &rCandidate)
basegfx::B2DPolyPolygon maPolyPolygon