40#include "albaServiceClient.h"
41#include "albaAbsLogicManager.h"
302 bool IsEmpty()
const {
return GetNumberOfChildren() == 0; }
487 DEFAULT_VISUAL_MODE = 0,
494 virtual void Print(std::ostream& os,
const int tabs=0);
789 void operator=(
const albaVME&);
long albaID
type for IDs inside ALBA
double albaTimeStamp
type for time varying data timestamps (not for pipelines timestamps!)
#define EXPORT_STL_VECTOR(declspec_, T_)
albaAbsMatrixPipe - this class implements VME tree direct cinematic (AbsMatrix).
An abstract class for objects representing an attribute for albaVMEs.
Hold a reference to a T instance.
abstract class for process objects producing data as output of a VME.
Implementation of the message object for the Subject/Observer design pattern.
This class inerith form albaEventSender and extends albaEventSender with the capacity of send events ...
albaGUI is a panel with function to easily create GUI.
Abstract class for ALBA interactors This class provides base interface and features of ALBA continuou...
bridge class between albaTransform pipeline and VME to compute VME output matrix.
albaMatrix - Time stamped 4x4 Matrix.
Abstract superclass for all ALBA classes implementing RTTI APIs.
Interface implementing the Observer of the Subject/Observer design pattern.
albaReferenceCounted - abstract base class for ALBA objects with reference counting.
albaStorable is an interface for serializable objects.
Abstract class representing the interface for the unit of information stored in the storage.
albaString - performs common string operations on c-strings.
An attribute used to store an associtive array of <key,value> pairs, where value is multi component.
class acting as an interface for timestamped objects This object simply defines few methods for manag...
albaUtility - the pourpose of this class is just to groups utilities classes
albaVMEIterator - an m-way tree data structure iterator albaVMEIterator is a class to traverse a tree...
albaVMEOutput - the output data structure of a VME node.
virtual void GetAbsTimeStamps(std::vector< albaTimeStamp > &kframes)
Return the list of timestamps considering all parents timestamps.
void SetLink(const char *name, albaVME *node, LinkType type)
set a link or a mandatory link to another node in the tree, if node is NULL current link is removed
int SetMatrixPipe(albaMatrixPipe *pipe)
Set the matrix pipe object, i.e.
void ForwardUpEvent(albaEventBase &alba_event)
void SetOldSubIdLink(albaString link_name, albaID link_node_id, albaID link_node_subid)
This method manage olds links with subid and is here only for retro compatibility issues please do no...
virtual albaString GetVisualPipeSlice()
Return the suggested pipe-typename for the visualization of this vme.
virtual bool IsDataAvailable()
Return true if the data associated with the VME is present and updated at the current time.
albaAbsMatrixPipe * GetAbsMatrixPipe()
return the matrix pipe used for computing the AbsMatrix.
void UpdateId()
Check if m_Id and regenerate it if is invalid (-1)
void SetVisibleToTraverse(bool flag)
Set/Get the flag to make this VME visible to tree traversal.
albaAttributesMap m_Attributes
attributes attached to this node
virtual void GetLocalTimeBounds(albaTimeStamp tbounds[2])
Set the time bounds for the time varying VME (base VME is not time varying).
albaAbstractTypeMacro(albaVME, albaReferenceCounted)
bool m_TestMode
Flag used with cppunitTest: put this flag at true when executing tests to avoid busy-info or splash s...
std::vector< albaVMEBackLink > albaVMEBackLinks
void AddBackLink(const char *name, albaVME *node)
set a mandatory link to another node in the tree
void SetLink(const char *name, albaVME *node)
set a link to another node in the tree, if node is NULL current link is removed
void Import(albaVME *tree)
Import all children of another tree into this tree.
virtual void SetName(const char *name)
set node name
albaAttributesMap * GetAttributes()
return the list of attributes.
void CleanTree()
Remove recursively all nodes from this tree, forcing all subnodes to detach their children.
albaVMEBackLinks m_BackLinks
links to other nodes in the tree
void DeleteGui()
destroy the Gui
virtual int InternalStore(albaStorageElement *parent)
This is called by Store() and must be reimplemented by subclasses.
albaVME * GetParent() const
return the parent VME Node.
void OnNodeDetachedFromTree(albaEventBase *e)
unsigned long GetNumberOfChildren(bool onlyVisible)
Return the number of children of this node If only visible is true return the number visible to trave...
bool IsVisible()
Return true if visible to tree traversal.
albaGUI * GetGui()
create and return the GUI for changing the node parameters
albaVME * FindInTreeByTag(const char *name, const char *value="", int type=ALBA_STRING_TAG)
Find a node in all the subtrees matching the given TagName/TagValue pair.
void SetAbsPose(double x, double y, double z, double rx, double ry, double rz, albaTimeStamp t=-1)
Set the global pose of this VME for the given time "t".
int GetNumberOfTimeStamps()
Return the number of time stamps in the whole tree.
virtual albaVMEOutput * GetOutput()
return a pointer to the output data structure
albaAutoPointer< albaMatrixPipe > m_MatrixPipe
albaVME * GetRoot()
Return the root of the tree this node owns to.
albaVMESet GetDependenciesVMEs()
Return a set of all VME depending on this vme or is subtree.
std::vector< albaOldSubIdLink > m_OldSubIdLinks
virtual int InternalRestore(albaStorageElement *node)
This is called by Restore() and must be reimplemented by subclasses The element from which the object...
virtual void SetAbsMatrix(const albaMatrix &matrix)
Set the global pose of this VME for the current time.
void ApplyMatrix(const albaMatrix &matrix, int premultiply, albaTimeStamp t=-1)
apply a matrix to the VME pose matrix
virtual void InternalSetTimeStamp(albaTimeStamp t)
Set the time for this VME (not for the whole tree) without notifying listeners.
albaAttribute * GetAttribute(const char *name)
return an attribute given the name
void ApplyAbsMatrix(const albaMatrix &matrix, int premultiply, albaTimeStamp t=-1)
apply a matrix to the VME abs pose matrix
virtual void Print(std::ostream &os, const int tabs=0)
print a dump of this object
albaID GetNumberOfBackLinks()
return the number of back links of this Node
albaTimeStamp m_CurrentTime
the time parameter for generation of the output
void RemoveAttribute(const char *name)
remove an attibute
bool GetTestMode()
Get TestMode.
albaVMEIterator * NewIterator()
Return a new Tree iterator already set to traverse the sub tree starting a this node.
void RemoveBackLink(const char *name, albaVME *node)
set a mandatory link to another node in the tree
virtual int SetDataPipe(albaDataPipe *dpipe)
Set/Get the data pipe object, i.e.
void RemoveLink(const char *name)
remove a link
virtual bool CanCopy(albaVME *vme)
TODO: to be moved to albaVME perform a copy by simply referencing the copied node's data array.
void RemoveAllLinks()
remove all links
static albaVME * InternalCopyTree(albaVME *vme, albaVME *parent)
const albaChildrenVector * GetChildren()
return list of children.
albaInteractor * m_Behavior
the interactor representing the behavior of this VME
albaID m_Id
ID of this node.
int Restore()
unserialized the object from a storage.
std::vector< albaAutoPointer< albaVME > > albaChildrenVector
albaGUI * m_Gui
pointer to the node GUI
int Initialize()
Initialize this node.
albaInteractor * GetBehavior()
return the interactor assigned as a behavior to this VME.
void RemoveDependenciesVMEs()
Removes all the VME that are depending on the current VME.
albaVME * GetLastChild(bool onlyVisible=false)
Get the Lase child in the list.
void SetTreeTime(albaTimeStamp t)
Set/Get CurrentTime for this VME and all subtree.
int Store()
serialize the object on a store.
void ForwardDownEvent(albaEventBase *alba_event)
used to send an event down in the tree
static char ** GetIcon()
return an xpm-icon that can be used to represent this node
bool CompareTree(albaVME *vme)
Compare the two subtrees starting from this node with the given one.
virtual albaGUI * CreateGui()
Create GUI for the VME Internally used to create a new instance of the GUI.
bool IsAChild(albaVME *a)
Return true if the given one is a child of this node.
void TestModeOn()
Turn On m_TestMode flag.
virtual albaString GetVisualPipe()
Return the suggested pipe-typename for the visualization of this vme.
VME_WIDGET_ID
IDs for the GUI.
albaVME * CopyTree()
Make a copy of the whole subtree and return its pointer.
albaID GetNumberOfLinks()
return the number of links stored in this Node
void SetAbsMatrix(const albaMatrix &matrix, albaTimeStamp t)
Set the global pose of this VME for the given time "t".
albaVME * GetChild(albaID idx, bool onlyVisible=false)
Return a the pointer to a child given its index.
albaVME * FindInTreeByName(const char *name, bool match_case=true, bool whole_word=true)
Find a node in all the subtrees matching the given VME Name.
void SetPose(double x, double y, double z, double rx, double ry, double rz, albaTimeStamp t)
Set the pose for this VME This function modifies pose matrix of the VME.
bool IsInTree(albaVME *a)
Find a node in all the subtrees, searching recursively into sub nodes.
bool WillBeRemovedWithDependencies(albaVME *vme)
Return true if vme will be removed on Remove Dependencies A VME will be removed if is contained on de...
albaMatrixPipe * GetMatrixPipe()
Set auxiliary reference system and its name.
virtual void UnRegister(void *o)
redefined to cope with tree registering
albaVME * m_Parent
parent node
int m_VisualMode
Store the visual mode to allow the visual pipe to choose the right visual pipe to render the VME.
albaVMEOutput * m_Output
the data structure storing the output of this VME
albaAutoPointer< albaAbsMatrixPipe > m_AbsMatrixPipe
virtual int SetParent(albaVME *parent)
This function set the parent for this Node.
void GetDependenciesVMEs(albaVMESet &dependencies, albaVME *vme)
Get the dependecies for the specified VME.
void OnNodeAttachedToTree(albaEventBase *e)
albaString GetTypeNameFromType(albaString typeName)
Returns typename (human readable) from vme type (class name)
albaChildrenVector m_Children
list of children
albaDataPipe * GetDataPipe()
return the data pipe object, i.e.
unsigned long GetNumberOfChildren() const
Return the number of children of this node If only visible is true return the number visible to trave...
const char * GetName()
return the name of this node
albaVME * GetLink(const char *name)
return the value of a link to another node in the tree.
virtual void GetLocalTimeStamps(std::vector< albaTimeStamp > &kframes)=0
Return the list of timestamps for this VME.
void SetBehavior(albaInteractor *bh)
set the interactor representing the behavior of this VME.
albaTagArray * GetTagArray()
return a pointer to the tag array attribute.
albaString m_GuiName
name showed on gui
void SetAbsPose(double xyz[3], double rxyz[3], albaTimeStamp t=-1)
Set the global pose of this VME for the given time "t".
void NodeOnEvent(albaEventBase *e)
Precess Tree management events.
void OnNodeDestroyed(albaEventBase *e)
int FindNodeIdx(albaVME *a, bool onlyVisible=false)
Find a child given its pointer and return its index.
int GetCrypting()
Get the crypting status of the vme.
bool m_VisibleToTraverse
enable/disable traversing visit of this node
albaVME * GetFirstChild(bool onlyVisible=false)
Get the First child in the list.
virtual void InternalPreUpdate()
called to prepare the update of output
void SetAbsMatrixPipe(albaAbsMatrixPipe *pipe)
Set the abs matrix pipe object, i.e.
virtual unsigned long GetMTime()
Return the modification time.
int IsInitialized()
Return true if this agent has been initialized.
int GetVisualMode()
Get the mode with which render the VME: DEFAULT_VISUAL_MODE or NO_DATA_VISUAL_MODE.
virtual void RemoveChild(const albaID idx, bool onlyVisible=false)
Remove a child node.
virtual void OnEvent(albaEventBase *e)
Precess events coming from other objects.
virtual void InternalUpdate()
update the output data structure
void TestModeOff()
Used to turn off m_TestMode flag.
albaString m_Name
name of this node
virtual void Update()
this function makes the current data pointer to point the right output data, usually the DataPipe out...
void SetAttribute(const char *name, albaAttribute *a)
Set a new attribute.
void RemoveAllChildren()
Remove all children nodes.
void SetId(albaID id)
internally used to set the node ID
void DependsOnLinkedNodeOn()
Turn on the flag to calculate the timestamp considering also the linked nodes.
virtual albaObject * NewObjectInstance() const
defined to allow MakeCopy implementation.
int FindNodeIdx(const char *name, bool onlyVisible=false)
Find a child index given its name.
virtual int AddChild(albaVME *node)
Add a child to this node.
virtual bool IsAnimated()
Return true if the number of local time stamps is > 1.
albaVME * FindInTreeById(const albaID id)
Find a node in all the subtrees matching the given VME Name.
bool GetVisibleToTraverse()
albaID GetId() const
return the Id of this node in the tree
void ForwardUpEvent(albaEventBase *alba_event)
used to send an event up in the tree
virtual bool Equals(albaVME *vme)
Compare two VMEs.
static albaVME * CopyTree(albaVME *vme, albaVME *parent=NULL)
Copy the given VME tree into a new tree.
albaAutoPointer< albaDataPipe > m_DataPipe
void SetPose(const albaMatrix &mat, albaTimeStamp t)
set the pose matrix for a specific time stamp (ignore the matrix internal timestamp!...
albaLinksMap * GetLinks()
return links array: links from this node to other arrays
void SetMandatoryLink(const char *name, albaVME *node)
set a mandatory link to another node in the tree, if node is NULL current link is removed
std::map< albaString, albaAutoPointer< albaAttribute > > albaAttributesMap
bool m_Initialized
set true by Initialize()
void ForwardDownEvent(albaEventBase &alba_event)
virtual void RemoveChild(albaVME *node)
Remove a child node.
virtual int ShallowCopy(albaVME *a)
perform a copy by simply referencing the copied VME's data array.
void Shutdown()
Shutdown this node.
void SetOutput(albaVMEOutput *output)
Set the output and connect it to the VME.
albaVME * GetByPath(const char *path, bool onlyVisible=true)
Get A child by path.
virtual int DeepCopy(albaVME *a)
Copy the contents of another VME into this one.
int GetNumberOfLocalTimeStamps()
Return the number of time stamps local to the vme.
void RemoveAllAttributes()
remove all the attributes of this node
int m_Crypting
enable flag for this VME
void SetPose(double xyz[3], double rxyz[3], albaTimeStamp t)
Set the pose for this VME This function modifies pose matrix of the VME.
virtual bool CanReparentTo(albaVME *parent)
return true if the VME can be reparented under the specified node
std::map< albaString, albaVMELink > albaLinksMap
std::set< albaVME * > albaVMESet
static albaVME * MakeCopy(albaVME *a)
Create a copy of this node (do not copy the sub tree,just the node)
virtual void InternalShutdown()
to be redefined by subclasses to define the shutdown actions
virtual albaTimeStamp GetTimeStamp()
void RemoveAllBackLinks()
remove all back links
virtual void SetMatrix(const albaMatrix &mat)=0
Set the Pose matrix of the VME.
albaVMEBackLinks GetBackLinks()
return a copy of the vector of back links of this Node
albaLinksMap m_Links
links to other nodes in the tree
virtual int ReparentTo(albaVME *parent)
Reparent this Node into a different place of the same tree.
albaVME * NewInstance()
Interface to allow creation of a copy of the node (works only for concrete subclasses)
virtual void GetTimeStamps(std::vector< albaTimeStamp > &kframes)
Return the list of timestamps for the full sub tree.
bool IsOnVMETree()
Valid VMEs have m_ID >= 0.
void DependsOnLinkedNodeOff()
Turn off the flag to calculate the timestamp considering also the linked nodes.
void SetVisualMode(int mode)
Set the mode with which render the VME: DEFAULT_VISUAL_MODE or NO_DATA_VISUAL_MODE.
void SetCrypting(int crypting)
Set the crypting status for the vme.
virtual void SetTimeStamp(albaTimeStamp t)
Set the time for this VME (not for the whole tree).
virtual int InternalInitialize()
used to initialize the AbsMatrixPipe
bool m_DependsOnLinkedNode
enable/disable calculation of MTime considering links
data structure used to store a link VME and its Id
albaOldSubIdLink(albaString name, albaID id=-1, albaID sub_id=-1)
data structure used to store a link VME and its Id
albaVMEBackLink(albaString name, albaVME *node=NULL)
data structure used to store a link VME and its Id
albaVMELink(albaID id=-1, albaVME *node=NULL, LinkType type=NORMAL_LINK)