#include <TransformerGraph.hpp>
|
| static osg::Node * | create (const std::string &name) |
| |
| static std::string | getWorldName (const osg::Node &transformer) |
| |
| static void | setTextSize (osg::Node &transformer, float size) |
| |
| static float | getTextSize (osg::Node &transformer) |
| |
| static osg::Node * | addFrame (osg::Node &transformer, const std::string &name) |
| |
| static osg::Node * | getFrame (osg::Node &transformer, const std::string &name) |
| |
| static osg::Node * | getFrame (osg::Node &transformer, osg::Node *node) |
| |
| static osg::Group * | getFrameGroup (osg::Node &transformer, const std::string &frame="") |
| |
| static std::string | getFrameName (osg::Node &transformer, osg::Node *node) |
| |
| static GraphDescription | getGraphDescription (osg::Node &transformer) |
| |
| static bool | setTransformation (osg::Node &transformer, const std::string &source_frame, const std::string &target_frame, const osg::Quat &quat, const osg::Vec3d &trans) |
| |
| static void | makeRoot (osg::Node &transformer, std::string const &desiredRoot) |
| |
| static bool | getTransformation (osg::Node &transformer, const std::string &source_frame, const std::string &target_frame, osg::Quat &quat, osg::Vec3d &trans) |
| |
| static bool | removeFrame (osg::Node &transformer, const std::string &name) |
| |
| static bool | hasFrame (osg::Node &transformer, const std::string &name) |
| |
| static std::vector< std::string > | getFrameNames (osg::Node &transformer) |
| |
| static void | showFrameAnnotation (osg::Node &transformer, bool value) |
| |
| static bool | areFrameAnnotationVisible (osg::Node &transformer) |
| |
| static void | attachNode (osg::Node &transformer, const std::string &frame, osg::Node &node) |
| |
| static void | detachNode (osg::Node &transformer, osg::Node &node) |
| |
The class TransfromerGraph is a collection of methods for creating and manipulating an osg sub scene graph used to maintain osg nodes living in different relative coordinate frames.
| osg::Node * TransformerGraph::addFrame |
( |
osg::Node & |
transformer, |
|
|
const std::string & |
name |
|
) |
| |
|
static |
Adds a new coordinate frame to the graph. Use setTranformation to change its location in the graph.
- Parameters
-
| transformer | The osg node of the transformer graph |
| name | The name of the new coordinate frame |
| bool TransformerGraph::areFrameAnnotationVisible |
( |
osg::Node & |
transformer | ) |
|
|
static |
Returns true if the frame annotations are activated
- Parameters
-
| transformer | The osg node of the transformer graph |
| void TransformerGraph::attachNode |
( |
osg::Node & |
transformer, |
|
|
const std::string & |
frame, |
|
|
osg::Node & |
node |
|
) |
| |
|
static |
Attaches the given node to the given coordinate frame. If the node is already attached it will be removed first.
- Parameters
-
| transformer | The osg node of the transformer graph |
| frame | The name of the coordinate frame. |
| node | The node which shall be attached. |
| osg::Node * TransformerGraph::create |
( |
const std::string & |
name | ) |
|
|
static |
Creates a new sub scene graph for maintaining a transformation stack
Do not directly add nodes to this node. Use getGroupNode instead!
- Parameters
-
| name | The name of the wold coordinate frame |
- Returns
- The transformer node of the created sub graph
| void TransformerGraph::detachNode |
( |
osg::Node & |
transformer, |
|
|
osg::Node & |
node |
|
) |
| |
|
static |
Detaches the given node from the transformer graph
- Parameters
-
| transformer | The osg node of the transformer graph |
| node | The node which shall be detached. |
| osg::Node * TransformerGraph::getFrame |
( |
osg::Node & |
transformer, |
|
|
const std::string & |
name |
|
) |
| |
|
static |
Returns the osg node for the given frame name. Returns NULL if the frame name does not exist.
Do not directly add nodes to this node. Use getGroupNode instead!
- Parameters
-
| transformer | The osg node of the transformer graph |
| name | The name of coordinate frame |
| osg::Node * TransformerGraph::getFrame |
( |
osg::Node & |
transformer, |
|
|
osg::Node * |
node |
|
) |
| |
|
static |
Returns the osg frame node for the given custom node. Returns NULL if the given node is not port of the sub scene graph
Do not directly add nodes to this node. Use getGroupNode instead!
- Parameters
-
| transformer | The osg node of the transformer graph |
| node | The node |
| osg::Group * TransformerGraph::getFrameGroup |
( |
osg::Node & |
transformer, |
|
|
const std::string & |
frame = "" |
|
) |
| |
|
static |
Returns the osg group node for the given frame. Use this node if you want to attach custom nodes to the frame
if no name is given it will return the group of the top level
- Parameters
-
| transformer | The osg node of the transformer graph |
| node | The node |
| std::string TransformerGraph::getFrameName |
( |
osg::Node & |
transformer, |
|
|
osg::Node * |
node |
|
) |
| |
|
static |
Returns the name of the osg frame node for the given custom node. Returns an empty string if the given node is not port of the sub scene graph
- Parameters
-
| transformer | The osg node of the transformer graph |
| node | The node |
| std::vector< std::string > TransformerGraph::getFrameNames |
( |
osg::Node & |
transformer | ) |
|
|
static |
Returns the names of all added coordinate frames.
- Parameters
-
| transformer | The osg node of the transformer graph |
Returns the shape of the graph as a list of frame names pairs (from->to)
| float TransformerGraph::getTextSize |
( |
osg::Node & |
transformer | ) |
|
|
static |
Returns the size of the frame annotations
| bool TransformerGraph::getTransformation |
( |
osg::Node & |
transformer, |
|
|
const std::string & |
source_frame, |
|
|
const std::string & |
target_frame, |
|
|
osg::Quat & |
quat, |
|
|
osg::Vec3d & |
trans |
|
) |
| |
|
static |
Gets the transformation between two coordinate frames. Thereby unlike setTransformation the frames do not have to be subsequently.
- Parameters
-
| transformer | The osg node of the transformer graph |
| source_frame | The name of the source coordinate frame |
| target_frame | The name of the target coordinate frame |
| quat | The rotation between source and target frame |
| trans | The translation between source and target frame |
| std::string TransformerGraph::getWorldName |
( |
const osg::Node & |
transformer | ) |
|
|
static |
Returns the name of the wold (root) frame.
| bool TransformerGraph::hasFrame |
( |
osg::Node & |
transformer, |
|
|
const std::string & |
name |
|
) |
| |
|
static |
Returns true if the given frame name exists.
- Parameters
-
| transformer | The osg node of the transformer graph |
| name | The name of coordinate frame |
| void TransformerGraph::makeRoot |
( |
osg::Node & |
transformer, |
|
|
std::string const & |
desiredRoot |
|
) |
| |
|
static |
Ensures that the transform node for the given frame is a direct child of the transformer node
| bool TransformerGraph::removeFrame |
( |
osg::Node & |
transformer, |
|
|
const std::string & |
name |
|
) |
| |
|
static |
Removes the osg node for the given frame name. Returns false if the frame name does not exist.
- Parameters
-
| transformer | The osg node of the transformer graph |
| name | The name of coordinate frame |
| void TransformerGraph::setTextSize |
( |
osg::Node & |
transformer, |
|
|
float |
size |
|
) |
| |
|
static |
Sets the size of the frame annotations
| bool TransformerGraph::setTransformation |
( |
osg::Node & |
transformer, |
|
|
const std::string & |
source_frame, |
|
|
const std::string & |
target_frame, |
|
|
const osg::Quat & |
quat, |
|
|
const osg::Vec3d & |
trans |
|
) |
| |
|
static |
Sets the transformation between two subsequently coordinate frames.
- Parameters
-
| transformer | The osg node of the transformer graph |
| source_frame | The name of the source coordinate frame |
| target_frame | The name of the target coordinate frame |
| quat | The rotation between source and target frame |
| trans | The translation between source and target frame |
| void TransformerGraph::showFrameAnnotation |
( |
osg::Node & |
transformer, |
|
|
bool |
value |
|
) |
| |
|
static |
Activates or deactivates the annotation of the frame nodes
- Parameters
-
| transformer | The osg node of the transformer graph |
| value | |
The documentation for this class was generated from the following files: