Update ooo320-m1
[ooovba.git] / svx / inc / dragmt3d.hxx
blobc8378deae7a520e7ee61cd3d0e737ef0d5446d2c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dragmt3d.hxx,v $
10 * $Revision: 1.8.18.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _E3D_DRAGMT3D_HXX
32 #define _E3D_DRAGMT3D_HXX
34 #include <svx/svddrgmt.hxx>
35 #include <svx/view3d.hxx>
36 #include <basegfx/polygon/b3dpolypolygon.hxx>
37 #include <vcl/timer.hxx>
38 #include <basegfx/matrix/b3dhommatrix.hxx>
40 class E3dScene;
42 /*************************************************************************
44 |* Parameter fuer Interaktion eines 3D-Objektes
46 \************************************************************************/
47 class E3dDragMethodUnit
49 public:
50 E3dObject* mp3DObj;
51 basegfx::B3DPolyPolygon maWireframePoly;
52 basegfx::B3DHomMatrix maDisplayTransform;
53 basegfx::B3DHomMatrix maInvDisplayTransform;
54 basegfx::B3DHomMatrix maInitTransform;
55 basegfx::B3DHomMatrix maTransform;
56 sal_Int32 mnStartAngle;
57 sal_Int32 mnLastAngle;
59 E3dDragMethodUnit()
60 : mp3DObj(0),
61 maWireframePoly(),
62 maDisplayTransform(),
63 maInvDisplayTransform(),
64 maInitTransform(),
65 maTransform(),
66 mnStartAngle(0),
67 mnLastAngle(0)
71 /*************************************************************************
73 |* Ableitung von SdrDragMethod fuer 3D-Objekte
75 \************************************************************************/
77 class E3dDragMethod : public SdrDragMethod
79 protected:
80 ::std::vector< E3dDragMethodUnit > maGrp;
81 E3dDragConstraint meConstraint;
82 Point maLastPos;
83 Rectangle maFullBound;
84 bool mbMoveFull;
85 bool mbMovedAtAll;
87 public:
88 TYPEINFO();
89 E3dDragMethod(
90 SdrDragView &rView,
91 const SdrMarkList& rMark,
92 E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
93 BOOL bFull = FALSE);
95 virtual void TakeSdrDragComment(String& rStr) const;
96 virtual bool BeginSdrDrag();
97 virtual void MoveSdrDrag(const Point& rPnt);
98 virtual void CancelSdrDrag();
99 virtual bool EndSdrDrag(bool bCopy);
101 E3dView& Get3DView() { return (E3dView&)getSdrDragView(); }
103 // for migration from XOR to overlay
104 virtual void CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverlayManager);
108 /*************************************************************************
110 |* Ableitung von SdrDragMethod zum Drehen von 3D-Objekten
112 \************************************************************************/
114 class E3dDragRotate : public E3dDragMethod
116 basegfx::B3DPoint maGlobalCenter;
118 public:
119 TYPEINFO();
120 E3dDragRotate(
121 SdrDragView &rView,
122 const SdrMarkList& rMark,
123 E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
124 BOOL bFull = FALSE);
126 virtual void MoveSdrDrag(const Point& rPnt);
127 virtual Pointer GetSdrDragPointer() const;
131 /*************************************************************************
133 |* Ableitung von SdrDragMethod zum Verschieben von 3D-Subobjekten
135 \************************************************************************/
137 class E3dDragMove : public E3dDragMethod
139 SdrHdlKind meWhatDragHdl;
140 Point maScaleFixPos;
142 public:
143 TYPEINFO();
144 E3dDragMove(
145 SdrDragView &rView,
146 const SdrMarkList& rMark,
147 SdrHdlKind eDrgHdl = HDL_MOVE,
148 E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
149 BOOL bFull = FALSE);
151 virtual void MoveSdrDrag(const Point& rPnt);
152 virtual Pointer GetSdrDragPointer() const;
156 #endif // _E3D_DRAGMT3D_HXX