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
406
408 void AddBackLink(const char *name, albaVME *node);
409
411 void RemoveBackLink(const char *name, albaVME *node);
412
415 void SetOldSubIdLink(albaString link_name, albaID link_node_id, albaID link_node_subid);
416
418 void RemoveLink(const char *name);
419
421 albaID GetNumberOfLinks() { return m_Links.size(); }
422
424 albaID GetNumberOfBackLinks() { return m_BackLinks.size(); }
425
427 albaVMEBackLinks GetBackLinks() { return m_BackLinks; }
428
431
433 void RemoveAllBackLinks() { m_BackLinks.clear(); }
434
437
440
445
447 albaLinksMap *GetLinks() { return &m_Links; }
448
450 void ForwardUpEvent(albaEventBase *alba_event);
451 void ForwardUpEvent(albaEventBase &alba_event);
452
456
457
460
462 void DeleteGui();
463
465 albaID GetId() const;
466
468 static char ** GetIcon();
469
471 void UpdateId();
472
475 virtual unsigned long GetMTime();
476
479 void DependsOnLinkedNodeOn() { m_DependsOnLinkedNode = true; };
480
483 void DependsOnLinkedNodeOff() { m_DependsOnLinkedNode = false; };
484
486 {
487 DEFAULT_VISUAL_MODE = 0,
488 NO_DATA_VISUAL_MODE
489 };
490
491 //typedef std::vector<albaTimeStamp> std::vector<albaTimeStamp>;
492
494 virtual void Print(std::ostream& os, const int tabs=0);// const;
495
499 albaVME *GetParent() const { return m_Parent; };
500
506 virtual int DeepCopy(albaVME *a);
507
513 virtual int ShallowCopy(albaVME *a);
514
516 virtual bool Equals(albaVME *vme);
517
523
528
534 virtual void SetMatrix(const albaMatrix &mat)=0;
535
537 void SetPose(const albaMatrix &mat,albaTimeStamp t);
538
544 void SetPose(double x,double y,double z,double rx,double ry,double rz, albaTimeStamp t);
545
551 void SetPose(double xyz[3],double rxyz[3], albaTimeStamp t);
552
554 void ApplyMatrix(const albaMatrix &matrix,int premultiply,albaTimeStamp t=-1);
555
557 void SetAbsPose(double x,double y,double z,double rx,double ry,double rz, albaTimeStamp t=-1);
559 void SetAbsPose(double xyz[3],double rxyz[3], albaTimeStamp t=-1);
561 void SetAbsMatrix(const albaMatrix &matrix,albaTimeStamp t);
563 virtual void SetAbsMatrix(const albaMatrix &matrix);
564
566 void ApplyAbsMatrix(const albaMatrix &matrix,int premultiply,albaTimeStamp t=-1);
567
569 virtual bool CanReparentTo(albaVME *parent);
570
571 // to be revised
573 //int SetAuxiliaryRefSys(mflTransform *AuxRefSys, const char *RefSysName, int type = MFL_LOCAL_FRAME_TAG);
574 //int SetAuxiliaryRefSys(vtkMatrix4x4 *AuxRefSys, const char *RefSysName, int type = MFL_LOCAL_FRAME_TAG);
575
576 // to be revises
578 //int GetAuxiliaryRefSys(mflTransform *AuxRefSys, const char *RefSysName, int type = MFL_LOCAL_FRAME_TAG);
579 //int GetAuxiliaryRefSys(vtkMatrix4x4 *AuxRefSys, const char *RefSysName, int type = MFL_LOCAL_FRAME_TAG);
580
582 albaMatrixPipe *GetMatrixPipe() {return m_MatrixPipe;}
583
585 albaAbsMatrixPipe *GetAbsMatrixPipe() {return m_AbsMatrixPipe;}
586
588 albaDataPipe *GetDataPipe() {return m_DataPipe;}
589
595 virtual void Update();
596
600 virtual void GetLocalTimeStamps(std::vector<albaTimeStamp> &kframes)=0;
601
603 virtual void GetLocalTimeBounds(albaTimeStamp tbounds[2]) {tbounds[0] = m_CurrentTime; tbounds[1] = m_CurrentTime;};
604
608 virtual void GetAbsTimeStamps(std::vector<albaTimeStamp> &kframes);
609
613 virtual void GetTimeStamps(std::vector<albaTimeStamp> &kframes);
614
617
620
622 virtual bool IsAnimated();
623
625 virtual bool IsDataAvailable();
626
628 void SetCrypting(int crypting);
629
632
634 virtual albaVMEOutput *GetOutput() {return m_Output;}
635
637 virtual albaString GetVisualPipe() { return albaString(""); };
638
640 virtual albaString GetVisualPipeSlice() { return albaString(""); };
641
646 void SetVisualMode(int mode);
647
649 int GetVisualMode() {return m_VisualMode;};
650
655 albaInteractor *GetBehavior() {return m_Behavior;}
656
658 void SetBehavior(albaInteractor *bh) {m_Behavior=bh;};
659
662 void TestModeOn() {m_TestMode = true;};
663
665 void TestModeOff() {m_TestMode = false;};
666
668 bool GetTestMode(){return m_TestMode;};
669
670protected:
671 albaVME(); // to be allocated with New()
672 virtual ~albaVME(); // to be deleted with Delete()
673
674
676 void SetId(albaID id);
677
678 virtual int InternalStore(albaStorageElement *parent);
680
681
683 virtual void InternalShutdown() {};
684
688 virtual int SetParent(albaVME *parent);
689
693
695 void GetDependenciesVMEs(albaVMESet &dependencies,albaVME *vme);
696
698 virtual int InternalInitialize();
699
701 virtual void InternalPreUpdate() {}
702
704 virtual void InternalUpdate() {}
705
709
710 // Make a Copy of Subtree and Update new Links (Recursive Function)
711 static albaVME* InternalCopyTree(albaVME * vme, albaVME * parent);
712
717
719 virtual int SetDataPipe(albaDataPipe *dpipe);
720
723
726
729
737 virtual albaGUI *CreateGui();
738
741
742
744
747
749
752 std::vector<albaOldSubIdLink> m_OldSubIdLinks;
753
757
762
766
770
772
774
775 typedef struct
776 {
780
781 typedef struct
782 {
785 } VmeLinks;
786
787private:
788 albaVME(const albaVME&); // Not implemented
789 void operator=(const albaVME&); // Not implemented
790
791};
792
793#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:640
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:585
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:748
virtual void GetLocalTimeBounds(albaTimeStamp tbounds[2])
Set the time bounds for the time varying VME (base VME is not time varying).
Definition: albaVME.h:603
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:761
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:751
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:499
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:634
albaAutoPointer< albaMatrixPipe > m_MatrixPipe
Definition: albaVME.h:764
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:752
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:424
albaTimeStamp m_CurrentTime
the time parameter for generation of the output
Definition: albaVME.h:768
void RemoveAttribute(const char *name)
remove an attibute
bool GetTestMode()
Get TestMode.
Definition: albaVME.h:668
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:771
albaID m_Id
ID of this node.
Definition: albaVME.h:756
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:743
int Initialize()
Initialize this node.
albaInteractor * GetBehavior()
return the interactor assigned as a behavior to this VME.
Definition: albaVME.h:655
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:662
virtual albaString GetVisualPipe()
Return the suggested pipe-typename for the visualization of this vme.
Definition: albaVME.h:637
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:421
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:582
virtual void UnRegister(void *o)
redefined to cope with tree registering
albaVME * m_Parent
parent node
Definition: albaVME.h:746
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:773
albaVMEOutput * m_Output
the data structure storing the output of this VME
Definition: albaVME.h:767
albaAutoPointer< albaAbsMatrixPipe > m_AbsMatrixPipe
Definition: albaVME.h:765
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:745
albaDataPipe * GetDataPipe()
return the data pipe object, i.e.
Definition: albaVME.h:588
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:658
albaTagArray * GetTagArray()
return a pointer to the tag array attribute.
albaString m_GuiName
name showed on gui
Definition: albaVME.h:755
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 IsEmpty() const
Definition: albaVME.h:302
bool m_VisibleToTraverse
enable/disable traversing visit of this node
Definition: albaVME.h:758
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:701
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:649
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:704
void TestModeOff()
Used to turn off m_TestMode flag.
Definition: albaVME.h:665
albaString m_Name
name of this node
Definition: albaVME.h:754
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:479
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()
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:763
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:447
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:486
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:759
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:769
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:683
virtual albaTimeStamp GetTimeStamp()
void RemoveAllBackLinks()
remove all back links
Definition: albaVME.h:433
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:427
albaLinksMap m_Links
links to other nodes in the tree
Definition: albaVME.h:750
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:483
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:760
albaVME * newPointer
Definition: albaVME.h:778
albaVME * oldPointer
Definition: albaVME.h:777