LLToolGrab Class Reference

#include <lltoolgrab.h>

Inheritance diagram for LLToolGrab:

Inheritance graph
[legend]
Collaboration diagram for LLToolGrab:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLToolGrab (LLToolComposite *composite=NULL)
 ~LLToolGrab ()
BOOL handleHover (S32 x, S32 y, MASK mask)
BOOL handleMouseDown (S32 x, S32 y, MASK mask)
BOOL handleMouseUp (S32 x, S32 y, MASK mask)
BOOL handleDoubleClick (S32 x, S32 y, MASK mask)
void render ()
void draw ()
virtual void handleSelect ()
virtual void handleDeselect ()
virtual LLViewerObjectgetEditingObject ()
virtual LLVector3d getEditingPointGlobal ()
virtual BOOL isEditing ()
virtual void stopEditing ()
virtual void onMouseCaptureLost ()
BOOL hasGrabOffset ()
LLVector3 getGrabOffset (S32 x, S32 y)
BOOL handleObjectHit (LLViewerObject *objectp, S32 x, S32 y, MASK mask)
BOOL getHideBuildHighlight ()

Static Public Member Functions

static void pickCallback (S32 x, S32 y, MASK mask)

Private Types

 GRAB_INACTIVE
 GRAB_ACTIVE_CENTER
 GRAB_NONPHYSICAL
 GRAB_LOCKED
 GRAB_NOOBJECT
enum  EGrabMode {
  GRAB_INACTIVE, GRAB_ACTIVE_CENTER, GRAB_NONPHYSICAL, GRAB_LOCKED,
  GRAB_NOOBJECT
}

Private Member Functions

LLVector3d getGrabPointGlobal ()
void startGrab (S32 x, S32 y)
void stopGrab ()
void startSpin ()
void stopSpin ()
void handleHoverSpin (S32 x, S32 y, MASK mask)
void handleHoverActive (S32 x, S32 y, MASK mask)
void handleHoverInactive (S32 x, S32 y, MASK mask)
void handleHoverFailed (S32 x, S32 y, MASK mask)

Private Attributes

EGrabMode mMode
BOOL mVerticalDragging
BOOL mHitLand
LLUUID mHitObjectID
LLPointer< LLViewerObjectmGrabObject
LLTimer mGrabTimer
LLVector3 mGrabOffsetFromCenterInitial
LLVector3 mGrabOffset
LLVector3d mGrabHiddenOffsetFromCamera
LLVector3d mDragStartPointGlobal
LLVector3d mDragStartFromCamera
S32 mLastMouseX
S32 mLastMouseY
S32 mMouseDownX
S32 mMouseDownY
MASK mMouseMask
S32 mAccumDeltaX
S32 mAccumDeltaY
BOOL mHasMoved
BOOL mOutsideSlop
BOOL mDeselectedThisClick
BOOL mSpinGrabbing
LLQuaternion mSpinRotation
BOOL mHideBuildHighlight

Detailed Description

Definition at line 45 of file lltoolgrab.h.


Member Enumeration Documentation

enum LLToolGrab::EGrabMode [private]

Enumerator:
GRAB_INACTIVE 
GRAB_ACTIVE_CENTER 
GRAB_NONPHYSICAL 
GRAB_LOCKED 
GRAB_NOOBJECT 

Definition at line 92 of file lltoolgrab.h.


Constructor & Destructor Documentation

LLToolGrab::LLToolGrab ( LLToolComposite composite = NULL  ) 

Definition at line 79 of file lltoolgrab.cpp.

LLToolGrab::~LLToolGrab (  ) 

Definition at line 94 of file lltoolgrab.cpp.


Member Function Documentation

void LLToolGrab::draw (  )  [virtual]

Reimplemented from LLTool.

Definition at line 870 of file lltoolgrab.cpp.

LLViewerObject * LLToolGrab::getEditingObject (  )  [virtual]

Reimplemented from LLTool.

Definition at line 883 of file lltoolgrab.cpp.

References mGrabObject.

Referenced by LLVOAvatar::needsRenderBeam().

LLVector3d LLToolGrab::getEditingPointGlobal (  )  [virtual]

Reimplemented from LLTool.

Definition at line 889 of file lltoolgrab.cpp.

References getGrabPointGlobal().

LLVector3 LLToolGrab::getGrabOffset ( S32  x,
S32  y 
)

LLVector3d LLToolGrab::getGrabPointGlobal (  )  [private]

Definition at line 894 of file lltoolgrab.cpp.

References gAgent, LLAgent::getCameraPositionGlobal(), LLAgent::getPositionGlobal(), GRAB_ACTIVE_CENTER, GRAB_INACTIVE, GRAB_LOCKED, GRAB_NONPHYSICAL, GRAB_NOOBJECT, mGrabHiddenOffsetFromCamera, and mMode.

Referenced by getEditingPointGlobal().

BOOL LLToolGrab::getHideBuildHighlight (  )  [inline]

Definition at line 75 of file lltoolgrab.h.

References mHideBuildHighlight.

Referenced by LLToolBar::refresh().

void LLToolGrab::handleDeselect (  )  [virtual]

Reimplemented from LLTool.

Definition at line 110 of file lltoolgrab.cpp.

References FALSE, LLTool::hasMouseCapture(), and LLTool::setMouseCapture().

BOOL LLToolGrab::handleDoubleClick ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLTool.

Definition at line 119 of file lltoolgrab.cpp.

References FALSE, gDebugClicks, llendl, and llinfos.

Referenced by LLToolCompGun::handleDoubleClick().

BOOL LLToolGrab::handleHover ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLTool.

Definition at line 393 of file lltoolgrab.cpp.

References FALSE, LLViewerWindow::getLeftMouseDown(), GRAB_ACTIVE_CENTER, GRAB_INACTIVE, GRAB_LOCKED, GRAB_NONPHYSICAL, GRAB_NOOBJECT, gViewerWindow, handleHoverActive(), handleHoverFailed(), handleHoverInactive(), mLastMouseX, mLastMouseY, mMode, LLViewerWindow::setCursor(), LLTool::setMouseCapture(), TRUE, and UI_CURSOR_TOOLGRAB.

void LLToolGrab::handleHoverActive ( S32  x,
S32  y,
MASK  mask 
) [private]

Definition at line 431 of file lltoolgrab.cpp.

References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_GrabOffsetInitial, _PREHASH_GrabPosition, _PREHASH_ObjectData, _PREHASH_ObjectGrabUpdate, _PREHASH_ObjectID, _PREHASH_ObjectSpinUpdate, _PREHASH_Rotation, _PREHASH_SessionID, _PREHASH_TimeSinceLast, LLMessageSystem::addQuatFast(), LLMessageSystem::addU32Fast(), LLMessageSystem::addUUIDFast(), LLMessageSystem::addVector3Fast(), ANIMATE, LLAgent::calcFocusPositionTargetGlobal(), LLAgent::cameraMouselook(), LLAgent::cameraOrbitAround(), LLAgent::clearFocusObject(), LLViewerWindow::clickPointInWorldGlobal(), LLWorld::clipToVisibleRegions(), DEG_TO_RAD, f, FALSE, gAgent, gCamera, LLAgent::getAvatarObject(), LLAgent::getCameraPositionGlobal(), LLTimer::getElapsedTimeAndResetF32(), LLAgent::getFocusOnAvatar(), LLAgent::getID(), LLCoordFrame::getLeftAxis(), LLAgent::getPosAgentFromGlobal(), LLXform::getRoot(), LLAgent::getSessionID(), LLCoordFrame::getUpAxis(), LLViewerWindow::getWindowHeight(), LLViewerWindow::getWindowWidth(), gFPSClamped, gGrabBtnSpin, gGrabBtnVertical, gMessageSystem, gSelectMgr, gViewerWindow, gWorldp, gWorldPointer, LLTool::hasMouseCapture(), llassert, lldebugst, llendl, mAccumDeltaX, mAccumDeltaY, MASK_SPIN, MASK_VERTICAL, MAX_OBJECT_Z, mDragStartFromCamera, mDragStartPointGlobal, LLVector3d::mdV, mGrabHiddenOffsetFromCamera, mGrabObject, mGrabOffsetFromCenterInitial, mGrabTimer, mHasMoved, mOutsideSlop, LLViewerWindow::moveCursorToCenter(), mSpinGrabbing, mSpinRotation, mVerticalDragging, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), LLVector3d::normVec(), LLUUID::null, LLViewerCamera::projectPosAgentToScreen(), S32, LLMessageSystem::sendMessage(), LLViewerWindow::setCursor(), LLAgent::setFocusGlobal(), LLAgent::setFocusOnAvatar(), LLTool::setMouseCapture(), LLVector3d::setVec(), SLOP_DIST_SQ, startSpin(), stopSpin(), TRUE, UI_CURSOR_ARROW, LLSelectMgr::updateSelectionCenter(), VZ, LLAgent::yaw(), and LLVector3d::z_axis.

Referenced by handleHover().

void LLToolGrab::handleHoverFailed ( S32  x,
S32  y,
MASK  mask 
) [private]

Definition at line 715 of file lltoolgrab.cpp.

References GRAB_LOCKED, GRAB_NOOBJECT, gViewerWindow, llassert, lldebugst, llendl, mMode, mMouseDownX, mMouseDownY, mOutsideSlop, S32, LLViewerWindow::setCursor(), SLOP_DIST_SQ, TRUE, UI_CURSOR_ARROW, UI_CURSOR_GRABLOCKED, and UI_CURSOR_NO.

Referenced by handleHover().

void LLToolGrab::handleHoverInactive ( S32  x,
S32  y,
MASK  mask 
) [private]

Definition at line 685 of file lltoolgrab.cpp.

References LLAgent::cameraThirdPerson(), DEG_TO_RAD, gAgent, LLControlGroup::getBOOL(), LLViewerWindow::getWindowWidth(), gFPSClamped, gSavedSettings, gViewerWindow, lldebugst, llendl, LLViewerWindow::setCursor(), UI_CURSOR_TOOLGRAB, and LLAgent::yaw().

Referenced by handleHover().

void LLToolGrab::handleHoverSpin ( S32  x,
S32  y,
MASK  mask 
) [private]

BOOL LLToolGrab::handleMouseDown ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLTool.

Definition at line 129 of file lltoolgrab.cpp.

References FALSE, gAgent, gDebugClicks, gViewerWindow, LLTool::handleMouseDown(), LLViewerWindow::hitObjectOrLandGlobalAsync(), LLAgent::leftButtonGrabbed(), llendl, llinfos, mHitLand, pickCallback(), and TRUE.

Referenced by LLToolGun::handleMouseDown(), and LLToolCompGun::handleMouseDown().

BOOL LLToolGrab::handleMouseUp ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLTool.

Definition at line 756 of file lltoolgrab.cpp.

References FALSE, gBasicToolset, gGrabTransientTool, GRAB_INACTIVE, LLTool::handleMouseUp(), LLTool::hasMouseCapture(), mMode, NULL, LLToolset::selectTool(), LLTool::setMouseCapture(), and TRUE.

BOOL LLToolGrab::handleObjectHit ( LLViewerObject objectp,
S32  x,
S32  y,
MASK  mask 
)

Definition at line 178 of file lltoolgrab.cpp.

References LLAgent::cameraMouselook(), LLVector3::clearVec(), FALSE, LLViewerObjectList::findObject(), LLViewerObject::flagHandleTouch(), gAgent, gBasicToolset, gDebugClicks, LLViewerObject::getID(), LLViewerWindow::getLeftMouseDown(), LLAgent::getPosAgentFromGlobal(), LLViewerObject::getPositionAgent(), LLViewerObject::getRenderRotation(), LLViewerObject::getRootEdit(), gGrabBtnSpin, gGrabBtnVertical, gGrabTransientTool, gLastHitNonFloraPosGlobal, gObjectList, GRAB_ACTIVE_CENTER, GRAB_LOCKED, GRAB_NONPHYSICAL, gSelectMgr, gViewerWindow, LLViewerWindow::hideCursor(), LLPrimitive::isAvatar(), llendl, llinfos, llwarns, LOOKAT_TARGET_SELECT, mAccumDeltaX, mAccumDeltaY, MASK_SPIN, MASK_VERTICAL, mGrabObject, mGrabOffset, mHasMoved, mHideBuildHighlight, mHitObjectID, mMode, mMouseDownX, mMouseDownY, mMouseMask, mOutsideSlop, LLViewerWindow::moveCursorToCenter(), mVerticalDragging, NULL, LLViewerObject::permMove(), POINTAT_TARGET_GRAB, LLToolset::selectTool(), LLAgent::setLookAt(), LLTool::setMouseCapture(), LLAgent::setPointAt(), startGrab(), startSpin(), TRUE, LLSelectMgr::updateSelectionCenter(), and LLViewerObject::usePhysics().

Referenced by LLToolPie::pickAndShowMenu(), and pickCallback().

void LLToolGrab::handleSelect (  )  [virtual]

Reimplemented from LLTool.

Definition at line 99 of file lltoolgrab.cpp.

References FALSE, gFloaterTools, gGrabBtnSpin, gGrabBtnVertical, and LLFloaterTools::setStatusText().

BOOL LLToolGrab::hasGrabOffset (  )  [inline]

Definition at line 68 of file lltoolgrab.h.

References TRUE.

BOOL LLToolGrab::isEditing (  )  [virtual]

Reimplemented from LLTool.

Definition at line 876 of file lltoolgrab.cpp.

References mGrabObject, and NULL.

Referenced by LLVOAvatar::needsRenderBeam().

void LLToolGrab::onMouseCaptureLost (  )  [virtual]

Reimplemented from LLTool.

Definition at line 787 of file lltoolgrab.cpp.

References LLAgent::cameraMouselook(), dialog_refresh_all(), FALSE, gAgent, gCamera, GRAB_ACTIVE_CENTER, GRAB_INACTIVE, GRAB_NONPHYSICAL, gSelectMgr, gViewerWindow, llassert, LOOKAT_TARGET_CLEAR, mAccumDeltaX, mAccumDeltaY, mGrabObject, mHasMoved, mHideBuildHighlight, mMode, mMouseDownX, mMouseDownY, LLCoord::mX, LLCoord::mY, NULL, POINTAT_TARGET_CLEAR, LLViewerCamera::projectPosAgentToScreen(), S32, LLUI::setCursorPositionScreen(), LLAgent::setLookAt(), LLAgent::setPointAt(), LLViewerWindow::showCursor(), stopGrab(), stopSpin(), LLSelectMgr::updateSelectionCenter(), x, and y.

void LLToolGrab::pickCallback ( S32  x,
S32  y,
MASK  mask 
) [static]

Definition at line 149 of file lltoolgrab.cpp.

References LLSelectMgr::deselectAll(), FALSE, LLViewerObjectList::findObject(), LLSelectMgr::getSelection(), gLastHitObjectID, gObjectList, GRAB_NOOBJECT, gSelectMgr, gToolGrab, handleObjectHit(), MASK_SHIFT, mDeselectedThisClick, mHitObjectID, mMode, LLTool::setMouseCapture(), LLUUID::setNull(), and TRUE.

Referenced by handleMouseDown().

void LLToolGrab::render (  )  [virtual]

Reimplemented from LLTool.

Definition at line 873 of file lltoolgrab.cpp.

void LLToolGrab::startGrab ( S32  x,
S32  y 
) [private]

Definition at line 350 of file lltoolgrab.cpp.

References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_GrabOffset, _PREHASH_LocalID, _PREHASH_ObjectData, _PREHASH_ObjectGrab, _PREHASH_SessionID, LLMessageSystem::addU32Fast(), LLMessageSystem::addUUIDFast(), LLMessageSystem::addVector3Fast(), LLQuaternion::conjQuat(), gAgent, LLAgent::getCameraPositionGlobal(), LLAgent::getID(), LLViewerObject::getPositionGlobal(), LLXform::getRotation(), LLAgent::getSessionID(), gMessageSystem, mDragStartFromCamera, mDragStartPointGlobal, mGrabHiddenOffsetFromCamera, mGrabObject, mGrabOffsetFromCenterInitial, mGrabTimer, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), LLTimer::reset(), LLMessageSystem::sendMessage(), and LLVector3::setVec().

Referenced by handleObjectHit().

void LLToolGrab::startSpin (  )  [private]

Definition at line 303 of file lltoolgrab.cpp.

References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_ObjectData, _PREHASH_ObjectID, _PREHASH_ObjectSpinStart, _PREHASH_SessionID, LLMessageSystem::addUUIDFast(), gAgent, LLAgent::getID(), LLXform::getRotation(), LLAgent::getSessionID(), gMessageSystem, mGrabObject, mSpinGrabbing, mSpinRotation, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), LLMessageSystem::sendMessage(), and TRUE.

Referenced by handleHoverActive(), and handleObjectHit().

void LLToolGrab::stopEditing (  )  [virtual]

Reimplemented from LLTool.

Definition at line 779 of file lltoolgrab.cpp.

References FALSE, LLTool::hasMouseCapture(), and LLTool::setMouseCapture().

void LLToolGrab::stopGrab (  )  [private]

Definition at line 838 of file lltoolgrab.cpp.

References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_LocalID, _PREHASH_ObjectData, _PREHASH_ObjectDeGrab, _PREHASH_SessionID, LLMessageSystem::addU32Fast(), LLMessageSystem::addUUIDFast(), LLVector3::clearVec(), FALSE, gAgent, LLAgent::getID(), LLAgent::getSessionID(), gMessageSystem, GRAB_ACTIVE_CENTER, GRAB_INACTIVE, GRAB_LOCKED, GRAB_NONPHYSICAL, GRAB_NOOBJECT, mGrabObject, mGrabOffset, mHideBuildHighlight, mMode, mVerticalDragging, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), and LLMessageSystem::sendMessage().

Referenced by onMouseCaptureLost().

void LLToolGrab::stopSpin (  )  [private]

Definition at line 322 of file lltoolgrab.cpp.

References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_ObjectData, _PREHASH_ObjectID, _PREHASH_ObjectSpinStop, _PREHASH_SessionID, LLMessageSystem::addUUIDFast(), FALSE, gAgent, LLAgent::getID(), LLAgent::getSessionID(), gMessageSystem, GRAB_ACTIVE_CENTER, GRAB_INACTIVE, GRAB_LOCKED, GRAB_NONPHYSICAL, GRAB_NOOBJECT, mGrabObject, mMode, mSpinGrabbing, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), and LLMessageSystem::sendMessage().

Referenced by handleHoverActive(), and onMouseCaptureLost().


Member Data Documentation

S32 LLToolGrab::mAccumDeltaX [private]

Definition at line 116 of file lltoolgrab.h.

Referenced by handleHoverActive(), handleObjectHit(), and onMouseCaptureLost().

S32 LLToolGrab::mAccumDeltaY [private]

Definition at line 117 of file lltoolgrab.h.

Referenced by handleHoverActive(), handleObjectHit(), and onMouseCaptureLost().

BOOL LLToolGrab::mDeselectedThisClick [private]

Definition at line 120 of file lltoolgrab.h.

Referenced by pickCallback().

LLVector3d LLToolGrab::mDragStartFromCamera [private]

Definition at line 109 of file lltoolgrab.h.

Referenced by handleHoverActive(), and startGrab().

LLVector3d LLToolGrab::mDragStartPointGlobal [private]

Definition at line 108 of file lltoolgrab.h.

Referenced by handleHoverActive(), and startGrab().

LLVector3d LLToolGrab::mGrabHiddenOffsetFromCamera [private]

Definition at line 106 of file lltoolgrab.h.

Referenced by getGrabPointGlobal(), handleHoverActive(), and startGrab().

LLPointer<LLViewerObject> LLToolGrab::mGrabObject [private]

Definition at line 101 of file lltoolgrab.h.

Referenced by getEditingObject(), handleHoverActive(), handleObjectHit(), isEditing(), onMouseCaptureLost(), startGrab(), startSpin(), stopGrab(), and stopSpin().

LLVector3 LLToolGrab::mGrabOffset [private]

Definition at line 105 of file lltoolgrab.h.

Referenced by handleObjectHit(), and stopGrab().

LLVector3 LLToolGrab::mGrabOffsetFromCenterInitial [private]

Definition at line 104 of file lltoolgrab.h.

Referenced by handleHoverActive(), and startGrab().

LLTimer LLToolGrab::mGrabTimer [private]

Definition at line 102 of file lltoolgrab.h.

Referenced by handleHoverActive(), and startGrab().

BOOL LLToolGrab::mHasMoved [private]

Definition at line 118 of file lltoolgrab.h.

Referenced by handleHoverActive(), handleObjectHit(), and onMouseCaptureLost().

BOOL LLToolGrab::mHideBuildHighlight [private]

Definition at line 125 of file lltoolgrab.h.

Referenced by getHideBuildHighlight(), handleObjectHit(), onMouseCaptureLost(), and stopGrab().

BOOL LLToolGrab::mHitLand [private]

Definition at line 98 of file lltoolgrab.h.

Referenced by handleMouseDown().

LLUUID LLToolGrab::mHitObjectID [private]

Definition at line 99 of file lltoolgrab.h.

Referenced by handleObjectHit(), and pickCallback().

S32 LLToolGrab::mLastMouseX [private]

Definition at line 111 of file lltoolgrab.h.

Referenced by handleHover().

S32 LLToolGrab::mLastMouseY [private]

Definition at line 112 of file lltoolgrab.h.

Referenced by handleHover().

EGrabMode LLToolGrab::mMode [private]

Definition at line 94 of file lltoolgrab.h.

Referenced by getGrabPointGlobal(), handleHover(), handleHoverFailed(), handleMouseUp(), handleObjectHit(), onMouseCaptureLost(), pickCallback(), stopGrab(), and stopSpin().

S32 LLToolGrab::mMouseDownX [private]

Definition at line 113 of file lltoolgrab.h.

Referenced by handleHoverFailed(), handleObjectHit(), and onMouseCaptureLost().

S32 LLToolGrab::mMouseDownY [private]

Definition at line 114 of file lltoolgrab.h.

Referenced by handleHoverFailed(), handleObjectHit(), and onMouseCaptureLost().

MASK LLToolGrab::mMouseMask [private]

Definition at line 115 of file lltoolgrab.h.

Referenced by handleObjectHit().

BOOL LLToolGrab::mOutsideSlop [private]

Definition at line 119 of file lltoolgrab.h.

Referenced by handleHoverActive(), handleHoverFailed(), and handleObjectHit().

BOOL LLToolGrab::mSpinGrabbing [private]

Definition at line 122 of file lltoolgrab.h.

Referenced by handleHoverActive(), startSpin(), and stopSpin().

LLQuaternion LLToolGrab::mSpinRotation [private]

Definition at line 123 of file lltoolgrab.h.

Referenced by handleHoverActive(), and startSpin().

BOOL LLToolGrab::mVerticalDragging [private]

Definition at line 96 of file lltoolgrab.h.

Referenced by handleHoverActive(), handleObjectHit(), and stopGrab().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:52 2010 for Second Life Viewer by  doxygen 1.4.7