/indra/newview/lltoolselectland.h
C++ Header | 76 lines | 36 code | 15 blank | 25 comment | 0 complexity | 359b2be076647d5dd598b4f25f3b78b4 MD5 | raw file
Possible License(s): LGPL-2.1
1/** 2 * @file lltoolselectland.h 3 * @brief LLToolSelectLand class header file 4 * 5 * $LicenseInfo:firstyear=2002&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_LLTOOLSELECTLAND_H 28#define LL_LLTOOLSELECTLAND_H 29 30#include "lltool.h" 31#include "v3dmath.h" 32 33class LLParcelSelection; 34 35class LLToolSelectLand 36: public LLTool, public LLSingleton<LLToolSelectLand> 37{ 38public: 39 LLToolSelectLand( ); 40 virtual ~LLToolSelectLand(); 41 42 /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); 43 /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); 44 /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); 45 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); 46 /*virtual*/ void render(); // draw the select rectangle 47 /*virtual*/ BOOL isAlwaysRendered() { return TRUE; } 48 49 /*virtual*/ void handleSelect(); 50 /*virtual*/ void handleDeselect(); 51 52protected: 53 BOOL outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y); 54 void roundXY(LLVector3d& vec); 55 56protected: 57 LLVector3d mDragStartGlobal; // global coords 58 LLVector3d mDragEndGlobal; // global coords 59 BOOL mDragEndValid; // is drag end a valid point in the world? 60 61 S32 mDragStartX; // screen coords, from left 62 S32 mDragStartY; // screen coords, from bottom 63 64 S32 mDragEndX; 65 S32 mDragEndY; 66 67 BOOL mMouseOutsideSlop; // has mouse ever gone outside slop region? 68 69 LLVector3d mWestSouthBottom; // global coords, from drag 70 LLVector3d mEastNorthTop; // global coords, from drag 71 72 LLSafeHandle<LLParcelSelection> mSelection; // hold on to a parcel selection 73}; 74 75 76#endif