Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _E3D_DRAGMT3D_HXX
30 : : #define _E3D_DRAGMT3D_HXX
31 : :
32 : : #include <svx/svddrgmt.hxx>
33 : : #include <svx/view3d.hxx>
34 : : #include <basegfx/polygon/b3dpolypolygon.hxx>
35 : : #include <vcl/timer.hxx>
36 : : #include <basegfx/matrix/b3dhommatrix.hxx>
37 : :
38 : : /*************************************************************************
39 : : |*
40 : : |* Parameters for the interaction of a 3D object
41 : : |*
42 : : \************************************************************************/
43 [ # # ][ # # ]: 0 : class E3dDragMethodUnit
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
44 : : {
45 : : public:
46 : : E3dObject* mp3DObj;
47 : : basegfx::B3DPolyPolygon maWireframePoly;
48 : : basegfx::B3DHomMatrix maDisplayTransform;
49 : : basegfx::B3DHomMatrix maInvDisplayTransform;
50 : : basegfx::B3DHomMatrix maInitTransform;
51 : : basegfx::B3DHomMatrix maTransform;
52 : : sal_Int32 mnStartAngle;
53 : : sal_Int32 mnLastAngle;
54 : :
55 : 0 : E3dDragMethodUnit()
56 : : : mp3DObj(0),
57 : : maWireframePoly(),
58 : : maDisplayTransform(),
59 : : maInvDisplayTransform(),
60 : : maInitTransform(),
61 : : maTransform(),
62 : : mnStartAngle(0),
63 [ # # ][ # # ]: 0 : mnLastAngle(0)
[ # # ][ # # ]
64 : 0 : {}
65 : : };
66 : :
67 : : /*************************************************************************
68 : : |*
69 : : |* Derivative of SdrDragMethod for 3D objects
70 : : |*
71 : : \************************************************************************/
72 : :
73 [ # # ]: 0 : class E3dDragMethod : public SdrDragMethod
74 : : {
75 : : protected:
76 : : ::std::vector< E3dDragMethodUnit > maGrp;
77 : : E3dDragConstraint meConstraint;
78 : : Point maLastPos;
79 : : Rectangle maFullBound;
80 : : bool mbMoveFull;
81 : : bool mbMovedAtAll;
82 : :
83 : : public:
84 : : TYPEINFO();
85 : : E3dDragMethod(
86 : : SdrDragView &rView,
87 : : const SdrMarkList& rMark,
88 : : E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
89 : : sal_Bool bFull = sal_False);
90 : :
91 : : virtual void TakeSdrDragComment(String& rStr) const;
92 : : virtual bool BeginSdrDrag();
93 : : virtual void MoveSdrDrag(const Point& rPnt);
94 : : virtual void CancelSdrDrag();
95 : : virtual bool EndSdrDrag(bool bCopy);
96 : :
97 : : E3dView& Get3DView() { return (E3dView&)getSdrDragView(); }
98 : :
99 : : // for migration from XOR to overlay
100 : : virtual void CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverlayManager);
101 : : };
102 : :
103 : :
104 : : /*************************************************************************
105 : : |*
106 : : |* Derivative of SdrDragMethod for spinning 3D objects
107 : : |*
108 : : \************************************************************************/
109 : :
110 [ # # ]: 0 : class E3dDragRotate : public E3dDragMethod
111 : : {
112 : : basegfx::B3DPoint maGlobalCenter;
113 : :
114 : : public:
115 : : TYPEINFO();
116 : : E3dDragRotate(
117 : : SdrDragView &rView,
118 : : const SdrMarkList& rMark,
119 : : E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
120 : : sal_Bool bFull = sal_False);
121 : :
122 : : virtual void MoveSdrDrag(const Point& rPnt);
123 : : virtual Pointer GetSdrDragPointer() const;
124 : : };
125 : :
126 : :
127 : : /*************************************************************************
128 : : |*
129 : : |* Derivative of SdrDragMethod for moving 3D sub-objects
130 : : |*
131 : : \************************************************************************/
132 : :
133 [ # # ]: 0 : class E3dDragMove : public E3dDragMethod
134 : : {
135 : : SdrHdlKind meWhatDragHdl;
136 : : Point maScaleFixPos;
137 : :
138 : : public:
139 : : TYPEINFO();
140 : : E3dDragMove(
141 : : SdrDragView &rView,
142 : : const SdrMarkList& rMark,
143 : : SdrHdlKind eDrgHdl = HDL_MOVE,
144 : : E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
145 : : sal_Bool bFull = sal_False);
146 : :
147 : : virtual void MoveSdrDrag(const Point& rPnt);
148 : : virtual Pointer GetSdrDragPointer() const;
149 : : };
150 : :
151 : :
152 : : #endif // _E3D_DRAGMT3D_HXX
153 : :
154 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|