editorTool.h
Engine/source/gui/worldEditor/tools/editorTool.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 _EDITOR_TOOL_ 25#define _EDITOR_TOOL_ 26 27#ifndef _WORLDEDITOR_H_ 28#include "gui/worldEditor/worldEditor.h" 29#endif 30 31class EditorTool : public SimObject 32{ 33 typedef SimObject Parent; 34 35protected: 36 WorldEditor* mWorldEditor; 37 bool mUseMouseDown; 38 bool mUseMouseUp; 39 bool mUseMouseMove; 40 41 bool mUseRightMouseDown; 42 bool mUseRightMouseUp; 43 bool mUseRightMouseMove; 44 45 bool mUseMiddleMouseDown; 46 bool mUseMiddleMouseUp; 47 bool mUseMiddleMouseMove; 48 49 bool mUseKeyInput; 50 51public: 52 EditorTool(); 53 ~EditorTool(){} 54 55 DECLARE_CONOBJECT(EditorTool); 56 57 bool onAdd(); 58 void onRemove(); 59 60 //Called when the tool is activated on the World Editor 61 virtual void onActivated(WorldEditor*); 62 63 //Called when the tool is deactivated on the World Editor 64 virtual void onDeactivated(); 65 66 // 67 virtual bool onMouseMove(const Gui3DMouseEvent &); 68 virtual bool onMouseDown(const Gui3DMouseEvent &); 69 virtual bool onMouseDragged(const Gui3DMouseEvent &); 70 virtual bool onMouseUp(const Gui3DMouseEvent &); 71 72 // 73 virtual bool onRightMouseDown(const Gui3DMouseEvent &); 74 virtual bool onRightMouseDragged(const Gui3DMouseEvent &); 75 virtual bool onRightMouseUp(const Gui3DMouseEvent &); 76 77 // 78 virtual bool onMiddleMouseDown(const Gui3DMouseEvent &); 79 virtual bool onMiddleMouseDragged(const Gui3DMouseEvent &); 80 virtual bool onMiddleMouseUp(const Gui3DMouseEvent &); 81 82 // 83 virtual bool onInputEvent(const InputEventInfo &); 84 85 // 86 virtual void render(){} 87}; 88 89#endif 90