forestTool.h
Engine/source/forest/editor/forestTool.h
Classes:
class
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _FOREST_EDITOR_TOOL_H_ 25#define _FOREST_EDITOR_TOOL_H_ 26 27#ifndef _FORESTITEM_H_ 28#include "forest/forestItem.h" 29#endif 30#ifndef _SIMBASE_H_ 31#include "console/simBase.h" 32#endif 33#ifndef _GUITYPES_H_ 34#include "gui/core/guiTypes.h" 35#endif 36 37class Forest; 38class ForestEditorCtrl; 39class ForestData; 40class UndoAction; 41class GuiTSCtrl; 42class Point3F; 43struct Gui3DMouseEvent; 44 45 46class ForestTool : public SimObject 47{ 48 typedef SimObject Parent; 49 50 protected: 51 52 SimObjectPtr<Forest> mForest; 53 ForestEditorCtrl *mEditor; 54 55 void _submitUndo( UndoAction *action ); 56 57 public: 58 59 ForestTool(); 60 virtual ~ForestTool(); 61 62 DECLARE_CONOBJECT( ForestTool ); 63 64 virtual void setActiveForest( Forest *forest ) { mForest = forest; } 65 virtual void setParentEditor( ForestEditorCtrl *editor ) { mEditor = editor; } 66 67 virtual void onActivated( const Gui3DMouseEvent &lastEvent ) {} 68 virtual void onDeactivated() {} 69 70 virtual void on3DMouseDown( const Gui3DMouseEvent &evt ) {} 71 virtual void on3DMouseUp( const Gui3DMouseEvent &evt ) {} 72 virtual void on3DMouseMove( const Gui3DMouseEvent &evt ) {} 73 virtual void on3DMouseDragged( const Gui3DMouseEvent &evt ) {} 74 virtual void on3DMouseEnter( const Gui3DMouseEvent &evt ) {} 75 virtual void on3DMouseLeave( const Gui3DMouseEvent &evt ) {} 76 virtual bool onMouseWheel( const GuiEvent &evt ) { return false; } 77 virtual void onRender3D() {} 78 virtual void onRender2D() {} 79 virtual void updateGizmo() {} 80 virtual bool updateGuiInfo() { return false; } 81 virtual void onUndoAction() {} 82}; 83 84 85#endif // _FOREST_EDITOR_TOOL_H_ 86 87 88 89