aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llnetmap.h
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llnetmap.h
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/newview/llnetmap.h')
-rw-r--r--linden/indra/newview/llnetmap.h89
1 files changed, 57 insertions, 32 deletions
diff --git a/linden/indra/newview/llnetmap.h b/linden/indra/newview/llnetmap.h
index d6fddc5..a5bf9f0 100644
--- a/linden/indra/newview/llnetmap.h
+++ b/linden/indra/newview/llnetmap.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 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 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 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -32,59 +33,55 @@
32#ifndef LL_LLNETMAP_H 33#ifndef LL_LLNETMAP_H
33#define LL_LLNETMAP_H 34#define LL_LLNETMAP_H
34 35
35#include "llmath.h" 36#include "llpanel.h"
36#include "lluictrl.h" 37#include "llmemberlistener.h"
37#include "v3math.h" 38#include "v3math.h"
38#include "v3dmath.h" 39#include "v3dmath.h"
39#include "v4color.h" 40#include "v4color.h"
40#include "llimage.h" 41#include "llimage.h"
41#include "llimagegl.h" 42#include "llimagegl.h"
42 43
43class LLColor4U; 44
44class LLCoordGL;
45class LLTextBox; 45class LLTextBox;
46class LLMenuGL;
47 46
48class LLNetMap : public LLUICtrl 47class LLNetMap : public LLPanel
49{ 48{
50public: 49public:
51 LLNetMap(const std::string& name, const LLRect& rect, const LLColor4& bg_color ); 50 LLNetMap(const std::string& name);
52 virtual ~LLNetMap(); 51 virtual ~LLNetMap();
53 52
54 virtual void draw(); 53 virtual void draw();
54 virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
55 virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); 55 virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
56 virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); 56 virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
57 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 57 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
58 virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ); 58 virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen );
59 59
60 void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius );
61
62private:
63
60 void setScale( F32 scale ); 64 void setScale( F32 scale );
65
66 // *TODO: Enable panning of the mini-map
61 void translatePan( F32 delta_x, F32 delta_y ); 67 void translatePan( F32 delta_x, F32 delta_y );
62 void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; } 68 void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; }
63 69
64 const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; }
65 void renderPoint(const LLVector3 &pos, const LLColor4U &color, 70 void renderPoint(const LLVector3 &pos, const LLColor4U &color,
66 S32 diameter, S32 relative_height = 0); 71 S32 diameter, S32 relative_height = 0);
67 void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); 72 LLVector3 globalPosToView(const LLVector3d& global_pos, BOOL rotated);
68 73 LLVector3d viewPosToGlobal(S32 x,S32 y, BOOL rotated);
69 LLVector3 globalPosToView(const LLVector3d& global_pos);
70 LLVector3d viewPosToGlobal(S32 x,S32 y);
71 74
72 static void setRotateMap( BOOL b ) { LLNetMap::sRotateMap = b; } 75 void drawTracking( const LLVector3d& pos_global,
73 static void handleZoomLevel(void* which); 76 BOOL rotated,
77 const LLColor4& color,
78 BOOL draw_arrow = TRUE);
74 79
75 void drawTracking( const LLVector3d& pos_global,
76 const LLColor4& color,
77 BOOL draw_arrow = TRUE);
78
79protected:
80 void setDirectionPos( LLTextBox* text_box, F32 rotation ); 80 void setDirectionPos( LLTextBox* text_box, F32 rotation );
81 void updateMinorDirections();
81 void createObjectImage(); 82 void createObjectImage();
82 static void teleport( const LLVector3d& destination );
83 static void fly( const LLVector3d& destination );
84 83
85public:
86 LLHandle<LLView> mPopupMenuHandle; 84 LLHandle<LLView> mPopupMenuHandle;
87 LLColor4 mBackgroundColor;
88 85
89 F32 mScale; // Size of a region in pixels 86 F32 mScale; // Size of a region in pixels
90 F32 mPixelsPerMeter; // world meters to map pixels 87 F32 mPixelsPerMeter; // world meters to map pixels
@@ -98,18 +95,46 @@ public:
98 LLVector3d mObjectImageCenterGlobal; 95 LLVector3d mObjectImageCenterGlobal;
99 LLPointer<LLImageRaw> mObjectRawImagep; 96 LLPointer<LLImageRaw> mObjectRawImagep;
100 LLPointer<LLImageGL> mObjectImagep; 97 LLPointer<LLImageGL> mObjectImagep;
101 LLTextBox* mTextBoxEast;
102 LLTextBox* mTextBoxNorth;
103 LLTextBox* mTextBoxWest;
104 LLTextBox* mTextBoxSouth;
105 98
106 LLTextBox* mTextBoxSouthEast; 99private:
107 LLTextBox* mTextBoxNorthEast; 100 LLUUID mClosestAgentToCursor;
108 LLTextBox* mTextBoxNorthWest; 101 LLUUID mClosestAgentAtLastRightClick;
109 LLTextBox* mTextBoxSouthWest;
110 102
111 static BOOL sRotateMap; 103 static BOOL sRotateMap;
112 static LLNetMap* sInstance; 104 static LLNetMap* sInstance;
105 static BOOL isAgentUnderCursor(void*) { return sInstance && sInstance->mClosestAgentToCursor.notNull(); }
106 static void showAgentProfile(void*);
107 BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); }
108
109 class LLScaleMap : public LLMemberListener<LLNetMap>
110 {
111 public:
112 /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
113 };
114
115 class LLStopTracking : public LLMemberListener<LLNetMap>
116 {
117 public:
118 /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
119 };
120
121 class LLEnableTracking : public LLMemberListener<LLNetMap>
122 {
123 public:
124 /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
125 };
126
127 class LLShowAgentProfile : public LLMemberListener<LLNetMap>
128 {
129 public:
130 /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
131 };
132
133 class LLEnableProfile : public LLMemberListener<LLNetMap>
134 {
135 public:
136 /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
137 };
113}; 138};
114 139
115 140