ALBA
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
albaVME Class Referenceabstract

#include <albaVME.h>

Inheritance diagram for albaVME:
Inheritance graph
[legend]
Collaboration diagram for albaVME:
Collaboration graph
[legend]

Classes

struct  VmeLinks
 
struct  VmePointerMap
 

Public Types

enum  VME_WIDGET_ID { ID_NAME = MINID , ID_PRINT_INFO , ID_HELP , ID_LAST }
 
enum  VME_VISUAL_MODE { DEFAULT_VISUAL_MODE = 0 , NO_DATA_VISUAL_MODE }
 
typedef std::vector< albaAutoPointer< albaVME > > albaChildrenVector
 
typedef std::map< albaString, albaAutoPointer< albaAttribute > > albaAttributesMap
 
typedef std::map< albaString, albaVMELinkalbaLinksMap
 
typedef std::set< albaVME * > albaVMESet
 
typedef std::vector< albaVMEBackLinkalbaVMEBackLinks
 

Public Member Functions

 albaAbstractTypeMacro (albaVME, albaReferenceCounted)
 
virtual albaObjectNewObjectInstance () const
 
albaVMENewInstance ()
 
int Initialize ()
 
void Shutdown ()
 
int IsInitialized ()
 
int Store ()
 
int Restore ()
 
const char * GetName ()
 
virtual void SetName (const char *name)
 
virtual bool CanCopy (albaVME *vme)
 
albaVMEMakeCopy ()
 
albaVMECopyTree ()
 
albaVMEGetChild (albaID idx, bool onlyVisible=false)
 
albaVMEGetFirstChild (bool onlyVisible=false)
 
albaVMEGetLastChild (bool onlyVisible=false)
 
albaVMEGetByPath (const char *path, bool onlyVisible=true)
 
virtual int AddChild (albaVME *node)
 
virtual void RemoveChild (const albaID idx, bool onlyVisible=false)
 
virtual void RemoveChild (albaVME *node)
 
int FindNodeIdx (albaVME *a, bool onlyVisible=false)
 
int FindNodeIdx (const char *name, bool onlyVisible=false)
 
albaVMEFindInTreeByTag (const char *name, const char *value="", int type=ALBA_STRING_TAG)
 
albaVMEFindInTreeByName (const char *name, bool match_case=true, bool whole_word=true)
 
albaVMEFindInTreeById (const albaID id)
 
virtual int ReparentTo (albaVME *parent)
 
void Import (albaVME *tree)
 
bool IsAChild (albaVME *a)
 
bool IsInTree (albaVME *a)
 
albaVMEGetRoot ()
 
bool IsEmpty () const
 
bool IsOnVMETree ()
 
unsigned long GetNumberOfChildren () const
 
unsigned long GetNumberOfChildren (bool onlyVisible)
 
void CleanTree ()
 
void RemoveAllChildren ()
 
albaVMEIteratorNewIterator ()
 
void SetVisibleToTraverse (bool flag)
 
bool GetVisibleToTraverse ()
 
bool IsVisible ()
 
bool CompareTree (albaVME *vme)
 
virtual void UnRegister (void *o)
 
virtual void OnEvent (albaEventBase *e)
 
const albaChildrenVectorGetChildren ()
 
albaAttributesMapGetAttributes ()
 
void SetAttribute (const char *name, albaAttribute *a)
 
albaAttributeGetAttribute (const char *name)
 
void RemoveAttribute (const char *name)
 
void RemoveAllAttributes ()
 
albaTagArrayGetTagArray ()
 
albaVMEGetLink (const char *name)
 
void SetLink (const char *name, albaVME *node)
 
void SetMandatoryLink (const char *name, albaVME *node)
 
void SetLink (const char *name, albaVME *node, LinkType type)
 
void AddBackLink (const char *name, albaVME *node)
 
void RemoveBackLink (const char *name, albaVME *node)
 
void SetOldSubIdLink (albaString link_name, albaID link_node_id, albaID link_node_subid)
 
void RemoveLink (const char *name)
 
albaID GetNumberOfLinks ()
 
albaID GetNumberOfBackLinks ()
 
albaVMEBackLinks GetBackLinks ()
 
void RemoveAllLinks ()
 
void RemoveAllBackLinks ()
 
albaVMESet GetDependenciesVMEs ()
 
void RemoveDependenciesVMEs ()
 
bool WillBeRemovedWithDependencies (albaVME *vme)
 
albaLinksMapGetLinks ()
 
void ForwardUpEvent (albaEventBase *alba_event)
 
void ForwardUpEvent (albaEventBase &alba_event)
 
void ForwardDownEvent (albaEventBase *alba_event)
 
void ForwardDownEvent (albaEventBase &alba_event)
 
albaGUIGetGui ()
 
void DeleteGui ()
 
albaID GetId () const
 
void UpdateId ()
 
virtual unsigned long GetMTime ()
 
void DependsOnLinkedNodeOn ()
 
void DependsOnLinkedNodeOff ()
 
virtual void Print (std::ostream &os, const int tabs=0)
 
albaVMEGetParent () const
 
virtual int DeepCopy (albaVME *a)
 
virtual int ShallowCopy (albaVME *a)
 
virtual bool Equals (albaVME *vme)
 
virtual void SetTimeStamp (albaTimeStamp t)
 
virtual albaTimeStamp GetTimeStamp ()
 
void SetTreeTime (albaTimeStamp t)
 
virtual void SetMatrix (const albaMatrix &mat)=0
 
void SetPose (const albaMatrix &mat, albaTimeStamp t)
 
void SetPose (double x, double y, double z, double rx, double ry, double rz, albaTimeStamp t)
 
void SetPose (double xyz[3], double rxyz[3], albaTimeStamp t)
 
void ApplyMatrix (const albaMatrix &matrix, int premultiply, albaTimeStamp t=-1)
 
void SetAbsPose (double x, double y, double z, double rx, double ry, double rz, albaTimeStamp t=-1)
 
void SetAbsPose (double xyz[3], double rxyz[3], albaTimeStamp t=-1)
 
void SetAbsMatrix (const albaMatrix &matrix, albaTimeStamp t)
 
virtual void SetAbsMatrix (const albaMatrix &matrix)
 
void ApplyAbsMatrix (const albaMatrix &matrix, int premultiply, albaTimeStamp t=-1)
 
virtual bool CanReparentTo (albaVME *parent)
 
albaMatrixPipeGetMatrixPipe ()
 
albaAbsMatrixPipeGetAbsMatrixPipe ()
 
albaDataPipeGetDataPipe ()
 
virtual void Update ()
 
virtual void GetLocalTimeStamps (std::vector< albaTimeStamp > &kframes)=0
 
virtual void GetLocalTimeBounds (albaTimeStamp tbounds[2])
 
virtual void GetAbsTimeStamps (std::vector< albaTimeStamp > &kframes)
 
virtual void GetTimeStamps (std::vector< albaTimeStamp > &kframes)
 
int GetNumberOfTimeStamps ()
 
int GetNumberOfLocalTimeStamps ()
 
virtual bool IsAnimated ()
 
virtual bool IsDataAvailable ()
 
void SetCrypting (int crypting)
 
int GetCrypting ()
 
virtual albaVMEOutputGetOutput ()
 
virtual albaString GetVisualPipe ()
 
virtual albaString GetVisualPipeSlice ()
 
void SetVisualMode (int mode)
 
int GetVisualMode ()
 
albaInteractorGetBehavior ()
 
void SetBehavior (albaInteractor *bh)
 
void TestModeOn ()
 
void TestModeOff ()
 
bool GetTestMode ()
 
- Public Member Functions inherited from albaReferenceCounted
 albaReferenceCounted ()
 
virtual ~albaReferenceCounted ()
 
 albaAbstractTypeMacro (albaReferenceCounted, albaObject)
 
virtual void Delete ()
 
void Register (void *obj)
 
virtual void UnRegister (void *obj)
 
int GetReferenceCount ()
 
void SetReferenceCount (int)
 
- Public Member Functions inherited from albaObject
 albaObject ()
 
virtual ~albaObject ()
 
virtual void Delete ()
 
virtual const char * GetTypeName () const
 
virtual bool IsA (const char *type_name) const
 
virtual bool IsA (const albaTypeID &type_id) const
 
virtual albaObjectNewObjectInstance () const =0
 
virtual const albaTypeIDGetTypeId () const
 
virtual void Print (std::ostream &os, const int indent=0) const
 
 albaObject (const albaObject &c)
 
- Public Member Functions inherited from albaEventBroadcaster
 albaEventBroadcaster (void *owner=NULL)
 
virtual ~albaEventBroadcaster ()
 
 albaEventBroadcaster (const albaEventBroadcaster &c)
 
void AddObserver (albaObserver *obj)
 
void AddObserver (albaObserver &obj)
 
albaObserverCallbackAddObserverCallback (void(*f)(void *sender, albaID eid, void *clientdata, void *calldata))
 
bool RemoveObserver (albaObserver *obj)
 
void RemoveAllObservers ()
 
bool IsObserver (albaObserver *obj)
 
bool HasObservers ()
 
void GetObservers (std::vector< albaObserver * > &olist)
 
void InvokeEvent (albaEventBase &e)
 
void InvokeEvent (albaEventBase *e)
 
void InvokeEvent (void *sender, albaID id=ID_NO_EVENT, void *data=NULL)
 
void SetChannel (albaID ch)
 
albaID GetChannel ()
 
virtual void SetListener (albaObserver *o)
 
- Public Member Functions inherited from albaEventSender
 albaEventSender ()
 
virtual void SetListener (albaObserver *o)
 
virtual albaObserverGetListener ()
 
virtual bool HasListener ()
 
virtual void InvokeEvent (albaEventBase &e)
 
virtual void InvokeEvent (albaEventBase *e)
 
virtual void InvokeEvent (void *sender, albaID id=ID_NO_EVENT, void *data=NULL)
 
- Public Member Functions inherited from albaStorable
 albaStorable ()
 
int Store (albaStorageElement *element)
 
int Restore (albaStorageElement *element)
 
albaObjectCastToObject ()
 
bool IsStorable ()
 
- Public Member Functions inherited from albaObserver
 albaObserver ()
 
virtual ~albaObserver ()
 
virtual void OnEvent (albaEventBase *e)=0
 
- Public Member Functions inherited from albaTimeStamped
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 

Static Public Member Functions

static albaVMEMakeCopy (albaVME *a)
 
static albaVMECopyTree (albaVME *vme, albaVME *parent=NULL)
 
static char ** GetIcon ()
 
- Static Public Member Functions inherited from albaObject
static const char * GetStaticTypeName ()
 
static bool IsStaticType (const char *type_name)
 
static bool IsStaticType (const albaTypeID &type_id)
 
static const albaTypeIDGetStaticTypeId ()
 
static albaObjectSafeDownCast (albaObject *o)
 
- Static Public Member Functions inherited from albaStorable
static albaStorableSafeCastToObject (albaObject *o)
 

Protected Member Functions

 albaVME ()
 
virtual ~albaVME ()
 
void SetId (albaID id)
 
virtual int InternalStore (albaStorageElement *parent)
 
virtual int InternalRestore (albaStorageElement *node)
 
virtual void InternalShutdown ()
 
virtual int SetParent (albaVME *parent)
 
void OnNodeDetachedFromTree (albaEventBase *e)
 
void OnNodeAttachedToTree (albaEventBase *e)
 
void OnNodeDestroyed (albaEventBase *e)
 
void GetDependenciesVMEs (albaVMESet &dependencies, albaVME *vme)
 
virtual int InternalInitialize ()
 
virtual void InternalPreUpdate ()
 
virtual void InternalUpdate ()
 
virtual void InternalSetTimeStamp (albaTimeStamp t)
 
void SetOutput (albaVMEOutput *output)
 
virtual int SetDataPipe (albaDataPipe *dpipe)
 
int SetMatrixPipe (albaMatrixPipe *pipe)
 
albaString GetTypeNameFromType (albaString typeName)
 
void SetAbsMatrixPipe (albaAbsMatrixPipe *pipe)
 
virtual albaGUICreateGui ()
 
void NodeOnEvent (albaEventBase *e)
 
virtual int InternalStore (albaStorageElement *node)=0
 
virtual int InternalRestore (albaStorageElement *node)=0
 

Static Protected Member Functions

static albaVMEInternalCopyTree (albaVME *vme, albaVME *parent)
 

Protected Attributes

albaGUIm_Gui
 
albaChildrenVector m_Children
 
albaVMEm_Parent
 
albaAttributesMap m_Attributes
 
albaLinksMap m_Links
 
albaVMEBackLinks m_BackLinks
 
std::vector< albaOldSubIdLinkm_OldSubIdLinks
 
albaString m_Name
 
albaString m_GuiName
 
albaID m_Id
 
bool m_VisibleToTraverse
 
bool m_Initialized
 
bool m_DependsOnLinkedNode
 
bool m_TestMode
 
albaAutoPointer< albaDataPipem_DataPipe
 
albaAutoPointer< albaMatrixPipem_MatrixPipe
 
albaAutoPointer< albaAbsMatrixPipem_AbsMatrixPipe
 
albaVMEOutputm_Output
 
albaTimeStamp m_CurrentTime
 
int m_Crypting
 
albaInteractorm_Behavior
 
int m_VisualMode
 
- Protected Attributes inherited from albaReferenceCounted
int m_ReferenceCount
 
- Protected Attributes inherited from albaObject
bool m_HeapFlag
 
- Protected Attributes inherited from albaEventBroadcaster
albaObserversList m_Observers
 
albaID m_Channel
 
- Protected Attributes inherited from albaEventSender
albaObserverm_Listener
 
- Protected Attributes inherited from albaStorable
bool m_Storable
 
- Protected Attributes inherited from albaTimeStamped
albaMTime m_MTime
 

Additional Inherited Members

- Protected Types inherited from albaEventBroadcaster
typedef std::list< albaObserver * > albaObserversList
 

Detailed Description

albaVME -

albaVME is a node for sciViz purposes. It features a procedural core generating an output data structure storing a pose matrix and a VTK dataset. The albaVME generates also an absolute pose matrix, a matrix representing the pose of the VME in the world reference system. albaVME has an output with a pose matrix and a VTK dataset.

This class also implements a m-way tree. A VME can be seen as a tree node. You can add/remove nodes by means of AddChild and RemoveChild. To access the tree you can use GetChild(). You can also obtain an iterator to iterate through the tree with a simple for (;;) loop. This node implementation take advantage of the ALBA reference counting mechanism. To avoid confusion constructor and destructor have been protected. To allocate a node use New() and to deallocate use Delete() or UnRegister(). To create a copy of the node you can use MakeCopy(). To copy node content use DeepCopy(). Any node has a CanCopy() to test if copying from a different node type i possible. A number of functions allow to query the tree, like IsEmpty(), IsInTree(), GetRoot(), GetNumberOfChildren(), FindNodeIdx(), FindInTreeByName(), FindInTreeById(), IsAChild(), GetParent(). A special features allow to make a node to be skipped by iterators: SetVisibleToTraverse() and IsVisible(). Comparison between nodes and trees can be accomplished through Equals() and CompareTree(). Nore reparenting can be performed through ReparentTo(). This function returns ALBA_ERROR in case reparenting is not allowed. Each node type can decide nodes to which it can be reparented by redefining the CanReparentTo() virtual function. Also each node type can decide nodes it is accepting as a child by redefining the AddChild() which also can return ALBA_ERROR in case of denied reparenting. A node can detach all children RemoveAllChildren() and an entire tree can be cleaned, by detaching each sub node, through CleanTree(). Nodes inherits from albaTimeStamped a modification time updated each time Modified() is called, that can be retrieved with GetMTime(). A tree can be initialized by calling Initialize() of its root, and deinitialized by means of Shutdown(). When attaching a node to an initialised tree the node is automatically initialized.

Todo:
  • events invoking
  • add storing of Id and Links
  • test Links and Id
  • test FindInTree functions
  • test node events (attach/detach from tree, destroy)
  • test DeepCopy()
See also
albaVMEIterator
Todo:
  • implement the GetMTime() function: it's used by pipeline to trigger the update
  • Change the SetParent to update the AbsMatrixPipe connections
  • fix the VME_TIME_SET issuing and propagation
  • implement Update() function

Definition at line 149 of file albaVME.h.

Member Typedef Documentation

◆ albaChildrenVector

Definition at line 353 of file albaVME.h.

◆ albaAttributesMap

Definition at line 360 of file albaVME.h.

◆ albaLinksMap

Definition at line 388 of file albaVME.h.

◆ albaVMESet

typedef std::set<albaVME *> albaVME::albaVMESet

Definition at line 389 of file albaVME.h.

◆ albaVMEBackLinks

Definition at line 390 of file albaVME.h.

Member Enumeration Documentation

◆ VME_WIDGET_ID

IDs for the GUI.

Enumerator
ID_NAME 
ID_PRINT_INFO 
ID_HELP 
ID_LAST 

Definition at line 156 of file albaVME.h.

◆ VME_VISUAL_MODE

Enumerator
DEFAULT_VISUAL_MODE 
NO_DATA_VISUAL_MODE 

Definition at line 485 of file albaVME.h.

Constructor & Destructor Documentation

◆ albaVME()

albaVME::albaVME ( )
protected

◆ ~albaVME()

virtual albaVME::~albaVME ( )
protectedvirtual

Member Function Documentation

◆ albaAbstractTypeMacro()

albaVME::albaAbstractTypeMacro ( albaVME  ,
albaReferenceCounted   
)

◆ NewObjectInstance()

virtual albaObject * albaVME::NewObjectInstance ( ) const
inlinevirtual

defined to allow MakeCopy implementation.

For the base class return a NULL pointer.

Implements albaObject.

Definition at line 165 of file albaVME.h.

◆ NewInstance()

albaVME * albaVME::NewInstance ( )
inline

Interface to allow creation of a copy of the node (works only for concrete subclasses)

Definition at line 168 of file albaVME.h.

◆ Initialize()

int albaVME::Initialize ( )

Initialize this node.

Subclasses can redefine InternalInitialize() to customize the initialization. A node is typically initialized when added to the tree, or just after tree loading in case of load from storage.

◆ Shutdown()

void albaVME::Shutdown ( )

Shutdown this node.

Subclasses can redefine InternalShutdown() to customize actions for shutting down. A node is typically shutdown when detached from the tree

◆ IsInitialized()

int albaVME::IsInitialized ( )
inline

Return true if this agent has been initialized.

Definition at line 183 of file albaVME.h.

◆ Store()

int albaVME::Store ( )

serialize the object on a store.

Todo:
syntax to be changed

◆ Restore()

int albaVME::Restore ( )

unserialized the object from a storage.

Todo:
syntax to be changed

◆ GetName()

const char * albaVME::GetName ( )
inline

return the name of this node

Definition at line 192 of file albaVME.h.

◆ SetName()

virtual void albaVME::SetName ( const char *  name)
virtual

set node name

◆ CanCopy()

virtual bool albaVME::CanCopy ( albaVME vme)
virtual

TODO: to be moved to albaVME perform a copy by simply referencing the copied node's data array.

Beware: This can allow to save memory when doing special tasks, but can be very dangerous making one of the VME inconsistent. Some nodes do not support such a function! Test if the given node instance can be copied into this. This function should be reimplemented into subclasses classes

◆ MakeCopy() [1/2]

static albaVME * albaVME::MakeCopy ( albaVME a)
static

Create a copy of this node (do not copy the sub tree,just the node)

◆ MakeCopy() [2/2]

albaVME * albaVME::MakeCopy ( )
inline

Definition at line 211 of file albaVME.h.

References MakeCopy().

Referenced by MakeCopy().

Here is the call graph for this function:

◆ CopyTree() [1/2]

static albaVME * albaVME::CopyTree ( albaVME vme,
albaVME parent = NULL 
)
static

Copy the given VME tree into a new tree.

In case a parent is provided, link the new root node to it. Return the root of the new tree.

◆ CopyTree() [2/2]

albaVME * albaVME::CopyTree ( )
inline

Make a copy of the whole subtree and return its pointer.

Definition at line 218 of file albaVME.h.

References CopyTree().

Referenced by CopyTree().

Here is the call graph for this function:

◆ GetChild()

albaVME * albaVME::GetChild ( albaID  idx,
bool  onlyVisible = false 
)

Return a the pointer to a child given its index.

If only visible is true return the idx-th visible to traverse node

◆ GetFirstChild()

albaVME * albaVME::GetFirstChild ( bool  onlyVisible = false)

Get the First child in the list.

If only visible is true return the first visible to traverse node

◆ GetLastChild()

albaVME * albaVME::GetLastChild ( bool  onlyVisible = false)

Get the Lase child in the list.

If only visible is true return the last visible to traverse node

◆ GetByPath()

albaVME * albaVME::GetByPath ( const char *  path,
bool  onlyVisible = true 
)

Get A child by path.

The pats are generated from a series of keyword divided by '\'

The possible keywords are: next: return the next node at same level prev: return the previous node at same level firstPair: return the first node at same level lastPair: return the last node at same level firstChild: return the first node between children lastChild: return the last node between children pair[<number>]: return the <number>-th node between pairs pair{<node name>}: return the node named <node name> between pairs child[<number>]: return the <number>-th node between children child{<node name>}: return the node named <node name> between children ..:

An example path is: "../../child{sideB}/child[2]"

By default this function search only on visible to traverse nodes

◆ AddChild()

virtual int albaVME::AddChild ( albaVME node)
virtual

Add a child to this node.

Return ALBA_OK if success.

◆ RemoveChild() [1/2]

virtual void albaVME::RemoveChild ( const albaID  idx,
bool  onlyVisible = false 
)
virtual

Remove a child node.

◆ RemoveChild() [2/2]

virtual void albaVME::RemoveChild ( albaVME node)
virtual

Remove a child node.

◆ FindNodeIdx() [1/2]

int albaVME::FindNodeIdx ( albaVME a,
bool  onlyVisible = false 
)

Find a child given its pointer and return its index.

Return -1 in case of not found or failure. If only visible is true return the idx of visible to traverse nodes subset

◆ FindNodeIdx() [2/2]

int albaVME::FindNodeIdx ( const char *  name,
bool  onlyVisible = false 
)

Find a child index given its name.

Search is performed only on first level children not in the sub-tree. Return -1 in case of not found or failure. If only visible is true return the idx of visible to traverse nodes subset

◆ FindInTreeByTag()

albaVME * 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.

◆ FindInTreeByName()

albaVME * 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.

◆ FindInTreeById()

albaVME * albaVME::FindInTreeById ( const albaID  id)

Find a node in all the subtrees matching the given VME Name.

◆ ReparentTo()

virtual int albaVME::ReparentTo ( albaVME parent)
virtual

Reparent this Node into a different place of the same tree.

BEWARE: Reparent into a different tree is allowed, but could generate bad problems. Inherited classes should reimplement this function to avoid these problems when reparenting to different trees. To move a node into a different tree you better use DeepCopy to copy it into a Node of that tree.

◆ Import()

void albaVME::Import ( albaVME tree)

Import all children of another tree into this tree.

◆ IsAChild()

bool albaVME::IsAChild ( albaVME a)

Return true if the given one is a child of this node.

◆ IsInTree()

bool albaVME::IsInTree ( albaVME a)

Find a node in all the subtrees, searching recursively into sub nodes.

Return true if found.

◆ GetRoot()

albaVME * albaVME::GetRoot ( )

Return the root of the tree this node owns to.

◆ IsEmpty()

bool albaVME::IsEmpty ( ) const
inline

Definition at line 302 of file albaVME.h.

◆ IsOnVMETree()

bool albaVME::IsOnVMETree ( )
inline

Valid VMEs have m_ID >= 0.

The root has m_Id = 0, other VMEs have m_Id > 0.

Definition at line 305 of file albaVME.h.

◆ GetNumberOfChildren() [1/2]

unsigned long albaVME::GetNumberOfChildren ( ) const

Return the number of children of this node If only visible is true return the number visible to traverse nodes.

◆ GetNumberOfChildren() [2/2]

unsigned long albaVME::GetNumberOfChildren ( bool  onlyVisible)

Return the number of children of this node If only visible is true return the number visible to traverse nodes.

◆ CleanTree()

void albaVME::CleanTree ( )

Remove recursively all nodes from this tree, forcing all subnodes to detach their children.

You better use RemoveAllChildren instead!!!

◆ RemoveAllChildren()

void albaVME::RemoveAllChildren ( )

Remove all children nodes.

If the children are not referenced by other objects they will be automatically deallocated by UnRegister() mechanism, and the removal will recurse.

◆ NewIterator()

albaVMEIterator * albaVME::NewIterator ( )

Return a new Tree iterator already set to traverse the sub tree starting a this node.

Remember to delete the iterator after use it.

◆ SetVisibleToTraverse()

void albaVME::SetVisibleToTraverse ( bool  flag)
inline

Set/Get the flag to make this VME visible to tree traversal.

albaVMEIterator, GetSpaceBounds and Get4DBounds will skip this VME if the flag is OFF.

Definition at line 334 of file albaVME.h.

◆ GetVisibleToTraverse()

bool albaVME::GetVisibleToTraverse ( )
inline

Definition at line 335 of file albaVME.h.

◆ IsVisible()

bool albaVME::IsVisible ( )
inline

Return true if visible to tree traversal.

Definition at line 338 of file albaVME.h.

Referenced by albaVMEIterator::IsVisible().

◆ CompareTree()

bool albaVME::CompareTree ( albaVME vme)

Compare the two subtrees starting from this node with the given one.

Two trees are considered equivalent if they have equivalent nodes (

See also
Equals() ), and are disposed in the same hierarchy. Order of children node is significative for comparison!

◆ UnRegister()

virtual void albaVME::UnRegister ( void *  o)
virtual

redefined to cope with tree registering

Reimplemented from albaReferenceCounted.

◆ OnEvent()

virtual void albaVME::OnEvent ( albaEventBase e)
virtual

Precess events coming from other objects.

Implements albaObserver.

Reimplemented in albaVMERoot.

◆ GetChildren()

const albaChildrenVector * albaVME::GetChildren ( )
inline

return list of children.

The returned list is a const, since it can be modified by means of nodes APIs

Definition at line 358 of file albaVME.h.

◆ GetAttributes()

albaAttributesMap * albaVME::GetAttributes ( )
inline

return the list of attributes.

Attributes vector can be manipulated directly by means of the map container APIs.

Definition at line 365 of file albaVME.h.

◆ SetAttribute()

void albaVME::SetAttribute ( const char *  name,
albaAttribute a 
)

Set a new attribute.

The given attribute is

◆ GetAttribute()

albaAttribute * albaVME::GetAttribute ( const char *  name)

return an attribute given the name

◆ RemoveAttribute()

void albaVME::RemoveAttribute ( const char *  name)

remove an attibute

◆ RemoveAllAttributes()

void albaVME::RemoveAllAttributes ( )

remove all the attributes of this node

◆ GetTagArray()

albaTagArray * albaVME::GetTagArray ( )

return a pointer to the tag array attribute.

If this attribute doesn't exist yet, create a new one. TagArray is a map storing pairs of Name<->components, where components are an array of albaStrings. It's a simple way to attach persistent attributes. For more complex attributes customized classes should be created, inheriting from albaAttribute (e.g.

See also
mmaMaterial).

◆ GetLink()

albaVME * albaVME::GetLink ( const char *  name)

return the value of a link to another node in the tree.

If no link with such a name exists return NULL. this function returns both links and mandatory links

◆ SetLink() [1/2]

void albaVME::SetLink ( const char *  name,
albaVME node 
)

set a link to another node in the tree, if node is NULL current link is removed

◆ SetMandatoryLink()

void albaVME::SetMandatoryLink ( const char *  name,
albaVME node 
)

set a mandatory link to another node in the tree, if node is NULL current link is removed

◆ SetLink() [2/2]

void albaVME::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

◆ AddBackLink()

void albaVME::AddBackLink ( const char *  name,
albaVME node 
)

set a mandatory link to another node in the tree

◆ RemoveBackLink()

void albaVME::RemoveBackLink ( const char *  name,
albaVME node 
)

set a mandatory link to another node in the tree

◆ SetOldSubIdLink()

void albaVME::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 not use this.

◆ RemoveLink()

void albaVME::RemoveLink ( const char *  name)

remove a link

◆ GetNumberOfLinks()

albaID albaVME::GetNumberOfLinks ( )
inline

return the number of links stored in this Node

Definition at line 421 of file albaVME.h.

◆ GetNumberOfBackLinks()

albaID albaVME::GetNumberOfBackLinks ( )
inline

return the number of back links of this Node

Definition at line 424 of file albaVME.h.

◆ GetBackLinks()

albaVMEBackLinks albaVME::GetBackLinks ( )
inline

return a copy of the vector of back links of this Node

Definition at line 427 of file albaVME.h.

◆ RemoveAllLinks()

void albaVME::RemoveAllLinks ( )

remove all links

◆ RemoveAllBackLinks()

void albaVME::RemoveAllBackLinks ( )
inline

remove all back links

Definition at line 433 of file albaVME.h.

◆ GetDependenciesVMEs() [1/2]

albaVMESet albaVME::GetDependenciesVMEs ( )

Return a set of all VME depending on this vme or is subtree.

◆ RemoveDependenciesVMEs()

void albaVME::RemoveDependenciesVMEs ( )

Removes all the VME that are depending on the current VME.

◆ WillBeRemovedWithDependencies()

bool albaVME::WillBeRemovedWithDependencies ( albaVME vme)

Return true if vme will be removed on Remove Dependencies A VME will be removed if is contained on dependencies list or if is contained in a sub-tree of the dependencies.

◆ GetLinks()

albaLinksMap * albaVME::GetLinks ( )
inline

return links array: links from this node to other arrays

Definition at line 447 of file albaVME.h.

◆ ForwardUpEvent() [1/2]

void albaVME::ForwardUpEvent ( albaEventBase alba_event)

used to send an event up in the tree

◆ ForwardUpEvent() [2/2]

void albaVME::ForwardUpEvent ( albaEventBase alba_event)

◆ ForwardDownEvent() [1/2]

void albaVME::ForwardDownEvent ( albaEventBase alba_event)

used to send an event down in the tree

◆ ForwardDownEvent() [2/2]

void albaVME::ForwardDownEvent ( albaEventBase alba_event)

◆ GetGui()

albaGUI * albaVME::GetGui ( )

create and return the GUI for changing the node parameters

◆ DeleteGui()

void albaVME::DeleteGui ( )

destroy the Gui

◆ GetId()

albaID albaVME::GetId ( ) const

return the Id of this node in the tree

◆ GetIcon()

static char ** albaVME::GetIcon ( )
static

return an xpm-icon that can be used to represent this node

◆ UpdateId()

void albaVME::UpdateId ( )

Check if m_Id and regenerate it if is invalid (-1)

◆ GetMTime()

virtual unsigned long albaVME::GetMTime ( )
virtual

Return the modification time.

Reimplemented from albaTimeStamped.

◆ DependsOnLinkedNodeOn()

void albaVME::DependsOnLinkedNodeOn ( )
inline

Turn on the flag to calculate the timestamp considering also the linked nodes.

Definition at line 479 of file albaVME.h.

◆ DependsOnLinkedNodeOff()

void albaVME::DependsOnLinkedNodeOff ( )
inline

Turn off the flag to calculate the timestamp considering also the linked nodes.

Definition at line 483 of file albaVME.h.

◆ Print()

virtual void albaVME::Print ( std::ostream &  os,
const int  tabs = 0 
)
virtual

print a dump of this object

Reimplemented in albaVMERoot.

◆ GetParent()

albaVME * albaVME::GetParent ( ) const
inline

return the parent VME Node.

Notice that a VME can only reparented under another VME, not to other kind of nodes!

Definition at line 499 of file albaVME.h.

◆ DeepCopy()

virtual int albaVME::DeepCopy ( albaVME a)
virtual

Copy the contents of another VME into this one.

Notice that subtrees are not copied, i.e. copy is not recursive! Concrete class should reimplement this function to verify admitted conversion.

Reimplemented in albaVMERoot.

◆ ShallowCopy()

virtual int albaVME::ShallowCopy ( albaVME a)
virtual

perform a copy by simply referencing the copied VME's data array.

Beware: This can allow to save memory when doing special tasks, but can be very dangerous making one of the VME inconsistent. Some VMEs do not support such a function!

◆ Equals()

virtual bool albaVME::Equals ( albaVME vme)
virtual

Compare two VMEs.

The specific comparison must be implemented by subclasses.

Reimplemented in albaVMERoot.

◆ SetTimeStamp()

virtual void albaVME::SetTimeStamp ( albaTimeStamp  t)
virtual

Set the time for this VME (not for the whole tree).

Normally time of the tree is set by sending an event with id VME_TIME_SET

◆ GetTimeStamp()

virtual albaTimeStamp albaVME::GetTimeStamp ( )
virtual

◆ SetTreeTime()

void albaVME::SetTreeTime ( albaTimeStamp  t)

Set/Get CurrentTime for this VME and all subtree.

Normally time of the tree is set by sending an event with id VME_TIME_SET

◆ SetMatrix()

virtual void albaVME::SetMatrix ( const albaMatrix mat)
pure virtual

Set the Pose matrix of the VME.

This function modifies pose matrix of the VME. The pose is modified for the given timestamp, if VME supports 4D pose (e.g. MatrixVector of VME-Generic) the output matrix is interpolated among set key matrices.

Implemented in albaVMERoot.

◆ SetPose() [1/3]

void albaVME::SetPose ( const albaMatrix mat,
albaTimeStamp  t 
)

set the pose matrix for a specific time stamp (ignore the matrix internal timestamp!)

◆ SetPose() [2/3]

void albaVME::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.

The pose is modified for the given timestamp, if VME supports 4D pose (e.g. MatrixVector of VME-Generic) the output matrix is interpolated among set key matrices.

◆ SetPose() [3/3]

void albaVME::SetPose ( double  xyz[3],
double  rxyz[3],
albaTimeStamp  t 
)

Set the pose for this VME This function modifies pose matrix of the VME.

The pose is modified for the given timestamp, if VME supports 4D pose (e.g. MatrixVector of VME-Generic) the output matrix is interpolated among set key matrices.

◆ ApplyMatrix()

void albaVME::ApplyMatrix ( const albaMatrix matrix,
int  premultiply,
albaTimeStamp  t = -1 
)

apply a matrix to the VME pose matrix

◆ SetAbsPose() [1/2]

void albaVME::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".

This function usually modifies the MatrixVector.

◆ SetAbsPose() [2/2]

void albaVME::SetAbsPose ( double  xyz[3],
double  rxyz[3],
albaTimeStamp  t = -1 
)

Set the global pose of this VME for the given time "t".

This function usually modifies the MatrixVector.

◆ SetAbsMatrix() [1/2]

void albaVME::SetAbsMatrix ( const albaMatrix matrix,
albaTimeStamp  t 
)

Set the global pose of this VME for the given time "t".

This function usually modifies the MatrixVector.

◆ SetAbsMatrix() [2/2]

virtual void albaVME::SetAbsMatrix ( const albaMatrix matrix)
virtual

Set the global pose of this VME for the current time.

This function usually modifies the MatrixVector.

◆ ApplyAbsMatrix()

void albaVME::ApplyAbsMatrix ( const albaMatrix matrix,
int  premultiply,
albaTimeStamp  t = -1 
)

apply a matrix to the VME abs pose matrix

◆ CanReparentTo()

virtual bool albaVME::CanReparentTo ( albaVME parent)
virtual

return true if the VME can be reparented under the specified node

Reimplemented in albaVMERoot.

◆ GetMatrixPipe()

albaMatrixPipe * albaVME::GetMatrixPipe ( )
inline

Set auxiliary reference system and its name.

Get auxiliary reference system from its name return the matrix pipe object, i.e. the source of the output matrix.

Definition at line 582 of file albaVME.h.

◆ GetAbsMatrixPipe()

albaAbsMatrixPipe * albaVME::GetAbsMatrixPipe ( )
inline

return the matrix pipe used for computing the AbsMatrix.

Definition at line 585 of file albaVME.h.

◆ GetDataPipe()

albaDataPipe * albaVME::GetDataPipe ( )
inline

return the data pipe object, i.e.

the source of the output dataset.

Definition at line 588 of file albaVME.h.

◆ Update()

virtual void albaVME::Update ( )
virtual

this function makes the current data pointer to point the right output data, usually the DataPipe output data but subclasses can redefine this function.

By default if no data pipe is defined, current data is set to NULL.

Reimplemented in albaVMERoot.

◆ GetLocalTimeStamps()

virtual void albaVME::GetLocalTimeStamps ( std::vector< albaTimeStamp > &  kframes)
pure virtual

Return the list of timestamps for this VME.

Timestamps list is obtained merging timestamps for matrices and VME items

Implemented in albaVMERoot.

◆ GetLocalTimeBounds()

virtual void albaVME::GetLocalTimeBounds ( albaTimeStamp  tbounds[2])
inlinevirtual

Set the time bounds for the time varying VME (base VME is not time varying).

Definition at line 603 of file albaVME.h.

◆ GetAbsTimeStamps()

virtual void albaVME::GetAbsTimeStamps ( std::vector< albaTimeStamp > &  kframes)
virtual

Return the list of timestamps considering all parents timestamps.

Timestamps list is obtained merging timestamps for matrices and VME items

◆ GetTimeStamps()

virtual void albaVME::GetTimeStamps ( std::vector< albaTimeStamp > &  kframes)
virtual

Return the list of timestamps for the full sub tree.

Timestamps list is obtained merging timestamps for matrices and VME items

◆ GetNumberOfTimeStamps()

int albaVME::GetNumberOfTimeStamps ( )

Return the number of time stamps in the whole tree.

◆ GetNumberOfLocalTimeStamps()

int albaVME::GetNumberOfLocalTimeStamps ( )

Return the number of time stamps local to the vme.

◆ IsAnimated()

virtual bool albaVME::IsAnimated ( )
virtual

Return true if the number of local time stamps is > 1.

◆ IsDataAvailable()

virtual bool albaVME::IsDataAvailable ( )
virtual

Return true if the data associated with the VME is present and updated at the current time.

◆ SetCrypting()

void albaVME::SetCrypting ( int  crypting)

Set the crypting status for the vme.

◆ GetCrypting()

int albaVME::GetCrypting ( )

Get the crypting status of the vme.

◆ GetOutput()

virtual albaVMEOutput * albaVME::GetOutput ( )
inlinevirtual

return a pointer to the output data structure

Definition at line 634 of file albaVME.h.

◆ GetVisualPipe()

virtual albaString albaVME::GetVisualPipe ( )
inlinevirtual

Return the suggested pipe-typename for the visualization of this vme.

Reimplemented in albaVMERoot.

Definition at line 637 of file albaVME.h.

◆ GetVisualPipeSlice()

virtual albaString albaVME::GetVisualPipeSlice ( )
inlinevirtual

Return the suggested pipe-typename for the visualization of this vme.

Definition at line 640 of file albaVME.h.

◆ SetVisualMode()

void albaVME::SetVisualMode ( int  mode)

Set the mode with which render the VME: DEFAULT_VISUAL_MODE or NO_DATA_VISUAL_MODE.

Setting the visual mode to default will produce also the reset of the m_EditingVisualPipe to the empty string. This because the editing visual pipe is set dynamically by the class that use this feature.

◆ GetVisualMode()

int albaVME::GetVisualMode ( )
inline

Get the mode with which render the VME: DEFAULT_VISUAL_MODE or NO_DATA_VISUAL_MODE.

Definition at line 649 of file albaVME.h.

◆ GetBehavior()

albaInteractor * albaVME::GetBehavior ( )
inline

return the interactor assigned as a behavior to this VME.

This is the interactor to which events coming from input devices are sent when user pick this VME. Responsible of this routing is the PER (

See also
albaInteractorPER)

Definition at line 655 of file albaVME.h.

◆ SetBehavior()

void albaVME::SetBehavior ( albaInteractor bh)
inline

set the interactor representing the behavior of this VME.

See also
GetBehavior()

Definition at line 658 of file albaVME.h.

◆ TestModeOn()

void albaVME::TestModeOn ( )
inline

Turn On m_TestMode flag.

The m_TestMode flag is used to exclude the execution of splash screen or wxBusyInfo that conflicts with test machine.

Definition at line 662 of file albaVME.h.

◆ TestModeOff()

void albaVME::TestModeOff ( )
inline

Used to turn off m_TestMode flag.

Definition at line 665 of file albaVME.h.

◆ GetTestMode()

bool albaVME::GetTestMode ( )
inline

Get TestMode.

Definition at line 668 of file albaVME.h.

◆ SetId()

void albaVME::SetId ( albaID  id)
protected

internally used to set the node ID

◆ InternalStore()

virtual int albaVME::InternalStore ( albaStorageElement node)
protectedvirtual

This is called by Store() and must be reimplemented by subclasses.

The node element where the object should store itself is passed as argument.

Implements albaStorable.

Reimplemented in albaVMERoot.

◆ InternalRestore()

virtual int albaVME::InternalRestore ( albaStorageElement node)
protectedvirtual

This is called by Restore() and must be reimplemented by subclasses The element from which the object should restore itself is passed as argument.

Implements albaStorable.

Reimplemented in albaVMERoot.

◆ InternalShutdown()

virtual void albaVME::InternalShutdown ( )
inlineprotectedvirtual

to be redefined by subclasses to define the shutdown actions

Definition at line 683 of file albaVME.h.

◆ SetParent()

virtual int albaVME::SetParent ( albaVME parent)
protectedvirtual

This function set the parent for this Node.

It returns a value to allow subclasses to implement selective reparenting.

◆ OnNodeDetachedFromTree()

void albaVME::OnNodeDetachedFromTree ( albaEventBase e)
protected

◆ OnNodeAttachedToTree()

void albaVME::OnNodeAttachedToTree ( albaEventBase e)
protected

◆ OnNodeDestroyed()

void albaVME::OnNodeDestroyed ( albaEventBase e)
protected

◆ GetDependenciesVMEs() [2/2]

void albaVME::GetDependenciesVMEs ( albaVMESet dependencies,
albaVME vme 
)
protected

Get the dependecies for the specified VME.

◆ InternalInitialize()

virtual int albaVME::InternalInitialize ( )
protectedvirtual

used to initialize the AbsMatrixPipe

◆ InternalPreUpdate()

virtual void albaVME::InternalPreUpdate ( )
inlineprotectedvirtual

called to prepare the update of output

Definition at line 701 of file albaVME.h.

◆ InternalUpdate()

virtual void albaVME::InternalUpdate ( )
inlineprotectedvirtual

update the output data structure

Definition at line 704 of file albaVME.h.

◆ InternalSetTimeStamp()

virtual void albaVME::InternalSetTimeStamp ( albaTimeStamp  t)
protectedvirtual

Set the time for this VME (not for the whole tree) without notifying listeners.

This method is called by SetTimeStamp method (that also notifies listeners).

◆ InternalCopyTree()

static albaVME * albaVME::InternalCopyTree ( albaVME vme,
albaVME parent 
)
staticprotected

◆ SetOutput()

void albaVME::SetOutput ( albaVMEOutput output)
protected

Set the output and connect it to the VME.

This is automatically called by GetOutput() of specific VME's

◆ SetDataPipe()

virtual int albaVME::SetDataPipe ( albaDataPipe dpipe)
protectedvirtual

Set/Get the data pipe object, i.e.

the source of the output dataset.

◆ SetMatrixPipe()

int albaVME::SetMatrixPipe ( albaMatrixPipe pipe)
protected

Set the matrix pipe object, i.e.

the source of the output matrix.

◆ GetTypeNameFromType()

albaString albaVME::GetTypeNameFromType ( albaString  typeName)
protected

Returns typename (human readable) from vme type (class name)

◆ SetAbsMatrixPipe()

void albaVME::SetAbsMatrixPipe ( albaAbsMatrixPipe pipe)
protected

Set the abs matrix pipe object, i.e.

the source of the output abs matrix.

◆ CreateGui()

virtual albaGUI * albaVME::CreateGui ( )
protectedvirtual

Create GUI for the VME Internally used to create a new instance of the GUI.

This function should be overridden by subclasses to create specialized GUIs. Each subclass should append its own widgets and define the enum of IDs for the widgets as an extension of the superclass enum. The last id value must be defined as "LAST_ID" to allow the subclass to continue the ID enumeration from it. For appending the widgets in the same pannel GUI, each CreateGUI() function should first call the superclass' one.

Reimplemented in albaVMERoot.

◆ NodeOnEvent()

void albaVME::NodeOnEvent ( albaEventBase e)
protected

Precess Tree management events.

Member Data Documentation

◆ m_Gui

albaGUI* albaVME::m_Gui
protected

pointer to the node GUI

Definition at line 743 of file albaVME.h.

◆ m_Children

albaChildrenVector albaVME::m_Children
protected

list of children

Definition at line 745 of file albaVME.h.

◆ m_Parent

albaVME* albaVME::m_Parent
protected

parent node

Definition at line 746 of file albaVME.h.

◆ m_Attributes

albaAttributesMap albaVME::m_Attributes
protected

attributes attached to this node

Definition at line 748 of file albaVME.h.

◆ m_Links

albaLinksMap albaVME::m_Links
protected

links to other nodes in the tree

Definition at line 750 of file albaVME.h.

◆ m_BackLinks

albaVMEBackLinks albaVME::m_BackLinks
protected

links to other nodes in the tree

Definition at line 751 of file albaVME.h.

◆ m_OldSubIdLinks

std::vector<albaOldSubIdLink> albaVME::m_OldSubIdLinks
protected

Definition at line 752 of file albaVME.h.

◆ m_Name

albaString albaVME::m_Name
protected

name of this node

Definition at line 754 of file albaVME.h.

◆ m_GuiName

albaString albaVME::m_GuiName
protected

name showed on gui

Definition at line 755 of file albaVME.h.

◆ m_Id

albaID albaVME::m_Id
protected

ID of this node.

Definition at line 756 of file albaVME.h.

◆ m_VisibleToTraverse

bool albaVME::m_VisibleToTraverse
protected

enable/disable traversing visit of this node

Definition at line 758 of file albaVME.h.

◆ m_Initialized

bool albaVME::m_Initialized
protected

set true by Initialize()

Definition at line 759 of file albaVME.h.

◆ m_DependsOnLinkedNode

bool albaVME::m_DependsOnLinkedNode
protected

enable/disable calculation of MTime considering links

Definition at line 760 of file albaVME.h.

◆ m_TestMode

bool albaVME::m_TestMode
protected

Flag used with cppunitTest: put this flag at true when executing tests to avoid busy-info or splash screen to be created, default is false.

Definition at line 761 of file albaVME.h.

◆ m_DataPipe

albaAutoPointer<albaDataPipe> albaVME::m_DataPipe
protected

Definition at line 763 of file albaVME.h.

◆ m_MatrixPipe

albaAutoPointer<albaMatrixPipe> albaVME::m_MatrixPipe
protected

Definition at line 764 of file albaVME.h.

◆ m_AbsMatrixPipe

albaAutoPointer<albaAbsMatrixPipe> albaVME::m_AbsMatrixPipe
protected

Definition at line 765 of file albaVME.h.

◆ m_Output

albaVMEOutput* albaVME::m_Output
protected

the data structure storing the output of this VME

Definition at line 767 of file albaVME.h.

◆ m_CurrentTime

albaTimeStamp albaVME::m_CurrentTime
protected

the time parameter for generation of the output

Definition at line 768 of file albaVME.h.

◆ m_Crypting

int albaVME::m_Crypting
protected

enable flag for this VME

Definition at line 769 of file albaVME.h.

◆ m_Behavior

albaInteractor* albaVME::m_Behavior
protected

the interactor representing the behavior of this VME

Definition at line 771 of file albaVME.h.

◆ m_VisualMode

int albaVME::m_VisualMode
protected

Store the visual mode to allow the visual pipe to choose the right visual pipe to render the VME.

Definition at line 773 of file albaVME.h.


The documentation for this class was generated from the following file: