Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/drawinglayer/primitive2d/PolygonStrokeArrowPrimitive2D.hxx
Line
Count
Source
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
20
#pragma once
21
22
#include <drawinglayer/drawinglayerdllapi.h>
23
24
#include <drawinglayer/primitive2d/PolygonStrokePrimitive2D.hxx>
25
#include <drawinglayer/attribute/linestartendattribute.hxx>
26
27
namespace drawinglayer::primitive2d
28
{
29
/** PolygonStrokeArrowPrimitive2D class
30
31
    This primitive defines a PolygonStrokePrimitive2D,
32
    possibly extended by start and end definitions, which are
33
    normally used for arrows.
34
 */
35
class DRAWINGLAYER_DLLPUBLIC PolygonStrokeArrowPrimitive2D final : public PolygonStrokePrimitive2D
36
{
37
private:
38
    /// geometric definitions for line start and end
39
    attribute::LineStartEndAttribute maStart;
40
    attribute::LineStartEndAttribute maEnd;
41
42
    /// local decomposition.
43
    virtual Primitive2DReference
44
    create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override;
45
46
public:
47
    /// constructor
48
    PolygonStrokeArrowPrimitive2D(const basegfx::B2DPolygon& rPolygon,
49
                                  const attribute::LineAttribute& rLineAttribute,
50
                                  const attribute::StrokeAttribute& rStrokeAttribute,
51
                                  const attribute::LineStartEndAttribute& rStart,
52
                                  const attribute::LineStartEndAttribute& rEnd);
53
54
    /// constructor without stroking
55
    PolygonStrokeArrowPrimitive2D(const basegfx::B2DPolygon& rPolygon,
56
                                  const attribute::LineAttribute& rLineAttribute,
57
                                  const attribute::LineStartEndAttribute& rStart,
58
                                  const attribute::LineStartEndAttribute& rEnd);
59
60
    /// data read access
61
0
    const attribute::LineStartEndAttribute& getStart() const { return maStart; }
62
0
    const attribute::LineStartEndAttribute& getEnd() const { return maEnd; }
63
64
    /// compare operator
65
    virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
66
67
    /// get range
68
    virtual basegfx::B2DRange
69
    getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
70
71
    /// provide unique ID
72
    virtual sal_uInt32 getPrimitive2DID() const override;
73
};
74
75
} // end of namespace primitive2d::drawinglayer
76
77
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */