00001
00032 #ifndef LL_LLTOOLBRUSH_H
00033 #define LL_LLTOOLBRUSH_H
00034
00035 #include "lltool.h"
00036 #include "v3math.h"
00037 #include "lleditmenuhandler.h"
00038
00039 class LLSurface;
00040 class LLVector3d;
00041 class LLViewerRegion;
00042
00043
00044
00045
00046
00047
00048
00049 class LLToolBrushLand : public LLTool, public LLEditMenuHandler, public LLSingleton<LLToolBrushLand>
00050 {
00051 typedef std::set<LLViewerRegion*> region_list_t;
00052
00053 public:
00054 LLToolBrushLand();
00055
00056
00057 virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
00058 virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
00059 virtual BOOL handleHover( S32 x, S32 y, MASK mask );
00060 virtual void handleSelect();
00061 virtual void handleDeselect();
00062
00063
00064
00065 virtual BOOL isAlwaysRendered() { return TRUE; }
00066
00067
00068 virtual void render();
00069
00070
00071 static void onIdle(void* brush_tool);
00072
00073 void onMouseCaptureLost();
00074
00075 void modifyLandInSelectionGlobal();
00076 virtual void undo();
00077 virtual BOOL canUndo() const { return TRUE; }
00078
00079 protected:
00080 void brush( void );
00081 void modifyLandAtPointGlobal( const LLVector3d &spot, MASK mask );
00082
00083 void determineAffectedRegions(region_list_t& regions,
00084 const LLVector3d& spot) const;
00085 void renderOverlay(LLSurface& land, const LLVector3& pos_region,
00086 const LLVector3& pos_world);
00087
00088
00089 bool canTerraform(LLViewerRegion* regionp) const;
00090
00091
00092 void alertNoTerraform(LLViewerRegion* regionp);
00093
00094 protected:
00095 F32 mStartingZ;
00096 S32 mMouseX;
00097 S32 mMouseY;
00098 S32 mBrushIndex;
00099 BOOL mGotHover;
00100 BOOL mLastShowParcelOwners;
00101 BOOL mBrushSelected;
00102
00103 region_list_t mLastAffectedRegions;
00104 };
00105
00106
00107 #endif // LL_LLTOOLBRUSH_H