00001 00032 #ifndef LL_TOOLPLACER_H 00033 #define LL_TOOLPLACER_H 00034 00035 #include "llprimitive.h" 00036 #include "llpanel.h" 00037 #include "lltool.h" 00038 00039 class LLButton; 00040 00042 // LLToolPlacer 00043 00044 class LLToolPlacer 00045 : public LLTool 00046 { 00047 public: 00048 LLToolPlacer(); 00049 00050 virtual BOOL placeObject(S32 x, S32 y, MASK mask); 00051 virtual BOOL handleHover(S32 x, S32 y, MASK mask); 00052 virtual void handleSelect(); // do stuff when your tool is selected 00053 virtual void handleDeselect(); // clean up when your tool is deselected 00054 00055 static void setObjectType( LLPCode type ) { sObjectType = type; } 00056 static LLPCode getObjectType() { return sObjectType; } 00057 00058 protected: 00059 static LLPCode sObjectType; 00060 }; 00061 00063 // LLToolPlacerPanel 00064 00065 00066 const S32 TOOL_PLACER_NUM_BUTTONS = 14; 00067 00068 00069 class LLToolPlacerPanel : public LLPanel 00070 { 00071 public: 00072 00073 LLToolPlacerPanel(const std::string& name, const LLRect& rect); 00074 00075 static void setObjectType( void* data ); 00076 00077 static LLPCode sCube; 00078 static LLPCode sPrism; 00079 static LLPCode sPyramid; 00080 static LLPCode sTetrahedron; 00081 static LLPCode sCylinder; 00082 static LLPCode sCylinderHemi; 00083 static LLPCode sCone; 00084 static LLPCode sConeHemi; 00085 static LLPCode sTorus; 00086 static LLPCode sSquareTorus; 00087 static LLPCode sTriangleTorus; 00088 static LLPCode sSphere; 00089 static LLPCode sSphereHemi; 00090 static LLPCode sTree; 00091 static LLPCode sGrass; 00092 00093 private: 00094 void addButton( const LLString& up_state, const LLString& down_state, LLPCode* pcode ); 00095 00096 private: 00097 static S32 sButtonsAdded; 00098 static LLButton* sButtons[ TOOL_PLACER_NUM_BUTTONS ]; 00099 }; 00100 00101 #endif