summaryrefslogtreecommitdiff
path: root/indra/newview/llnetmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llnetmap.h')
-rw-r--r--indra/newview/llnetmap.h110
1 files changed, 44 insertions, 66 deletions
diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h
index 9fbd5097fd..a673ea3f57 100644
--- a/indra/newview/llnetmap.h
+++ b/indra/newview/llnetmap.h
@@ -33,55 +33,67 @@
#ifndef LL_LLNETMAP_H
#define LL_LLNETMAP_H
-#include "llpanel.h"
-#include "llmemberlistener.h"
+#include "llmath.h"
+#include "lluictrl.h"
#include "v3math.h"
#include "v3dmath.h"
#include "v4color.h"
#include "llimage.h"
-#include "llimagegl.h"
-
+class LLColor4U;
+class LLCoordGL;
class LLTextBox;
+class LLViewerTexture ;
-class LLNetMap : public LLPanel
+class LLNetMap : public LLUICtrl
{
public:
- LLNetMap(const std::string& name);
- virtual ~LLNetMap();
+ struct Params
+ : public LLInitParam::Block<Params, LLUICtrl::Params>
+ {
+ Optional<LLUIColor> bg_color;
- virtual void draw();
- virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
- virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
- virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
- virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
- virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen );
+ Params()
+ : bg_color("bg_color")
+ {}
+ };
- void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius );
+protected:
+ LLNetMap (const Params & p);
+ friend class LLUICtrlFactory;
-private:
+public:
+ virtual ~LLNetMap();
+ /*virtual*/ void draw();
+ /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
+ /*virtual*/ BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen );
+
void setScale( F32 scale );
-
- // *TODO: Enable panning of the mini-map
+ void setRotateMap( BOOL b ) { mRotateMap = b; }
+ void setToolTipMsg(const std::string& msg) { mToolTipMsg = msg; }
+ BOOL getRotateMap( ) { return mRotateMap; }
+ void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius );
+
+private:
void translatePan( F32 delta_x, F32 delta_y );
void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; }
- void renderPoint(const LLVector3 &pos, const LLColor4U &color,
- S32 diameter, S32 relative_height = 0);
- LLVector3 globalPosToView(const LLVector3d& global_pos, BOOL rotated);
- LLVector3d viewPosToGlobal(S32 x,S32 y, BOOL rotated);
+ const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; }
+ void renderPoint(const LLVector3 &pos, const LLColor4U &color,
+ S32 diameter, S32 relative_height = 0);
- void drawTracking( const LLVector3d& pos_global,
- BOOL rotated,
- const LLColor4& color,
- BOOL draw_arrow = TRUE);
+ LLVector3 globalPosToView(const LLVector3d& global_pos);
+ LLVector3d viewPosToGlobal(S32 x,S32 y);
- void setDirectionPos( LLTextBox* text_box, F32 rotation );
- void updateMinorDirections();
- void createObjectImage();
+ void drawTracking( const LLVector3d& pos_global,
+ const LLColor4& color,
+ BOOL draw_arrow = TRUE);
- LLHandle<LLView> mPopupMenuHandle;
+ void createObjectImage();
+
+private:
+ LLUIColor mBackgroundColor;
F32 mScale; // Size of a region in pixels
F32 mPixelsPerMeter; // world meters to map pixels
@@ -94,47 +106,13 @@ private:
BOOL mUpdateNow;
LLVector3d mObjectImageCenterGlobal;
LLPointer<LLImageRaw> mObjectRawImagep;
- LLPointer<LLImageGL> mObjectImagep;
+ LLPointer<LLViewerTexture> mObjectImagep;
-private:
LLUUID mClosestAgentToCursor;
LLUUID mClosestAgentAtLastRightClick;
- static BOOL sRotateMap;
- static LLNetMap* sInstance;
- static BOOL isAgentUnderCursor(void*) { return sInstance && sInstance->mClosestAgentToCursor.notNull(); }
- static void showAgentProfile(void*);
- BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); }
-
- class LLScaleMap : public LLMemberListener<LLNetMap>
- {
- public:
- /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
- };
-
- class LLStopTracking : public LLMemberListener<LLNetMap>
- {
- public:
- /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
- };
-
- class LLEnableTracking : public LLMemberListener<LLNetMap>
- {
- public:
- /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
- };
-
- class LLShowAgentProfile : public LLMemberListener<LLNetMap>
- {
- public:
- /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
- };
-
- class LLEnableProfile : public LLMemberListener<LLNetMap>
- {
- public:
- /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
- };
+ BOOL mRotateMap;
+ std::string mToolTipMsg;
};