ALBA
albaVMERoot.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaVMERoot
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 __albaVMERoot_h
17#define __albaVMERoot_h
18//----------------------------------------------------------------------------
19// includes :
20//----------------------------------------------------------------------------
21#include "albaVME.h"
22
23//----------------------------------------------------------------------------
24// forward declarations :
25//----------------------------------------------------------------------------
26class albaVMEStorage;
27
34class ALBA_EXPORT albaVMERoot : public albaVME
35{
36public:
38
40 virtual bool Equals(albaVME *vme);
41
43 {
44 ID_APPLICATION_STAMP = Superclass::ID_LAST,
45 ID_LAST
46 };
47
48 virtual int DeepCopy(albaVME *a);
49
53 albaID GetMaxItemId() {return m_MaxItemId;}
54
56 albaID GetNextItemId() { this->Modified();return ++m_MaxItemId;}
57
61 void SetMaxItemId(albaID id) { m_MaxItemId=id; Modified();}
62 void ResetMaxItemId() { this->SetMaxItemId(0);}
63
65 void CleanTree() { \
66 albaVME::CleanTree(); \
67 m_Attributes.clear(); \
68 };
69
71 virtual void SetMatrix(const albaMatrix &mat);
72
74 virtual void Print(std::ostream& os, const int tabs=0);// const;
75
77 virtual void GetLocalTimeStamps(std::vector<albaTimeStamp> &kframes);
78
79 void OnEvent(albaEventBase *alba_event);
80
82 virtual void Update();
83
85 static char ** GetIcon(); //SIL. 11-4-2005:
86
88 virtual albaString GetVisualPipe() {return albaString("albaPipeBox");};
89
93 virtual bool CanReparentTo(albaVME *parent) { return parent == NULL; }
94
98 albaID GetMaxNodeId() { return m_MaxNodeId; }
99
101 albaID GetNextNodeId() { return ++m_MaxNodeId; }
102
106 void SetMaxNodeId(albaID id) { m_MaxNodeId = id; }
107 void ResetMaxNodeId() { this->SetMaxNodeId(0); }
108
109
112
114 void SetStorage(albaVMEStorage * storage);
115
116protected:
119 virtual ~albaVMERoot();
120
122 virtual albaGUI *CreateGui();
123
124 virtual int StoreRoot(albaStorageElement *parent);
125 virtual int RestoreRoot(albaStorageElement *element);
126
127 virtual int InternalStore(albaStorageElement *parent);
129
132
134
136
138
139private:
140 albaVMERoot(const albaVMERoot&); // Not implemented
141 void operator=(const albaVMERoot&); // Not implemented
142};
143#endif
long albaID
type for IDs inside ALBA
Definition: albaDefines.h:58
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
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
virtual void Modified()
Update this objects modification time.
albaTransform - class for homogeneous transformations.
Definition: albaTransform.h:53
albaVMERoot - a VME is the root of a tree of VME nodes.
Definition: albaVMERoot.h:35
virtual albaString GetVisualPipe()
Return the suggested pipe-typename for the visualization of this vme.
Definition: albaVMERoot.h:88
virtual albaGUI * CreateGui()
Create GUI for the VME.
albaID m_MaxNodeId
Counter for node Ids.
Definition: albaVMERoot.h:135
void SetMaxNodeId(albaID id)
Set the NodeMaxId.
Definition: albaVMERoot.h:106
virtual void GetLocalTimeStamps(std::vector< albaTimeStamp > &kframes)
return no timestamps
void ResetMaxNodeId()
Definition: albaVMERoot.h:107
virtual void Print(std::ostream &os, const int tabs=0)
print a dump of this object
albaTransform * m_Transform
pose matrix for the root
Definition: albaVMERoot.h:131
virtual bool CanReparentTo(albaVME *parent)
root node cannot be reparented.
Definition: albaVMERoot.h:93
albaVMEStorage * m_Storage
Definition: albaVMERoot.h:137
virtual bool Equals(albaVME *vme)
compare two VME-Root.
albaVMEStorage * GetStorage() const
Returns Storage.
virtual int InternalStore(albaStorageElement *parent)
This is called by Store() and must be reimplemented by subclasses.
albaTypeMacro(albaVMERoot, albaVME)
void CleanTree()
Clean the tree and all the data structures of this root.
Definition: albaVMERoot.h:65
static char ** GetIcon()
return an xpm-icon that can be used to represent this node
virtual int InternalRestore(albaStorageElement *node)
This is called by Restore() and must be reimplemented by subclasses The element from which the object...
virtual int StoreRoot(albaStorageElement *parent)
albaID m_MaxItemId
id counter for VME items
Definition: albaVMERoot.h:130
virtual int RestoreRoot(albaStorageElement *element)
albaID GetMaxItemId()
Return highest ItemId assigned for this tree.
Definition: albaVMERoot.h:53
albaID GetMaxNodeId()
Return highest NodeId assigned for this tree.
Definition: albaVMERoot.h:98
void OnEvent(albaEventBase *alba_event)
Precess events coming from other objects.
virtual void Update()
Redefined to update the gui.
virtual int DeepCopy(albaVME *a)
Copy the contents of another VME into this one.
void SetMaxItemId(albaID id)
Set the ItemMaxId.
Definition: albaVMERoot.h:61
albaString m_ApplicationStamp
Definition: albaVMERoot.h:133
albaVMERoot()
allowed only dynamic allocation via New()
albaID GetNextNodeId()
Return next available NodeId and increment the internal counter.
Definition: albaVMERoot.h:101
virtual ~albaVMERoot()
void ResetMaxItemId()
Definition: albaVMERoot.h:62
albaID GetNextItemId()
Return next available ItemId and increment the internal counter.
Definition: albaVMERoot.h:56
void SetStorage(albaVMEStorage *storage)
Sets Storage.
virtual void SetMatrix(const albaMatrix &mat)
set the tree reference system
A storage class for MSF local files.
albaVME -
Definition: albaVME.h:150