29 #include <Inventor/SbVec3f.h>
30 #include <Inventor/SbRotation.h>
35 controller::RotateTranslateOperation::RotateTranslateOperation(
const std::shared_ptr<memoryxcontroller::MemoryXController>& memoryXController,
const std::shared_ptr<scene3D::Scene>& scene,
const std::string& objectId,
const SbRotation& oldRotation,
const SbRotation& newRotation,
const SbVec3f& oldPosition,
const SbVec3f& newPosition) :
36 Operation(memoryXController, scene, objectId),
37 oldRotation(oldRotation),
38 newRotation(newRotation),
39 oldPosition(oldPosition),
40 newPosition(newPosition)
46 std::shared_ptr<controller::Operation> inverseOperation(
new controller::RotateTranslateOperation(getMemoryXController(), getScene(), getObjectId(), newRotation, oldRotation, newPosition, oldPosition));
47 return inverseOperation;
52 getMemoryXController()->getWorkingMemoryController()->rotateTranslateObject(getObjectId(), newRotation, newPosition);
57 std::shared_ptr<scene3D::Scene> scene = getScene();
62 throw std::logic_error(
"Object does not exist");
65 object->setRotation(newRotation);
66 object->setTranslation(newPosition);
69 scene->getManipulatorManager()->applyManipulator(
object);
71 if (scene->getSelectionManager()->isSelected(
object))
73 scene->getManipulatorManager()->addManipulator(
object);
79 std::shared_ptr<scene3D::Scene> scene = getScene();
87 return object->isMutable();