31#include <Inventor/SbRotation.h>
32#include <Inventor/SbVec3f.h>
35#include <MemoryX/interface/components/WorkingMemoryInterface.h>
36#include <MemoryX/interface/memorytypes/MemorySegments.h>
59 virtual public memoryx::WorkingMemoryListenerInterface
75 const std::string& workingMemoryUpdatesTopic,
76 const std::string& objectInstancesSegmentName,
77 const std::shared_ptr<MemoryXController>& memoryXController);
103 std::vector<std::string>
122 const SbRotation& newOrientation,
123 const SbVec3f& newPosition);
148 const memoryx::LongtermMemoryInterfacePrx& longtermMemoryPrx)
const;
160 const memoryx::LongtermMemoryInterfacePrx& longtermMemoryPrx,
161 const std::vector<std::string>& objectIds)
const;
204 const ::memoryx::EntityBasePtr& entity,
205 const ::Ice::Current& = Ice::emptyCurrent)
override;
212 const ::memoryx::EntityBasePtr& entityOld,
213 const ::memoryx::EntityBasePtr& entityNew,
214 const ::Ice::Current& = Ice::emptyCurrent)
override;
221 const ::memoryx::EntityBasePtr& entity,
222 const ::Ice::Current& = Ice::emptyCurrent)
override;
229 const ::Ice::Current& = Ice::emptyCurrent)
override;
242 const ::Ice::Current& = Ice::emptyCurrent)
override;
245 mutable std::recursive_mutex mutexEntities;
247 bool findAndRemoveInstanceFromList(std::list<memoryx::ObjectInstancePtr>& list,
250 memoryx::WorkingMemoryInterfacePrx workingMemoryPrx;
251 memoryx::ObjectInstanceMemorySegmentBasePrx objectInstancesPrx;
252 std::weak_ptr<memoryxcontroller::MemoryXController> memoryXController;
254 std::string workingMemoryUpdatesTopic;
255 std::list<memoryx::ObjectInstancePtr> currentChangedInstances;
The ManagedIceObject is the base class for all ArmarX objects.
void onInitComponent() override
static SbRotation getSbRotationFromInstance(const memoryx::ObjectInstancePtr &objectInstance)
Returns the rotation of a object instance.
WorkingMemoryController(const memoryx::WorkingMemoryInterfacePrx &workingMemoryPrx, const std::string &workingMemoryUpdatesTopic, const std::string &objectInstancesSegmentName, const std::shared_ptr< MemoryXController > &memoryXController)
Constructor.
void reportSnapshotLoaded(const std::string &segmentName, const ::Ice::Current &=Ice::emptyCurrent) override
Recognises when a segment was loaded from a snapshot.
void addAllInstancesToLocalScene() const
Adds all object instances of the working memory to the local scene.
void reportSnapshotCompletelyLoaded(const Ice::Current &c=Ice::emptyCurrent) override
~WorkingMemoryController() override
Destructor.
std::vector< std::string > getAllObjectInstances() const
Returns all object ids that are currently in the working memory.
std::string addObjectInstance(const std::string &objectName, const memoryx::ObjectClassPtr &objectClassPtr)
Adds a new object instance to the working memory.
void reportEntityRemoved(const std::string &segmentName, const ::memoryx::EntityBasePtr &entity, const ::Ice::Current &=Ice::emptyCurrent) override
Recognises when an entity is removed from the working memory.
static SbVec3f getSbVec3fFromInstance(const memoryx::ObjectInstancePtr &objectInstance)
Returns the position of a object instance.
void reportEntityUpdated(const std::string &segmentName, const ::memoryx::EntityBasePtr &entityOld, const ::memoryx::EntityBasePtr &entityNew, const ::Ice::Current &=Ice::emptyCurrent) override
Recognises when an entity is updated in the working memory.
void removeObjectInstance(const std::string &id)
Removes the object instance with the given id.
void rotateTranslateObject(const std::string &id, const SbRotation &newOrientation, const SbVec3f &newPosition)
Applies the given orientation and position to the object instance with the given id.
bool saveObjectsInSnapshot(const std::string &snapshotName, const memoryx::LongtermMemoryInterfacePrx &longtermMemoryPrx, const std::vector< std::string > &objectIds) const
Saves the object instances with the given ids in a snapshot with the given name.
void reportEntityCreated(const std::string &segmentName, const ::memoryx::EntityBasePtr &entity, const ::Ice::Current &=Ice::emptyCurrent) override
Recognises when an entity is created in the working memory.
void onConnectComponent() override
bool saveSceneInSnapshot(const std::string &snapshotName, const memoryx::LongtermMemoryInterfacePrx &longtermMemoryPrx) const
Saves the whole scene in a snapshot with the given name.
std::vector< std::string > addObjectInstances(const std::vector< memoryx::ObjectInstancePtr > &instancePtrs)
Adds all given object instances to the working memory.
void reportMemoryCleared(const std::string &segmentName, const ::Ice::Current &=Ice::emptyCurrent) override
Recognises when an entity is created on the working memory.
std::string getDefaultName() const override
Returns the default name of this managed ice object.
IceInternal::Handle< ObjectInstance > ObjectInstancePtr
IceInternal::Handle< ObjectClass > ObjectClassPtr
IceInternal::Handle< WorkingMemoryController > WorkingMemoryControllerPtr