This class implements a command for adding primitives into the map, as part of their specified parent entities. More...
#include "AddPrim.hpp"
Public Member Functions | |
CommandAddPrimT (MapDocumentT &MapDoc, MapPrimitiveT *AddPrim, IntrusivePtrT< MapEditor::CompMapEntityT > Parent, wxString Name="new primitive", bool SetSel=true) | |
The constructor for creating a command for adding a single primitive into the map. More... | |
CommandAddPrimT (MapDocumentT &MapDoc, const ArrayT< MapPrimitiveT * > &AddPrims, IntrusivePtrT< MapEditor::CompMapEntityT > Parent, wxString Name="new primitives", bool SetSel=true) | |
The constructor for creating a command for adding multiple primitives into the map. More... | |
~CommandAddPrimT () | |
The destructor. More... | |
bool | Do () |
This method executes the command. More... | |
void | Undo () |
This method un-does the command. More... | |
wxString | GetName () const |
Returns the name (a description) of the command. More... | |
![]() | |
CommandT (bool ShowInHistory=true, bool SuggestsSave=true) | |
The constructor. More... | |
virtual | ~CommandT () |
The virtual destructor. More... | |
bool | ShowInHistory () const |
Whether the command should be shown in the undo/redo history. More... | |
bool | SuggestsSave () const |
Whether the command suggests to save the document when its closed and hasn't been saved between the command execution and the closing (selection changes for example don't suggest to save the document since no important changes have been made). More... | |
bool | IsDone () const |
Whether the command has been executed. More... | |
unsigned long | GetID () const |
Returns the commands unique ID. More... | |
Additional Inherited Members | |
![]() | |
bool | m_Done |
Whether the command has been executed. More... | |
const bool | m_ShowInHistory |
Whether the command should have an entry in the undo/redo history. More... | |
const bool | m_SuggestsSave |
Whether the command suggests saving of the document on close. More... | |
const unsigned long | m_ID |
The commands unique ID. More... | |
This class implements a command for adding primitives into the map, as part of their specified parent entities.
It is quasi the counterpart to CommandDeleteT.
CommandAddPrimT::CommandAddPrimT | ( | MapDocumentT & | MapDoc, |
MapPrimitiveT * | AddPrim, | ||
IntrusivePtrT< MapEditor::CompMapEntityT > | Parent, | ||
wxString | Name = "new primitive" , |
||
bool | SetSel = true |
||
) |
The constructor for creating a command for adding a single primitive into the map.
MapDoc | The map document into which the primitive is inserted. |
AddPrim | The primitive to add. NOTE: AddPrim->GetParent()==NULL is assumed, i.e. AddPrim has no prior parent! |
Parent | The parent entity that the primitive becomes a part of and which it is added to. Can be the world or a custom entity. |
Name | The name of this command for the undo history. |
SetSel | Whether the selection should be set to the newly added map primitive(s). |
CommandAddPrimT::CommandAddPrimT | ( | MapDocumentT & | MapDoc, |
const ArrayT< MapPrimitiveT * > & | AddPrims, | ||
IntrusivePtrT< MapEditor::CompMapEntityT > | Parent, | ||
wxString | Name = "new primitives" , |
||
bool | SetSel = true |
||
) |
The constructor for creating a command for adding multiple primitives into the map.
Analogous to the constructor for adding a single primitive above.
CommandAddPrimT::~CommandAddPrimT | ( | ) |
The destructor.
|
virtual |
This method executes the command.
Implements CommandT.
|
virtual |
Returns the name (a description) of the command.
Implements CommandT.
|
virtual |
This method un-does the command.
Implements CommandT.