Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions

DialNode Class Reference

This is the primary interface to infinite dial type devices associated with a ClientBase. More...

#include "dialNode.h"

Inheritance diagram for DialNode:
DataNode PandaNode TypedWritable Namable LinkedListNode ReferenceCount TypedObject MemoryBase MemoryBase MemoryBase

List of all members.

Public Member Functions

 DialNode (ClientBase *client, const string &device_name)
virtual TypeHandle force_init_type ()
int get_num_dials () const
 Returns the number of dial dials known to the DialNode.
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.
bool is_valid () const
 Returns true if the DialNode is valid and connected to a server, false otherwise.
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 ()

Protected Member Functions

virtual void do_transmit_data (DataGraphTraverser *trav, const DataNodeTransmit &input, DataNodeTransmit &output)
 The virtual implementation of transmit_data().

Detailed Description

This is the primary interface to infinite dial type devices associated with a ClientBase.

This creates a node that connects to the named dial device, if it exists, and provides hooks to the user to read the state of any of the sequentially numbered dial controls associated with that device.

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 39 of file dialNode.h.


Member Function Documentation

void DialNode::do_transmit_data ( DataGraphTraverser trav,
const DataNodeTransmit input,
DataNodeTransmit output 
) [protected, virtual]

The virtual implementation of transmit_data().

This function receives an array of input parameters and should generate an array of output parameters. The input parameters may be accessed with the index numbers returned by the define_input() calls that were made earlier (presumably in the constructor); likewise, the output parameters should be set with the index numbers returned by the define_output() calls.

Reimplemented from DataNode.

Definition at line 77 of file dialNode.cxx.

References is_valid().

int DialNode::get_num_dials ( ) const [inline]

Returns the number of dial dials known to the DialNode.

This number may change as more dials are discovered.

Definition at line 35 of file dialNode.I.

bool DialNode::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 66 of file dialNode.I.

bool DialNode::is_valid ( ) const [inline]

Returns true if the DialNode is valid and connected to a server, false otherwise.

Definition at line 23 of file dialNode.I.

Referenced by do_transmit_data().

double DialNode::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.

Definition at line 51 of file dialNode.I.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations