LibreOffice Module drawinglayer (master) 1
PolyPolygonColorPrimitive2D.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
21
25#include <utility>
26
27using namespace com::sun::star;
28
30{
32 const basegfx::BColor& rBColor)
33 : maPolyPolygon(std::move(aPolyPolygon))
34 , maBColor(rBColor)
35{
36}
37
39{
40 if (BasePrimitive2D::operator==(rPrimitive))
41 {
42 const PolyPolygonColorPrimitive2D& rCompare
43 = static_cast<const PolyPolygonColorPrimitive2D&>(rPrimitive);
44
45 return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
46 && getBColor() == rCompare.getBColor());
47 }
48
49 return false;
50}
51
53 const geometry::ViewInformation2D& /*rViewInformation*/) const
54{
55 // return range
57}
58
59// provide unique ID
61{
63}
64
66 const basegfx::BColor& rBColor)
68 , maB2DRange(rB2DRange)
69 , maBColor(rBColor)
70{
71}
72
74{
75 if (BasePrimitive2D::operator==(rPrimitive))
76 {
77 const FilledRectanglePrimitive2D& rCompare(
78 static_cast<const FilledRectanglePrimitive2D&>(rPrimitive));
79
80 return (getB2DRange() == rCompare.getB2DRange() && getBColor() == rCompare.getBColor());
81 }
82
83 return false;
84}
85
87 const geometry::ViewInformation2D& /*rViewInformation*/) const
88{
89 return getB2DRange();
90}
91
93{
95}
96
99 const geometry::ViewInformation2D& /*rViewInformation*/) const
100{
101 if (getB2DRange().isEmpty())
102 {
103 // no geometry, done
104 return;
105 }
106
108 Primitive2DContainer aSequence
110 rVisitor.visit(aSequence);
111}
112
113} // end drawinglayer::primitive2d namespace
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FilledRectanglePrimitive2D(const basegfx::B2DRange &rB2DRange, const basegfx::BColor &rBColor)
constructor
const basegfx::B2DRange & getB2DRange() const
data read access
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
return as PolyPolygonColorPrimitive2D
PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon aPolyPolygon, const basegfx::BColor &rBColor)
constructor
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
const basegfx::B2DPolyPolygon & getB2DPolyPolygon() const
data read access
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &rViewInformation) const override
get range
virtual void visit(const Primitive2DReference &)=0
#define PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D
#define PRIMITIVE2D_ID_FILLEDRECTANGLEPRIMITIVE2D
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
B2DRange getRange(const B2DPolygon &rCandidate)
basegfx::B2DPolyPolygon maPolyPolygon