16 #include "trackball.h"
17 #include "buttonEvent.h"
18 #include "buttonEventList.h"
19 #include "dataNodeTransmit.h"
20 #include "mouseData.h"
30 MouseInterfaceNode(
const string &name) :
33 _button_events_input = define_input(
"button_events", ButtonEventList::get_class_type());
42 ~MouseInterfaceNode() {
65 _required_buttons_state.
button_up(button);
78 _required_buttons_state.
button_up(button);
112 void MouseInterfaceNode::
139 bool &required_buttons_match) {
142 if (input.
has_data(_button_events_input)) {
143 DCAST_INTO_R(button_events, input.
get_data(_button_events_input).
get_ptr(), NULL);
147 required_buttons_match =
148 (_current_button_state & _required_buttons_mask) == _required_buttons_state;
150 return button_events;
The fundamental type of node for the data graph.
void clear_all_buttons()
Removes all requirements on buttons set by an earlier call to require_button().
void clear_button(const ButtonHandle &button)
Removes any requirement on the indicated button set by an earlier call to require_button().
const EventParameter & get_data(int index) const
Extracts the data for the indicated index, if it has been stored, or the empty parameter if it has no...
void require_button(const ButtonHandle &button, bool is_down)
Indicates that the indicated button must be in the required state (either up or down) in order for th...
TypedWritableReferenceCount * get_ptr() const
Retrieves a pointer to the actual value stored in the parameter.
TypeHandle is the identifier used to differentiate C++ class types.
bool has_data(int index) const
Returns true if the indicated parameter has been stored, false otherwise.
Encapsulates the data generated from (or sent into) any particular DataNode.