diff options
Diffstat (limited to 'linden/indra/newview/llnetmap.h')
-rw-r--r-- | linden/indra/newview/llnetmap.h | 126 |
1 files changed, 91 insertions, 35 deletions
diff --git a/linden/indra/newview/llnetmap.h b/linden/indra/newview/llnetmap.h index 91027c5..ef046d8 100644 --- a/linden/indra/newview/llnetmap.h +++ b/linden/indra/newview/llnetmap.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -32,63 +32,64 @@ | |||
32 | #ifndef LL_LLNETMAP_H | 32 | #ifndef LL_LLNETMAP_H |
33 | #define LL_LLNETMAP_H | 33 | #define LL_LLNETMAP_H |
34 | 34 | ||
35 | #include "llmath.h" | 35 | #include "llpanel.h" |
36 | #include "lluictrl.h" | 36 | #include "llmemberlistener.h" |
37 | #include "v3math.h" | 37 | #include "v3math.h" |
38 | #include "v3dmath.h" | 38 | #include "v3dmath.h" |
39 | #include "v4color.h" | 39 | #include "v4color.h" |
40 | #include "llimage.h" | 40 | #include "llimage.h" |
41 | #include "llimagegl.h" | 41 | #include "llimagegl.h" |
42 | 42 | ||
43 | class LLColor4U; | ||
44 | class LLCoordGL; | ||
45 | class LLTextBox; | 43 | class LLTextBox; |
46 | class LLMenuGL; | ||
47 | 44 | ||
48 | class LLNetMap : public LLUICtrl | 45 | typedef enum e_minimap_center |
46 | { | ||
47 | MAP_CENTER_NONE = 0, | ||
48 | MAP_CENTER_CAMERA = 1 | ||
49 | } EMiniMapCenter; | ||
50 | |||
51 | class LLNetMap : public LLPanel | ||
49 | { | 52 | { |
50 | public: | 53 | public: |
51 | LLNetMap(const std::string& name, const LLRect& rect, const LLColor4& bg_color ); | 54 | LLNetMap(const std::string& name); |
52 | virtual ~LLNetMap(); | 55 | virtual ~LLNetMap(); |
53 | 56 | ||
54 | virtual void draw(); | 57 | virtual void draw(); |
58 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); | ||
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 ); | ||
55 | virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); | 62 | virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); |
56 | virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); | 63 | virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); |
57 | virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); | 64 | virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); |
58 | virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ); | 65 | virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ); |
59 | 66 | ||
67 | void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); | ||
68 | |||
69 | private: | ||
70 | |||
60 | void setScale( F32 scale ); | 71 | void setScale( F32 scale ); |
72 | |||
73 | // Not used at present | ||
61 | void translatePan( F32 delta_x, F32 delta_y ); | 74 | void translatePan( F32 delta_x, F32 delta_y ); |
62 | void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; } | 75 | void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; } |
63 | 76 | ||
64 | const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; } | ||
65 | void renderPoint(const LLVector3 &pos, const LLColor4U &color, | 77 | void renderPoint(const LLVector3 &pos, const LLColor4U &color, |
66 | S32 diameter, S32 relative_height = 0); | 78 | S32 diameter, S32 relative_height = 0); |
67 | void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); | 79 | LLVector3 globalPosToView(const LLVector3d& global_pos, BOOL rotated); |
80 | LLVector3d viewPosToGlobal(S32 x,S32 y, BOOL rotated); | ||
68 | 81 | ||
69 | LLVector3 globalPosToView(const LLVector3d& global_pos); | 82 | void drawTracking( const LLVector3d& pos_global, |
70 | LLVector3d viewPosToGlobal(S32 x,S32 y); | 83 | BOOL rotated, |
84 | const LLColor4& color, | ||
85 | BOOL draw_arrow = TRUE); | ||
71 | 86 | ||
72 | static void setRotateMap( BOOL b ) { LLNetMap::sRotateMap = b; } | ||
73 | static void handleZoomLevel(void* which); | ||
74 | |||
75 | void drawTracking( const LLVector3d& pos_global, | ||
76 | const LLColor4& color, | ||
77 | BOOL draw_arrow = TRUE); | ||
78 | |||
79 | protected: | ||
80 | void setDirectionPos( LLTextBox* text_box, F32 rotation ); | 87 | void setDirectionPos( LLTextBox* text_box, F32 rotation ); |
88 | void updateMinorDirections(); | ||
81 | void createObjectImage(); | 89 | void createObjectImage(); |
82 | static void teleport( const LLVector3d& destination ); | ||
83 | static void fly( const LLVector3d& destination ); | ||
84 | 90 | ||
85 | public: | ||
86 | LLHandle<LLView> mPopupMenuHandle; | 91 | LLHandle<LLView> mPopupMenuHandle; |
87 | 92 | ||
88 | LLColor4 mBackgroundColor; | ||
89 | LLColor4 glyph_color_avatar; | ||
90 | LLColor4 glyph_color_friend; | ||
91 | |||
92 | F32 mScale; // Size of a region in pixels | 93 | F32 mScale; // Size of a region in pixels |
93 | F32 mPixelsPerMeter; // world meters to map pixels | 94 | F32 mPixelsPerMeter; // world meters to map pixels |
94 | F32 mObjectMapTPM; // texels per meter on map | 95 | F32 mObjectMapTPM; // texels per meter on map |
@@ -97,22 +98,77 @@ public: | |||
97 | F32 mTargetPanY; | 98 | F32 mTargetPanY; |
98 | F32 mCurPanX; | 99 | F32 mCurPanX; |
99 | F32 mCurPanY; | 100 | F32 mCurPanY; |
101 | |||
102 | BOOL mPanning; // map has been dragged | ||
103 | S32 mMouseDownPanX; // value at start of drag | ||
104 | S32 mMouseDownPanY; // value at start of drag | ||
105 | S32 mMouseDownX; | ||
106 | S32 mMouseDownY; | ||
107 | |||
100 | BOOL mUpdateNow; | 108 | BOOL mUpdateNow; |
101 | LLVector3d mObjectImageCenterGlobal; | 109 | LLVector3d mObjectImageCenterGlobal; |
102 | LLPointer<LLImageRaw> mObjectRawImagep; | 110 | LLPointer<LLImageRaw> mObjectRawImagep; |
103 | LLPointer<LLImageGL> mObjectImagep; | 111 | LLPointer<LLImageGL> mObjectImagep; |
104 | LLTextBox* mTextBoxEast; | ||
105 | LLTextBox* mTextBoxNorth; | ||
106 | LLTextBox* mTextBoxWest; | ||
107 | LLTextBox* mTextBoxSouth; | ||
108 | 112 | ||
109 | LLTextBox* mTextBoxSouthEast; | 113 | private: |
110 | LLTextBox* mTextBoxNorthEast; | 114 | LLUUID mClosestAgentToCursor; |
111 | LLTextBox* mTextBoxNorthWest; | 115 | LLUUID mClosestAgentAtLastRightClick; |
112 | LLTextBox* mTextBoxSouthWest; | ||
113 | 116 | ||
114 | static BOOL sRotateMap; | 117 | static BOOL sRotateMap; |
115 | static LLNetMap* sInstance; | 118 | static LLNetMap* sInstance; |
119 | static BOOL isAgentUnderCursor(void*) { return sInstance && sInstance->mClosestAgentToCursor.notNull(); } | ||
120 | static BOOL outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y); | ||
121 | |||
122 | static void showAgentProfile(void*); | ||
123 | BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); } | ||
124 | |||
125 | class LLScaleMap : public LLMemberListener<LLNetMap> | ||
126 | { | ||
127 | public: | ||
128 | /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); | ||
129 | }; | ||
130 | |||
131 | class LLCenterMap : public LLMemberListener<LLNetMap> | ||
132 | { | ||
133 | public: | ||
134 | /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); | ||
135 | }; | ||
136 | |||
137 | class LLCheckCenterMap : public LLMemberListener<LLNetMap> | ||
138 | { | ||
139 | public: | ||
140 | /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); | ||
141 | }; | ||
142 | |||
143 | class LLShowWorldMap : public LLMemberListener<LLNetMap> | ||
144 | { | ||
145 | public: | ||
146 | /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); | ||
147 | }; | ||
148 | |||
149 | class LLStopTracking : public LLMemberListener<LLNetMap> | ||
150 | { | ||
151 | public: | ||
152 | /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); | ||
153 | }; | ||
154 | |||
155 | class LLEnableTracking : public LLMemberListener<LLNetMap> | ||
156 | { | ||
157 | public: | ||
158 | /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); | ||
159 | }; | ||
160 | |||
161 | class LLShowAgentProfile : public LLMemberListener<LLNetMap> | ||
162 | { | ||
163 | public: | ||
164 | /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); | ||
165 | }; | ||
166 | |||
167 | class LLEnableProfile : public LLMemberListener<LLNetMap> | ||
168 | { | ||
169 | public: | ||
170 | /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); | ||
171 | }; | ||
116 | }; | 172 | }; |
117 | 173 | ||
118 | 174 | ||