Welcome to Leap’s documentation!

Leap is a bare-basic implementation of how future CAD interfaces would be like. It consists of

  • input from a 3D device (currently Leap Motion) which is converted to Gestures. Each gesture signifies an action to the application.
  • application which accepts the data in 3D unlike the 2D input from a mouse. The application here is a simple Cylinder being controlled in OpenGL

Contents:

src

Leap package

Subpackages
Leap.leap package
Submodules
Leap.leap.leap_start module
Module contents
Leap.ogl package
Submodules
Leap.ogl.application module
Leap.ogl.element module
Leap.ogl.interface module

Wrapper around PyOpenGL and PyGame

class Leap.ogl.interface.GLInterface[source]

Bases: object

Creates a screen, and allows easy evaluation of events

display_loop()[source]

Main display function, called every iteration

event_handler(event)[source]

A big switch case function for input event

Parameters:event – pygame.Event, used to check for events
Returns:handler for event.type
init()[source]

Sets the env settings for the application in the beginning

init_loop()[source]

It is called before drawing on the screen each time

key_down(key)[source]
Parameters:key – key pressed
key_up(key)[source]
Parameters:key – key unpressed
main_loop()[source]

Blocking loop, as per the convention of opengl

mouse_button_down(event)[source]
Parameters:event – directly passes from event-handler
mouse_button_up(event)[source]
Parameters:event – directly passes from event-handler
mouse_motion()[source]

Detect motion of mouse

stop_and_exit()[source]

Quit the application properly

unimplemented(something)[source]

Simple wrapper around print for ease :param something: any printable object

Leap.ogl.quaternion module
Leap.ogl.sample_elements module
Leap.ogl.world module

Analogue to Stage in a typical application

class Leap.ogl.world.World[source]

holds all the elements, and interface to modify any element

add_element(element)[source]

adds an element onto the screen

Parameters:element – adds the element to the list
clear()[source]

removes all the elements

display()[source]

displays the elements to the screen

transform(pose=None)[source]

modifies the elements selected

Parameters:poseLeap.ogl.element.Element.transform()
Module contents
Submodules
Leap.main module
Module contents

Indices and tables