Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / svx / inc / dragmt3d.hxx
bloba92f3be188f78e34e1a04b623563f8193fd0a1c1
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/def3d.hxx>
24 #include <svx/svddrgmt.hxx>
25 #include <svx/view3d.hxx>
26 #include <basegfx/polygon/b3dpolypolygon.hxx>
27 #include <vcl/timer.hxx>
28 #include <basegfx/matrix/b3dhommatrix.hxx>
30 // Parameters for the interaction of a 3D object
31 class E3dDragMethodUnit
33 public:
34 E3dObject& mr3DObj;
35 basegfx::B3DPolyPolygon maWireframePoly;
36 basegfx::B3DHomMatrix maDisplayTransform;
37 basegfx::B3DHomMatrix maInvDisplayTransform;
38 basegfx::B3DHomMatrix maInitTransform;
39 basegfx::B3DHomMatrix maTransform;
40 sal_Int32 mnStartAngle;
41 sal_Int32 mnLastAngle;
43 E3dDragMethodUnit(E3dObject& r3DObj)
44 : mr3DObj(r3DObj),
45 maWireframePoly(),
46 maDisplayTransform(),
47 maInvDisplayTransform(),
48 maInitTransform(),
49 maTransform(),
50 mnStartAngle(0),
51 mnLastAngle(0)
56 // Derivative of SdrDragMethod for 3D objects
57 class E3dDragMethod : public SdrDragMethod
59 protected:
60 ::std::vector< E3dDragMethodUnit > maGrp;
61 E3dDragConstraint const meConstraint;
62 Point maLastPos;
63 tools::Rectangle maFullBound;
64 bool mbMoveFull;
65 bool mbMovedAtAll;
67 public:
68 E3dDragMethod(
69 SdrDragView &rView,
70 const SdrMarkList& rMark,
71 E3dDragConstraint eConstr,
72 bool bFull);
74 virtual OUString GetSdrDragComment() const override;
75 virtual bool BeginSdrDrag() override;
76 virtual void MoveSdrDrag(const Point& rPnt) override;
77 virtual void CancelSdrDrag() override;
78 virtual bool EndSdrDrag(bool bCopy) override;
80 // for migration from XOR to overlay
81 virtual void CreateOverlayGeometry(
82 sdr::overlay::OverlayManager& rOverlayManager,
83 const sdr::contact::ObjectContact& rObjectContact) override;
86 // Derivative of SdrDragMethod for spinning 3D objects
87 class E3dDragRotate : public E3dDragMethod
89 basegfx::B3DPoint maGlobalCenter;
91 public:
92 E3dDragRotate(
93 SdrDragView &rView,
94 const SdrMarkList& rMark,
95 E3dDragConstraint eConstr,
96 bool bFull);
98 virtual void MoveSdrDrag(const Point& rPnt) override;
99 virtual PointerStyle GetSdrDragPointer() const override;
102 // Derivative of SdrDragMethod for moving 3D sub-objects
103 class E3dDragMove : public E3dDragMethod
105 SdrHdlKind meWhatDragHdl;
106 Point maScaleFixPos;
108 public:
109 E3dDragMove(
110 SdrDragView &rView,
111 const SdrMarkList& rMark,
112 SdrHdlKind eDrgHdl,
113 E3dDragConstraint eConstr,
114 bool bFull);
116 virtual void MoveSdrDrag(const Point& rPnt) override;
117 virtual PointerStyle GetSdrDragPointer() const override;
121 #endif // INCLUDED_SVX_INC_DRAGMT3D_HXX
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */