Coverage Report

Created: 2026-06-30 11:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/svx/inc/dragmt3d.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_INC_DRAGMT3D_HXX
21
#define INCLUDED_SVX_INC_DRAGMT3D_HXX
22
23
#include "def3d.hxx"
24
#include <svx/svddrgmt.hxx>
25
#include <basegfx/polygon/b3dpolypolygon.hxx>
26
#include <basegfx/matrix/b3dhommatrix.hxx>
27
28
// Parameters for the interaction of a 3D object
29
class E3dDragMethodUnit
30
{
31
public:
32
    E3dObject&                      mr3DObj;
33
    basegfx::B3DPolyPolygon         maWireframePoly;
34
    basegfx::B3DHomMatrix           maDisplayTransform;
35
    basegfx::B3DHomMatrix           maInvDisplayTransform;
36
    basegfx::B3DHomMatrix           maInitTransform;
37
    basegfx::B3DHomMatrix           maTransform;
38
    Degree100                       mnStartAngle;
39
    Degree100                       mnLastAngle;
40
41
    E3dDragMethodUnit(E3dObject& r3DObj)
42
0
    :   mr3DObj(r3DObj),
43
0
        maWireframePoly(),
44
0
        maDisplayTransform(),
45
0
        maInvDisplayTransform(),
46
0
        maInitTransform(),
47
0
        maTransform(),
48
0
        mnStartAngle(0),
49
0
        mnLastAngle(0)
50
0
    {
51
0
    }
52
};
53
54
// Derivative of SdrDragMethod for 3D objects
55
class E3dDragMethod : public SdrDragMethod
56
{
57
protected:
58
    ::std::vector< E3dDragMethodUnit >  maGrp;
59
    E3dDragConstraint                   meConstraint;
60
    Point                               maLastPos;
61
    tools::Rectangle                           maFullBound;
62
    bool                                mbMoveFull;
63
    bool                                mbMovedAtAll;
64
65
public:
66
    E3dDragMethod(
67
        SdrDragView &rView,
68
        const SdrMarkList& rMark,
69
        E3dDragConstraint eConstr,
70
        bool bFull);
71
72
    virtual OUString GetSdrDragComment() const override;
73
    virtual bool BeginSdrDrag() override;
74
    virtual void MoveSdrDrag(const Point& rPnt) override;
75
    virtual void CancelSdrDrag() override;
76
    virtual bool EndSdrDrag(bool bCopy) override;
77
78
    // for migration from XOR to overlay
79
    virtual void CreateOverlayGeometry(
80
        sdr::overlay::OverlayManager& rOverlayManager,
81
        const sdr::contact::ObjectContact& rObjectContact, bool IsGeometrySizeValid=true) override;
82
};
83
84
// Derivative of SdrDragMethod for spinning 3D objects
85
class E3dDragRotate final : public E3dDragMethod
86
{
87
    basegfx::B3DPoint                   maGlobalCenter;
88
89
public:
90
    E3dDragRotate(
91
        SdrDragView &rView,
92
        const SdrMarkList& rMark,
93
        E3dDragConstraint eConstr,
94
        bool bFull);
95
96
    virtual void MoveSdrDrag(const Point& rPnt) override;
97
    virtual PointerStyle GetSdrDragPointer() const override;
98
};
99
100
// Derivative of SdrDragMethod for moving 3D sub-objects
101
class E3dDragMove final : public E3dDragMethod
102
{
103
    SdrHdlKind              meWhatDragHdl;
104
    Point                   maScaleFixPos;
105
106
public:
107
    E3dDragMove(
108
        SdrDragView &rView,
109
        const SdrMarkList& rMark,
110
        SdrHdlKind eDrgHdl,
111
        E3dDragConstraint eConstr,
112
        bool bFull);
113
114
    virtual void MoveSdrDrag(const Point& rPnt) override;
115
    virtual PointerStyle GetSdrDragPointer() const override;
116
};
117
118
119
#endif // INCLUDED_SVX_INC_DRAGMT3D_HXX
120
121
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */