ALBA
albaVME.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaVME
5 Authors: Marco Petrone
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __albaVME_h
17#define __albaVME_h
18//----------------------------------------------------------------------------
19// includes :
20//----------------------------------------------------------------------------
22#include "albaStorable.h"
23#include "albaSmartPointer.h"
24#include "albaObserver.h"
26#include "albaTagItem.h"
27#include "albaString.h"
28#include "albaTimeStamped.h"
29#include "albaAttribute.h"
30#include "albaDecl.h"
31#include <vector>
32#include <map>
33#include <set>
34#include <string>
35
36#include "albaVMEOutput.h"
37#include "albaDataPipe.h"
38#include "albaMatrixPipe.h"
39#include "albaAbsMatrixPipe.h"
40#include "albaServiceClient.h"
41#include "albaAbsLogicManager.h"
42
43//----------------------------------------------------------------------------
44// forward declarations :
45//----------------------------------------------------------------------------
46class albaMatrix;
47class albaTransform;
48class albaInteractor;
49class albaVMEIterator;
50class albaTagArray;
51class albaGUI;
52
53
54typedef enum LinkType
55{
59
61struct ALBA_EXPORT albaOldSubIdLink :public albaUtility
62{
63public:
64 albaOldSubIdLink(albaString name,albaID id = -1, albaID sub_id = -1):m_Name(name), m_NodeId(id), m_NodeSubId(sub_id) {}
68};
69
71struct ALBA_EXPORT albaVMELink :public albaUtility
72{
73public:
74 albaVMELink(albaID id = -1, albaVME *node = NULL, LinkType type = NORMAL_LINK) :m_NodeId(id), m_Node(node), m_Type(type) {}
78};
79
81struct ALBA_EXPORT albaVMEBackLink :public albaUtility
82{
83public:
84 albaVMEBackLink(albaString name, albaVME *node = NULL):m_Name(name), m_Node(node) {}
87};
88
89
90
91#ifdef ALBA_EXPORTS
92#include "albaDllMacros.h"
94#endif
95
96
97#ifdef ALBA_EXPORTS
98template class ALBA_EXPORT albaAutoPointer<albaDataPipe>;
99template class ALBA_EXPORT albaAutoPointer<albaMatrixPipe>;
100template class ALBA_EXPORT albaAutoPointer<albaAbsMatrixPipe>;
101#endif
102
149class ALBA_EXPORT albaVME : public albaReferenceCounted, public albaEventBroadcaster, public albaStorable, public albaObserver, public albaTimeStamped, public albaServiceClient
150{
151public:
152
154
157 {
158 ID_NAME = MINID,
161 ID_LAST
162 };
163
165 virtual albaObject *NewObjectInstance() const { return NULL; }
166
168 albaVME *NewInstance() { return SafeDownCast(NewObjectInstance()); }
169
175
180 void Shutdown();
181
183 int IsInitialized() { return m_Initialized; }
184
186 int Store();
187
189 int Restore();
190
192 const char *GetName() { return m_Name; }
193
195 virtual void SetName(const char *name);
196
197
203 //virtual int ShallowCopy(albaVME *a);
204
207 virtual bool CanCopy(albaVME *vme);
208
211 albaVME *MakeCopy() { return MakeCopy(this); }
212
215 static albaVME *CopyTree(albaVME *vme, albaVME *parent = NULL);
216
218 albaVME *CopyTree() { return CopyTree(this); }
219
222 albaVME *GetChild(albaID idx, bool onlyVisible = false);
225 albaVME *GetFirstChild(bool onlyVisible = false);
228 albaVME *GetLastChild(bool onlyVisible = false);
229
251 albaVME *GetByPath(const char *path, bool onlyVisible = true);
252
254 virtual int AddChild(albaVME *node);
255
257 virtual void RemoveChild(const albaID idx, bool onlyVisible = false);
259 virtual void RemoveChild(albaVME *node);
260
263 int FindNodeIdx(albaVME *a, bool onlyVisible = false);
264
268 int FindNodeIdx(const char *name, bool onlyVisible = false);
269
271 albaVME *FindInTreeByTag(const char *name, const char *value = "", int type = ALBA_STRING_TAG);
272
274 albaVME *FindInTreeByName(const char *name, bool match_case = true, bool whole_word = true);
275
278
286 virtual int ReparentTo(albaVME *parent);
287
289 void Import(albaVME *tree);
290
293
298
301
302 bool IsEmpty() const { return GetNumberOfChildren() == 0; }
303
305 bool IsOnVMETree() { return m_Parent !=NULL; };
306
309 unsigned long GetNumberOfChildren() const;
310
313 unsigned long GetNumberOfChildren(bool onlyVisible);
314
318 void CleanTree();
319
325
330
334 void SetVisibleToTraverse(bool flag) { m_VisibleToTraverse = flag; }
335 bool GetVisibleToTraverse() { return m_VisibleToTraverse; }
336
338 bool IsVisible() { return m_VisibleToTraverse; }
339
346
348 virtual void UnRegister(void *o);
349
351 virtual void OnEvent(albaEventBase *e);
352
353 typedef std::vector<albaAutoPointer<albaVME> > albaChildrenVector;
354
358 const albaChildrenVector *GetChildren() { return &m_Children; }
359
360 typedef std::map<albaString, albaAutoPointer<albaAttribute> > albaAttributesMap;
361
365 albaAttributesMap *GetAttributes() { return &m_Attributes; }
366
368 void SetAttribute(const char *name, albaAttribute *a);
369
371 albaAttribute *GetAttribute(const char *name);
372
374 void RemoveAttribute(const char *name);
375
378
387
388 typedef std::map<albaString, albaVMELink> albaLinksMap;
389 typedef std::set<albaVME *> albaVMESet;
390 typedef std::vector<albaVMEBackLink> albaVMEBackLinks;
391
395 albaVME *GetLink(const char *name);
396
398 void SetLink(const char *name, albaVME *node);
399
401 void SetMandatoryLink(const char *name, albaVME *node);
402
404 void SetLink(const char *name, albaVME *node, LinkType type);
405
407 void SetLinkToMandatory(char* link);
408
410 void SetLinkToNonMandatory(char* link);
411
413 void AddBackLink(const char *name, albaVME *node);
414
416 void RemoveBackLink(const char *name, albaVME *node);
417
420 void SetOldSubIdLink(albaString link_name, albaID link_node_id, albaID link_node_subid);
421
423 void RemoveLink(const char *name);
424
426 albaID GetNumberOfLinks() { return m_Links.size(); }
427
429 albaID GetNumberOfBackLinks() { return m_BackLinks.size(); }
430
432 albaVMEBackLinks GetBackLinks() { return m_BackLinks; }
433
436
438 void RemoveAllBackLinks() { m_BackLinks.clear(); }
439
442
445
450
452 albaLinksMap *GetLinks() { return &m_Links; }
453
455 void ForwardUpEvent(albaEventBase *alba_event);
456 void ForwardUpEvent(albaEventBase &alba_event);
457
461
462
465
467 void DeleteGui();
468
470 albaID GetId() const;
471
473 static char ** GetIcon();
474
476 void UpdateId();
477
480 virtual unsigned long GetMTime();
481
484 void DependsOnLinkedNodeOn() { m_DependsOnLinkedNode = true; };
485
488 void DependsOnLinkedNodeOff() { m_DependsOnLinkedNode = false; };
489
491 {
492 DEFAULT_VISUAL_MODE = 0,
493 NO_DATA_VISUAL_MODE
494 };
495
496 //typedef std::vector<albaTimeStamp> std::vector<albaTimeStamp>;
497
499 virtual void Print(std::ostream& os, const int tabs=0);// const;
500
504 albaVME *GetParent() const { return m_Parent; };
505
511 virtual int DeepCopy(albaVME *a);
512
518 virtual int ShallowCopy(albaVME *a);
519
521 virtual bool Equals(albaVME *vme);
522
528
533
539 virtual void SetMatrix(const albaMatrix &mat)=0;
540
542 void SetPose(const albaMatrix &mat,albaTimeStamp t);
543
549 void SetPose(double x,double y,double z,double rx,double ry,double rz, albaTimeStamp t);
550
556 void SetPose(double xyz[3],double rxyz[3], albaTimeStamp t);
557
559 void ApplyMatrix(const albaMatrix &matrix,int premultiply,albaTimeStamp t=-1);
560
562 void SetAbsPose(double x,double y,double z,double rx,double ry,double rz, albaTimeStamp t=-1);
564 void SetAbsPose(double xyz[3],double rxyz[3], albaTimeStamp t=-1);
566 void SetAbsMatrix(const albaMatrix &matrix,albaTimeStamp t);
568 virtual void SetAbsMatrix(const albaMatrix &matrix);
569
571 void ApplyAbsMatrix(const albaMatrix &matrix,int premultiply,albaTimeStamp t=-1);
572
574 virtual bool CanReparentTo(albaVME *parent);
575
576 // to be revised
578 //int SetAuxiliaryRefSys(mflTransform *AuxRefSys, const char *RefSysName, int type = MFL_LOCAL_FRAME_TAG);
579 //int SetAuxiliaryRefSys(vtkMatrix4x4 *AuxRefSys, const char *RefSysName, int type = MFL_LOCAL_FRAME_TAG);
580
581 // to be revises
583 //int GetAuxiliaryRefSys(mflTransform *AuxRefSys, const char *RefSysName, int type = MFL_LOCAL_FRAME_TAG);
584 //int GetAuxiliaryRefSys(vtkMatrix4x4 *AuxRefSys, const char *RefSysName, int type = MFL_LOCAL_FRAME_TAG);
585
587 albaMatrixPipe *GetMatrixPipe() {return m_MatrixPipe;}
588
590 albaAbsMatrixPipe *GetAbsMatrixPipe() {return m_AbsMatrixPipe;}
591
593 albaDataPipe *GetDataPipe() {return m_DataPipe;}
594
600 virtual void Update();
601
605 virtual void GetLocalTimeStamps(std::vector<albaTimeStamp> &kframes)=0;
606
608 virtual void GetLocalTimeBounds(albaTimeStamp tbounds[2]) {tbounds[0] = m_CurrentTime; tbounds[1] = m_CurrentTime;};
609
613 virtual void GetAbsTimeStamps(std::vector<albaTimeStamp> &kframes);
614
618 virtual void GetTimeStamps(std::vector<albaTimeStamp> &kframes);
619
622
625
627 virtual bool IsAnimated();
628
630 virtual bool IsDataAvailable();
631
633 void SetCrypting(int crypting);
634
637
639 virtual albaVMEOutput *GetOutput() {return m_Output;}
640
642 virtual albaString GetVisualPipe() { return albaString(""); };
643
645 virtual albaString GetVisualPipeSlice() { return albaString(""); };
646
651 void SetVisualMode(int mode);
652
654 int GetVisualMode() {return m_VisualMode;};
655
660 albaInteractor *GetBehavior() {return m_Behavior;}
661
663 void SetBehavior(albaInteractor *bh) {m_Behavior=bh;};
664
667 void TestModeOn() {m_TestMode = true;};
668
670 void TestModeOff() {m_TestMode = false;};
671
673 bool GetTestMode(){return m_TestMode;};
674
675
677 bool WasVMEExpandedWhenStored() const { return m_VMEExpandedWhenStored; }
678
679protected:
680 albaVME(); // to be allocated with New()
681 virtual ~albaVME(); // to be deleted with Delete()
682
683
685 void SetId(albaID id);
686
687 virtual int InternalStore(albaStorageElement *parent);
689
690
692 virtual void InternalShutdown() {};
693
697 virtual int SetParent(albaVME *parent);
698
702
704 void GetDependenciesVMEs(albaVMESet &dependencies,albaVME *vme);
705
707 virtual int InternalInitialize();
708
710 virtual void InternalPreUpdate() {}
711
713 virtual void InternalUpdate() {}
714
718
719 // Make a Copy of Subtree and Update new Links (Recursive Function)
720 static albaVME* InternalCopyTree(albaVME * vme, albaVME * parent);
721
726
728 virtual int SetDataPipe(albaDataPipe *dpipe);
729
732
735
738
746 virtual albaGUI *CreateGui();
747
750
751
753
756
758
761 std::vector<albaOldSubIdLink> m_OldSubIdLinks;
762
766
771
775
779
781
783
785
786 typedef struct
787 {
791
792 typedef struct
793 {
796 } VmeLinks;
797
798private:
799 albaVME(const albaVME&); // Not implemented
800 void operator=(const albaVME&); // Not implemented
801
802};
803
804#endif
MINID
Definition: albaDecl.h:420
long albaID
type for IDs inside ALBA
Definition: albaDefines.h:58
double albaTimeStamp
type for time varying data timestamps (not for pipelines timestamps!)
Definition: albaDefines.h:57
#define EXPORT_STL_VECTOR(declspec_, T_)
Definition: albaDllMacros.h:84
@ ALBA_STRING_TAG
Definition: albaTagItem.h:36
LinkType
Definition: albaVME.h:55
@ MANDATORY_LINK
Definition: albaVME.h:57
@ NORMAL_LINK
Definition: albaVME.h:56
albaAbsMatrixPipe - this class implements VME tree direct cinematic (AbsMatrix).
An abstract class for objects representing an attribute for albaVMEs.
Definition: albaAttribute.h:34
Hold a reference to a T instance.
abstract class for process objects producing data as output of a VME.
Definition: albaDataPipe.h:51
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
This class inerith form albaEventSender and extends albaEventSender with the capacity of send events ...
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
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.
Definition: albaMatrix.h:44
Abstract superclass for all ALBA classes implementing RTTI APIs.
Definition: albaObject.h:38
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaReferenceCounted - abstract base class for ALBA objects with reference counting.
albaStorable is an interface for serializable objects.
Definition: albaStorable.h:41
Abstract class representing the interface for the unit of information stored in the storage.
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
An attribute used to store an associtive array of <key,value> pairs, where value is multi component.
Definition: albaTagArray.h:37
class acting as an interface for timestamped objects This object simply defines few methods for manag...
albaTransform - class for homogeneous transformations.
Definition: albaTransform.h:53
albaUtility - the pourpose of this class is just to groups utilities classes
Definition: albaUtility.h:27
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.
Definition: albaVMEOutput.h:56
albaVME -
Definition: albaVME.h:150
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.
Definition: albaVME.h:645
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.
Definition: albaVME.h:590
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.
Definition: albaVME.h:334
albaAttributesMap m_Attributes
attributes attached to this node
Definition: albaVME.h:757
virtual void GetLocalTimeBounds(albaTimeStamp tbounds[2])
Set the time bounds for the time varying VME (base VME is not time varying).
Definition: albaVME.h:608
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...
Definition: albaVME.h:770
std::vector< albaVMEBackLink > albaVMEBackLinks
Definition: albaVME.h:390
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.
Definition: albaVME.h:365
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
Definition: albaVME.h:760
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.
Definition: albaVME.h:504
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.
Definition: albaVME.h:338
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
Definition: albaVME.h:639
albaAutoPointer< albaMatrixPipe > m_MatrixPipe
Definition: albaVME.h:773
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
Definition: albaVME.h:761
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
Definition: albaVME.h:429
albaTimeStamp m_CurrentTime
the time parameter for generation of the output
Definition: albaVME.h:777
void RemoveAttribute(const char *name)
remove an attibute
bool GetTestMode()
Get TestMode.
Definition: albaVME.h:673
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.
Definition: albaVME.h:358
albaInteractor * m_Behavior
the interactor representing the behavior of this VME
Definition: albaVME.h:780
albaID m_Id
ID of this node.
Definition: albaVME.h:765
int Restore()
unserialized the object from a storage.
std::vector< albaAutoPointer< albaVME > > albaChildrenVector
Definition: albaVME.h:353
albaGUI * m_Gui
pointer to the node GUI
Definition: albaVME.h:752
int Initialize()
Initialize this node.
albaInteractor * GetBehavior()
return the interactor assigned as a behavior to this VME.
Definition: albaVME.h:660
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.
Definition: albaVME.h:667
virtual albaString GetVisualPipe()
Return the suggested pipe-typename for the visualization of this vme.
Definition: albaVME.h:642
VME_WIDGET_ID
IDs for the GUI.
Definition: albaVME.h:157
@ ID_HELP
Definition: albaVME.h:160
@ ID_PRINT_INFO
Definition: albaVME.h:159
albaVME * CopyTree()
Make a copy of the whole subtree and return its pointer.
Definition: albaVME.h:218
albaID GetNumberOfLinks()
return the number of links stored in this Node
Definition: albaVME.h:426
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.
Definition: albaVME.h:587
virtual void UnRegister(void *o)
redefined to cope with tree registering
albaVME * m_Parent
parent node
Definition: albaVME.h:755
int m_VisualMode
Store the visual mode to allow the visual pipe to choose the right visual pipe to render the VME.
Definition: albaVME.h:782
albaVMEOutput * m_Output
the data structure storing the output of this VME
Definition: albaVME.h:776
albaAutoPointer< albaAbsMatrixPipe > m_AbsMatrixPipe
Definition: albaVME.h:774
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
Definition: albaVME.h:754
albaDataPipe * GetDataPipe()
return the data pipe object, i.e.
Definition: albaVME.h:593
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
Definition: albaVME.h:192
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.
Definition: albaVME.h:663
albaTagArray * GetTagArray()
return a pointer to the tag array attribute.
albaString m_GuiName
name showed on gui
Definition: albaVME.h:764
void SetLinkToMandatory(char *link)
Set an existing link to mandatory.
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)
bool WasVMEExpandedWhenStored() const
Returns if VME Was expanded when stored last time.
Definition: albaVME.h:677
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 IsEmpty() const
Definition: albaVME.h:302
bool m_VisibleToTraverse
enable/disable traversing visit of this node
Definition: albaVME.h:767
albaVME * GetFirstChild(bool onlyVisible=false)
Get the First child in the list.
virtual void InternalPreUpdate()
called to prepare the update of output
Definition: albaVME.h:710
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.
Definition: albaVME.h:183
int GetVisualMode()
Get the mode with which render the VME: DEFAULT_VISUAL_MODE or NO_DATA_VISUAL_MODE.
Definition: albaVME.h:654
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
Definition: albaVME.h:713
void TestModeOff()
Used to turn off m_TestMode flag.
Definition: albaVME.h:670
albaString m_Name
name of this node
Definition: albaVME.h:763
void SetLinkToNonMandatory(char *link)
Set an existing link to non mandatory.
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.
Definition: albaVME.h:484
virtual albaObject * NewObjectInstance() const
defined to allow MakeCopy implementation.
Definition: albaVME.h:165
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()
Definition: albaVME.h:335
albaID GetId() const
return the Id of this node in the tree
virtual ~albaVME()
albaID m_VMEExpandedWhenStored
Definition: albaVME.h:784
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
Definition: albaVME.h:772
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
Definition: albaVME.h:452
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
VME_VISUAL_MODE
Definition: albaVME.h:491
albaVME * MakeCopy()
Definition: albaVME.h:211
std::map< albaString, albaAutoPointer< albaAttribute > > albaAttributesMap
Definition: albaVME.h:360
bool m_Initialized
set true by Initialize()
Definition: albaVME.h:768
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
Definition: albaVME.h:778
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
Definition: albaVME.h:388
std::set< albaVME * > albaVMESet
Definition: albaVME.h:389
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
Definition: albaVME.h:692
virtual albaTimeStamp GetTimeStamp()
void RemoveAllBackLinks()
remove all back links
Definition: albaVME.h:438
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
Definition: albaVME.h:432
albaLinksMap m_Links
links to other nodes in the tree
Definition: albaVME.h:759
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)
Definition: albaVME.h:168
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.
Definition: albaVME.h:305
void DependsOnLinkedNodeOff()
Turn off the flag to calculate the timestamp considering also the linked nodes.
Definition: albaVME.h:488
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
Definition: albaVME.h:769
albaVME * newPointer
Definition: albaVME.h:789
albaVME * oldPointer
Definition: albaVME.h:788