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(false)
47 std::shared_ptr<controller::Operation> inverseOperation(
49 return inverseOperation;
53 std::shared_ptr<controller::Operation> inverseOperation(
56 return inverseOperation;
69 std::shared_ptr<scene3D::Scene> scene =
getScene();
75 throw std::logic_error(
"Group does not exist");
80 throw std::logic_error(
"Object does not exist");
83 if (group->contains(sceneObject))
90 group->addObject(sceneObject);
const OperationPtr createInverseOperation() const override
Returns a new operation which removes the object from the group.
void executeOnScene() override
Adds the object to the group.
AddToGroupOperation(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 adds a new object to a group.
void executeOnWorkingMemory() override
Because the WorkingMemory does not support groups, nothing is done here.
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.
A operation to removes a object from a existing group.
std::shared_ptr< Operation > OperationPtr
boost::intrusive_ptr< SceneObject > SceneObjectPtr
std::shared_ptr< SceneGroup > SceneGroupPtr