LibreOffice Module drawinglayer (master) 1
PolyPolygonHairlinePrimitive2D.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(
43 }
44 }
45}
46
48 const basegfx::BColor& rBColor)
49 : maPolyPolygon(std::move(aPolyPolygon))
50 , maBColor(rBColor)
51{
52}
53
55{
56 if (BufferedDecompositionPrimitive2D::operator==(rPrimitive))
57 {
58 const PolyPolygonHairlinePrimitive2D& rCompare
59 = static_cast<const PolyPolygonHairlinePrimitive2D&>(rPrimitive);
60
61 return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
62 && getBColor() == rCompare.getBColor());
63 }
64
65 return false;
66}
67
69 const geometry::ViewInformation2D& /*rViewInformation*/) const
70{
71 // return range
73}
74
75// provide unique ID
77{
79}
80
81} // end drawinglayer::primitive2d namespace
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
sal_uInt32 count() const
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const override
local decomposition.
const basegfx::B2DPolyPolygon & getB2DPolyPolygon() const
data read access
PolyPolygonHairlinePrimitive2D(basegfx::B2DPolyPolygon aPolyPolygon, const basegfx::BColor &rBColor)
constructor
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &rViewInformation) const override
get range
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
int nCount
#define PRIMITIVE2D_ID_POLYPOLYGONHAIRLINEPRIMITIVE2D
uno_Any a
B2DRange getRange(const B2DPolygon &rCandidate)
basegfx::B2DPolyPolygon maPolyPolygon