xref: /aoo42x/main/svx/inc/dragmt3d.hxx (revision 3334a7e6)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _E3D_DRAGMT3D_HXX
25cdf0e10cSrcweir #define _E3D_DRAGMT3D_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/svddrgmt.hxx>
28cdf0e10cSrcweir #include <svx/view3d.hxx>
29cdf0e10cSrcweir #include <basegfx/polygon/b3dpolypolygon.hxx>
30cdf0e10cSrcweir #include <vcl/timer.hxx>
31cdf0e10cSrcweir #include <basegfx/matrix/b3dhommatrix.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir class E3dScene;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir /*************************************************************************
36cdf0e10cSrcweir |*
37cdf0e10cSrcweir |* Parameter fuer Interaktion eines 3D-Objektes
38cdf0e10cSrcweir |*
39cdf0e10cSrcweir \************************************************************************/
40cdf0e10cSrcweir class E3dDragMethodUnit
41cdf0e10cSrcweir {
42cdf0e10cSrcweir public:
43cdf0e10cSrcweir 	E3dObject*						mp3DObj;
44cdf0e10cSrcweir 	basegfx::B3DPolyPolygon			maWireframePoly;
45cdf0e10cSrcweir 	basegfx::B3DHomMatrix			maDisplayTransform;
46cdf0e10cSrcweir 	basegfx::B3DHomMatrix			maInvDisplayTransform;
47cdf0e10cSrcweir 	basegfx::B3DHomMatrix           maInitTransform;
48cdf0e10cSrcweir 	basegfx::B3DHomMatrix			maTransform;
49cdf0e10cSrcweir 	sal_Int32						mnStartAngle;
50cdf0e10cSrcweir 	sal_Int32						mnLastAngle;
51cdf0e10cSrcweir 
E3dDragMethodUnit()52cdf0e10cSrcweir 	E3dDragMethodUnit()
53cdf0e10cSrcweir 	:	mp3DObj(0),
54cdf0e10cSrcweir 		maWireframePoly(),
55cdf0e10cSrcweir 		maDisplayTransform(),
56cdf0e10cSrcweir 		maInvDisplayTransform(),
57cdf0e10cSrcweir 		maInitTransform(),
58cdf0e10cSrcweir 		maTransform(),
59cdf0e10cSrcweir 		mnStartAngle(0),
60cdf0e10cSrcweir 		mnLastAngle(0)
61cdf0e10cSrcweir 	{}
62cdf0e10cSrcweir };
63cdf0e10cSrcweir 
64cdf0e10cSrcweir /*************************************************************************
65cdf0e10cSrcweir |*
66cdf0e10cSrcweir |* Ableitung von SdrDragMethod fuer 3D-Objekte
67cdf0e10cSrcweir |*
68cdf0e10cSrcweir \************************************************************************/
69cdf0e10cSrcweir 
70cdf0e10cSrcweir class E3dDragMethod : public SdrDragMethod
71cdf0e10cSrcweir {
72cdf0e10cSrcweir protected:
73cdf0e10cSrcweir 	::std::vector< E3dDragMethodUnit >	maGrp;
74cdf0e10cSrcweir 	E3dDragConstraint					meConstraint;
75cdf0e10cSrcweir 	Point								maLastPos;
76cdf0e10cSrcweir 	Rectangle							maFullBound;
77cdf0e10cSrcweir 	bool								mbMoveFull;
78cdf0e10cSrcweir 	bool								mbMovedAtAll;
79cdf0e10cSrcweir 
80cdf0e10cSrcweir public:
81cdf0e10cSrcweir 	TYPEINFO();
82cdf0e10cSrcweir 	E3dDragMethod(
83cdf0e10cSrcweir 		SdrDragView &rView,
84cdf0e10cSrcweir 		const SdrMarkList& rMark,
85cdf0e10cSrcweir 		E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
86cdf0e10cSrcweir 		sal_Bool bFull = sal_False);
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	virtual void TakeSdrDragComment(String& rStr) const;
89cdf0e10cSrcweir 	virtual bool BeginSdrDrag();
90cdf0e10cSrcweir 	virtual void MoveSdrDrag(const Point& rPnt);
91cdf0e10cSrcweir 	virtual void CancelSdrDrag();
92cdf0e10cSrcweir 	virtual bool EndSdrDrag(bool bCopy);
93cdf0e10cSrcweir 
Get3DView()94cdf0e10cSrcweir 	E3dView& Get3DView()  { return (E3dView&)getSdrDragView();  }
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	// for migration from XOR to overlay
97cdf0e10cSrcweir 	virtual void CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverlayManager);
98cdf0e10cSrcweir };
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 
101cdf0e10cSrcweir /*************************************************************************
102cdf0e10cSrcweir |*
103cdf0e10cSrcweir |* Ableitung von SdrDragMethod zum Drehen von 3D-Objekten
104cdf0e10cSrcweir |*
105cdf0e10cSrcweir \************************************************************************/
106cdf0e10cSrcweir 
107cdf0e10cSrcweir class E3dDragRotate : public E3dDragMethod
108cdf0e10cSrcweir {
109cdf0e10cSrcweir 	basegfx::B3DPoint					maGlobalCenter;
110cdf0e10cSrcweir 
111cdf0e10cSrcweir public:
112cdf0e10cSrcweir 	TYPEINFO();
113cdf0e10cSrcweir 	E3dDragRotate(
114cdf0e10cSrcweir 		SdrDragView &rView,
115cdf0e10cSrcweir 		const SdrMarkList& rMark,
116cdf0e10cSrcweir 		E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
117cdf0e10cSrcweir 		sal_Bool bFull = sal_False);
118cdf0e10cSrcweir 
119cdf0e10cSrcweir 	virtual void MoveSdrDrag(const Point& rPnt);
120cdf0e10cSrcweir 	virtual Pointer GetSdrDragPointer() const;
121cdf0e10cSrcweir };
122cdf0e10cSrcweir 
123cdf0e10cSrcweir 
124cdf0e10cSrcweir /*************************************************************************
125cdf0e10cSrcweir |*
126cdf0e10cSrcweir |* Ableitung von SdrDragMethod zum Verschieben von 3D-Subobjekten
127cdf0e10cSrcweir |*
128cdf0e10cSrcweir \************************************************************************/
129cdf0e10cSrcweir 
130cdf0e10cSrcweir class E3dDragMove : public E3dDragMethod
131cdf0e10cSrcweir {
132cdf0e10cSrcweir 	SdrHdlKind				meWhatDragHdl;
133cdf0e10cSrcweir 	Point					maScaleFixPos;
134cdf0e10cSrcweir 
135cdf0e10cSrcweir public:
136cdf0e10cSrcweir 	TYPEINFO();
137cdf0e10cSrcweir 	E3dDragMove(
138cdf0e10cSrcweir 		SdrDragView &rView,
139cdf0e10cSrcweir 		const SdrMarkList& rMark,
140cdf0e10cSrcweir 		SdrHdlKind eDrgHdl = HDL_MOVE,
141cdf0e10cSrcweir 		E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
142cdf0e10cSrcweir 		sal_Bool bFull = sal_False);
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 	virtual void MoveSdrDrag(const Point& rPnt);
145cdf0e10cSrcweir 	virtual Pointer GetSdrDragPointer() const;
146cdf0e10cSrcweir };
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 
149cdf0e10cSrcweir #endif			// _E3D_DRAGMT3D_HXX
150