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.
 
 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.
 
 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.
 
 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.
 
const OperationPtr createInverseOperation () const override
 Returns a new operation which removes the object, which will be added in this operation.
 
- Public Member Functions inherited from Operation
std::string getObjectId () const
 Returns the ID of the object, this Operation is working on.
 
virtual bool isExecuteable ()
 Return wehether the operation can be executed currently.
 
 Operation (const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene)
 A constructor.
 
 Operation (const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene, const std::string &objectId)
 A constructor.
 

Protected Member Functions

void executeOnScene () override
 Adds the object to the local Scene.
 
void executeOnWorkingMemory () override
 Adds the object to the WorkingMemory.
 
- Protected Member Functions inherited from Operation
const std::shared_ptr< memoryxcontroller::MemoryXController > getMemoryXController () const
 Returns the the MemoryXController to execute the Operation at.
 
const std::shared_ptr< scene3D::Scene > getScene () const
 Returns the the Scene to execute the Operation at.
 
void setObjectId (const std::string &objectId)
 Sets the ID, this operation is working on.
 

Detailed Description

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

See also
controller::Operation

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;

◆ 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

◆ 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

◆ 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

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.

◆ executeOnScene()

void executeOnScene ( )
overrideprotectedvirtual

Adds the object to the local Scene.

See also
controller::Operation::executeOnScene

Implements Operation.

◆ executeOnWorkingMemory()

void executeOnWorkingMemory ( )
overrideprotectedvirtual

Adds the object to the WorkingMemory.

See also
controller::Operation::executeOnWorkingMemory

Implements Operation.


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