# H3DNetworkingUtils::ToolPosDetector Class Reference

The ToolposDetector class detects tool posititon and makes this available in its output fields at the haptic rate. More...

`#include <H3DNetworkingUtils/ToolPosDetector.h>`

List of all members.

## Public Member Functions
| ToolPosDetector (H3D::Inst< H3D::SFBool > _enabled=0, H3D::Inst< H3D::SFInt32 > _deviceIndex=0, H3D::Inst< ThreadSafeSFVec3f > _globalPos=0, H3D::Inst< ThreadSafeSFVec3f > _localPos=0)
| Constructor.
## Public Attributes
auto_ptr< H3D::SFBool > | enabled
| Switches the node on or off access type: inputOutput basic type: SFBool default value: FALSE .
auto_ptr< H3D::SFInt32 > | deviceIndex
| Specifies which haptic devicde to monitor access type: inputOutput basic type: SFInt32 default value: 0 .
auto_ptr< ThreadSafeSFVec3f > | globalPos
| The position in global coord system access type: inputOutput basic type: SFVec3f default value: 0 0 0 .
auto_ptr< ThreadSafeSFVec3f > | localPos
| The position in local coord system access type: inputOutput basic type: SFVec3f default value: 0 0 0 .
## Static Public Attributes
static H3D::H3DNodeDatabase | database
| The H3DNodeDatabase for this node.
## Classes
class | ThreadSafeSFVec3f
| This class is designed to allow the value to be set in one thread and retrieved in another (not necessarily the graphics and haptics threads - in our case it is the haptics thread and a network sending thread). More...

## Detailed Description

The ToolposDetector class detects tool posititon and makes this available in its output fields at the haptic rate.

Note that there is an internal lock mechanism on the set update and get functions of the output fields. This allows you to retrieve the fields from a thread other than the haptics thread (e.g. one writing to a network). Note, however, that it may be dangerous to retrieve the values in the graphics loop, if you use it to change the scene graph. You should use a ThreadSafe (see H3D ThreadSafeSField.h) field to protect against those problems.

Examples:

- RealtimeAttractorTestServer.x3d
- RealtimeAttractorTestClient.x3d

## Member Data Documentation

auto_ptr<H3D::SFBool > H3DNetworkingUtils::ToolPosDetector::enabled

Switches the node on or off
access type: inputOutput
basic type: SFBool
default value: FALSE
.

auto_ptr<H3D::SFInt32 > H3DNetworkingUtils::ToolPosDetector::deviceIndex

Specifies which haptic devicde to monitor
access type: inputOutput
basic type: SFInt32
default value: 0
.

auto_ptr<ThreadSafeSFVec3f > H3DNetworkingUtils::ToolPosDetector::globalPos

The position in global coord system
access type: inputOutput
basic type: SFVec3f
default value: 0 0 0
.

auto_ptr<ThreadSafeSFVec3f > H3DNetworkingUtils::ToolPosDetector::localPos

The position in local coord system
access type: inputOutput
basic type: SFVec3f
default value: 0 0 0
.

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

- ToolPosDetector.h
- ToolPosDetector.cpp