Annotation of /trunk/linden/indra/newview/llmaniptranslate.h
Parent Directory
|
Revision Log
Revision 57 -
(view)
(download)
Original Path: linden_release/linden/indra/newview/llmaniptranslate.h
| 1 : | mjm | 57 | /** |
| 2 : | * @file llmaniptranslate.h | ||
| 3 : | * @brief LLManipTranslate class definition | ||
| 4 : | * | ||
| 5 : | * $LicenseInfo:firstyear=2002&license=viewergpl$ | ||
| 6 : | * | ||
| 7 : | * Copyright (c) 2002-2008, Linden Research, Inc. | ||
| 8 : | * | ||
| 9 : | * Second Life Viewer Source Code | ||
| 10 : | * The source code in this file ("Source Code") is provided by Linden Lab | ||
| 11 : | * to you under the terms of the GNU General Public License, version 2.0 | ||
| 12 : | * ("GPL"), unless you have obtained a separate licensing agreement | ||
| 13 : | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
| 14 : | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
| 15 : | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
| 16 : | * | ||
| 17 : | * There are special exceptions to the terms and conditions of the GPL as | ||
| 18 : | * it is applied to this Source Code. View the full text of the exception | ||
| 19 : | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
| 20 : | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
| 21 : | * | ||
| 22 : | * By copying, modifying or distributing this software, you acknowledge | ||
| 23 : | * that you have read and understood your obligations described above, | ||
| 24 : | * and agree to abide by those obligations. | ||
| 25 : | * | ||
| 26 : | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
| 27 : | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
| 28 : | * COMPLETENESS OR PERFORMANCE. | ||
| 29 : | * $/LicenseInfo$ | ||
| 30 : | */ | ||
| 31 : | |||
| 32 : | #ifndef LL_LLMANIPTRANSLATE_H | ||
| 33 : | #define LL_LLMANIPTRANSLATE_H | ||
| 34 : | |||
| 35 : | #include "llmanip.h" | ||
| 36 : | #include "lltimer.h" | ||
| 37 : | #include "v4math.h" | ||
| 38 : | #include "llquaternion.h" | ||
| 39 : | |||
| 40 : | class LLManipTranslate : public LLManip | ||
| 41 : | { | ||
| 42 : | public: | ||
| 43 : | class ManipulatorHandle | ||
| 44 : | { | ||
| 45 : | public: | ||
| 46 : | LLVector3 mStartPosition; | ||
| 47 : | LLVector3 mEndPosition; | ||
| 48 : | EManipPart mManipID; | ||
| 49 : | F32 mHotSpotRadius; | ||
| 50 : | |||
| 51 : | ManipulatorHandle(LLVector3 start_pos, LLVector3 end_pos, EManipPart id, F32 radius):mStartPosition(start_pos), mEndPosition(end_pos), mManipID(id), mHotSpotRadius(radius){} | ||
| 52 : | }; | ||
| 53 : | |||
| 54 : | |||
| 55 : | LLManipTranslate( LLToolComposite* composite ); | ||
| 56 : | virtual ~LLManipTranslate(); | ||
| 57 : | |||
| 58 : | static void restoreGL(); | ||
| 59 : | virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); | ||
| 60 : | virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); | ||
| 61 : | virtual BOOL handleHover(S32 x, S32 y, MASK mask); | ||
| 62 : | virtual void render(); | ||
| 63 : | virtual void handleSelect(); | ||
| 64 : | |||
| 65 : | virtual void highlightManipulators(S32 x, S32 y); | ||
| 66 : | virtual BOOL handleMouseDownOnPart(S32 x, S32 y, MASK mask); | ||
| 67 : | virtual BOOL canAffectSelection(); | ||
| 68 : | |||
| 69 : | protected: | ||
| 70 : | enum EHandleType { | ||
| 71 : | HANDLE_CONE, | ||
| 72 : | HANDLE_BOX, | ||
| 73 : | HANDLE_SPHERE | ||
| 74 : | }; | ||
| 75 : | |||
| 76 : | void renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_size, F32 arrow_size, F32 handle_size, BOOL reverse_direction); | ||
| 77 : | void renderTranslationHandles(); | ||
| 78 : | void renderText(); | ||
| 79 : | void renderSnapGuides(); | ||
| 80 : | void renderGrid(F32 x, F32 y, F32 size, F32 r, F32 g, F32 b, F32 a); | ||
| 81 : | void renderGridVert(F32 x_trans, F32 y_trans, F32 r, F32 g, F32 b, F32 alpha); | ||
| 82 : | void highlightIntersection(LLVector3 normal, | ||
| 83 : | LLVector3 selection_center, | ||
| 84 : | LLQuaternion grid_rotation, | ||
| 85 : | LLColor4 inner_color); | ||
| 86 : | F32 getMinGridScale(); | ||
| 87 : | |||
| 88 : | private: | ||
| 89 : | struct compare_manipulators | ||
| 90 : | { | ||
| 91 : | bool operator() (const ManipulatorHandle* const a, const ManipulatorHandle* const b) const | ||
| 92 : | { | ||
| 93 : | if (a->mEndPosition.mV[VZ] != b->mEndPosition.mV[VZ]) | ||
| 94 : | return (a->mEndPosition.mV[VZ] < b->mEndPosition.mV[VZ]); | ||
| 95 : | else | ||
| 96 : | return a->mManipID < b->mManipID; | ||
| 97 : | } | ||
| 98 : | }; | ||
| 99 : | |||
| 100 : | S32 mLastHoverMouseX; | ||
| 101 : | S32 mLastHoverMouseY; | ||
| 102 : | BOOL mSendUpdateOnMouseUp; | ||
| 103 : | BOOL mMouseOutsideSlop; // true after mouse goes outside slop region | ||
| 104 : | BOOL mCopyMadeThisDrag; | ||
| 105 : | S32 mMouseDownX; | ||
| 106 : | S32 mMouseDownY; | ||
| 107 : | F32 mAxisArrowLength; // pixels | ||
| 108 : | F32 mConeSize; // meters, world space | ||
| 109 : | F32 mArrowLengthMeters; // meters | ||
| 110 : | F32 mGridSizeMeters; | ||
| 111 : | F32 mPlaneManipOffsetMeters; | ||
| 112 : | LLVector3 mManipNormal; | ||
| 113 : | LLVector3d mDragCursorStartGlobal; | ||
| 114 : | LLVector3d mDragSelectionStartGlobal; | ||
| 115 : | LLTimer mUpdateTimer; | ||
| 116 : | typedef std::set<ManipulatorHandle*, compare_manipulators> minpulator_list_t; | ||
| 117 : | minpulator_list_t mProjectedManipulators; | ||
| 118 : | LLVector4 mManipulatorVertices[18]; | ||
| 119 : | F32 mSnapOffsetMeters; | ||
| 120 : | LLVector3 mSnapOffsetAxis; | ||
| 121 : | LLQuaternion mGridRotation; | ||
| 122 : | LLVector3 mGridOrigin; | ||
| 123 : | LLVector3 mGridScale; | ||
| 124 : | F32 mSubdivisions; | ||
| 125 : | BOOL mInSnapRegime; | ||
| 126 : | BOOL mSnapped; | ||
| 127 : | LLVector3 mArrowScales; | ||
| 128 : | LLVector3 mPlaneScales; | ||
| 129 : | LLVector4 mPlaneManipPositions; | ||
| 130 : | }; | ||
| 131 : | |||
| 132 : | #endif |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

