00001
00032 #ifndef LL_LLNETMAP_H
00033 #define LL_LLNETMAP_H
00034
00035 #include "llmath.h"
00036 #include "lluictrl.h"
00037 #include "v3math.h"
00038 #include "v3dmath.h"
00039 #include "v4color.h"
00040 #include "llimage.h"
00041 #include "llimagegl.h"
00042
00043 class LLColor4U;
00044 class LLCoordGL;
00045 class LLTextBox;
00046 class LLMenuGL;
00047
00048 class LLNetMap : public LLUICtrl
00049 {
00050 public:
00051 LLNetMap(const std::string& name, const LLRect& rect, const LLColor4& bg_color );
00052 virtual ~LLNetMap();
00053
00054 virtual void draw();
00055 virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
00056 virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
00057 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
00058 virtual BOOL handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen );
00059
00060 void setScale( F32 scale );
00061 void translatePan( F32 delta_x, F32 delta_y );
00062 void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; }
00063
00064 const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; }
00065 void renderPoint(const LLVector3 &pos, const LLColor4U &color,
00066 S32 diameter, S32 relative_height = 0);
00067 void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius );
00068
00069 LLVector3 globalPosToView(const LLVector3d& global_pos);
00070 LLVector3d viewPosToGlobal(S32 x,S32 y);
00071
00072 static void setRotateMap( BOOL b ) { LLNetMap::sRotateMap = b; }
00073 static void handleZoomLevel(void* which);
00074
00075 void drawTracking( const LLVector3d& pos_global,
00076 const LLColor4& color,
00077 BOOL draw_arrow = TRUE);
00078
00079 protected:
00080 void setDirectionPos( LLTextBox* text_box, F32 rotation );
00081 void createObjectImage();
00082 static void teleport( const LLVector3d& destination );
00083 static void fly( const LLVector3d& destination );
00084
00085 public:
00086 LLHandle<LLView> mPopupMenuHandle;
00087 LLColor4 mBackgroundColor;
00088
00089 F32 mScale;
00090 F32 mPixelsPerMeter;
00091 F32 mObjectMapTPM;
00092 F32 mObjectMapPixels;
00093 F32 mTargetPanX;
00094 F32 mTargetPanY;
00095 F32 mCurPanX;
00096 F32 mCurPanY;
00097 BOOL mUpdateNow;
00098 LLVector3d mObjectImageCenterGlobal;
00099 LLPointer<LLImageRaw> mObjectRawImagep;
00100 LLPointer<LLImageGL> mObjectImagep;
00101 LLTextBox* mTextBoxEast;
00102 LLTextBox* mTextBoxNorth;
00103 LLTextBox* mTextBoxWest;
00104 LLTextBox* mTextBoxSouth;
00105
00106 LLTextBox* mTextBoxSouthEast;
00107 LLTextBox* mTextBoxNorthEast;
00108 LLTextBox* mTextBoxNorthWest;
00109 LLTextBox* mTextBoxSouthWest;
00110
00111 static BOOL sRotateMap;
00112 static LLNetMap* sInstance;
00113 };
00114
00115
00116 #endif