/indra/newview/lltoolselectland.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 76 lines · 36 code · 15 blank · 25 comment · 0 complexity · 359b2be076647d5dd598b4f25f3b78b4 MD5 · raw file

  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. #ifndef LL_LLTOOLSELECTLAND_H
  27. #define LL_LLTOOLSELECTLAND_H
  28. #include "lltool.h"
  29. #include "v3dmath.h"
  30. class LLParcelSelection;
  31. class LLToolSelectLand
  32. : public LLTool, public LLSingleton<LLToolSelectLand>
  33. {
  34. public:
  35. LLToolSelectLand( );
  36. virtual ~LLToolSelectLand();
  37. /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
  38. /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
  39. /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
  40. /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
  41. /*virtual*/ void render(); // draw the select rectangle
  42. /*virtual*/ BOOL isAlwaysRendered() { return TRUE; }
  43. /*virtual*/ void handleSelect();
  44. /*virtual*/ void handleDeselect();
  45. protected:
  46. BOOL outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y);
  47. void roundXY(LLVector3d& vec);
  48. protected:
  49. LLVector3d mDragStartGlobal; // global coords
  50. LLVector3d mDragEndGlobal; // global coords
  51. BOOL mDragEndValid; // is drag end a valid point in the world?
  52. S32 mDragStartX; // screen coords, from left
  53. S32 mDragStartY; // screen coords, from bottom
  54. S32 mDragEndX;
  55. S32 mDragEndY;
  56. BOOL mMouseOutsideSlop; // has mouse ever gone outside slop region?
  57. LLVector3d mWestSouthBottom; // global coords, from drag
  58. LLVector3d mEastNorthTop; // global coords, from drag
  59. LLSafeHandle<LLParcelSelection> mSelection; // hold on to a parcel selection
  60. };
  61. #endif