Coverage Report

Created: 2025-12-31 10:39

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