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);
111 PT(ButtonEventList) bel = _device->get_button_events();
112 output.set_data(_button_events_output, EventParameter(bel));
An abstract base class for a family of client device interfaces–including trackers,...
PointerTo< ClientDevice > get_device(TypeHandle device_type, const std::string &device_name)
Returns a ClientDevice pointer that corresponds to the named device of the indicated device type.
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.
The fundamental type of node for the data graph.
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.