LibreOffice Module drawinglayer (master) 1
sdrdecompositiontools2d.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
27
28
30{
32 const basegfx::B2DHomMatrix& rMatrix)
33 {
35
37 false/*bFilled*/,
38 basegfx::B2DPolyPolygon(aUnitOutline),
39 rMatrix);
40 }
41
43 const basegfx::B2DPolyPolygon& rPolyPolygon)
44 {
46 false/*bFilled*/,
47 rPolyPolygon,
49 }
50
52 bool bFilled,
53 const basegfx::B2DRange& rRange)
54 {
56 bFilled,
57 rRange,
59 }
60
62 bool bFilled,
63 const basegfx::B2DRange& rRange,
64 const basegfx::B2DHomMatrix& rMatrix)
65 {
67
69 bFilled,
70 aOutline,
71 rMatrix);
72 }
73
75 bool bFilled,
76 const basegfx::B2DPolyPolygon& rPolyPolygon,
77 const basegfx::B2DHomMatrix& rMatrix)
78 {
79 // create fill or line primitive
80 Primitive2DReference xReference;
81 basegfx::B2DPolyPolygon aScaledOutline(rPolyPolygon);
82 aScaledOutline.transform(rMatrix);
83
84 if(bFilled)
85 {
86 xReference = new PolyPolygonColorPrimitive2D(
87 std::move(aScaledOutline),
88 basegfx::BColor(0.0, 0.0, 0.0));
89 }
90 else
91 {
92 const basegfx::BColor aGrayTone(0xc0 / 255.0, 0xc0 / 255.0, 0xc0 / 255.0);
93
94 xReference = new PolyPolygonHairlinePrimitive2D(
95 std::move(aScaledOutline),
96 aGrayTone);
97 }
98
99 // create HiddenGeometryPrimitive2D
102 }
103
104} // end of namespace
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void transform(const basegfx::B2DHomMatrix &rMatrix)
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
B2DPolygon const & createUnitPolygon()
rtl::Reference< BasePrimitive2D > Primitive2DReference
Definition: CommonTypes.hxx:27
Primitive2DReference createHiddenGeometryPrimitives2D(const basegfx::B2DHomMatrix &rMatrix)