SOFA plugin: LeapMotion  master
Open source framework for multi-physics simuation
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Leap::ScreenList Class Reference

#include <Leap.h>

Inheritance diagram for Leap::ScreenList:

Detailed Description

The ScreenList class represents a list of Screen objects.

The list always contains at least one entry representing the default screen. If the user has not registered the location of this default screen, then the coordinates, directions, and other values reported by the functions in its Screen object will not be accurate. Other monitor screens only appear in the list if their positions have been registered using the Leap Screen Locator.

Get a ScreenList object by calling Controller::locatedScreens().

Public Member Functions

 ScreenList (const ListBaseImplementation< Screen > &)
 
LEAP_EXPORT ScreenList ()
 
LEAP_EXPORT int count () const
 
LEAP_EXPORT bool isEmpty () const
 
LEAP_EXPORT bool empty () const
 
LEAP_EXPORT Screen operator[] (int index) const
 
LEAP_EXPORT const_iterator begin () const
 
LEAP_EXPORT const_iterator end () const
 
LEAP_EXPORT Screen closestScreenHit (const Pointable &pointable) const
 
LEAP_EXPORT Screen closestScreenHit (const Vector &position, const Vector &direction) const
 
LEAP_EXPORT Screen closestScreen (const Vector &position) const
 

Additional Inherited Members

- Protected Attributes inherited from Leap::Interface
class SharedObject * m_object
 
- Protected Member Functions inherited from Leap::Interface
LEAP_EXPORT Interface (void *owner)
 
LEAP_EXPORT Interface (Implementation *reference, void *owner)
 
LEAP_EXPORT Interface (const Interface &rhs)
 
LEAP_EXPORT Interfaceoperator= (const Interface &rhs)
 
virtual LEAP_EXPORT ~Interface ()
 
template<typename T >
T * get () const
 

Constructor details

◆ ScreenList() [1/2]

Leap::ScreenList::ScreenList ( const ListBaseImplementation< Screen > &  )

◆ ScreenList() [2/2]

LEAP_EXPORT Leap::ScreenList::ScreenList ( )

Constructs an empty list of screens.

Function details

◆ begin()

LEAP_EXPORT const_iterator Leap::ScreenList::begin ( ) const

The C++ iterator set to the beginning of this ScreenList.

◆ closestScreen()

LEAP_EXPORT Screen Leap::ScreenList::closestScreen ( const Vector position) const

Gets the Screen closest to the specified position.

The specified position is projected along each screen's normal vector onto the screen's plane. The screen whose projected point is closest to the specified position is returned. Call Screen::project(position) on the returned Screen object to find the projected point.

Parameters
positionThe position from which to check for screen projection.
Returns
The closest Screen onto which the specified position is projected.

◆ closestScreenHit() [1/2]

LEAP_EXPORT Screen Leap::ScreenList::closestScreenHit ( const Pointable pointable) const

Gets the closest Screen intercepting a ray projecting from the specified Pointable object.

The projected ray emanates from the Pointable tipPosition along the Pointable's direction vector. If the projected ray does not intersect any screen surface directly, then the Leap checks for intersection with the planes extending from the surfaces of the known screens and returns the Screen with the closest intersection.

If no intersections are found (i.e. the ray is directed parallel to or away from all known screens), then an invalid Screen object is returned.

Note: Be sure to test whether the Screen object returned by this method is valid. Attempting to use an invalid Screen object will lead to incorrect results.

Parameters
pointableThe Pointable object to check for screen intersection.
Returns
The closest Screen toward which the specified Pointable object is pointing, or, if the pointable is not pointing in the direction of any known screen, an invalid Screen object.

◆ closestScreenHit() [2/2]

LEAP_EXPORT Screen Leap::ScreenList::closestScreenHit ( const Vector position,
const Vector direction 
) const

Gets the closest Screen intercepting a ray projecting from the specified position in the specified direction.

The projected ray emanates from the position along the direction vector. If the projected ray does not intersect any screen surface directly, then the Leap checks for intersection with the planes extending from the surfaces of the known screens and returns the Screen with the closest intersection.

If no intersections are found (i.e. the ray is directed parallel to or away from all known screens), then an invalid Screen object is returned.

Note: Be sure to test whether the Screen object returned by this method is valid. Attempting to use an invalid Screen object will lead to incorrect results.

Parameters
positionThe position from which to check for screen intersection.
directionThe direction in which to check for screen intersection.
Returns
The closest Screen toward which the specified ray is pointing, or, if the ray is not pointing in the direction of any known screen, an invalid Screen object.

◆ count()

LEAP_EXPORT int Leap::ScreenList::count ( ) const

Returns the number of screens in this list.

Returns
The number of screens in this list.

◆ empty()

LEAP_EXPORT bool Leap::ScreenList::empty ( ) const

Deprecated. Use ScreenList::isEmpty() instead.

See also
ScreenList::isEmpty()

◆ end()

LEAP_EXPORT const_iterator Leap::ScreenList::end ( ) const

The C++ iterator set to the end of this ScreenList.

◆ isEmpty()

LEAP_EXPORT bool Leap::ScreenList::isEmpty ( ) const

Reports whether the list is empty.

Returns
True, if the list has no members.

◆ operator[]()

LEAP_EXPORT Screen Leap::ScreenList::operator[] ( int  index) const

Access a list member by its position in the list.

Parameters
indexThe zero-based list position index.
Returns
The Screen object at the specified index.