28 #ifndef AbstractNode_H 29 #define AbstractNode_H 31 #include "plotCommon.h" 32 #include "../common/sharedStructures.h" 44 ITOMCOMMONPLOT_EXPORT uint calculateChannelHash(AbstractNode *parent,
ito::Param *parentParam, AbstractNode *child,
ito::Param *childParam);
50 rttiPlotNode = 0x1000,
51 rttiFilterNode = 0x2000,
52 rttiPlotNodeDObj = 0x0100,
53 rttiPlotNodePCL = 0x0200,
54 rttiPlotNode1D = 0x0001,
55 rttiPlotNode2D = 0x0002,
56 rttiPlotNode25D = 0x0003,
57 rttiPlotNode3D = 0x0004
71 static unsigned int UID;
86 Channel() : m_uniqueID(UID++), m_pParent(NULL), m_pChild(NULL), m_direction(
Channel::undefined), m_pParentParam(NULL), m_pChildParam(NULL), m_deleteParentOnDisconnect(false), m_deleteChildOnDisconnect(false), m_updatePending(false), m_channelBuffering(false), m_hashVal(0) {}
92 inline AbstractNode* getParent()
const {
return m_pParent; }
94 inline AbstractNode* getChild()
const {
return m_pChild; }
96 inline ChanDirection getDirection()
const {
return m_direction; }
98 inline bool getUpdatePending()
const {
return m_updatePending; }
100 inline unsigned int getUniqueID()
const {
return m_uniqueID; }
105 if(
self == m_pParent)
106 return m_pParentParam;
107 else if(
self == m_pChild)
108 return m_pChildParam;
116 if(
self == m_pParent)
117 return m_pChildParam;
118 else if(
self == m_pChild)
119 return m_pParentParam;
124 inline QString getSenderParamName()
const 126 if (m_direction == Channel::childToParent)
127 return QString(m_pChildParam->
getName());
128 else if (m_direction == Channel::parentToChild)
129 return QString(m_pParentParam->
getName());
134 inline signed char getDeleteBehaviour(
AbstractNode* query)
const 136 if(query == m_pParent)
137 return m_deleteParentOnDisconnect;
138 else if(query == m_pChild)
139 return m_deleteChildOnDisconnect;
145 RetVal propagateUpdatePending();
147 inline bool getChannelBuffering()
const {
return m_channelBuffering; }
149 inline void setChannelBuffering(
bool buffering) { m_channelBuffering = buffering;
return; }
152 inline uint
getHash()
const {
return m_hashVal; }
154 inline ito::Param * getParentParam()
const {
return m_pParentParam; }
156 inline ito::Param * getChildParam()
const {
return m_pChildParam; }
164 if (((m_direction == Channel::childToParent) && (m_pChild == query))
165 || ((m_direction == Channel::parentToChild) && (m_pParent == query)))
174 if (((m_direction == Channel::childToParent) && (m_pParent == query))
175 || ((m_direction == Channel::parentToChild) && (m_pChild == query)))
184 if(m_direction == Channel::childToParent)
186 else if (m_direction == Channel::parentToChild)
194 if(m_direction == Channel::childToParent)
196 else if (m_direction == Channel::parentToChild)
210 virtual RetVal applyUpdate(
void) = 0;
213 virtual RetVal update(
void) = 0;
224 retval += updateParam(thisParam);
231 inline rttiNodeType getType()
const {
return m_NodeType; }
235 virtual RetVal addChannel(
AbstractNode *child,
ito::Param* parentParam,
ito::Param* childParam, Channel::ChanDirection direction,
bool deleteOnParentDisconnect,
bool deleteOnChildDisconnect) = 0;
238 virtual RetVal removeChannelFromList(
unsigned int UniqueID) = 0;
241 RetVal getUpdateStatus(
void)
const;
243 RetVal updateChannels(
const QList<QString> ¶mNames);
245 inline bool isConnected()
const {
return !(m_pChannels.isEmpty()); }
247 inline int getUniqueID(
void)
const {
return m_uniqueID; }
249 RetVal setUpdatePending(
int uniqueID = -1);
251 Channel * getInputChannel(
const char *inpParamName)
const;
253 inline ito::Param* getInputParam(
const QString ¶mName)
const 255 if (m_pInput.contains(paramName))
257 return m_pInput[paramName];
262 inline ito::Param* getOutputParam(
const QString ¶mName)
const 264 if (m_pOutput.contains(paramName))
266 return m_pOutput[paramName];
272 rttiNodeType m_NodeType;
278 static unsigned int UID;
bool m_channelBuffering
tells the receiver to wait for updates before proceeding
Definition: AbstractNode.h:82
ito::Param * m_pChildParam
the parameter-connector on the parentīs side (can be sending or receiving)
Definition: AbstractNode.h:77
unsigned int m_uniqueID
Definition: AbstractNode.h:72
ito::Param * getPartnerParam(AbstractNode *self) const
Definition: AbstractNode.h:114
bool isSender(AbstractNode *query)
Definition: AbstractNode.h:162
bool isReceiver(AbstractNode *query) const
Definition: AbstractNode.h:172
Class for managing status values (like errors or warning)
Definition: retVal.h:54
class for parameter handling e.g. to pass paramters to plugins
Definition: param.h:251
Definition: typeDefs.h:58
Definition: apiFunctionsGraph.cpp:39
Definition: AbstractNode.h:203
int m_uniqueID
>
Definition: AbstractNode.h:277
ito::Param * m_pParentParam
Definition: AbstractNode.h:76
AbstractNode * m_pParent
Definition: AbstractNode.h:73
QHash< QString, ito::Param * > m_pInput
the type of the actual node inheriting this abstract node
Definition: AbstractNode.h:273
AbstractNode * m_pChild
Definition: AbstractNode.h:74
ChanDirection m_direction
Definition: AbstractNode.h:75
uint getHash() const
Definition: AbstractNode.h:152
AbstractNode * getSender(void) const
Definition: AbstractNode.h:182
int containsError() const
Definition: retVal.h:150
const char * getName(void) const
returns parameter name (returned string is no copy, do not delete it)
Definition: param.h:182
bool m_updatePending
Definition: AbstractNode.h:81
uint m_hashVal
marks, if the Receiver has received and is buffering data from a new source
Definition: AbstractNode.h:83
void resetUpdatePending(void)
Definition: AbstractNode.h:159
QHash< unsigned int, Channel * > m_pChannels
the node's output parameters
Definition: AbstractNode.h:275
RetVal updateParam(const QHash< QString, ito::ParamBase * > *inputs)
this function must ONLY be used for the root of a tree. Sets several input parameters at once ...
Definition: AbstractNode.h:218
AbstractNode * getReceiver(void) const
Definition: AbstractNode.h:192
bool m_deleteParentOnDisconnect
the parameter-connector on the childīs side (can be sending or receiving)
Definition: AbstractNode.h:78
Definition: AbstractNode.h:62
QHash< QString, ito::Param * > m_pOutput
the node's input parameters
Definition: AbstractNode.h:274
ito::Param * getOwnParam(AbstractNode *self) const
Definition: AbstractNode.h:103