forestTool.cpp

Engine/source/forest/editor/forestTool.cpp

More...

Public Functions

ConsoleDocClass(ForestTool , "@brief Base class <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/class/classforest/">Forest</a> Editor specific <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tools\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )

Detailed Description

Public Functions

ConsoleDocClass(ForestTool , "@brief Base class <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/class/classforest/">Forest</a> Editor specific <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tools\n\n</a>" "Editor use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">only.\n\n</a>" "@internal" )

IMPLEMENT_CONOBJECT(ForestTool )

 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#include "platform/platform.h"
25#include "forest/editor/forestTool.h"
26#include "forest/editor/forestEditorCtrl.h"
27
28#include "forest/forestDataFile.h"
29#include "forest/forestCell.h"
30
31#include "util/undo.h"
32#include "math/mMath.h"
33#include "math/mathUtils.h"
34
35
36IMPLEMENT_CONOBJECT( ForestTool );
37
38ConsoleDocClass( ForestTool,
39   "@brief Base class for Forest Editor specific tools\n\n"
40   "Editor use only.\n\n"
41   "@internal"
42);
43
44ForestTool::ForestTool()
45   : mForest( NULL ),
46     mEditor( NULL )
47{   
48}
49
50ForestTool::~ForestTool()
51{
52}
53
54void ForestTool::_submitUndo( UndoAction *action )
55{
56   AssertFatal( action, "ForestTool::_submitUndo() - No undo action!" );
57
58   // Grab the mission editor undo manager.
59   UndoManager *undoMan = NULL;
60   if ( !Sim::findObject( "EUndoManager", undoMan ) )
61   {
62      Con::errorf( "ForestTool::_submitUndo() - EUndoManager not found!" );
63      return;     
64   }
65
66   undoMan->addAction( action );
67
68   mEditor->updateCollision();
69}
70