15 #include "virtualMouse.h" 16 #include "dataNodeTransmit.h" 26 VirtualMouse(
const string &name) :
29 _pixel_xy_output = define_output(
"pixel_xy", EventStoreVec2::get_class_type());
30 _pixel_size_output = define_output(
"pixel_size", EventStoreVec2::get_class_type());
31 _xy_output = define_output(
"xy", EventStoreVec2::get_class_type());
32 _button_events_output = define_output(
"button_events", ButtonEventList::get_class_type());
96 _next_button_events->add_event(
ButtonEvent(button, ButtonEvent::T_down));
107 _next_button_events->add_event(
ButtonEvent(button, ButtonEvent::T_up));
128 _button_events = _next_button_events;
129 _next_button_events = events;
130 _next_button_events->clear();
133 _pixel_size->set_value(
LPoint2(_win_width, _win_height));
138 _pixel_xy->set_value(
LPoint2(_mouse_x, _mouse_y));
142 PN_stdfloat xf = (2.0f * (PN_stdfloat)_mouse_x) / (PN_stdfloat)_win_width - 1.0f;
143 PN_stdfloat yf = 1.0f - (2.0f * (PN_stdfloat)_mouse_y) / (PN_stdfloat)_win_height;
144 _xy->set_value(
LPoint2(xf, yf));
The fundamental type of node for the data graph.
void press_button(ButtonHandle button)
Simulates a mouse or keyboard button being depressed.
An optional parameter associated with an event.
A handy class object for storing simple values (like integers or strings) passed along with an Event ...
void set_data(int index, const EventParameter &data)
Sets the data for the indicated parameter.
void set_window_size(int width, int height)
Sets the size of the "window" in which the mouse rolls.
void release_button(ButtonHandle button)
Simulates the button being released.
void set_mouse_pos(int x, int y)
Sets the current mouse pixel location, where (0,0) is the upper left, and (width-1, height-1) is the lower right pixel of the virtual window.
This is a two-component point in space.
void set_mouse_on(bool flag)
Sets whether the mouse should appear to be within the window or not.
TypeHandle is the identifier used to differentiate C++ class types.
Encapsulates the data generated from (or sent into) any particular DataNode.
This object supervises the traversal of the data graph and the moving of data from one DataNode to it...