Panda3D
|
A device, attached to the ClientBase by a DialNode, that records the data from a single named dial device. More...
#include "clientDialDevice.h"
Classes | |
class | DialState |
Public Member Functions | |
virtual TypeHandle | force_init_type () |
int | get_num_dials () const |
Returns the number of dial dials known to the ClientDialDevice. | |
virtual TypeHandle | get_type () const |
bool | is_dial_known (int index) const |
Returns true if the state of the indicated dial dial is known, or false if we have never heard anything about this particular dial. | |
void | push_dial (int index, double offset) |
Marks that the dial has been offset by the indicated amount. | |
double | read_dial (int index) |
Returns the number of complete revolutions of the dial since the last time read_dial() was called. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Protected Types | |
typedef pvector< DialState > | Dials |
Protected Member Functions | |
ClientDialDevice (ClientBase *client, const string &device_name) | |
Protected Attributes | |
Dials | _dials |
A device, attached to the ClientBase by a DialNode, that records the data from a single named dial device.
The named device can contain any number of dials, numbered in sequence beginning at zero.
A dial is a rotating device that does not have stops--it can keep rotating any number of times. Therefore it does not have a specific position at any given time, unlike an AnalogDevice.
Definition at line 35 of file clientDialDevice.h.
int ClientDialDevice::get_num_dials | ( | ) | const [inline] |
Returns the number of dial dials known to the ClientDialDevice.
This number may change as more dials are discovered.
Definition at line 46 of file clientDialDevice.I.
static void ClientDialDevice::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from ClientDevice.
Reimplemented in VrpnDialDevice.
Definition at line 66 of file clientDialDevice.h.
References ClientDevice::init_type().
bool ClientDialDevice::is_dial_known | ( | int | index | ) | const [inline] |
Returns true if the state of the indicated dial dial is known, or false if we have never heard anything about this particular dial.
Definition at line 95 of file clientDialDevice.I.
void ClientDialDevice::push_dial | ( | int | index, |
double | offset | ||
) | [inline] |
Marks that the dial has been offset by the indicated amount.
It is the user's responsibility to ensure that this call is protected within acquire().
Definition at line 58 of file clientDialDevice.I.
double ClientDialDevice::read_dial | ( | int | index | ) | [inline] |
Returns the number of complete revolutions of the dial since the last time read_dial() was called.
This is a destructive operation; it is not possible to read the dial without resetting the counter.
It is the user's responsibility to ensure that this call is protected within acquire().
Definition at line 77 of file clientDialDevice.I.