26ButtonNode(
ClientBase *client,
const std::string &device_name) :
29 _button_events_output = define_output(
"button_events", ButtonEventList::get_class_type());
31 nassertv(client !=
nullptr);
33 client->get_device(ClientButtonDevice::get_class_type(), device_name);
35 if (device ==
nullptr) {
37 <<
"Unable to open button device " << device_name <<
"\n";
41 if (!device->is_of_type(ClientButtonDevice::get_class_type())) {
43 <<
"Inappropriate device type " << device->get_type()
44 <<
" created; expected a ClientButtonDevice.\n";
59 _button_events_output = define_output(
"button_events", ButtonEventList::get_class_type());
77output(std::ostream &out)
const {
80 if (_device !=
nullptr) {
82 _device->output_buttons(out);
91write(std::ostream &out,
int indent_level)
const {
92 DataNode::write(out, indent_level);
94 if (_device !=
nullptr) {
95 _device->write_buttons(out, indent_level + 2);
An abstract base class for a family of client device interfaces–including trackers,...
Any of a number of different devices that might be attached to a ClientBase, including trackers,...
This object supervises the traversal of the data graph and the moving of data from one DataNode to it...
Encapsulates the data generated from (or sent into) any particular DataNode.
void set_data(int index, const EventParameter &data)
Sets the data for the indicated parameter.
The fundamental type of node for the data graph.
An optional parameter associated with an event.
void output(std::ostream &out) const
Outputs the Namable.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.