MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::PythonViewer::Viewer Class Reference

GLFW-based mesh viewer. More...

#include <MRPythonViewer/MRPythonViewer.h>

Public Member Functions

Viewport viewport (ViewportId viewportId={}) const
void incrementForceRedrawFrames (int num=1, bool swapOnLastOnly=false) const
void skipFrames (int frames) const
void preciseFitDataViewport (ViewportMask vpList=ViewportMask::all(), const ViewportFitDataParams &params={}) const
void captureScreenShot (const std::string &path) const
 Captures part of window (redraw 3d scene over UI (without redrawing UI))
void captureUIScreenShot (const std::string &path) const
 Captures full window screenshot with UI.
void shutdown (int exitCode=0, bool interruptible=true) const
 sets stop event loop flag (this flag is glfwShouldWindowClose equivalent); the viewer's launch then returns exitCode; interruptible = False: no interruptCloseSignal slot can cancel the stop
void mouseDown (MouseButton button, KeyMod modifier=KeyMod::Empty) const
 Simulate mouse down event.
void mouseUp (MouseButton button, KeyMod modifier=KeyMod::Empty) const
 Simulate mouse up event.
void mouseMove (int x, int y) const
Vector2f getMousePos () const
 Get the current mouse position.
Vector3f viewportToScreen (const Vector3f &viewportPoint, ViewportId id) const
 Convert viewport coordinates to to screen coordinates.
void showSceneTree (bool show) const
 Shows or hide scene tree.

Detailed Description

GLFW-based mesh viewer.

Member Function Documentation

◆ captureScreenShot()

void MR::PythonViewer::Viewer::captureScreenShot ( const std::string & path) const

Captures part of window (redraw 3d scene over UI (without redrawing UI))

◆ captureUIScreenShot()

void MR::PythonViewer::Viewer::captureUIScreenShot ( const std::string & path) const

Captures full window screenshot with UI.

◆ getMousePos()

Vector2f MR::PythonViewer::Viewer::getMousePos ( ) const
nodiscard

Get the current mouse position.

◆ incrementForceRedrawFrames()

void MR::PythonViewer::Viewer::incrementForceRedrawFrames ( int num = 1,
bool swapOnLastOnly = false ) const

Increment number of forced frames to redraw in event loop if swapOnLastOnly only last forced frame will be present on screen and all previous will not

◆ mouseDown()

void MR::PythonViewer::Viewer::mouseDown ( MouseButton button,
KeyMod modifier = KeyMod::Empty ) const

Simulate mouse down event.

◆ mouseMove()

void MR::PythonViewer::Viewer::mouseMove ( int x,
int y ) const

Simulate mouse move event. NOTE: Some plugins need at least TWO mouseMove()s in a row (possibly with the same position). If you're having issues, try sending two events.

◆ mouseUp()

void MR::PythonViewer::Viewer::mouseUp ( MouseButton button,
KeyMod modifier = KeyMod::Empty ) const

Simulate mouse up event.

◆ preciseFitDataViewport()

void MR::PythonViewer::Viewer::preciseFitDataViewport ( ViewportMask vpList = ViewportMask::all(),
const ViewportFitDataParams & params = {} ) const

Calls fitData and change FOV to match the screen size then params - params fit data

◆ showSceneTree()

void MR::PythonViewer::Viewer::showSceneTree ( bool show) const

Shows or hide scene tree.

◆ shutdown()

void MR::PythonViewer::Viewer::shutdown ( int exitCode = 0,
bool interruptible = true ) const

sets stop event loop flag (this flag is glfwShouldWindowClose equivalent); the viewer's launch then returns exitCode; interruptible = False: no interruptCloseSignal slot can cancel the stop

◆ skipFrames()

void MR::PythonViewer::Viewer::skipFrames ( int frames) const

◆ viewport()

Viewport MR::PythonViewer::Viewer::viewport ( ViewportId viewportId = {}) const
nodiscard

Return the current viewport, or the viewport corresponding to a given unique identifier viewportId - unique identifier corresponding to the desired viewport (current viewport if 0)

◆ viewportToScreen()

Vector3f MR::PythonViewer::Viewer::viewportToScreen ( const Vector3f & viewportPoint,
ViewportId id ) const
nodiscard

Convert viewport coordinates to to screen coordinates.


The documentation for this class was generated from the following file: