SPIN Framework
|
Reports geometric relations to other nodes in the scene. More...
#include <ReporterNode.h>
Public Member Functions | |
ReporterNode (SceneManager *sceneManager, const char *initID) | |
virtual void | debug () |
virtual void | callbackUpdate (osg::NodeVisitor *nv) |
void | forceAllReports () |
void | sendReports (reporterTarget *target) |
void | addTarget (const char *targetID) |
void | removeTarget (const char *targetID) |
void | setReporting (const char *type, bool enabled) |
int | getReporting (const char *type) const |
void | setMaxRate (float hz) |
float | getMaxRate () const |
virtual std::vector< lo_message > | getState () const |
Reports geometric relations to other nodes in the scene.
A list of targets can be specified, and then reports are computed with respect to this node and it's subgraph. One must turn on each of these report types using the setReport method. The current list is:
DISTANCE 'distance' between this and the target
INCIDENCE 'direction' (angle) to the target on the XY plane, and 'incidence', which is the angle difference between the reporterNode's current orientation to that which would point at the target
ANGLES reports the angle difference between the reporterNode's current orientation to that which would point at the target (available in both 'eulers' or 'quaternion' format)
CONTAINMENT whether this node is contained within this bounds of the target's subgraph (note: assumes the target is convex)
OCCLUSION whether the target is occluded (line-of-sight) for this object
Notes:
void spin::ReporterNode::addTarget | ( | const char * | targetID | ) |
Add a target node to the report list
void spin::ReporterNode::callbackUpdate | ( | osg::NodeVisitor * | nv | ) | [virtual] |
The update callback for ReporterNode checks to see if a target or the the ReporterNode's global matrix has changed (ie, whether it has been moved or not). If so, it updates the internal matrices, and calls sendReports()
Reimplemented from spin::GroupNode.
void spin::ReporterNode::debug | ( | ) | [virtual] |
Print debug information about the node to standard out (when running in console mode). It may be possible to redirect this to a text box for GUI logs.
Reimplemented from spin::GroupNode.
void spin::ReporterNode::forceAllReports | ( | ) |
Sometimes something happens in the scene that might not change the matrices of the reporter or the target (eg, a SwitchNode changes the visibility of the node). This method allows us to force a recomputation of all reports in such a case.
float spin::ReporterNode::getMaxRate | ( | ) | const [inline] |
This returns the current set reporting rate in Hz.
int spin::ReporterNode::getReporting | ( | const char * | type | ) | const |
This returns the reporting type that is currently set.
std::vector< lo_message > spin::ReporterNode::getState | ( | ) | const [virtual] |
For each subclass of ReferencedNode, we override the getState() method to fill the vector with the correct set of methods for this particular node
Reimplemented from spin::GroupNode.
void spin::ReporterNode::removeTarget | ( | const char * | targetID | ) |
Remove a target from the report list
void spin::ReporterNode::sendReports | ( | reporterTarget * | target | ) |
sendReports checks which reportTypes are enabled, and actually performs computation for necessary reports, which are then sent out on the network
void spin::ReporterNode::setMaxRate | ( | float | hz | ) |
Set the maximum reporting rate (hz). Note: updates are only sent when necessary, so there is no constant reporting mode.
void spin::ReporterNode::setReporting | ( | const char * | type, |
bool | enabled | ||
) |
This enables or disables a particular reporting type