34 const std::shared_ptr<memoryxcontroller::MemoryXController>& memoryXController,
35 const std::shared_ptr<scene3D::Scene>& scene,
36 const std::string& groupName,
37 const std::string& objectId) :
38 Operation(memoryXController, scene, objectId), groupName(groupName), wasIncluded(true)
47 std::shared_ptr<controller::Operation> inverseOperation(
49 return inverseOperation;
55 return inverseOperation;
68 std::shared_ptr<scene3D::Scene> scene =
getScene();
74 throw std::logic_error(
"Group does not exist");
79 throw std::logic_error(
"Object does not exist");
82 if (group->contains(sceneObject))
85 group->removeObject(sceneObject);
A operation to add a object to a existing group.
A operation which does nothing.
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.
const OperationPtr createInverseOperation() const override
Returns a new operation which adds the object to the group.
RemoveFromGroupOperation(const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene, const std::string &groupName, const std::string &objectId)
Creates a new operation, which removes a object from a group.
void executeOnScene() override
Removes the object from the group.
void executeOnWorkingMemory() override
Because the WorkingMemory does not support groups, nothing is done here.
std::shared_ptr< Operation > OperationPtr
boost::intrusive_ptr< SceneObject > SceneObjectPtr
std::shared_ptr< SceneGroup > SceneGroupPtr