diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llmanip.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/llmanip.h')
-rw-r--r-- | linden/indra/newview/llmanip.h | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/linden/indra/newview/llmanip.h b/linden/indra/newview/llmanip.h new file mode 100644 index 0000000..7382bd4 --- /dev/null +++ b/linden/indra/newview/llmanip.h | |||
@@ -0,0 +1,156 @@ | |||
1 | /** | ||
2 | * @file llmanip.h | ||
3 | * @brief LLManip class definition | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_MANIP_H | ||
29 | #define LL_MANIP_H | ||
30 | |||
31 | #include "lltool.h" | ||
32 | //#include "v3math.h" | ||
33 | |||
34 | class LLView; | ||
35 | class LLTextBox; | ||
36 | class LLViewerObject; | ||
37 | class LLToolComposite; | ||
38 | class LLVector3; | ||
39 | |||
40 | const S32 MIN_DIVISION_PIXEL_WIDTH = 9; | ||
41 | |||
42 | class LLManip : public LLTool | ||
43 | { | ||
44 | public: | ||
45 | typedef enum e_manip_part | ||
46 | { | ||
47 | LL_NO_PART = 0, | ||
48 | |||
49 | // Translation | ||
50 | LL_X_ARROW, | ||
51 | LL_Y_ARROW, | ||
52 | LL_Z_ARROW, | ||
53 | |||
54 | LL_YZ_PLANE, | ||
55 | LL_XZ_PLANE, | ||
56 | LL_XY_PLANE, | ||
57 | |||
58 | // Scale | ||
59 | LL_CORNER_NNN, | ||
60 | LL_CORNER_NNP, | ||
61 | LL_CORNER_NPN, | ||
62 | LL_CORNER_NPP, | ||
63 | LL_CORNER_PNN, | ||
64 | LL_CORNER_PNP, | ||
65 | LL_CORNER_PPN, | ||
66 | LL_CORNER_PPP, | ||
67 | |||
68 | // Faces | ||
69 | LL_FACE_POSZ, | ||
70 | LL_FACE_POSX, | ||
71 | LL_FACE_POSY, | ||
72 | LL_FACE_NEGX, | ||
73 | LL_FACE_NEGY, | ||
74 | LL_FACE_NEGZ, | ||
75 | |||
76 | // Edges | ||
77 | LL_EDGE_NEGX_NEGY, | ||
78 | LL_EDGE_NEGX_POSY, | ||
79 | LL_EDGE_POSX_NEGY, | ||
80 | LL_EDGE_POSX_POSY, | ||
81 | |||
82 | LL_EDGE_NEGY_NEGZ, | ||
83 | LL_EDGE_NEGY_POSZ, | ||
84 | LL_EDGE_POSY_NEGZ, | ||
85 | LL_EDGE_POSY_POSZ, | ||
86 | |||
87 | LL_EDGE_NEGZ_NEGX, | ||
88 | LL_EDGE_NEGZ_POSX, | ||
89 | LL_EDGE_POSZ_NEGX, | ||
90 | LL_EDGE_POSZ_POSX, | ||
91 | |||
92 | // Rotation Manip | ||
93 | LL_ROT_GENERAL, | ||
94 | LL_ROT_X, | ||
95 | LL_ROT_Y, | ||
96 | LL_ROT_Z, | ||
97 | LL_ROT_ROLL | ||
98 | } EManipPart; | ||
99 | |||
100 | // For use in loops and range checking. | ||
101 | typedef enum e_select_part_ranges | ||
102 | { | ||
103 | LL_ARROW_MIN = LL_X_ARROW, | ||
104 | LL_ARROW_MAX = LL_Z_ARROW, | ||
105 | |||
106 | LL_CORNER_MIN = LL_CORNER_NNN, | ||
107 | LL_CORNER_MAX = LL_CORNER_PPP, | ||
108 | |||
109 | LL_FACE_MIN = LL_FACE_POSZ, | ||
110 | LL_FACE_MAX = LL_FACE_NEGZ, | ||
111 | |||
112 | LL_EDGE_MIN = LL_EDGE_NEGX_NEGY, | ||
113 | LL_EDGE_MAX = LL_EDGE_POSZ_POSX | ||
114 | } EManipPartRanges; | ||
115 | public: | ||
116 | static void rebuild(LLViewerObject* vobj); | ||
117 | |||
118 | LLManip( const LLString& name, LLToolComposite* composite ); | ||
119 | |||
120 | virtual BOOL handleMouseDownOnPart(S32 x, S32 y, MASK mask) = 0; | ||
121 | void renderGuidelines(BOOL draw_x = TRUE, BOOL draw_y = TRUE, BOOL draw_z = TRUE); | ||
122 | static void renderXYZ(const LLVector3 &vec); | ||
123 | |||
124 | virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) = 0; | ||
125 | /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); | ||
126 | /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); | ||
127 | virtual EManipPart getHighlightedPart() { return LL_NO_PART; } | ||
128 | virtual void highlightManipulators(S32 x, S32 y) {}; | ||
129 | protected: | ||
130 | LLVector3 getSavedPivotPoint() const; | ||
131 | LLVector3 getPivotPoint() const; | ||
132 | void getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3 &normal); | ||
133 | BOOL getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 &axis); | ||
134 | F32 getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing = MIN_DIVISION_PIXEL_WIDTH); | ||
135 | void renderTickValue(const LLVector3& pos, F32 value, const char* suffix, const LLColor4 &color); | ||
136 | void renderTickText(const LLVector3& pos, const char* suffix, const LLColor4 &color); | ||
137 | void updateGridSettings(); | ||
138 | BOOL getMousePointOnPlaneGlobal(LLVector3d& point, S32 x, S32 y, LLVector3d origin, LLVector3 normal); | ||
139 | BOOL getMousePointOnPlaneAgent(LLVector3& point, S32 x, S32 y, LLVector3 origin, LLVector3 normal); | ||
140 | BOOL nearestPointOnLineFromMouse( S32 x, S32 y, const LLVector3& b1, const LLVector3& b2, F32 &a_param, F32 &b_param ) const; | ||
141 | LLColor4 setupSnapGuideRenderPass(S32 pass); | ||
142 | protected: | ||
143 | LLFrameTimer mHelpTextTimer; | ||
144 | BOOL mInSnapRegime; | ||
145 | |||
146 | static F32 sHelpTextVisibleTime; | ||
147 | static F32 sHelpTextFadeTime; | ||
148 | static S32 sNumTimesHelpTextShown; | ||
149 | static S32 sMaxTimesShowHelpText; | ||
150 | static F32 sGridMaxSubdivisionLevel; | ||
151 | static F32 sGridMinSubdivisionLevel; | ||
152 | static LLVector2 sTickLabelSpacing; | ||
153 | }; | ||
154 | |||
155 | |||
156 | #endif | ||