SDFormat Editor
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
CommandFactoryI Class Referenceabstract

Interface for the SDFormat Editor's Command Factory. More...

#include <command_factory_interface.h>

Inheritance diagram for CommandFactoryI:
Inheritance graph
Collaboration diagram for CommandFactoryI:
Collaboration graph

Public Member Functions

virtual std::unique_ptr< CommandIMakeOpenFileCommand (std::string file_path)=0
 Create an open file command.
 
virtual std::unique_ptr< CommandIMakeCreateFileCommand ()=0
 Create a create file command.
 
virtual std::unique_ptr< CommandIMakeDeleteElementCommand (sdf::ElementPtr element_to_delete)=0
 Create a delete element command.
 
virtual std::unique_ptr< CommandIMakeAddElementCommand (sdf::ElementPtr parent_element, sdf::ElementPtr new_element)=0
 Create an add element command.
 
virtual std::unique_ptr< CommandIMakeUndoCommand ()=0
 Create an undo command.
 
virtual std::unique_ptr< CommandIMakeRedoCommand ()=0
 Create a redo command.
 
virtual std::unique_ptr< CommandIMakeSaveFileCommand ()=0
 Create a save file command.
 
virtual std::unique_ptr< CommandIMakeModifyAttributeCommand (sdf::ParamPtr attribute_to_modify, std::string new_value)=0
 create a modify attribute command
 
virtual std::unique_ptr< CommandIMakeModifyAttributeCommand (sdf::ParamPtr attribute_to_modify, bool new_value)=0
 create a modify attribute command
 
virtual std::unique_ptr< CommandIMakeModifyElementCommand (sdf::ElementPtr element_to_modify, std::string new_value)=0
 create a modify element command
 
virtual std::unique_ptr< CommandIMakeModifyElementCommand (sdf::ElementPtr element_to_modify, bool new_value)=0
 create a modify element command
 
virtual std::unique_ptr< CommandIMakeRenderModelCommand (bool render_collisions_in_model_viewer)=0
 Create a render model command.
 
virtual std::unique_ptr< CommandIMakeOpenModelViewerCommand ()=0
 Create a open model viewer model command.
 
virtual std::unique_ptr< CommandIMakeCloseModelViewerCommand ()=0
 Create a close model viewer model command.
 
virtual void PushToUndoCommandsStack (std::unique_ptr< CommandI > command, const bool new_change=true)=0
 Pushes to the undo commands stack.
 
virtual void PushToRedoCommandsStack (std::unique_ptr< CommandI > command)=0
 Pushes to the redo commands stack.
 
virtual void ClearUndoRedoStacks ()=0
 Clears both the undo and redo stacks.
 

Private Member Functions

virtual void Initialize (std::shared_ptr< GUII > gui, std::shared_ptr< SDFormatParserI > sdformatParser, std::shared_ptr< ModelViewerI > model_viewer)=0
 Initialization of the Command Factory. Should be wrapped in the constructor of the implementation.
 

Detailed Description

Interface for the SDFormat Editor's Command Factory.

Member Function Documentation

◆ ClearUndoRedoStacks()

virtual void CommandFactoryI::ClearUndoRedoStacks ( )
pure virtual

Clears both the undo and redo stacks.

Implemented in CommandFactory.

◆ Initialize()

virtual void CommandFactoryI::Initialize ( std::shared_ptr< GUII gui,
std::shared_ptr< SDFormatParserI sdformatParser,
std::shared_ptr< ModelViewerI model_viewer 
)
privatepure virtual

Initialization of the Command Factory. Should be wrapped in the constructor of the implementation.

Parameters
[in]guiA pointer to the GUI object
[in]sdformat_parserA pointer to the sdformat parser object
[in]model_viewerA pointer to the model viewer object

Implemented in CommandFactory.

◆ MakeAddElementCommand()

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeAddElementCommand ( sdf::ElementPtr  parent_element,
sdf::ElementPtr  new_element 
)
pure virtual

Create an add element command.

Parameters
[in]parent_elementThe parent of the new SDF element
[in]new_elementThe new SDF element
Returns
Unique pointer to a command interface

Implemented in CommandFactory.

◆ MakeCloseModelViewerCommand()

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeCloseModelViewerCommand ( )
pure virtual

Create a close model viewer model command.

Returns
Unique pointer to a command interface

Implemented in CommandFactory.

◆ MakeCreateFileCommand()

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeCreateFileCommand ( )
pure virtual

Create a create file command.

Returns
Unique pointer to a command interface

Implemented in CommandFactory.

◆ MakeDeleteElementCommand()

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeDeleteElementCommand ( sdf::ElementPtr  element_to_delete)
pure virtual

Create a delete element command.

Parameters
[in]element_to_deleteThe SDF element to delete
Returns
Unique pointer to a command interface

Implemented in CommandFactory.

◆ MakeModifyAttributeCommand() [1/2]

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeModifyAttributeCommand ( sdf::ParamPtr  attribute_to_modify,
bool  new_value 
)
pure virtual

create a modify attribute command

Parameters
[in]attribute_to_modifyPointer to the attribute to modify
[in]new_valueThe boolean value that will be given to the element
Returns
a unique pointer to the commmand interface

Implemented in CommandFactory.

◆ MakeModifyAttributeCommand() [2/2]

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeModifyAttributeCommand ( sdf::ParamPtr  attribute_to_modify,
std::string  new_value 
)
pure virtual

create a modify attribute command

Parameters
[in]attribute_to_modifyPointer to the attribute to modify
[in]new_valueThe string value that will be given to the element
Returns
a unique pointer to the commmand interface

Implemented in CommandFactory.

◆ MakeModifyElementCommand() [1/2]

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeModifyElementCommand ( sdf::ElementPtr  element_to_modify,
bool  new_value 
)
pure virtual

create a modify element command

Returns
a unique pointer to the commmand interface
Parameters
[in]element_to_modifyPointer to the element to modify
[in]new_valueThe boolean value that will be given to the element

Implemented in CommandFactory.

◆ MakeModifyElementCommand() [2/2]

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeModifyElementCommand ( sdf::ElementPtr  element_to_modify,
std::string  new_value 
)
pure virtual

create a modify element command

Returns
a unique pointer to the commmand interface
Parameters
[in]element_to_modifyPointer to the element to modify
[in]new_valueThe string value that will be given to the element

Implemented in CommandFactory.

◆ MakeOpenFileCommand()

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeOpenFileCommand ( std::string  file_path)
pure virtual

Create an open file command.

Parameters
[in]file_pathFilepath of the model
Returns
Unique pointer to a command interface

Implemented in CommandFactory.

◆ MakeOpenModelViewerCommand()

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeOpenModelViewerCommand ( )
pure virtual

Create a open model viewer model command.

Returns
Unique pointer to a command interface

Implemented in CommandFactory.

◆ MakeRedoCommand()

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeRedoCommand ( )
pure virtual

Create a redo command.

Returns
Unique pointer to a command interface

Implemented in CommandFactory.

◆ MakeRenderModelCommand()

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeRenderModelCommand ( bool  render_collisions_in_model_viewer)
pure virtual

Create a render model command.

Parameters
[in]render_collisions_in_model_viewerindicates if collision boxes should be rendered in the model viewer
Returns
Unique pointer to a command interface

Implemented in CommandFactory.

◆ MakeSaveFileCommand()

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeSaveFileCommand ( )
pure virtual

Create a save file command.

Returns
Unique pointer to a command interface

Implemented in CommandFactory.

◆ MakeUndoCommand()

virtual std::unique_ptr< CommandI > CommandFactoryI::MakeUndoCommand ( )
pure virtual

Create an undo command.

Returns
Unique pointer to a command interface

Implemented in CommandFactory.

◆ PushToRedoCommandsStack()

virtual void CommandFactoryI::PushToRedoCommandsStack ( std::unique_ptr< CommandI command)
pure virtual

Pushes to the redo commands stack.

Parameters
[in]commandcommandI object to push

Implemented in CommandFactory.

◆ PushToUndoCommandsStack()

virtual void CommandFactoryI::PushToUndoCommandsStack ( std::unique_ptr< CommandI command,
const bool  new_change = true 
)
pure virtual

Pushes to the undo commands stack.

Parameters
[in]commandcommandI object to push
[in]new_changeindicates if we are pushing a new change, and thus should clear the redo stack

Implemented in CommandFactory.


The documentation for this class was generated from the following file: