MIRA
|
#include <fw/FrameworkTransformer.h>
Public Types | |
typedef FrameworkTransformerNode | Node |
The type of a transformation node. More... | |
typedef Node * | NodePtr |
The type of a pointer of the actual transformation node. More... | |
typedef TransformerBase::AbstractNodePtr | AbstractNodePtr |
The type of a pointer to the AbstractTransformerNode base class. More... | |
Public Member Functions | |
FrameworkTransformer (Authority &authority) | |
~FrameworkTransformer () | |
void | addLink (const std::string &childID, const std::string &parentID) |
Add a transformation link between the given child and parent. More... | |
void | addLink (const std::string &childID, const std::string &parentID, FrameworkTransformerNode::Type type) |
Add a transformation link between the given child and parent, specifying the type of the transformation. More... | |
template<typename Transform > | |
void | publishTransform (const std::string &nodeID, const Transform &transform, const Time &time=Time::now()) |
Publish a transformation for a given node. More... | |
template<typename Transform , typename Filter = NearestNeighborInterpolator> | |
void | publishTransformIndirect (const std::string &nodeID, const std::string &targetID, const std::string &sourceID, const Transform &transform, const Time &time=Time::now(), Filter &&filter=NearestNeighborInterpolator()) |
Publish a transformation (nodeID) indirect by specifying a direct transform between two nodes (sourceID and targetID). More... | |
void | storeTransformTree (const Path &filename) |
Stores currently known transform tree in a XML config file. More... | |
TransformDesc | prepareTransform (NodePtr target, NodePtr source) |
Prepares the computation of a transformation by computing the path between the target and source node. More... | |
TransformDesc | prepareTransform (NodePtr target, NodePtr source, NodePtr fixed) |
Prepares the computation of a transformation by computing the path between the 'target' and 'source' node via the 'fixed' node, i.e. More... | |
Transform | getTransform (const TransformDesc &desc, const Time &targetTime, const Time &sourceTime, Filter &&filter) |
Computes and returns a certain transformation that is specified via the TransformDesc. More... | |
Transform | getTransform (const TransformDesc &desc, const Time &targetTime, const Time &sourceTime) |
same as above, but using NearestNeighborInterpolator as filter. More... | |
Transform | getTransform (const TransformDesc &desc, const Time &time, Filter &&filter) |
same as above, but with the same time for source and target transform. More... | |
Transform | getTransform (const TransformDesc &desc, const Time &time) |
same as above, but using NearestNeighborInterpolator as filter. More... | |
Transform | getTransform (NodePtr target, NodePtr source, const Time &time, Filter &&filter) |
Computes and returns a certain transformation between the specified target and source node. More... | |
Transform | getTransform (NodePtr target, NodePtr source, const Time &time) |
same as above, but using NearestNeighborInterpolator as filter More... | |
Transform | getTransform (NodePtr target, const Time &targetTime, NodePtr source, const Time &sourceTime, NodePtr fixed, Filter &&filter) |
Computes and returns a certain transformation between the specified target and source node via the 'fixed' node, i.e. More... | |
Transform | getTransform (NodePtr target, const Time &targetTime, NodePtr source, const Time &sourceTime, NodePtr fixed) |
same as above, but using NearestNeighborInterpolator as filter More... | |
Transform | inferTransform (NodePtr node, NodePtr target, NodePtr source, const Transform &transform, const Time &time, Filter &&filter) |
Infers a transform by specifying a direct transform between two nodes, which are connected indirectly over the transformation, that shall be infered. More... | |
Transform | inferTransform (NodePtr node, NodePtr target, NodePtr source, const Transform &transform, const Time &time) |
same as above, but using NearestNeighborInterpolator as filter More... | |
NodePtr | getNode (const std::string &nodeID) |
Returns a pointer to the node with the given ID or nullptr if it does not exist. More... | |
bool | addLink (AbstractNodePtr child, AbstractNodePtr parent) |
Adds a link between the specified child and its parent. More... | |
void | removeLink (AbstractNodePtr child, AbstractNodePtr parent) |
Removes an existing link between the specified child node and the given parent node. More... | |
std::list< AbstractNodePtr > | getNodes () |
Returns all nodes that are known by this transformer. More... | |
std::list< std::pair< AbstractNodePtr, AbstractNodePtr > > | getLinks () |
Returns all links (as parent,child-pairs) that are known by this transformer. More... | |
const std::list< AbstractNodePtr > | getRootNodes () |
Returns a list of all nodes, that have no ancestor, e.g. More... | |
void | getTransformChain (AbstractNodePtr target, AbstractNodePtr source, Chain &oChain) |
bool | isTransformAvailable (AbstractNodePtr target, AbstractNodePtr source) |
Checks if a transformation between 'target' and 'source' node is available: More... | |
void | reflect (Reflector &r) |
Static Public Attributes | |
static const int | MAX_TREE_DEPTH = 1000 |
The max. More... | |
Protected Types | |
typedef std::map< std::string, AbstractNodePtr > | IDToNodeMap |
Protected Member Functions | |
void | registerInterface (const std::string &interface, const std::string &otherTransformer) |
bool | createLink (const std::string &childID, const std::string &parentID, FrameworkTransformerNode::Type type) |
void | notifyTransformerOfLink (const std::string &otherTransformer, const std::string &childID, const std::string &parentID, FrameworkTransformerNode::Type type) |
void | notifyTransformerOfLink (const std::string &otherTransformer, bool implementsLinkType, const std::string &childID, const std::string &parentID, FrameworkTransformerNode::Type type) |
Transform | getTransform (const Chain &chain, const Time &time, Filter &&filter) |
Computes the resulting transform by applying all transforms according to the specified transform chain. More... | |
void | addNode (AbstractNodePtr node) |
An exception that is thrown when errors related to transformations occur. More... | |
Static Protected Member Functions | |
static NodePtr | castNode (AbstractNodePtr node) |
Casts an abstract node pointer to the actual used Node. This is safe. More... | |
Protected Attributes | |
IDToNodeMap | mNodes |
maps from ids to nodes that were added to us More... | |
Friends | |
class | IFrameworkTransformer< FrameworkTransformer > |
|
inherited |
The type of a transformation node.
|
inherited |
The type of a pointer to the AbstractTransformerNode base class.
|
protectedinherited |
FrameworkTransformer | ( | Authority & | authority | ) |
~FrameworkTransformer | ( | ) |
void addLink | ( | const std::string & | childID, |
const std::string & | parentID | ||
) |
Add a transformation link between the given child and parent.
Creates child and/or parent if not existing, unlinks an existing different parent if necessary. The type is not specified. This method exists for backward compatibility.
[in] | childID | The frame id of the child |
[in] | parentID | The frame id of the parent |
void addLink | ( | const std::string & | childID, |
const std::string & | parentID, | ||
FrameworkTransformerNode::Type | type | ||
) |
Add a transformation link between the given child and parent, specifying the type of the transformation.
Creates child and/or parent if not existing, unlinks an existing different parent if necessary.
[in] | childID | The frame id of the child |
[in] | parentID | The frame id of the parent |
[in] | type | Link type fixed/moving |
|
inline |
Publish a transformation for a given node.
[in] | nodeID | The id of the node |
[in] | transform | Either a 2d or 3d transformation |
[in] | time | The time of the transformation |
|
inline |
Publish a transformation (nodeID) indirect by specifying a direct transform between two nodes (sourceID and targetID).
These two nodes are connected indirectly over the transformation (nodeID) This is, the transformation (nodeID) is inferred. In the case you know the direct transform between 'targetID' and 'sourceID' you can use this method to publish the desired transform on the link 'nodeID' at the specified 'time' and using the specified 'filter' for interpolation.
XRuntime | if either the frame, target or source node does not exist |
[in] | nodeID | The id of the frame to publish indirectly |
[in] | targetID | The frame id of the target node |
[in] | sourceID | The frame id of the source node |
[in] | transform | Either a 2d or 3d transformation |
[in] | time | The time of the transformation |
[in] | filter | The filter used to interpolate between the transforms |
void storeTransformTree | ( | const Path & | filename | ) |
Stores currently known transform tree in a XML config file.
|
protected |
|
protected |
|
protected |
|
protected |
|
inlineinherited |
Prepares the computation of a transformation by computing the path between the target and source node.
The returned TransformDesc can be used in a call to the getTransform() method.
|
inlineinherited |
Prepares the computation of a transformation by computing the path between the 'target' and 'source' node via the 'fixed' node, i.e.
target->fixed->source. The returned TransformDesc can be used in a call to the getTransform() method.
|
inlineinherited |
Computes and returns a certain transformation that is specified via the TransformDesc.
Moreover, the timestamps of the transformations is taken into account, therefore the timestamps of the target and source transforms must be specified. Additionally, a filter can be specified that can be used to interpolate or filter the transforms according to the specified timestamps.
|
inlineinherited |
same as above, but using NearestNeighborInterpolator as filter.
|
inlineinherited |
same as above, but with the same time for source and target transform.
|
inlineinherited |
same as above, but using NearestNeighborInterpolator as filter.
|
inlineinherited |
Computes and returns a certain transformation between the specified target and source node.
Moreover, the timestamps of the transformations is taken into account. Additionally, a filter can be specified that can be used to interpolate or filter the transforms according to the specified timestamps.
same as above, but using NearestNeighborInterpolator as filter
|
inlineinherited |
Computes and returns a certain transformation between the specified target and source node via the 'fixed' node, i.e.
target->fixed->source. Moreover, the timestamps of the transformations is taken into account, therefore the timestamps of the target and source transforms must be specified. Additionally, a filter can be specified that can be used to interpolate or filter the transforms according to the specified timestamps.
|
inlineinherited |
same as above, but using NearestNeighborInterpolator as filter
|
inlineprotectedinherited |
Computes the resulting transform by applying all transforms according to the specified transform chain.
|
inlineinherited |
Infers a transform by specifying a direct transform between two nodes, which are connected indirectly over the transformation, that shall be infered.
Imagine the following example, were the transformation node 'p' is directly connected to the transformation node 'node'. Additionally, both nodes are connected via certain paths with the nodes 'source' and 'target', respectively:
p ---- x ---- source | | | v node --- y --- target
Now imagine, you want to compute the transformation between 'p' and 'node', but all you know is the direct transformation between the nodes 'source' and 'target' which are however not directly connected:
p ---- x ---- source | . | ??? . this 'transform' | . is known v v node --- y --- target
In this case you can use this method. It computes and returns the desired transform on the link towards 'node' given the 'transform' between the nodes 'target' and 'source' at the specified 'time' and using the specified 'filter' for interpolation.
|
inlineinherited |
same as above, but using NearestNeighborInterpolator as filter
|
inlineinherited |
Returns a pointer to the node with the given ID or nullptr if it does not exist.
|
inlinestaticprotectedinherited |
Casts an abstract node pointer to the actual used Node. This is safe.
|
inherited |
Adds a link between the specified child and its parent.
Both nodes must have been added to this Transformer. If both nodes are connected to each other already this method has no effect. If the child was connected to another parent before it is unlinked from its current parent first and then linked to the new one. Returns true, if the link was new. If the link was already known, false is returned.
|
inherited |
Removes an existing link between the specified child node and the given parent node.
If both nodes are not connected, this method does nothing.
|
inherited |
Returns all nodes that are known by this transformer.
|
inherited |
Returns all links (as parent,child-pairs) that are known by this transformer.
|
inherited |
Returns a list of all nodes, that have no ancestor, e.g.
that are root nodes of a transform tree.
|
inherited |
Throws | XTransform, if source and target are not connected or if there is a loop in the transform tree. |
|
inherited |
Checks if a transformation between 'target' and 'source' node is available:
|
protectedinherited |
An exception that is thrown when errors related to transformations occur.
Adds the specified node to the internal node map
|
inlineinherited |
|
friend |
|
staticinherited |
The max.
allowed number of levels within a transformation tree. It is used by collectNodesUpwardsToRoot() that is applied to find the "lowest common ancestor" in getTransformChain() to detect loops within the transformation tree.
|
protectedinherited |
maps from ids to nodes that were added to us