Skip to content

Commit 9276feb

Browse files
committed
Undo system cleanup
1 parent 61e3348 commit 9276feb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+450
-487
lines changed

Editor/Frame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "CommandQueue.h"
55
#include "Foundation/Memory/SmartPtr.h"
66

7-
#include "Foundation/Undo/Queue.h"
7+
#include "Foundation/Undo/UndoQueue.h"
88

99
#include <wx/timer.h>
1010

Editor/HierarchyOutliner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void HierarchyOutliner::OnEndDrag( wxTreeEvent& args )
230230
SceneGraph::HierarchyNode* newParent = GetTreeItemData( dropItem )->GetHierarchyNode();
231231
HELIUM_ASSERT( newParent );
232232

233-
Undo::BatchCommandPtr batch = new Undo::BatchCommand ();
233+
BatchUndoCommandPtr batch = new BatchUndoCommand ();
234234

235235
const OS_SceneNodeDumbPtr& selection = m_CurrentScene->GetSelection().GetItems();
236236
OS_SceneNodeDumbPtr::Iterator selItr = selection.Begin();

Editor/LayersPanel.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void LayersPanel::LayerSelectedItems( bool addToLayer )
283283
if ( selectedNodes.Size() > 0 && selectedRows.size() > 0 )
284284
{
285285
//Log::Debug( "LayerSelectedItems\n" );
286-
Undo::BatchCommandPtr batch = new Undo::BatchCommand ();
286+
BatchUndoCommandPtr batch = new BatchUndoCommand ();
287287

288288
OS_SceneNodeDumbPtr::Iterator nodeItr = selectedNodes.Begin();
289289
OS_SceneNodeDumbPtr::Iterator nodeEnd = selectedNodes.End();
@@ -401,7 +401,7 @@ void LayersPanel::OnNewLayer( wxCommandEvent& event )
401401
LayerPtr layer = new Layer();
402402
layer->SetOwner( m_Scene );
403403
layer->Initialize();
404-
m_Scene->Push( new SceneNodeExistenceCommand( Undo::ExistenceActions::Add, m_Scene, layer ) );
404+
m_Scene->Push( new SceneNodeExistenceCommand( ExistenceActions::Add, m_Scene, layer ) );
405405
m_Scene->Execute( false );
406406
}
407407
}
@@ -418,15 +418,15 @@ void LayersPanel::OnNewLayerFromSelection( wxCommandEvent& dummyEvt )
418418
return;
419419
}
420420

421-
Undo::BatchCommandPtr batch = new Undo::BatchCommand ();
421+
BatchUndoCommandPtr batch = new BatchUndoCommand ();
422422
LayerPtr layer = new Layer();
423423
layer->SetOwner( m_Scene );
424424
layer->Initialize();
425425

426426
// Generate a name for this layer
427427
GenerateLayerName(layer);
428428

429-
batch->Push( new SceneNodeExistenceCommand( Undo::ExistenceActions::Add, m_Scene, layer ) );
429+
batch->Push( new SceneNodeExistenceCommand( ExistenceActions::Add, m_Scene, layer ) );
430430

431431
// Step 2: add all the selected items to the layer
432432
const OS_SceneNodeDumbPtr& selection = m_Scene->GetSelection().GetItems();
@@ -471,7 +471,7 @@ void LayersPanel::DeleteSelectedLayers()
471471
LayerSelectedItems( false );
472472

473473
// Begin undo batch
474-
Undo::BatchCommandPtr batch = new Undo::BatchCommand ();
474+
BatchUndoCommandPtr batch = new BatchUndoCommand ();
475475

476476
// Get an ordered list of the selected rows, and traverse the list in reverse order.
477477
// This makes sure that removing an item doesn't change the row number of another
@@ -510,7 +510,7 @@ void LayersPanel::DeleteSelectedLayers()
510510
}
511511

512512
// Push the command to delete the layer
513-
batch->Push( new SceneNodeExistenceCommand( Undo::ExistenceActions::Remove, m_Scene, layer ) );
513+
batch->Push( new SceneNodeExistenceCommand( ExistenceActions::Remove, m_Scene, layer ) );
514514
}
515515
}
516516

@@ -782,7 +782,7 @@ void LayersPanel::RowRenamed( const GridRowRenamedArgs& args )
782782
if ( found != m_Layers.end() )
783783
{
784784
Layer* layer = found->second;
785-
layer->GetOwner()->Push( new Undo::PropertyCommand< tstring >( new Helium::MemberProperty< Layer, tstring >( layer, &Layer::GetName, &Layer::SetGivenName ), args.m_NewName ) );
785+
layer->GetOwner()->Push( new PropertyUndoCommand< tstring >( new Helium::MemberProperty< Layer, tstring >( layer, &Layer::GetName, &Layer::SetGivenName ), args.m_NewName ) );
786786
}
787787
}
788788

Editor/MainFrame.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ void MainFrame::OnViewVisibleChange(wxCommandEvent& event)
12611261
{
12621262
if ( m_SceneManager.HasCurrentScene() )
12631263
{
1264-
Undo::BatchCommandPtr batch = new Undo::BatchCommand ();
1264+
BatchUndoCommandPtr batch = new BatchUndoCommand ();
12651265

12661266
switch ( event.GetId() )
12671267
{
@@ -1463,7 +1463,7 @@ void MainFrame::OnExport(wxCommandEvent& event)
14631463
SceneStatusChanged( str.str() );
14641464
}
14651465

1466-
Undo::BatchCommandPtr changes = new Undo::BatchCommand();
1466+
BatchUndoCommandPtr changes = new BatchUndoCommand();
14671467

14681468
std::vector< Reflect::ObjectPtr > elements;
14691469
bool result = m_SceneManager.GetCurrentScene()->Export( elements, args, changes );
@@ -2389,7 +2389,7 @@ bool MainFrame::Paste( SceneGraph::Scene* scene )
23892389
if ( !xml.empty() )
23902390
{
23912391
// Create a batch to add the objects to the scene
2392-
Undo::BatchCommandPtr batch = new Undo::BatchCommand ();
2392+
BatchUndoCommandPtr batch = new BatchUndoCommand ();
23932393

23942394
// Import the data as children of the paste root
23952395
batch->Push( scene->ImportXML( xml, ImportFlags::Select ) );

Editor/SceneOutliner.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#include "EditorPch.h"
22
#include "Editor/SceneOutliner.h"
3+
4+
#include "Foundation/Undo/UndoCommand.h"
35
#include "SceneGraph/Scene.h"
46
#include "SceneGraph/SceneManager.h"
5-
#include "Foundation/Undo/PropertyCommand.h"
67

78
using namespace Helium;
89
using namespace Helium::Editor;
@@ -458,7 +459,7 @@ void SceneOutliner::OnEndLabelEdit( wxTreeEvent& args )
458459
if ( node->GetName() != newName )
459460
{
460461
// Create an undoable command to rename the object
461-
m_CurrentScene->Push( new Undo::PropertyCommand<tstring>( new Helium::MemberProperty<SceneGraph::SceneNode, tstring> (node, &SceneGraph::SceneNode::GetName, &SceneGraph::SceneNode::SetGivenName), newName) );
462+
m_CurrentScene->Push( new PropertyUndoCommand<tstring>( new Helium::MemberProperty<SceneGraph::SceneNode, tstring> (node, &SceneGraph::SceneNode::GetName, &SceneGraph::SceneNode::SetGivenName), newName) );
462463
m_CurrentScene->Execute( false );
463464

464465
// Sort

Editor/Vault/ThumbnailView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "Foundation/String/Utilities.h"
88
#include "Editor/UpdateStatusEvent.h"
99
#include "Editor/DragDrop/DropSource.h"
10-
#include "Foundation/Undo/Command.h"
10+
#include "Foundation/Undo/UndoCommand.h"
1111
#include "Editor/ArtProvider.h"
1212

1313
#include "SceneGraph/Color.h" // BARF! Should we move Color.h to Editor?

Editor/ViewCanvas.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "Foundation/SettingsManager.h"
88
#include "Foundation/Reflect/Enumeration.h"
9-
#include "Foundation/Undo/Queue.h"
9+
#include "Foundation/Undo/UndoQueue.h"
1010

1111
#include "SceneGraph/Render.h"
1212
#include "SceneGraph/Camera.h"

Foundation/Undo/BatchCommand.cpp

Lines changed: 0 additions & 74 deletions
This file was deleted.

Foundation/Undo/BatchCommand.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

Foundation/Undo/ExistenceCommand.cpp

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)