29#include <Inventor/SbRotation.h>
30#include <Inventor/SbVec3f.h>
36 const std::shared_ptr<memoryxcontroller::MemoryXController>& memoryXController,
37 const std::shared_ptr<scene3D::Scene>& scene,
38 const std::string& objectId,
39 const SbRotation& oldRotation,
40 const SbRotation& newRotation,
41 const SbVec3f& oldPosition,
42 const SbVec3f& newPosition) :
43 Operation(memoryXController, scene, objectId),
44 oldRotation(oldRotation),
45 newRotation(newRotation),
46 oldPosition(oldPosition),
47 newPosition(newPosition)
54 std::shared_ptr<controller::Operation> inverseOperation(
62 return inverseOperation;
75 std::shared_ptr<scene3D::Scene> scene =
getScene();
80 throw std::logic_error(
"Object does not exist");
83 object->setRotation(newRotation);
84 object->setTranslation(newPosition);
87 scene->getManipulatorManager()->applyManipulator(
object);
89 if (scene->getSelectionManager()->isSelected(
object))
91 scene->getManipulatorManager()->addManipulator(
object);
98 std::shared_ptr<scene3D::Scene> scene =
getScene();
106 return object->isMutable();
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.
A operation to rotate and translate a object.
bool isExecuteable() override
Returns true, if the SceneObject is mutable.
const OperationPtr createInverseOperation() const override
Returns a new operation, which reverts the rotation and translatioon of the object.
void executeOnScene() override
Rotates and translates the object in the Scene.
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)
Creates a new operation, which rotates and translates a object.
void executeOnWorkingMemory() override
Rotates and translates the object in the WorkingMemory.
std::shared_ptr< Operation > OperationPtr
boost::intrusive_ptr< SceneObject > SceneObjectPtr