itom  4.1.0
ito::AbstractNode Class Referenceabstract

Every plot designer plugin in itom, that should be able to open dependent sub-plots (e.g. a 1d line cut is a subplot of its 2d parent plot), must be inherited from this class AbstractNode. However, AbstractNode is no widget class of Qt. Therefore it is also possible to create non-visible classes derived from AbstractNode. This allows creating a directed net of nodes where changes of some input parameters are propagated through all relevant sub-nodes. More...

#include <AbstractNode.h>

Inheritance diagram for ito::AbstractNode:
ito::AbstractFigure ito::AbstractDObjFigure ito::AbstractDObjPclFigure

Public Types

typedef QPair< QString, QString > ParamNamePair
 

Public Member Functions

 AbstractNode ()
 constructor
 
virtual ~AbstractNode ()
 destructor
 
virtual RetVal applyUpdate (void)=0
 
virtual RetVal update (void)=0
 update of this node if the values of all changed input channels are propgated to the corresponding input parameters of this node More...
 
RetVal createChannel (const QString &senderParamName, AbstractNode *receiver, const QString &receiverParamName, bool replaceChannelIfExists=false)
 creates a new channel from this node as sender and a specific sender parameter (output) to a receiver node and its specific receiver (input) parameter. More...
 
RetVal removeChannel (QSharedPointer< Channel > channel)
 

removes the channel from the list of channels, forces the partner node to detach the channel and destroys the channel object


 
RetVal removeAllChannelsToReceiver (const AbstractNode *receiver, QList< ParamNamePair > excludedConnections=QList< ParamNamePair >())
 >
 
QList< QSharedPointer< Channel > > getConnectedInputChannels (const QString &inputParamName) const
 

returns a list of channels, that are connected to an input param with a given name. This node must be the receiver of the returned channels.


 
QList< QSharedPointer< Channel > > getConnectedInputChannels (const ito::Param *inputParam) const
 

returns a list of channels, that are connected to a given input parameter. This node must be the receiver of the returned channels.


 
QList< QSharedPointer< Channel > > getConnectedOutputChannels (const QString &outputParamName) const
 

returns a list of channels, that are connected to an ouput param with a given name. This node must be the sender of the returned channels.


 
QList< QSharedPointer< Channel > > getConnectedOutputChannels (const ito::Param *outputParam) const
 

returns a list of channels, that are connected to a given output parameter. This node must be the sender of the returned channels.


 
RetVal updateChannelData (QSharedPointer< Channel > updatedChannel)
 

This method is called, if the sender parameter of the channel changed its value.


 
RetVal setUpdatePending (QSharedPointer< ito::Channel > singleOutputChannel=QSharedPointer< ito::Channel >())
 >propagates information about a soon, future update to all (or one selected) output channel(s) of this node
 
ito::ParamgetInputParam (const QString &paramName) const
 returns the input parameter whose name is equal to paramName or returns NULL if the parameter is not found.
 
ito::ParamgetOutputParam (const QString &paramName) const
 returns the output parameter whose name is equal to paramName or returns NULL if the parameter is not found.
 
RetVal addOutputParam (ito::Param *param)
 adds the given parameter to the list of output parameters of this node.
 
RetVal removeAndDeleteOutputParam (const QString &paramName)
 
RetVal addInputParam (ito::Param *param)
 adds the given parameter to the list of input parameters of this node.
 
RetVal removeAndDeleteInputParam (const QString &paramName)
 
RetVal updateChannels (const QList< QString > &outputParamNames)
 triggers updates of all channels that are connected to the given output parameter names of the sender.
 
rttiNodeType getType () const
 returns the type of this node
 
bool isConnected () const
 returns true if at least one channel is connected to this node
 
unsigned int getUniqueID (void) const
 return a unique, auto-incremented UID of this node (beginning with 1)
 

Protected Member Functions

RetVal detachChannel (QSharedPointer< Channel > channel)
 removes the given channel from the list of chnanels of this node.
 
RetVal attachChannel (QSharedPointer< Channel > channel)
 

attaches the given channel to the list of channels (either input or output, depending if this is sender or receiver)


 
RetVal inputParamChanged (const ito::ParamBase *updatedInputParam)
 

indicates that an input parameter of the node has been changed and initializes the update pipline to child nodes if necessary. This is the source of an update.

More...
 

Static Protected Attributes

static unsigned int UID = 1
 highest used UID of any node. This value is auto-incremented upon every More...
 

Private Member Functions

 Q_DECLARE_PRIVATE (AbstractNode)
 

self-managed pointer to the private class container (deletes itself if d_ptr is destroyed). pointer to private class of AbstractNode defined in AbstractNode.cpp. This container is used to allow flexible changes in the interface without destroying the binary compatibility


 

Private Attributes

QScopedPointer< AbstractNodePrivated_ptr
 

Detailed Description

Every plot designer plugin in itom, that should be able to open dependent sub-plots (e.g. a 1d line cut is a subplot of its 2d parent plot), must be inherited from this class AbstractNode. However, AbstractNode is no widget class of Qt. Therefore it is also possible to create non-visible classes derived from AbstractNode. This allows creating a directed net of nodes where changes of some input parameters are propagated through all relevant sub-nodes.

Every node has a set of input parameters (as list of ito::Param) and a set of output parameters. One output parameter of one node can be connected with another input parameter of another node, using the class ito::Channel (see methods createChannel, removeChannel, ...). Whenever one or multiple output parameters of one node are changed, the changes are propagated through all connected channels to the corresponding parameters of the receiver node(s).

Since the real update of the view of a plot needs some computing power, a mechanism (called 'pending update') is integrated in the channels, such that the view update is done as soon as the announced changes of all affected input channels have been propagated to all affected input parameters of one node.

This is realized by a two-step update mechanism: If one or multiple output parameters have been changed, an update of all possible channels is triggered, which are connected to these output parameters. Then the states of these channels is set to Channel::StateUpdatePending. This is repeated recursively in all receiving nodes of these affected channels, such that all output channels of these receivers are also notified about the upcoming update (update pending).

If the pending update is reported recursively through the entire sub-tree below the changed initial parameters, the changed parameters are started to be copied from sender to receiver in every affected channel. Once done, the state of the channel switches from Channel::StateUpdatePending to Channel::StateUpdateReceived. As soon as the last input channel of a receiver node switched its state from StateUpdatePending to StateUpdateReceived, the real update() method of the node is called, which calls the pure virtual method applyUpdate, that calculates the real view update of the plot (or similar node element).

Member Function Documentation

RetVal ito::AbstractNode::createChannel ( const QString &  senderParamName,
AbstractNode receiver,
const QString &  receiverParamName,
bool  replaceChannelIfExists = false 
)

creates a new channel from this node as sender and a specific sender parameter (output) to a receiver node and its specific receiver (input) parameter.

Calls applyUpdate() and updates all children

RetVal ito::AbstractNode::inputParamChanged ( const ito::ParamBase updatedInputParam)
protected

indicates that an input parameter of the node has been changed and initializes the update pipline to child nodes if necessary. This is the source of an update.

>

RetVal ito::AbstractNode::removeAndDeleteInputParam ( const QString &  paramName)

removes the parameter 'paramName' from the list of output parameters and deletes it (if it exists). Also removes all channels that have this output parameter as sender.

RetVal ito::AbstractNode::removeAndDeleteOutputParam ( const QString &  paramName)

removes the parameter 'paramName' from the list of output parameters and deletes it (if it exists). Also removes all channels that have this output parameter as sender.

virtual RetVal ito::AbstractNode::update ( void  )
pure virtual

update of this node if the values of all changed input channels are propgated to the corresponding input parameters of this node

Performs the in INTERNAL operations necessary in updating the node and displaying the data. This has to implemented

in each final successor in the inheritance structure. Anyway the "displayed" parameter MUST be filled adequately as this can only be done by the node itself.

Implemented in ito::AbstractFigure, ito::AbstractDObjPclFigure, and ito::AbstractDObjFigure.

Member Data Documentation

unsigned int ito::AbstractNode::UID = 1
staticprotected

highest used UID of any node. This value is auto-incremented upon every

Updates the input param of the associated node and attempts to propagate the update down the node tree.

It DOES NOT/CANNOT, however, ensure that the output parameters of the node are updated correctly, this functionality has to be a part of update().


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