Operation Class Referenceabstract

An abstract class, which offers methods to run operations on the WorkingMemory and the Scene. More...

#include <MemoryX/gui-plugins/SceneEditor/controller/Operation.h>

+ Inheritance diagram for Operation:

Public Member Functions

virtual const OperationPtr createInverseOperation () const =0
 Returns a Operation, which reverts the changes done in this instance of the Operation. More...
 
std::string getObjectId () const
 Returns the ID of the object, this Operation is working on. More...
 
virtual bool isExecuteable ()
 Return wehether the operation can be executed currently. More...
 
 Operation (const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene)
 A constructor. More...
 
 Operation (const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene, const std::string &objectId)
 A constructor. More...
 

Protected Member Functions

virtual void executeOnScene ()=0
 Executes the Operation on the given Scene. More...
 
virtual void executeOnWorkingMemory ()=0
 Executes the Operation on the given WorkingMemory. More...
 
const std::shared_ptr< memoryxcontroller::MemoryXControllergetMemoryXController () const
 Returns the the MemoryXController to execute the Operation at. More...
 
const std::shared_ptr< scene3D::ScenegetScene () const
 Returns the the Scene to execute the Operation at. More...
 
void setObjectId (const std::string &objectId)
 Sets the ID, this operation is working on. More...
 

Friends

class Controller
 
class UndoRedoStack
 

Detailed Description

An abstract class, which offers methods to run operations on the WorkingMemory and the Scene.

See also
scene3D::Scene
memoryxcontroller::WorkingMemoryController

Definition at line 44 of file Operation.h.

Constructor & Destructor Documentation

◆ Operation() [1/2]

Operation ( const std::shared_ptr< memoryxcontroller::MemoryXController > &  memoryXController,
const std::shared_ptr< scene3D::Scene > &  scene,
const std::string &  objectId 
)

A constructor.

Sets the Scene and WorkingMemory to execute the scene at.

Parameters
memoryXControllerthe Controller for the WorkingMemory instance to run the Operation at
scenethe Scene to run the Operation at
theID of the object, which is affected by this operation
See also
scene3D::Scene
memoryxcontroller::WorkingMemoryController

Definition at line 26 of file Operation.cpp.

◆ Operation() [2/2]

Operation ( const std::shared_ptr< memoryxcontroller::MemoryXController > &  memoryXController,
const std::shared_ptr< scene3D::Scene > &  scene 
)

A constructor.

Sets the Scene and WorkingMemory to execute the scene at.

Parameters
memoryXControllerthe Controller for the WorkingMemory instance to run the Operation at
scenethe Scene to run the Operation at
See also
scene3D::Scene
memoryxcontroller::WorkingMemoryController

Definition at line 34 of file Operation.cpp.

Member Function Documentation

◆ createInverseOperation()

virtual const OperationPtr createInverseOperation ( ) const
pure virtual

◆ executeOnScene()

◆ executeOnWorkingMemory()

◆ getMemoryXController()

const std::shared_ptr< memoryxcontroller::MemoryXController > getMemoryXController ( ) const
protected

Returns the the MemoryXController to execute the Operation at.

Returns
the MemoryXController
See also
memoryxcontroller::MemoryXController

Definition at line 47 of file Operation.cpp.

◆ getObjectId()

std::string getObjectId ( ) const

Returns the ID of the object, this Operation is working on.

Returns
the ID

Definition at line 52 of file Operation.cpp.

+ Here is the caller graph for this function:

◆ getScene()

const std::shared_ptr< scene3D::Scene > getScene ( ) const
protected

Returns the the Scene to execute the Operation at.

Returns
the Scene
See also
scene3D::Scene

Definition at line 42 of file Operation.cpp.

◆ isExecuteable()

bool isExecuteable ( )
virtual

Return wehether the operation can be executed currently.

If the Operation is never executeable this method return true.

Returns
true, if the operation can be executed; false otherwise

Reimplemented in RotateTranslateOperation, and RemoveOperation.

Definition at line 62 of file Operation.cpp.

◆ setObjectId()

void setObjectId ( const std::string &  objectId)
protected

Sets the ID, this operation is working on.

Parameters
thenew ID

Definition at line 57 of file Operation.cpp.

Friends And Related Function Documentation

◆ Controller

friend class Controller
friend

Definition at line 46 of file Operation.h.

◆ UndoRedoStack

friend class UndoRedoStack
friend

Definition at line 47 of file Operation.h.


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