PageRenderTime 52ms CodeModel.GetById 31ms app.highlight 4ms RepoModel.GetById 16ms app.codeStats 0ms

/indra/newview/lltoolfocus.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 79 lines | 38 code | 14 blank | 27 comment | 0 complexity | d2f66057a9ede2bae56d93c83bd35e5f MD5 | raw file
 1/** 
 2 * @file lltoolfocus.h
 3 * @brief A tool to set the build focus point.
 4 *
 5 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLTOOLFOCUS_H
28#define LL_LLTOOLFOCUS_H
29
30#include "lltool.h"
31
32class LLPickInfo;
33
34class LLToolCamera
35:	public LLTool, public LLSingleton<LLToolCamera>
36{
37public:
38	LLToolCamera();
39	virtual ~LLToolCamera();
40
41	virtual BOOL	handleMouseDown(S32 x, S32 y, MASK mask);
42	virtual BOOL	handleMouseUp(S32 x, S32 y, MASK mask);
43	virtual BOOL	handleHover(S32 x, S32 y, MASK mask);
44
45	virtual void	onMouseCaptureLost();
46
47	virtual void	handleSelect();
48	virtual void	handleDeselect();
49
50	virtual LLTool*	getOverrideTool(MASK mask) { return NULL; }
51
52	static void pickCallback(const LLPickInfo& pick_info);
53	BOOL mouseSteerMode() { return mMouseSteering; }
54
55protected:
56	// called from handleMouseUp and onMouseCaptureLost to "let go"
57	// of the mouse and make it visible JC
58	void releaseMouse();
59
60protected:
61	S32		mAccumX;
62	S32		mAccumY;
63	S32		mMouseDownX;
64	S32		mMouseDownY;
65	BOOL	mOutsideSlopX;
66	BOOL	mOutsideSlopY;
67	BOOL	mValidClickPoint;
68	BOOL	mMouseSteering;
69	S32		mMouseUpX;	// needed for releaseMouse()
70	S32		mMouseUpY;
71	MASK	mMouseUpMask;
72};
73
74
75extern BOOL gCameraBtnOrbit;
76extern BOOL gCameraBtnPan;
77extern BOOL gCameraBtnZoom;
78
79#endif