Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions
MouseSubregion Class Reference

The MouseSubregion object scales the mouse inputs from within a rectangular region of the screen, as if they were the full-screen inputs. More...

#include "mouseSubregion.h"

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

List of all members.

Public Member Functions

 MouseSubregion (const string &name)
virtual TypeHandle force_init_type ()
PN_stdfloat get_bottom () const
 Retrieves the y coordinate of the bottom edge of the rectangle within the window.
PN_stdfloat get_left () const
 Retrieves the x coordinate of the left edge of the rectangle within the window.
PN_stdfloat get_right () const
 Retrieves the x coordinate of the right edge of the rectangle within the window.
PN_stdfloat get_top () const
 Retrieves the y coordinate of the top edge of the rectangle within the window.
virtual TypeHandle get_type () const
void set_dimensions (PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t)
 Changes the region of the window in which the mouse is considered to be active.

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

The MouseSubregion object scales the mouse inputs from within a rectangular region of the screen, as if they were the full-screen inputs.

If you choose your MouseSubregion coordinates to exactly match a DisplayRegion within your window, you end up with a virtual mouse within your DisplayRegion.

Definition at line 37 of file mouseSubregion.h.


Member Function Documentation

void MouseSubregion::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 68 of file mouseSubregion.cxx.

References DataNodeTransmit::get_data(), ButtonEventList::get_event(), ButtonEventList::get_num_events(), EventParameter::get_ptr(), EventStoreValue< Type >::get_value(), DataNodeTransmit::has_data(), and DataNodeTransmit::set_data().

PN_stdfloat MouseSubregion::get_bottom ( ) const [inline]

Retrieves the y coordinate of the bottom edge of the rectangle within the window.

This number will be in the range [0..1].

Definition at line 48 of file mouseSubregion.I.

PN_stdfloat MouseSubregion::get_left ( ) const [inline]

Retrieves the x coordinate of the left edge of the rectangle within the window.

This number will be in the range [0..1].

Definition at line 24 of file mouseSubregion.I.

PN_stdfloat MouseSubregion::get_right ( ) const [inline]

Retrieves the x coordinate of the right edge of the rectangle within the window.

This number will be in the range [0..1].

Definition at line 36 of file mouseSubregion.I.

PN_stdfloat MouseSubregion::get_top ( ) const [inline]

Retrieves the y coordinate of the top edge of the rectangle within the window.

This number will be in the range [0..1].

Definition at line 60 of file mouseSubregion.I.

void MouseSubregion::set_dimensions ( PN_stdfloat  l,
PN_stdfloat  r,
PN_stdfloat  b,
PN_stdfloat  t 
) [inline]

Changes the region of the window in which the mouse is considered to be active.

The parameters are identical to those for a DisplayRegion: they range from 0 to 1, where 0,0 is the lower left corner and 1,1 is the upper right; (0, 1, 0, 1) represents the whole window.

Definition at line 75 of file mouseSubregion.I.


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