aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llmaniptranslate.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:11 -0500
committerJacek Antonelli2008-08-15 23:45:11 -0500
commit215f423cbe18fe9ca14a26caef918d303bad28ff (patch)
tree0743442b286216cc8e19aa487c26f4e9345ffd64 /linden/indra/newview/llmaniptranslate.cpp
parentSecond Life viewer sources 1.18.3.5-RC (diff)
downloadmeta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.zip
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.gz
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.bz2
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.xz
Second Life viewer sources 1.18.4.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llmaniptranslate.cpp74
1 files changed, 42 insertions, 32 deletions
diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp
index e405dc4..1963b1a 100644
--- a/linden/indra/newview/llmaniptranslate.cpp
+++ b/linden/indra/newview/llmaniptranslate.cpp
@@ -2,6 +2,8 @@
2 * @file llmaniptranslate.cpp 2 * @file llmaniptranslate.cpp
3 * @brief LLManipTranslate class implementation 3 * @brief LLManipTranslate class implementation
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 *
5 * Copyright (c) 2002-2007, Linden Research, Inc. 7 * Copyright (c) 2002-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,6 +26,7 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29/** 32/**
@@ -258,7 +261,7 @@ LLManipTranslate::~LLManipTranslate()
258void LLManipTranslate::handleSelect() 261void LLManipTranslate::handleSelect()
259{ 262{
260 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); 263 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
261 gFloaterTools->setStatusText("Drag to move, shift-drag to copy"); 264 gFloaterTools->setStatusText("move");
262 LLManip::handleSelect(); 265 LLManip::handleSelect();
263} 266}
264 267
@@ -266,7 +269,6 @@ void LLManipTranslate::handleDeselect()
266{ 269{
267 mHighlightedPart = LL_NO_PART; 270 mHighlightedPart = LL_NO_PART;
268 mManipPart = LL_NO_PART; 271 mManipPart = LL_NO_PART;
269 gFloaterTools->setStatusText("");
270 LLManip::handleDeselect(); 272 LLManip::handleDeselect();
271} 273}
272 274
@@ -293,14 +295,7 @@ BOOL LLManipTranslate::handleMouseDown(S32 x, S32 y, MASK mask)
293// Assumes that one of the arrows on an object was hit. 295// Assumes that one of the arrows on an object was hit.
294BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) 296BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
295{ 297{
296 BOOL can_move = mObjectSelection->getObjectCount() != 0; 298 BOOL can_move = canAffectSelection();
297 for (LLViewerObject* objectp = mObjectSelection->getFirstObject();
298 objectp;
299 objectp = mObjectSelection->getNextObject())
300 {
301 can_move = can_move && objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
302 }
303
304 if (!can_move) 299 if (!can_move)
305 { 300 {
306 return FALSE; 301 return FALSE;
@@ -428,8 +423,6 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
428 } 423 }
429 } 424 }
430 425
431 LLViewerObject *object;
432
433 // Suppress processing if mouse hasn't actually moved. 426 // Suppress processing if mouse hasn't actually moved.
434 // This may cause problems if the camera moves outside of the 427 // This may cause problems if the camera moves outside of the
435 // rotation above. 428 // rotation above.
@@ -488,7 +481,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
488 return TRUE; 481 return TRUE;
489 } 482 }
490 483
491 object = selectNode->getObject(); 484 LLViewerObject* object = selectNode->getObject();
492 if (!object) 485 if (!object)
493 { 486 {
494 // somehow we lost the object! 487 // somehow we lost the object!
@@ -651,11 +644,11 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
651 LLVector3d clamped_relative_move = axis_magnitude * axis_d; // scalar multiply 644 LLVector3d clamped_relative_move = axis_magnitude * axis_d; // scalar multiply
652 LLVector3 clamped_relative_move_f = (F32)axis_magnitude * axis_f; // scalar multiply 645 LLVector3 clamped_relative_move_f = (F32)axis_magnitude * axis_f; // scalar multiply
653 646
654 for(selectNode = mObjectSelection->getFirstNode(); 647 for (LLObjectSelection::iterator iter = mObjectSelection->begin();
655 selectNode; 648 iter != mObjectSelection->end(); iter++)
656 selectNode = mObjectSelection->getNextNode() )
657 { 649 {
658 object = selectNode->getObject(); 650 LLSelectNode* selectNode = *iter;
651 LLViewerObject* object = selectNode->getObject();
659 652
660 // Only apply motion to root objects and objects selected 653 // Only apply motion to root objects and objects selected
661 // as "individual". 654 // as "individual".
@@ -1044,16 +1037,19 @@ BOOL LLManipTranslate::handleMouseUp(S32 x, S32 y, MASK mask)
1044 // first, perform normal processing in case this was a quick-click 1037 // first, perform normal processing in case this was a quick-click
1045 handleHover(x, y, mask); 1038 handleHover(x, y, mask);
1046 1039
1047 // make sure arrow colors go back to normal 1040 if(hasMouseCapture())
1048 mManipPart = LL_NO_PART; 1041 {
1049 gSelectMgr->enableSilhouette(TRUE); 1042 // make sure arrow colors go back to normal
1043 mManipPart = LL_NO_PART;
1044 gSelectMgr->enableSilhouette(TRUE);
1050 1045
1051 // Might have missed last update due to UPDATE_DELAY timing. 1046 // Might have missed last update due to UPDATE_DELAY timing.
1052 gSelectMgr->sendMultipleUpdate( UPD_POSITION ); 1047 gSelectMgr->sendMultipleUpdate( UPD_POSITION );
1053 1048
1054 mInSnapRegime = FALSE; 1049 mInSnapRegime = FALSE;
1055 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); 1050 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
1056 //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); 1051 //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject"));
1052 }
1057 1053
1058 return LLManip::handleMouseUp(x, y, mask); 1054 return LLManip::handleMouseUp(x, y, mask);
1059} 1055}
@@ -1736,12 +1732,8 @@ void LLManipTranslate::renderText()
1736 } 1732 }
1737 else 1733 else
1738 { 1734 {
1739 LLViewerObject* objectp = mObjectSelection->getFirstRootObject(); 1735 const BOOL children_ok = TRUE;
1740 if(!objectp) 1736 LLViewerObject* objectp = mObjectSelection->getFirstRootObject(children_ok);
1741 {
1742 objectp = mObjectSelection->getFirstObject();
1743 }
1744
1745 if (objectp) 1737 if (objectp)
1746 { 1738 {
1747 renderXYZ(objectp->getPositionEdit()); 1739 renderXYZ(objectp->getPositionEdit());
@@ -2261,3 +2253,21 @@ void LLManipTranslate::renderGridVert(F32 x_trans, F32 y_trans, F32 r, F32 g, F3
2261 } 2253 }
2262 2254
2263} 2255}
2256
2257// virtual
2258BOOL LLManipTranslate::canAffectSelection()
2259{
2260 BOOL can_move = mObjectSelection->getObjectCount() != 0;
2261 if (can_move)
2262 {
2263 struct f : public LLSelectedObjectFunctor
2264 {
2265 virtual bool apply(LLViewerObject* objectp)
2266 {
2267 return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
2268 }
2269 } func;
2270 can_move = mObjectSelection->applyToObjects(&func);
2271 }
2272 return can_move;
2273}