Paquete gl.app

app Package

Provides the Application class.

class Application(ui=None, space=None)

Bases: pyglet.event.EventDispatcher

Inheritance diagram of nabla.gl.app

Skeleton class for an application using the nabla framework.

Parámetros:
  • name (geo.Space) – ui
  • name – space
Devuelve:

Applicattion singleton

Return type:

app.Applicattion

TODO
.path = application path .primary = screen .screens = [pyglet.screens]
add_viewport(name=None, space=0, ui=0, type=None)

Create a new Viewport system window.

Parámetros:name (string) – Window title
Devuelve:Created Viewport
Return type:nabla.gl.app.view.Viewport
busy()
cam_default(viewport=0, fast=True)
cam_focus(viewport, plane=None, fast=False, main=True)
camera(plane=None, fast=False, main=True)
draw()

Send Heartbeat to all [viewport].

event_types = ['on_tick']
exit()

Exit from main loop.

force_redraw()
name = 'Nabla Framework'
on_resize(w, h, viewport=None)
run()

Main loop.

set_mouse_cursor(cursor)
set_mouse_visible(value)
set_name(name)
set_overlay(overlay, viewport=0)

Assign an Overlay to a Viewport index

set_vsync(value)
space_set(space, viewport=0)

Assign a Space to a Viewport index

tick(dt)

Send Heartbeat to all [viewport].

viewport_desktop()

Switch to full desktop mode, covering all screens.

database Module

class DataBase(file=None)

Bases: object

Open a SQLite3 file Types: TEXT, INTEGER, FLOAT, BLOB, NULL

fields(table)
info()
query(command)
result(sql)
scheme()
size()

Cuantos Kb ocupa la base de datos

tables()
class Record(database, table, key='')

Bases: object

delete()
insert(values=None, auto=False)
select()
update(values=None)
sql_get_table(sql)

functions Module

Miscelaneous functions.

class Log

Bases: object

write(text)
cartesians(m, a)
log(text)
log_enabled(value=None)
polars(x, y)
print_matrix(m)

Debug function. Prints a 4x4 matrix.

vector(list)

Converts List to GLFloat vector.

globals Module

Initialize OpenGL according to the current platform. Provides a Platform global instance to retrieve information.

HOME = 'C:\\Users\\txema\\workspace\\NLAB\\src\\doc'

Main script path

PATH = 'c:\\users\\txema\\workspace\\nlab\\src\\nabla'

Main folder

PATH_SETTINGS = 'C:\\Users\\txema\\AppData\\Roaming\\Nabla Framework'

Settings path folder

Platform = <nabla.gl.app.globals.__Platform object at 0x03C6B3D0>

Global Instance providing platform information.

view Module

A Viewport is a OpenGL window, wich can have an Overlay and/or a Space. All Keyboard events are sent directly to the Application. Mouse events not handled by the Overlay are sent to the Space.

class Camera(name='Main')

Bases: object

The Camera object.

apply()

Apply camera transformations.

at(tx=None, ty=None, tz=None, rx=None, ry=None, rz=None, zoom=None, sx=None, sy=None, sz=None)

Instant absolute change.

go(tx=None, ty=None, tz=None, rx=None, ry=None, rz=None, sx=None, sy=None, sz=None, zoom=None)

Smoothly go to an absolute position.

mode = 2
move(tx=None, ty=None, tz=None, rx=None, ry=None, rz=None, sx=None, sy=None, sz=None, zoom=None)

Smoothly go to a relative position.

on_key_press(symbol, modifiers)

Overridable.

projection_default()

Set pyglet default projection.

projection_isometric()

Set isometric projection.

projection_perspective()

Set perspective projection.

relative(tx=None, ty=None, tz=None, rx=None, ry=None, rz=None, sx=None, sy=None, sz=None, zoom=None)

Instant relative change.

update()

Update current position.

view(width=None, height=None)

Apply projection mode.

walk(tx=None, ty=None, tz=None, rx=None, ry=None, rz=None, sx=None, sy=None, sz=None, zoom=None, scale=None)

FPS style camera movement.

class Viewport(app=None, name=None, type=None)

Bases: object

An OpenGL Window.

app = None

Application instance to send keyboard events to.

maximize()
on_activate()
on_close()
on_draw()

Apply Camera projection and draw all.

on_key_press(symbol, modifiers)
on_key_release(symbol, modifiers)
on_mouse_drag(x, y, dx, dy, button, modifiers)
on_mouse_press(x, y, button, modifiers)
on_mouse_release(x, y, button, modifiers)
on_mouse_scroll(x, y, scroll_x, scroll_y)
on_resize(width, height)
overlay = None

pyglet.batch or gui.Overlay instance to show in this viewport

resize()
set_full_desktop()

Extend this Viewport to all screens.

set_fullscreen(full=None, screen=None)
set_layout(x, y, w, h)
set_mouse_cursor(cursor=None)
set_overlay(overlay)

Set current gui.Overlay in this viewport.

space = None

pyglet.batch or geo.Space instance to show in this viewport.

space_set(space)

Set current geo.Space in this viewport.

tick(dt)
window = None

Operating System Window

Contenidos

Tema anterior

2.5. Aplicaciones OpenGL

Próximo tema

Paquete gl.gui

Esta página