mrpt.gui

mrpt.gui — GUI windows for 3D visualization.

Provides:
  • CBaseGUIWindow : Abstract base for all MRPT GUI windows

  • CDisplayWindow3D: Interactive 3D OpenGL scene viewer window

Usage example:

import mrpt.gui as gui
import mrpt.viz as viz

win = gui.CDisplayWindow3D("My 3D Window", 800, 600)
scene = win.get3DSceneAndLock()
scene.insert(viz.stock_objects.CornerXYZ())
win.unlockAccess3DScene()
win.forceRepaint()
win.waitForKey()

Package Contents

class mrpt.gui.CBaseGUIWindow

C++ API: class mrpt::gui::CBaseGUIWindow

The base class for GUI window classes based on wxWidgets.

clearKeyHitFlag() → None

Assure that “keyHit” will return false until the next pushed key.

isOpen() → bool

Returns false if the user has already closed the window.

keyHit() → bool

Returns true if a key has been pushed, without blocking waiting for a new key being pushed.

waitForKey(ignoreControlKeys: bool = True) → int

Waits until a key is pressed in the window. Returns the key code.

class mrpt.gui.CDisplayWindow3D(windowCaption: str = '', width: int = 400, height: int = 300)

C++ API: class mrpt::gui::CDisplayWindow3D

Bases: CBaseGUIWindow

A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.

static Create(windowCaption: str = '', width: int = 400, height: int = 300) → CDisplayWindow3D

Creates a new 3D window (same arguments as the constructor).

forceRepaint() → None

Repaints the window. forceRepaint, repaint and updateWindow are all aliases of the same method.

get3DSceneAndLock() → mrpt.viz.Scene

Get locked 3D scene pointer. Call unlockAccess3DScene() when done.

getCameraAzimuthDeg() → float

Returns the camera azimuth angle, in degrees.

getCameraElevationDeg() → float

Returns the camera elevation angle, in degrees.

getCameraPointingToPoint() → tuple

Returns the point the camera looks at, as (x, y, z).

getCameraZoom() → float

Returns the camera distance to the point it looks at.

getFOV() → float

Returns the camera field of view, in degrees.

getRenderingFPS() → float

Get the average Frames Per Second (FPS) value from the last 250 rendering events.

grabImagesStart(prefix: str = 'video_') → None

Starts saving each rendered frame as a PNG file, with the given filename prefix.

grabImagesStop() → None

Stops image grabbing started by grabImagesStart.

isCameraProjective() → bool

Returns true for a perspective camera, false for an orthographic one.

repaint() → None

Repaints the window. forceRepaint, repaint and updateWindow are all aliases of the same method.

resize(arg0: int, arg1: int) → None

Resizes the window, stretching the image to fit into the display area.

setCameraAzimuthDeg(arg0: float) → None

Sets the camera azimuth angle, in degrees.

setCameraElevationDeg(arg0: float) → None

Sets the camera elevation angle, in degrees.

setCameraPointingToPoint(arg0: float, arg1: float, arg2: float) → None

Sets the point the camera looks at (x, y, z).

setCameraZoom(arg0: float) → None

Sets the camera distance to the point it looks at.

setFOV(arg0: float) → None

Sets the camera field of view, in degrees.

setImageView(img: mrpt.img.CImage) → None

Display a 2D image in this window

setMaxRange(arg0: float) → None

Sets the far clip distance of the camera.

setMinRange(arg0: float) → None

Sets the near clip distance of the camera.

setPos(arg0: int, arg1: int) → None

Changes the position of the window on the screen.

setProjectiveModel(arg0: bool) → None

Sets a perspective (true) or orthographic (false) camera.

setWindowTitle(arg0: str) → None

Changes the window title.

unlockAccess3DScene() → None

Releases the scene lock taken by get3DSceneAndLock().

updateWindow() → None

Repaints the window. forceRepaint, repaint and updateWindow are all aliases of the same method.

useCameraFromScene(arg0: bool) → None

If true, the camera of the scene viewport is used instead of the mouse-controlled one.