aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltoolgrab.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/lltoolgrab.h
parentREADME.txt (diff)
downloadmeta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/lltoolgrab.h')
-rw-r--r--linden/indra/newview/lltoolgrab.h131
1 files changed, 131 insertions, 0 deletions
diff --git a/linden/indra/newview/lltoolgrab.h b/linden/indra/newview/lltoolgrab.h
new file mode 100644
index 0000000..db8242c
--- /dev/null
+++ b/linden/indra/newview/lltoolgrab.h
@@ -0,0 +1,131 @@
1/**
2 * @file lltoolgrab.h
3 * @brief LLToolGrab class header file
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_TOOLGRAB_H
29#define LL_TOOLGRAB_H
30
31#include "lltool.h"
32#include "v3math.h"
33#include "llquaternion.h"
34#include "llmemory.h"
35#include "lluuid.h"
36
37class LLView;
38class LLTextBox;
39class LLViewerObject;
40
41class LLToolGrab : public LLTool
42{
43public:
44 LLToolGrab( LLToolComposite* composite = NULL );
45 ~LLToolGrab();
46
47 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
48 /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
49 /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
50 /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
51 /*virtual*/ void render(); // 3D elements
52 /*virtual*/ void draw(); // 2D elements
53
54 virtual void handleSelect();
55 virtual void handleDeselect();
56
57 virtual LLViewerObject* getEditingObject();
58 virtual LLVector3d getEditingPointGlobal();
59 virtual BOOL isEditing();
60 virtual void stopEditing();
61
62 virtual void onMouseCaptureLost();
63
64 BOOL hasGrabOffset() { return TRUE; } // HACK
65 LLVector3 getGrabOffset(S32 x, S32 y); // HACK
66
67 // Capture the mouse and start grabbing.
68 BOOL handleObjectHit(LLViewerObject *objectp, S32 x, S32 y, MASK mask);
69
70 // Certain grabs should not highlight the "Build" toolbar button
71 BOOL getHideBuildHighlight() { return mHideBuildHighlight; }
72
73 static void pickCallback(S32 x, S32 y, MASK mask);
74private:
75 LLVector3d getGrabPointGlobal();
76 void startGrab(S32 x, S32 y);
77 void stopGrab();
78
79 void startSpin();
80 void stopSpin();
81
82 void handleHoverSpin(S32 x, S32 y, MASK mask);
83 void handleHoverActive(S32 x, S32 y, MASK mask);
84 void handleHoverInactive(S32 x, S32 y, MASK mask);
85 void handleHoverFailed(S32 x, S32 y, MASK mask);
86
87private:
88 enum EGrabMode { GRAB_INACTIVE, GRAB_ACTIVE_CENTER, GRAB_NONPHYSICAL, GRAB_LOCKED, GRAB_NOOBJECT };
89
90 EGrabMode mMode;
91
92 BOOL mVerticalDragging;
93
94 BOOL mHitLand;
95 LLUUID mHitObjectID; // if hit something, its ID
96
97 LLPointer<LLViewerObject> mGrabObject; // the object currently being grabbed
98 LLTimer mGrabTimer; // send simulator time between hover movements
99
100 LLVector3 mGrabOffsetFromCenterInitial; // meters from CG of object
101 LLVector3 mGrabOffset; // how far cursor currently is from grab start point, meters
102 LLVector3d mGrabHiddenOffsetFromCamera; // in cursor hidden drag, how far is grab offset from camera
103
104 LLVector3d mDragStartPointGlobal; // projected into world
105 LLVector3d mDragStartFromCamera; // drag start relative to camera
106
107 S32 mLastMouseX;
108 S32 mLastMouseY;
109 S32 mMouseDownX;
110 S32 mMouseDownY;
111 MASK mMouseMask;
112 S32 mAccumDeltaX; // since cursor hidden, how far have you moved?
113 S32 mAccumDeltaY;
114 BOOL mHasMoved; // has mouse moved off center at all?
115 BOOL mOutsideSlop; // has mouse moved outside center 5 pixels?
116 BOOL mDeselectedThisClick;
117
118 BOOL mSpinGrabbing;
119 LLQuaternion mSpinRotation;
120
121 BOOL mHideBuildHighlight;
122};
123
124extern LLToolGrab *gToolGrab;
125
126extern BOOL gGrabBtnVertical;
127extern BOOL gGrabBtnSpin;
128extern LLTool* gGrabTransientTool;
129
130#endif // LL_TOOLGRAB_H
131