Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/svx/lathe3d.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_SVX_LATHE3D_HXX
21
#define INCLUDED_SVX_LATHE3D_HXX
22
23
#include <svl/intitem.hxx>
24
#include <svl/itemset.hxx>
25
#include <svx/obj3d.hxx>
26
#include <svx/svxdllapi.h>
27
#include <svx/svddef.hxx>
28
#include <svx/svx3ditems.hxx>
29
30
class E3dDefaultAttributes;
31
32
/*************************************************************************
33
|*
34
|* Create a 3D rotation object from a passed 2D polygon
35
|*
36
|* The aPolyPoly3D is rotated around its axis in nHSegments steps.
37
|* nVSegments contains the number of lines of aPolyPoly3D and therefore
38
|* is effectively a vertical segmentation.
39
|*
40
\************************************************************************/
41
42
class E3dLatheObj final : public E3dCompoundObject
43
{
44
    basegfx::B2DPolyPolygon maPolyPoly2D;
45
46
    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
47
    virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override;
48
    void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
49
50
private:
51
    // protected destructor - due to final, make private
52
    virtual ~E3dLatheObj() override;
53
54
public:
55
    SVXCORE_DLLPUBLIC E3dLatheObj(
56
        SdrModel& rSdrModel,
57
        const E3dDefaultAttributes& rDefault,
58
        basegfx::B2DPolyPolygon aPoly2D);
59
    E3dLatheObj(SdrModel& rSdrModel, E3dLatheObj const & rSource);
60
    E3dLatheObj(SdrModel& rSdrModel);
61
62
    // HorizontalSegments:
63
    sal_uInt32 GetHorizontalSegments() const
64
0
        { return GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS).GetValue(); }
65
66
    // VerticalSegments:
67
    sal_uInt32 GetVerticalSegments() const
68
0
        { return GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS).GetValue(); }
69
70
    // PercentDiagonal: 0..100, before 0.0..0.5
71
    sal_uInt16 GetPercentDiagonal() const
72
0
        { return GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL).GetValue(); }
73
74
    // BackScale: 0..100, before 0.0..1.0
75
    sal_uInt16 GetBackScale() const
76
0
        { return GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE).GetValue(); }
77
78
    // EndAngle: 0..10000
79
    sal_uInt16 GetEndAngle() const
80
0
        { return GetObjectItemSet().Get(SDRATTR_3DOBJ_END_ANGLE).GetValue(); }
81
82
    // #107245# GetSmoothNormals() for bLatheSmoothed
83
    bool GetSmoothNormals() const
84
0
        { return GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS).GetValue(); }
85
86
    // #107245# GetSmoothLids() for bLatheSmoothFrontBack
87
    bool GetSmoothLids() const
88
0
        { return GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS).GetValue(); }
89
90
    // #107245# GetCharacterMode() for bLatheCharacterMode
91
    bool GetCharacterMode() const
92
0
        { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE).GetValue(); }
93
94
    // #107245# GetCloseFront() for bLatheCloseFront
95
    bool GetCloseFront() const
96
0
        { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT).GetValue(); }
97
98
    // #107245# GetCloseBack() for bLatheCloseBack
99
    bool GetCloseBack() const
100
0
        { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK).GetValue(); }
101
102
    virtual SdrObjKind GetObjIdentifier() const override;
103
104
    virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override;
105
106
    virtual rtl::Reference<SdrObject> DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
107
108
    // TakeObjName...() is for the display in the UI, for example "3 frames selected".
109
    virtual OUString TakeObjNameSingul() const override;
110
    virtual OUString TakeObjNamePlural() const override;
111
112
    // set/get local parameters with geometry recreation
113
    void SetPolyPoly2D(const basegfx::B2DPolyPolygon& rNew);
114
0
    const basegfx::B2DPolyPolygon& GetPolyPoly2D() const { return maPolyPoly2D; }
115
116
    // break up
117
    virtual bool IsBreakObjPossible() override;
118
    virtual rtl::Reference<SdrAttrObj> GetBreakObj() override;
119
};
120
121
#endif // INCLUDED_SVX_LATHE3D_HXX
122
123
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */