Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/drawinglayer/primitive3d/polygonprimitive3d.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/primitive3d/baseprimitive3d.hxx>
25
#include <basegfx/color/bcolor.hxx>
26
#include <basegfx/polygon/b3dpolygon.hxx>
27
#include <drawinglayer/attribute/lineattribute.hxx>
28
#include <drawinglayer/attribute/strokeattribute.hxx>
29
30
31
namespace drawinglayer::primitive3d
32
    {
33
        /** PolygonHairlinePrimitive3D class
34
35
            This primitive defines a Hairline in 3D. Since hairlines are view-dependent,
36
            this primitive is view-dependent, too.
37
38
            This is one of the non-decomposable 3D primitives, so a renderer
39
            should process it.
40
         */
41
        class DRAWINGLAYER_DLLPUBLIC PolygonHairlinePrimitive3D : public BasePrimitive3D
42
        {
43
        private:
44
            /// the hairline geometry
45
            basegfx::B3DPolygon                     maPolygon;
46
47
            /// the hairline color
48
            basegfx::BColor                         maBColor;
49
50
        public:
51
            /// constructor
52
            PolygonHairlinePrimitive3D(
53
                basegfx::B3DPolygon aPolygon,
54
                const basegfx::BColor& rBColor);
55
56
            /// data read access
57
0
            const basegfx::B3DPolygon& getB3DPolygon() const { return maPolygon; }
58
0
            const basegfx::BColor& getBColor() const { return maBColor; }
59
60
            /// compare operator
61
            virtual bool operator==(const BasePrimitive3D& rPrimitive) const override;
62
63
            /// get range
64
            virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const override final;
65
66
            /// provide unique ID
67
            DeclPrimitive3DIDBlock()
68
        };
69
70
} // end of namespace drawinglayer::primitive3d
71
72
73
namespace drawinglayer::primitive3d
74
    {
75
        /** PolygonStrokePrimitive3D class
76
77
            This primitive defines a 3D line with line width, line join, line color
78
            and stroke attributes. It will be decomposed dependent on the definition
79
            to the needed primitives, e.g. filled Tubes for fat lines.
80
         */
81
        class PolygonStrokePrimitive3D final : public BufferedDecompositionPrimitive3D
82
        {
83
        private:
84
            /// the line geometry
85
            basegfx::B3DPolygon                     maPolygon;
86
87
            /// the line attributes like width, join and color
88
            attribute::LineAttribute                maLineAttribute;
89
90
            /// the line stroking (if used)
91
            attribute::StrokeAttribute              maStrokeAttribute;
92
93
            /// local decomposition.
94
            virtual Primitive3DContainer create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const override;
95
96
        public:
97
            /// constructor
98
            PolygonStrokePrimitive3D(
99
                basegfx::B3DPolygon aPolygon,
100
                const attribute::LineAttribute& rLineAttribute,
101
                attribute::StrokeAttribute aStrokeAttribute);
102
103
            /// data read access
104
0
            const basegfx::B3DPolygon& getB3DPolygon() const { return maPolygon; }
105
0
            const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
106
0
            const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
107
108
            /// compare operator
109
            virtual bool operator==(const BasePrimitive3D& rPrimitive) const override;
110
111
            /// provide unique ID
112
            DeclPrimitive3DIDBlock()
113
        };
114
115
} // end of namespace drawinglayer::primitive3d
116
117
118
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */