Line data Source code
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 _E3D_DRAGMT3D_HXX
21 : #define _E3D_DRAGMT3D_HXX
22 :
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>
28 :
29 : /*************************************************************************
30 : |*
31 : |* Parameters for the interaction of a 3D object
32 : |*
33 : \************************************************************************/
34 0 : class E3dDragMethodUnit
35 : {
36 : public:
37 : E3dObject* mp3DObj;
38 : basegfx::B3DPolyPolygon maWireframePoly;
39 : basegfx::B3DHomMatrix maDisplayTransform;
40 : basegfx::B3DHomMatrix maInvDisplayTransform;
41 : basegfx::B3DHomMatrix maInitTransform;
42 : basegfx::B3DHomMatrix maTransform;
43 : sal_Int32 mnStartAngle;
44 : sal_Int32 mnLastAngle;
45 :
46 0 : E3dDragMethodUnit()
47 : : mp3DObj(0),
48 : maWireframePoly(),
49 : maDisplayTransform(),
50 : maInvDisplayTransform(),
51 : maInitTransform(),
52 : maTransform(),
53 : mnStartAngle(0),
54 0 : mnLastAngle(0)
55 0 : {}
56 : };
57 :
58 : /*************************************************************************
59 : |*
60 : |* Derivative of SdrDragMethod for 3D objects
61 : |*
62 : \************************************************************************/
63 :
64 0 : class E3dDragMethod : public SdrDragMethod
65 : {
66 : protected:
67 : ::std::vector< E3dDragMethodUnit > maGrp;
68 : E3dDragConstraint meConstraint;
69 : Point maLastPos;
70 : Rectangle maFullBound;
71 : bool mbMoveFull;
72 : bool mbMovedAtAll;
73 :
74 : public:
75 : TYPEINFO();
76 : E3dDragMethod(
77 : SdrDragView &rView,
78 : const SdrMarkList& rMark,
79 : E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
80 : sal_Bool bFull = sal_False);
81 :
82 : virtual void TakeSdrDragComment(String& rStr) const;
83 : virtual bool BeginSdrDrag();
84 : virtual void MoveSdrDrag(const Point& rPnt);
85 : virtual void CancelSdrDrag();
86 : virtual bool EndSdrDrag(bool bCopy);
87 :
88 : E3dView& Get3DView() { return (E3dView&)getSdrDragView(); }
89 :
90 : // for migration from XOR to overlay
91 : virtual void CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverlayManager);
92 : };
93 :
94 :
95 : /*************************************************************************
96 : |*
97 : |* Derivative of SdrDragMethod for spinning 3D objects
98 : |*
99 : \************************************************************************/
100 :
101 0 : class E3dDragRotate : public E3dDragMethod
102 : {
103 : basegfx::B3DPoint maGlobalCenter;
104 :
105 : public:
106 : TYPEINFO();
107 : E3dDragRotate(
108 : SdrDragView &rView,
109 : const SdrMarkList& rMark,
110 : E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
111 : sal_Bool bFull = sal_False);
112 :
113 : virtual void MoveSdrDrag(const Point& rPnt);
114 : virtual Pointer GetSdrDragPointer() const;
115 : };
116 :
117 :
118 : /*************************************************************************
119 : |*
120 : |* Derivative of SdrDragMethod for moving 3D sub-objects
121 : |*
122 : \************************************************************************/
123 :
124 0 : class E3dDragMove : public E3dDragMethod
125 : {
126 : SdrHdlKind meWhatDragHdl;
127 : Point maScaleFixPos;
128 :
129 : public:
130 : TYPEINFO();
131 : E3dDragMove(
132 : SdrDragView &rView,
133 : const SdrMarkList& rMark,
134 : SdrHdlKind eDrgHdl = HDL_MOVE,
135 : E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
136 : sal_Bool bFull = sal_False);
137 :
138 : virtual void MoveSdrDrag(const Point& rPnt);
139 : virtual Pointer GetSdrDragPointer() const;
140 : };
141 :
142 :
143 : #endif // _E3D_DRAGMT3D_HXX
144 :
145 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|