29#include <QtCore/qstatemachine.h>
31#include <Inventor/SbRotation.h>
32#include <Inventor/SbVec3f.h>
38 const std::shared_ptr<memoryxcontroller::MemoryXController>& memoryXController,
39 const std::shared_ptr<scene3D::Scene>& scene,
40 const std::string& objectName,
41 const std::string& objectCollection,
42 const SbVec3f& objectPosition,
43 const SbRotation& objectRotation,
44 const std::string& objectId) :
45 Operation(memoryXController, scene, objectId),
46 objectName(objectName),
47 objectCollection(objectCollection),
48 objectPosition(objectPosition),
49 objectRotation(objectRotation)
54 const std::shared_ptr<memoryxcontroller::MemoryXController>& memoryXController,
55 const std::shared_ptr<scene3D::Scene>& scene,
56 const std::string& objectId) :
57 Operation(memoryXController, scene, objectId),
68 if (!(objectName.empty() || objectCollection.empty()))
70 std::shared_ptr<controller::Operation> inverseOperation(
78 return inverseOperation;
82 throw std::runtime_error(
"Not yet executed");
99 memoryXController->getWorkingMemoryController()->removeObjectInstance(
getObjectId());
105 std::shared_ptr<scene3D::Scene> scene =
getScene();
110 throw std::logic_error(
"Object does not exist");
113 objectName =
object->getClassId();
114 objectCollection =
object->getCollection();
115 objectPosition =
object->getTranslation();
116 objectRotation =
object->getRotation();
117 scene->getObjectManager()->removeObject(
object);
123 std::shared_ptr<scene3D::Scene> scene =
getScene();
131 return object->isMutable();
A Operation to create a new object in the scene and the WorkingMemory.
std::string getObjectId() const
Returns the ID of the object, this Operation is working on.
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.
Operation(const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene, const std::string &objectId)
A constructor.
bool isExecuteable() override
Returns true, if the SceneObject is mutable.
const OperationPtr createInverseOperation() const override
Returns a new operation which adds the object again.
void executeOnScene() override
Removes the object from the local Scene.
void executeOnWorkingMemory() override
Removes the object from the WorkingMemory.
RemoveOperation(const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene, const std::string &objectId)
Creates a new operation, which removes a object.
std::shared_ptr< Operation > OperationPtr
std::shared_ptr< MemoryXController > MemoryXControllerPtr
boost::intrusive_ptr< SceneObject > SceneObjectPtr