29 #include <Inventor/SbVec3f.h>
30 #include <Inventor/SbRotation.h>
31 #include <QtCore/qstatemachine.h>
36 controller::RemoveOperation::RemoveOperation(
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) :
37 Operation(memoryXController, scene, objectId),
38 objectName(objectName),
39 objectCollection(objectCollection),
40 objectPosition(objectPosition),
41 objectRotation(objectRotation)
46 Operation(memoryXController, scene, objectId),
56 if (!(objectName.empty() || objectCollection.empty()))
58 std::shared_ptr<controller::Operation> inverseOperation(
new controller::AddOperation(getMemoryXController(), getScene(), objectName, objectCollection, objectPosition, objectRotation, getObjectId()));
59 return inverseOperation;
63 throw std::runtime_error(
"Not yet executed");
79 memoryXController->getWorkingMemoryController()->removeObjectInstance(getObjectId());
84 std::shared_ptr<scene3D::Scene> scene = getScene();
89 throw std::logic_error(
"Object does not exist");
92 objectName =
object->getClassId();
93 objectCollection =
object->getCollection();
94 objectPosition =
object->getTranslation();
95 objectRotation =
object->getRotation();
96 scene->getObjectManager()->removeObject(
object);
101 std::shared_ptr<scene3D::Scene> scene = getScene();
109 return object->isMutable();