AddOperation Class Reference

A Operation to create a new object in the scene and the WorkingMemory. More...

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

+ Inheritance diagram for AddOperation:

Public Member Functions

 AddOperation (const AddOperation &operation)
 Creates a new operation, which is a copy of the given operation, but has a new random ID. More...
 
 AddOperation (const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene, const std::string &objectName, const std::string &objectCollection)
 Creates a new operation, which adds a new object. More...
 
 AddOperation (const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene, const std::string &objectName, const std::string &objectCollection, const SbVec3f &objectPosition, const SbRotation &objectRotation)
 Creates a new operation, which adds a new object. More...
 
 AddOperation (const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene, const std::string &objectName, const std::string &objectCollection, const SbVec3f &objectPosition, const SbRotation &objectRotation, const std::string &objectId)
 Creates a new operation, which adds a new object. More...
 
const OperationPtr createInverseOperation () const override
 Returns a new operation which removes the object, which will be added in this operation. More...
 
- Public Member Functions inherited from Operation
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

void executeOnScene () override
 Adds the object to the local Scene. More...
 
void executeOnWorkingMemory () override
 Adds the object to the WorkingMemory. More...
 
- Protected Member Functions inherited from Operation
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...
 

Detailed Description

A Operation to create a new object in the scene and the WorkingMemory.

See also
controller::Operation

Definition at line 46 of file AddOperation.h.

Constructor & Destructor Documentation

◆ AddOperation() [1/4]

AddOperation ( const AddOperation operation)

Creates a new operation, which is a copy of the given operation, but has a new random ID.

Parameters
operationThe operation to copy;

Definition at line 40 of file AddOperation.cpp.

+ Here is the call graph for this function:

◆ AddOperation() [2/4]

AddOperation ( const std::shared_ptr< memoryxcontroller::MemoryXController > &  memoryXController,
const std::shared_ptr< scene3D::Scene > &  scene,
const std::string &  objectName,
const std::string &  objectCollection,
const SbVec3f &  objectPosition,
const SbRotation &  objectRotation,
const std::string &  objectId 
)

Creates a new operation, which adds a new object.

Parameters
memoryXControllerThe MemoryXController to add the object at.
sceneThe scene to add the object at.
objectNameThe name of the class of the object. This is used to identify the class in PriorKnowledge.
objectCollectionThe name of the collection where the object is in. This is used to identify the class in PriorKnowledge.
objectPositionThe position where the object should be added.
objectRotationThe rotation to add the object with.
objectIdThe object id to create the object with.
See also
controller::Operation::Operation

Definition at line 53 of file AddOperation.cpp.

◆ AddOperation() [3/4]

AddOperation ( const std::shared_ptr< memoryxcontroller::MemoryXController > &  memoryXController,
const std::shared_ptr< scene3D::Scene > &  scene,
const std::string &  objectName,
const std::string &  objectCollection,
const SbVec3f &  objectPosition,
const SbRotation &  objectRotation 
)

Creates a new operation, which adds a new object.

A new random object ID is created in this operation.

Parameters
memoryXControllerThe MemoryXController to add the object at.
sceneThe scene to add the object at.
objectNameThe name of the class of the object. This is used to identify the class in PriorKnowledge.
objectCollectionThe name of the collection where the object is in. This is used to identify the class in PriorKnowledge.
objectPositionThe position where the object should be added.
objectRotationThe rotation to add the object with.
See also
controller::Operation::Operation

Definition at line 63 of file AddOperation.cpp.

◆ AddOperation() [4/4]

AddOperation ( const std::shared_ptr< memoryxcontroller::MemoryXController > &  memoryXController,
const std::shared_ptr< scene3D::Scene > &  scene,
const std::string &  objectName,
const std::string &  objectCollection 
)

Creates a new operation, which adds a new object.

A new random object ID is created in this operation. The object will be added at a default position with a default rotation.

Parameters
memoryXControllerThe MemoryXController to add the object at.
sceneThe scene to add the object at.
objectNameThe name of the class of the object. This is used to identify the class in PriorKnowledge.
objectCollectionThe name of the collection where the object is in. This is used to identify the class in PriorKnowledge.
See also
controller::Operation::Operation

Definition at line 73 of file AddOperation.cpp.

Member Function Documentation

◆ createInverseOperation()

const controller::OperationPtr createInverseOperation ( ) const
overridevirtual

Returns a new operation which removes the object, which will be added in this operation.

Returns
The operation, which removes the object.
See also
controller::Operation::createInverseOperation

Implements Operation.

Definition at line 107 of file AddOperation.cpp.

◆ executeOnScene()

void executeOnScene ( )
overrideprotectedvirtual

Adds the object to the local Scene.

See also
controller::Operation::executeOnScene

Implements Operation.

Definition at line 131 of file AddOperation.cpp.

◆ executeOnWorkingMemory()

void executeOnWorkingMemory ( )
overrideprotectedvirtual

Adds the object to the WorkingMemory.

See also
controller::Operation::executeOnWorkingMemory

Implements Operation.

Definition at line 113 of file AddOperation.cpp.


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