Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / svx / inc / dragmt3d.hxx
blob0966fbf919814d66d3b9074038e936566630c1f9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SVX_INC_DRAGMT3D_HXX
21 #define INCLUDED_SVX_INC_DRAGMT3D_HXX
23 #include <svx/svddrgmt.hxx>
24 #include <svx/view3d.hxx>
25 #include <basegfx/polygon/b3dpolypolygon.hxx>
26 #include <vcl/timer.hxx>
27 #include <basegfx/matrix/b3dhommatrix.hxx>
29 // Parameters for the interaction of a 3D object
30 class E3dDragMethodUnit
32 public:
33 E3dObject* mp3DObj;
34 basegfx::B3DPolyPolygon maWireframePoly;
35 basegfx::B3DHomMatrix maDisplayTransform;
36 basegfx::B3DHomMatrix maInvDisplayTransform;
37 basegfx::B3DHomMatrix maInitTransform;
38 basegfx::B3DHomMatrix maTransform;
39 sal_Int32 mnStartAngle;
40 sal_Int32 mnLastAngle;
42 E3dDragMethodUnit()
43 : mp3DObj(nullptr),
44 maWireframePoly(),
45 maDisplayTransform(),
46 maInvDisplayTransform(),
47 maInitTransform(),
48 maTransform(),
49 mnStartAngle(0),
50 mnLastAngle(0)
54 // Derivative of SdrDragMethod for 3D objects
55 class E3dDragMethod : public SdrDragMethod
57 protected:
58 ::std::vector< E3dDragMethodUnit > maGrp;
59 E3dDragConstraint meConstraint;
60 Point maLastPos;
61 tools::Rectangle maFullBound;
62 bool mbMoveFull;
63 bool mbMovedAtAll;
65 public:
66 E3dDragMethod(
67 SdrDragView &rView,
68 const SdrMarkList& rMark,
69 E3dDragConstraint eConstr,
70 bool bFull = false);
72 virtual void TakeSdrDragComment(OUString& rStr) 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;
78 // for migration from XOR to overlay
79 virtual void CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlayManager) override;
82 // Derivative of SdrDragMethod for spinning 3D objects
83 class E3dDragRotate : public E3dDragMethod
85 basegfx::B3DPoint maGlobalCenter;
87 public:
88 E3dDragRotate(
89 SdrDragView &rView,
90 const SdrMarkList& rMark,
91 E3dDragConstraint eConstr,
92 bool bFull = false);
94 virtual void MoveSdrDrag(const Point& rPnt) override;
95 virtual Pointer GetSdrDragPointer() const override;
98 // Derivative of SdrDragMethod for moving 3D sub-objects
99 class E3dDragMove : public E3dDragMethod
101 SdrHdlKind meWhatDragHdl;
102 Point maScaleFixPos;
104 public:
105 E3dDragMove(
106 SdrDragView &rView,
107 const SdrMarkList& rMark,
108 SdrHdlKind eDrgHdl,
109 E3dDragConstraint eConstr = E3dDragConstraint::XYZ,
110 bool bFull = false);
112 virtual void MoveSdrDrag(const Point& rPnt) override;
113 virtual Pointer GetSdrDragPointer() const override;
117 #endif // INCLUDED_SVX_INC_DRAGMT3D_HXX
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */