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

#include <MRViewer.h>

Public Types

enum class  EventType {
  MouseDown , MouseUp , MouseMove , MouseScroll ,
  KeyDown , KeyUp , KeyRepeat , CharPressed ,
  Count
}
 
enum class  GLPrimitivesType {
  PointArraySize , LineArraySize , TriangleArraySize , PointElementsNum ,
  LineElementsNum , TriangleElementsNum , Count
}
 
using MouseButton = MR::MouseButton
 
using MouseMode = MR::MouseMode
 
using LaunchParams = MR::LaunchParams
 
using PointInAllSpaces = MR::PointInAllSpaces
 

Public Member Functions

MRVIEWER_API int launch (const LaunchParams &params)
 
MRVIEWER_API void launchEventLoop ()
 
MRVIEWER_API void launchShut ()
 
bool isLaunched () const
 
const LaunchParamsgetLaunchParams () const
 
template<typename PluginType >
PluginType * getPluginInstance ()
 
MRVIEWER_API bool isSupportedFormat (const std::filesystem::path &file_name)
 
MRVIEWER_API bool loadFiles (const std::vector< std::filesystem::path > &filesList, const FileLoadOptions &options)
 
MRVIEWER_API bool loadFiles (const std::vector< std::filesystem::path > &filesList)
 
MRVIEWER_API bool saveToFile (const std::filesystem::path &mesh_file_name)
 
MRVIEWER_API bool keyPressed (unsigned int unicode_key, int modifier)
 
MRVIEWER_API bool keyDown (int key, int modifier)
 
MRVIEWER_API bool keyUp (int key, int modifier)
 
MRVIEWER_API bool keyRepeat (int key, int modifier)
 
MRVIEWER_API bool mouseDown (MouseButton button, int modifier)
 
MRVIEWER_API bool mouseUp (MouseButton button, int modifier)
 
MRVIEWER_API bool mouseMove (int mouse_x, int mouse_y)
 
MRVIEWER_API bool mouseScroll (float delta_y)
 
MRVIEWER_API bool mouseClick (MouseButton button, int modifier)
 
MRVIEWER_API bool dragStart (MouseButton button, int modifier)
 
MRVIEWER_API bool dragEnd (MouseButton button, int modifier)
 
MRVIEWER_API bool drag (int mouse_x, int mouse_y)
 
MRVIEWER_API bool spaceMouseMove (const Vector3f &translate, const Vector3f &rotate)
 
MRVIEWER_API bool spaceMouseDown (int key)
 
MRVIEWER_API bool spaceMouseUp (int key)
 
MRVIEWER_API bool spaceMouseRepeat (int key)
 
MRVIEWER_API bool dragDrop (const std::vector< std::filesystem::path > &paths)
 
MRVIEWER_API bool touchStart (int id, int x, int y)
 
MRVIEWER_API bool touchMove (int id, int x, int y)
 
MRVIEWER_API bool touchEnd (int id, int x, int y)
 
MRVIEWER_API bool touchpadRotateGestureBegin ()
 
MRVIEWER_API bool touchpadRotateGestureUpdate (float angle)
 
MRVIEWER_API bool touchpadRotateGestureEnd ()
 
MRVIEWER_API bool touchpadSwipeGestureBegin ()
 
MRVIEWER_API bool touchpadSwipeGestureUpdate (float dx, float dy, bool kinetic)
 
MRVIEWER_API bool touchpadSwipeGestureEnd ()
 
MRVIEWER_API bool touchpadZoomGestureBegin ()
 
MRVIEWER_API bool touchpadZoomGestureUpdate (float scale, bool kinetic)
 
MRVIEWER_API bool touchpadZoomGestureEnd ()
 
MRVIEWER_API bool interruptWindowClose ()
 
MRVIEWER_API void draw (bool force=false)
 
MRVIEWER_API void drawFull (bool dirtyScene)
 
MRVIEWER_API void drawScene ()
 
void setSceneDirty ()
 
MRVIEWER_API void setupScene ()
 
MRVIEWER_API void clearFramebuffers ()
 
MRVIEWER_API void resize (int w, int h)
 
MRVIEWER_API void postResize (int w, int h)
 
MRVIEWER_API void postSetPosition (int xPos, int yPos)
 
MRVIEWER_API void postSetMaximized (bool maximized)
 
MRVIEWER_API void postSetIconified (bool iconified)
 
MRVIEWER_API void postFocus (bool focused)
 
MRVIEWER_API void postRescale (float x, float y)
 
MRVIEWER_API void postClose ()
 
MRVIEWER_API void set_root (SceneRootObject &newRoot)
 
MRVIEWER_API void clearScene ()
 
MRVIEWER_API Viewportviewport (ViewportId viewportId={})
 
MRVIEWER_API const Viewportviewport (ViewportId viewportId={}) const
 
MRVIEWER_API ViewportId append_viewport (const ViewportRectangle &viewportRect, bool append_empty=false)
 
MRVIEWER_API Box2f getViewportsBounds () const
 
MRVIEWER_API bool erase_viewport (const size_t index)
 
MRVIEWER_API bool erase_viewport (ViewportId viewport_id)
 
MRVIEWER_API int viewport_index (ViewportId viewport_id) const
 
MRVIEWER_API ViewportId getHoveredViewportId () const
 
MRVIEWER_API ViewportId getHoveredViewportIdOrInvalid () const
 
MRVIEWER_API void select_hovered_viewport ()
 
MRVIEWER_API void fitDataViewport (MR::ViewportMask vpList=MR::ViewportMask::all(), float fill=0.6f, bool snapView=true)
 
MRVIEWER_API void fitBoxViewport (const Box3f &box, MR::ViewportMask vpList=MR::ViewportMask::all(), float fill=0.6f, bool snapView=true)
 
MRVIEWER_API void preciseFitDataViewport (MR::ViewportMask vpList=MR::ViewportMask::all())
 
MRVIEWER_API void preciseFitDataViewport (MR::ViewportMask vpList, const FitDataParams &param)
 
MRVIEWER_API size_t getTotalFrames () const
 
MRVIEWER_API size_t getSwappedFrames () const
 
MRVIEWER_API size_t getFPS () const
 
MRVIEWER_API double getPrevFrameDrawTimeMillisec () const
 
MRVIEWER_API size_t getStaticGLBufferSize () const
 
MRVIEWER_API void incrementForceRedrawFrames (int i=1, bool swapOnLastOnly=false)
 
MRVIEWER_API bool isCurrentFrameSwapping () const
 
MRVIEWER_API size_t getEventsCount (EventType type) const
 
MRVIEWER_API size_t getLastFrameGLPrimitivesCount (GLPrimitivesType type) const
 
MRVIEWER_API void incrementThisFrameGLPrimitivesCount (GLPrimitivesType type, size_t num)
 
ViewportMask getPresentViewports () const
 
MRVIEWER_API void resetAllCounters ()
 
MRVIEWER_API Image captureSceneScreenShot (const Vector2i &resolution=Vector2i(), bool transparentBg=false)
 
MRVIEWER_API void captureUIScreenShot (std::function< void(const Image &)> callback, const Vector2i &pos=Vector2i(), const Vector2i &size=Vector2i())
 
MRVIEWER_API bool isAlphaSortAvailable () const
 
MRVIEWER_API bool enableAlphaSort (bool on)
 
bool isAlphaSortEnabled () const
 
MRVIEWER_API bool isSceneTextureBound () const
 
MRVIEWER_API void bindSceneTexture (bool bind)
 
MRVIEWER_API bool isSceneTextureEnabled () const
 
MRVIEWER_API int getMSAA () const
 
MRVIEWER_API void requestChangeMSAA (int newMSAA)
 
MRVIEWER_API int getRequestedMSAA () const
 
MRVIEWER_API void setViewportSettingsManager (std::unique_ptr< IViewerSettingsManager > mng)
 
MRVIEWER_API const std::unique_ptr< IViewerSettingsManager > & getViewerSettingsManager () const
 
MRVIEWER_API PointInAllSpaces getPixelPointInfo (const Vector3f &screenPoint) const
 
MRVIEWER_API PointInAllSpaces getMousePointInfo () const
 
MRVIEWER_API Vector3f screenToViewport (const Vector3f &screenPoint, ViewportId id) const
 
MRVIEWER_API Vector3f viewportToScreen (const Vector3f &viewportPoint, ViewportId id) const
 
MRVIEWER_API std::vector< std::reference_wrapper< Viewport > > getViewports (ViewportMask mask=ViewportMask::any())
 
MRVIEWER_API void enableGlobalHistory (bool on)
 
bool isGlobalHistoryEnabled () const
 
MRVIEWER_API void appendHistoryAction (const std::shared_ptr< HistoryAction > &action)
 
MRVIEWER_API bool globalHistoryUndo ()
 
MRVIEWER_API bool globalHistoryRedo ()
 
const std::shared_ptr< HistoryStore > & getGlobalHistoryStore () const
 
const std::shared_ptr< SpaceMouseHandler > & getSpaceMouseHandler () const
 
MRVIEWER_API void onSceneSaved (const std::filesystem::path &savePath, bool storeInRecent=true)
 
MRVIEWER_API const std::shared_ptr< ImGuiMenu > & getMenuPlugin () const
 
MRVIEWER_API void setMenuPlugin (std::shared_ptr< ImGuiMenu > menu)
 
MRVIEWER_API std::shared_ptr< RibbonMenugetRibbonMenu () const
 
template<typename T >
std::shared_ptr< T > getMenuPluginAs () const
 
MRVIEWER_API void stopEventLoop ()
 
bool getStopEventLoopFlag () const
 
bool windowShouldClose ()
 
bool isGLInitialized () const
 
MRVIEWER_API void makeTitleFromSceneRootPath ()
 
bool hasScaledFramebuffer () const
 
ViewerSignalssignals ()
 return the structure with all viewer's signals
 
MRVIEWER_API void emplaceEvent (std::string name, ViewerEventCallback cb, bool skipable=false)
 
MRVIEWER_API void popEventByName (const std::string &name)
 
MRVIEWER_API void postEmptyEvent ()
 
MRVIEWER_API const TouchpadParametersgetTouchpadParameters () const
 
MRVIEWER_API void setTouchpadParameters (const TouchpadParameters &)
 
MRVIEWER_API SpaceMouseParameters getSpaceMouseParameters () const
 
MRVIEWER_API void setSpaceMouseParameters (const SpaceMouseParameters &)
 
const MouseControllermouseController () const
 
MouseControllermouseController ()
 
const RecentFilesStorerecentFilesStore () const
 
RecentFilesStorerecentFilesStore ()
 
bool getSortDroppedFiles () const
 returns whether to sort the filenames received from Drag&Drop in lexicographical order before adding them in scene
 
void setSortDroppedFiles (bool value)
 sets whether to sort the filenames received from Drag&Drop in lexicographical order before adding them in scene
 
MRVIEWER_API void initSpaceMouseHandler (std::function< void(const std::string &)> deviceSignal={})
 
MRVIEWER_API void drawUiRenderObjects ()
 draw 2d (UI) part of objects in scene
 

Static Public Member Functions

static MRVIEWER_API void parseLaunchParams (LaunchParams &params)
 
static Viewerinstance ()
 
static ViewerinstanceRef ()
 
static const ViewerconstInstance ()
 
static const ViewerconstInstanceRef ()
 

Public Attributes

bool swapOnLastPostEventsRedraw { true }
 
int forceRedrawMinimumIncrementAfterEvents { 4 }
 
GLFWwindow * window
 
std::function< void(Viewer *viewer)> resetSettingsFunction
 
std::vector< Viewportviewport_list
 
size_t selected_viewport_index
 
std::vector< ViewerPlugin * > plugins
 
float pixelRatio { 1.0f }
 
Vector2i framebufferSize
 
Vector2i windowSavePos
 
Vector2i windowSaveSize
 
Vector2i windowOldPos
 
bool windowMaximized { false }
 
bool isAnimating { false }
 
int animationMaxFps { 30 }
 
float scrollForce { }
 
uint16_t glPickRadius { }
 
bool experimentalFeatures { }
 
std::vector< std::string > commandArgs
 
std::shared_ptr< ObjectMeshbasisAxes
 
std::unique_ptr< CornerControllerObjectbasisViewController
 
std::unique_ptr< ViewportGlobalBasisglobalBasis
 
std::shared_ptr< ObjectMeshrotationSphere
 
std::shared_ptr< ObjectMeshclippingPlaneObject
 
std::shared_ptr< ViewerTitlewindowTitle
 

Friends

MRVIEWER_API ViewergetViewerInstance ()
 returns global instance of Viewer class
 

Member Typedef Documentation

◆ LaunchParams

◆ MouseButton

◆ MouseMode

◆ PointInAllSpaces

Member Enumeration Documentation

◆ EventType

enum class MR::Viewer::EventType
strong
Enumerator
MouseDown 
MouseUp 
MouseMove 
MouseScroll 
KeyDown 
KeyUp 
KeyRepeat 
CharPressed 
Count 

◆ GLPrimitivesType

enum class MR::Viewer::GLPrimitivesType
strong
Enumerator
PointArraySize 
LineArraySize 
TriangleArraySize 
PointElementsNum 
LineElementsNum 
TriangleElementsNum 
Count 

Member Function Documentation

◆ append_viewport()

MRVIEWER_API ViewportId MR::Viewer::append_viewport ( const ViewportRectangle & viewportRect,
bool append_empty = false )

◆ appendHistoryAction()

MRVIEWER_API void MR::Viewer::appendHistoryAction ( const std::shared_ptr< HistoryAction > & action)

◆ bindSceneTexture()

MRVIEWER_API void MR::Viewer::bindSceneTexture ( bool bind)

◆ captureSceneScreenShot()

MRVIEWER_API Image MR::Viewer::captureSceneScreenShot ( const Vector2i & resolution = Vector2i(),
bool transparentBg = false )

Captures 3d scene

Parameters
resolutionresolution of the image <= 0 means default
transparentBgdon't draw background / viewport borders

◆ captureUIScreenShot()

MRVIEWER_API void MR::Viewer::captureUIScreenShot ( std::function< void(const Image &)> callback,
const Vector2i & pos = Vector2i(),
const Vector2i & size = Vector2i() )

Captures part of window in the beginning of next frame, capturing all that was drawn in this frame

Parameters
callbackwill be called right when screenshot is taken
posleft-bottom corner of capturing area relative of left-down corner of window. default = size(0, 0)
sizesize of capturing area. default = size(0, 0) - auto size to right-top corner of window.

◆ clearFramebuffers()

MRVIEWER_API void MR::Viewer::clearFramebuffers ( )

◆ clearScene()

MRVIEWER_API void MR::Viewer::clearScene ( )

◆ constInstance()

static const Viewer * MR::Viewer::constInstance ( )
inlinestatic

◆ constInstanceRef()

static const Viewer & MR::Viewer::constInstanceRef ( )
inlinestatic

◆ drag()

MRVIEWER_API bool MR::Viewer::drag ( int mouse_x,
int mouse_y )

◆ dragDrop()

MRVIEWER_API bool MR::Viewer::dragDrop ( const std::vector< std::filesystem::path > & paths)

◆ dragEnd()

MRVIEWER_API bool MR::Viewer::dragEnd ( MouseButton button,
int modifier )

◆ dragStart()

MRVIEWER_API bool MR::Viewer::dragStart ( MouseButton button,
int modifier )

◆ draw()

MRVIEWER_API void MR::Viewer::draw ( bool force = false)

◆ drawFull()

MRVIEWER_API void MR::Viewer::drawFull ( bool dirtyScene)

◆ drawScene()

MRVIEWER_API void MR::Viewer::drawScene ( )

◆ drawUiRenderObjects()

MRVIEWER_API void MR::Viewer::drawUiRenderObjects ( )

draw 2d (UI) part of objects in scene

◆ emplaceEvent()

MRVIEWER_API void MR::Viewer::emplaceEvent ( std::string name,
ViewerEventCallback cb,
bool skipable = false )

emplace event at the end of the queue replace last skipable with new skipable

◆ enableAlphaSort()

MRVIEWER_API bool MR::Viewer::enableAlphaSort ( bool on)

◆ enableGlobalHistory()

MRVIEWER_API void MR::Viewer::enableGlobalHistory ( bool on)

◆ erase_viewport() [1/2]

MRVIEWER_API bool MR::Viewer::erase_viewport ( const size_t index)

◆ erase_viewport() [2/2]

MRVIEWER_API bool MR::Viewer::erase_viewport ( ViewportId viewport_id)

◆ fitBoxViewport()

MRVIEWER_API void MR::Viewer::fitBoxViewport ( const Box3f & box,
MR::ViewportMask vpList = MR::ViewportMask::all(),
float fill = 0.6f,
bool snapView = true )

◆ fitDataViewport()

MRVIEWER_API void MR::Viewer::fitDataViewport ( MR::ViewportMask vpList = MR::ViewportMask::all(),
float fill = 0.6f,
bool snapView = true )

◆ getEventsCount()

MRVIEWER_API size_t MR::Viewer::getEventsCount ( EventType type) const

◆ getFPS()

MRVIEWER_API size_t MR::Viewer::getFPS ( ) const

◆ getGlobalHistoryStore()

const std::shared_ptr< HistoryStore > & MR::Viewer::getGlobalHistoryStore ( ) const
inline

◆ getHoveredViewportId()

MRVIEWER_API ViewportId MR::Viewer::getHoveredViewportId ( ) const

◆ getHoveredViewportIdOrInvalid()

MRVIEWER_API ViewportId MR::Viewer::getHoveredViewportIdOrInvalid ( ) const

◆ getLastFrameGLPrimitivesCount()

MRVIEWER_API size_t MR::Viewer::getLastFrameGLPrimitivesCount ( GLPrimitivesType type) const

◆ getLaunchParams()

const LaunchParams & MR::Viewer::getLaunchParams ( ) const
inline

◆ getMenuPlugin()

MRVIEWER_API const std::shared_ptr< ImGuiMenu > & MR::Viewer::getMenuPlugin ( ) const

◆ getMenuPluginAs()

template<typename T >
std::shared_ptr< T > MR::Viewer::getMenuPluginAs ( ) const
inline

◆ getMousePointInfo()

MRVIEWER_API PointInAllSpaces MR::Viewer::getMousePointInfo ( ) const

◆ getMSAA()

MRVIEWER_API int MR::Viewer::getMSAA ( ) const

◆ getPixelPointInfo()

MRVIEWER_API PointInAllSpaces MR::Viewer::getPixelPointInfo ( const Vector3f & screenPoint) const

◆ getPluginInstance()

template<typename PluginType >
PluginType * MR::Viewer::getPluginInstance ( )
inline

◆ getPresentViewports()

ViewportMask MR::Viewer::getPresentViewports ( ) const
inline

◆ getPrevFrameDrawTimeMillisec()

MRVIEWER_API double MR::Viewer::getPrevFrameDrawTimeMillisec ( ) const

◆ getRequestedMSAA()

MRVIEWER_API int MR::Viewer::getRequestedMSAA ( ) const

◆ getRibbonMenu()

MRVIEWER_API std::shared_ptr< RibbonMenu > MR::Viewer::getRibbonMenu ( ) const

◆ getSortDroppedFiles()

bool MR::Viewer::getSortDroppedFiles ( ) const
inlinenodiscard

returns whether to sort the filenames received from Drag&Drop in lexicographical order before adding them in scene

◆ getSpaceMouseHandler()

const std::shared_ptr< SpaceMouseHandler > & MR::Viewer::getSpaceMouseHandler ( ) const
inline

◆ getSpaceMouseParameters()

MRVIEWER_API SpaceMouseParameters MR::Viewer::getSpaceMouseParameters ( ) const
nodiscard

◆ getStaticGLBufferSize()

MRVIEWER_API size_t MR::Viewer::getStaticGLBufferSize ( ) const

◆ getStopEventLoopFlag()

bool MR::Viewer::getStopEventLoopFlag ( ) const
inline

◆ getSwappedFrames()

MRVIEWER_API size_t MR::Viewer::getSwappedFrames ( ) const

◆ getTotalFrames()

MRVIEWER_API size_t MR::Viewer::getTotalFrames ( ) const

◆ getTouchpadParameters()

MRVIEWER_API const TouchpadParameters & MR::Viewer::getTouchpadParameters ( ) const
nodiscard

◆ getViewerSettingsManager()

MRVIEWER_API const std::unique_ptr< IViewerSettingsManager > & MR::Viewer::getViewerSettingsManager ( ) const
inline

◆ getViewports()

MRVIEWER_API std::vector< std::reference_wrapper< Viewport > > MR::Viewer::getViewports ( ViewportMask mask = ViewportMask::any())

◆ getViewportsBounds()

MRVIEWER_API Box2f MR::Viewer::getViewportsBounds ( ) const

◆ globalHistoryRedo()

MRVIEWER_API bool MR::Viewer::globalHistoryRedo ( )

◆ globalHistoryUndo()

MRVIEWER_API bool MR::Viewer::globalHistoryUndo ( )

◆ hasScaledFramebuffer()

bool MR::Viewer::hasScaledFramebuffer ( ) const
inline

◆ incrementForceRedrawFrames()

MRVIEWER_API void MR::Viewer::incrementForceRedrawFrames ( int i = 1,
bool swapOnLastOnly = false )

◆ incrementThisFrameGLPrimitivesCount()

MRVIEWER_API void MR::Viewer::incrementThisFrameGLPrimitivesCount ( GLPrimitivesType type,
size_t num )

◆ initSpaceMouseHandler()

MRVIEWER_API void MR::Viewer::initSpaceMouseHandler ( std::function< void(const std::string &)> deviceSignal = {})

(re)initializes the handler of SpaceMouse events

Parameters
deviceSignalevery device-related event will be sent here: find, connect, disconnect

◆ instance()

static Viewer * MR::Viewer::instance ( )
inlinestatic

◆ instanceRef()

static Viewer & MR::Viewer::instanceRef ( )
inlinestatic

◆ interruptWindowClose()

MRVIEWER_API bool MR::Viewer::interruptWindowClose ( )

◆ isAlphaSortAvailable()

MRVIEWER_API bool MR::Viewer::isAlphaSortAvailable ( ) const

◆ isAlphaSortEnabled()

bool MR::Viewer::isAlphaSortEnabled ( ) const
inline

◆ isCurrentFrameSwapping()

MRVIEWER_API bool MR::Viewer::isCurrentFrameSwapping ( ) const

◆ isGLInitialized()

bool MR::Viewer::isGLInitialized ( ) const
inline

◆ isGlobalHistoryEnabled()

bool MR::Viewer::isGlobalHistoryEnabled ( ) const
inline

◆ isLaunched()

bool MR::Viewer::isLaunched ( ) const
inline

◆ isSceneTextureBound()

MRVIEWER_API bool MR::Viewer::isSceneTextureBound ( ) const

◆ isSceneTextureEnabled()

MRVIEWER_API bool MR::Viewer::isSceneTextureEnabled ( ) const

◆ isSupportedFormat()

MRVIEWER_API bool MR::Viewer::isSupportedFormat ( const std::filesystem::path & file_name)

◆ keyDown()

MRVIEWER_API bool MR::Viewer::keyDown ( int key,
int modifier )

◆ keyPressed()

MRVIEWER_API bool MR::Viewer::keyPressed ( unsigned int unicode_key,
int modifier )

◆ keyRepeat()

MRVIEWER_API bool MR::Viewer::keyRepeat ( int key,
int modifier )

◆ keyUp()

MRVIEWER_API bool MR::Viewer::keyUp ( int key,
int modifier )

◆ launch()

MRVIEWER_API int MR::Viewer::launch ( const LaunchParams & params)

◆ launchEventLoop()

MRVIEWER_API void MR::Viewer::launchEventLoop ( )

◆ launchShut()

MRVIEWER_API void MR::Viewer::launchShut ( )

◆ loadFiles() [1/2]

MRVIEWER_API bool MR::Viewer::loadFiles ( const std::vector< std::filesystem::path > & filesList)

◆ loadFiles() [2/2]

MRVIEWER_API bool MR::Viewer::loadFiles ( const std::vector< std::filesystem::path > & filesList,
const FileLoadOptions & options )

◆ makeTitleFromSceneRootPath()

MRVIEWER_API void MR::Viewer::makeTitleFromSceneRootPath ( )

◆ mouseClick()

MRVIEWER_API bool MR::Viewer::mouseClick ( MouseButton button,
int modifier )

◆ mouseController() [1/2]

MouseController & MR::Viewer::mouseController ( )
inlinenodiscard

◆ mouseController() [2/2]

const MouseController & MR::Viewer::mouseController ( ) const
inlinenodiscard

◆ mouseDown()

MRVIEWER_API bool MR::Viewer::mouseDown ( MouseButton button,
int modifier )

◆ mouseMove()

MRVIEWER_API bool MR::Viewer::mouseMove ( int mouse_x,
int mouse_y )

◆ mouseScroll()

MRVIEWER_API bool MR::Viewer::mouseScroll ( float delta_y)

◆ mouseUp()

MRVIEWER_API bool MR::Viewer::mouseUp ( MouseButton button,
int modifier )

◆ onSceneSaved()

MRVIEWER_API void MR::Viewer::onSceneSaved ( const std::filesystem::path & savePath,
bool storeInRecent = true )

◆ parseLaunchParams()

static MRVIEWER_API void MR::Viewer::parseLaunchParams ( LaunchParams & params)
static

◆ popEventByName()

MRVIEWER_API void MR::Viewer::popEventByName ( const std::string & name)

◆ postClose()

MRVIEWER_API void MR::Viewer::postClose ( )

◆ postEmptyEvent()

MRVIEWER_API void MR::Viewer::postEmptyEvent ( )

◆ postFocus()

MRVIEWER_API void MR::Viewer::postFocus ( bool focused)

◆ postRescale()

MRVIEWER_API void MR::Viewer::postRescale ( float x,
float y )

◆ postResize()

MRVIEWER_API void MR::Viewer::postResize ( int w,
int h )

◆ postSetIconified()

MRVIEWER_API void MR::Viewer::postSetIconified ( bool iconified)

◆ postSetMaximized()

MRVIEWER_API void MR::Viewer::postSetMaximized ( bool maximized)

◆ postSetPosition()

MRVIEWER_API void MR::Viewer::postSetPosition ( int xPos,
int yPos )

◆ preciseFitDataViewport() [1/2]

MRVIEWER_API void MR::Viewer::preciseFitDataViewport ( MR::ViewportMask vpList,
const FitDataParams & param )

◆ preciseFitDataViewport() [2/2]

MRVIEWER_API void MR::Viewer::preciseFitDataViewport ( MR::ViewportMask vpList = MR::ViewportMask::all())

◆ recentFilesStore() [1/2]

RecentFilesStore & MR::Viewer::recentFilesStore ( )
inlinenodiscard

◆ recentFilesStore() [2/2]

const RecentFilesStore & MR::Viewer::recentFilesStore ( ) const
inlinenodiscard

◆ requestChangeMSAA()

MRVIEWER_API void MR::Viewer::requestChangeMSAA ( int newMSAA)

◆ resetAllCounters()

MRVIEWER_API void MR::Viewer::resetAllCounters ( )

◆ resize()

MRVIEWER_API void MR::Viewer::resize ( int w,
int h )

◆ saveToFile()

MRVIEWER_API bool MR::Viewer::saveToFile ( const std::filesystem::path & mesh_file_name)

◆ screenToViewport()

MRVIEWER_API Vector3f MR::Viewer::screenToViewport ( const Vector3f & screenPoint,
ViewportId id ) const

◆ select_hovered_viewport()

MRVIEWER_API void MR::Viewer::select_hovered_viewport ( )

◆ set_root()

MRVIEWER_API void MR::Viewer::set_root ( SceneRootObject & newRoot)

◆ setMenuPlugin()

MRVIEWER_API void MR::Viewer::setMenuPlugin ( std::shared_ptr< ImGuiMenu > menu)

◆ setSceneDirty()

void MR::Viewer::setSceneDirty ( )
inline

◆ setSortDroppedFiles()

void MR::Viewer::setSortDroppedFiles ( bool value)
inline

sets whether to sort the filenames received from Drag&Drop in lexicographical order before adding them in scene

◆ setSpaceMouseParameters()

MRVIEWER_API void MR::Viewer::setSpaceMouseParameters ( const SpaceMouseParameters & )

◆ setTouchpadParameters()

MRVIEWER_API void MR::Viewer::setTouchpadParameters ( const TouchpadParameters & )

◆ setupScene()

MRVIEWER_API void MR::Viewer::setupScene ( )

◆ setViewportSettingsManager()

MRVIEWER_API void MR::Viewer::setViewportSettingsManager ( std::unique_ptr< IViewerSettingsManager > mng)

◆ signals()

ViewerSignals & MR::Viewer::signals ( )
inline

return the structure with all viewer's signals

◆ spaceMouseDown()

MRVIEWER_API bool MR::Viewer::spaceMouseDown ( int key)

◆ spaceMouseMove()

MRVIEWER_API bool MR::Viewer::spaceMouseMove ( const Vector3f & translate,
const Vector3f & rotate )

◆ spaceMouseRepeat()

MRVIEWER_API bool MR::Viewer::spaceMouseRepeat ( int key)

◆ spaceMouseUp()

MRVIEWER_API bool MR::Viewer::spaceMouseUp ( int key)

◆ stopEventLoop()

MRVIEWER_API void MR::Viewer::stopEventLoop ( )

◆ touchEnd()

MRVIEWER_API bool MR::Viewer::touchEnd ( int id,
int x,
int y )

◆ touchMove()

MRVIEWER_API bool MR::Viewer::touchMove ( int id,
int x,
int y )

◆ touchpadRotateGestureBegin()

MRVIEWER_API bool MR::Viewer::touchpadRotateGestureBegin ( )

◆ touchpadRotateGestureEnd()

MRVIEWER_API bool MR::Viewer::touchpadRotateGestureEnd ( )

◆ touchpadRotateGestureUpdate()

MRVIEWER_API bool MR::Viewer::touchpadRotateGestureUpdate ( float angle)

◆ touchpadSwipeGestureBegin()

MRVIEWER_API bool MR::Viewer::touchpadSwipeGestureBegin ( )

◆ touchpadSwipeGestureEnd()

MRVIEWER_API bool MR::Viewer::touchpadSwipeGestureEnd ( )

◆ touchpadSwipeGestureUpdate()

MRVIEWER_API bool MR::Viewer::touchpadSwipeGestureUpdate ( float dx,
float dy,
bool kinetic )

◆ touchpadZoomGestureBegin()

MRVIEWER_API bool MR::Viewer::touchpadZoomGestureBegin ( )

◆ touchpadZoomGestureEnd()

MRVIEWER_API bool MR::Viewer::touchpadZoomGestureEnd ( )

◆ touchpadZoomGestureUpdate()

MRVIEWER_API bool MR::Viewer::touchpadZoomGestureUpdate ( float scale,
bool kinetic )

◆ touchStart()

MRVIEWER_API bool MR::Viewer::touchStart ( int id,
int x,
int y )

◆ viewport() [1/2]

MRVIEWER_API Viewport & MR::Viewer::viewport ( ViewportId viewportId = {})

◆ viewport() [2/2]

MRVIEWER_API const Viewport & MR::Viewer::viewport ( ViewportId viewportId = {}) const

◆ viewport_index()

MRVIEWER_API int MR::Viewer::viewport_index ( ViewportId viewport_id) const

◆ viewportToScreen()

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

◆ windowShouldClose()

bool MR::Viewer::windowShouldClose ( )

Friends And Related Symbol Documentation

◆ getViewerInstance

MRVIEWER_API Viewer & getViewerInstance ( )
friend

returns global instance of Viewer class

Member Data Documentation

◆ animationMaxFps

int MR::Viewer::animationMaxFps { 30 }

◆ basisAxes

std::shared_ptr<ObjectMesh> MR::Viewer::basisAxes

◆ basisViewController

std::unique_ptr<CornerControllerObject> MR::Viewer::basisViewController

◆ clippingPlaneObject

std::shared_ptr<ObjectMesh> MR::Viewer::clippingPlaneObject

◆ commandArgs

std::vector<std::string> MR::Viewer::commandArgs

◆ experimentalFeatures

bool MR::Viewer::experimentalFeatures { }

◆ forceRedrawMinimumIncrementAfterEvents

int MR::Viewer::forceRedrawMinimumIncrementAfterEvents { 4 }

◆ framebufferSize

Vector2i MR::Viewer::framebufferSize

◆ globalBasis

std::unique_ptr<ViewportGlobalBasis> MR::Viewer::globalBasis

◆ glPickRadius

uint16_t MR::Viewer::glPickRadius { }

◆ isAnimating

bool MR::Viewer::isAnimating { false }

◆ pixelRatio

float MR::Viewer::pixelRatio { 1.0f }

◆ plugins

std::vector<ViewerPlugin*> MR::Viewer::plugins

◆ resetSettingsFunction

std::function<void( Viewer* viewer )> MR::Viewer::resetSettingsFunction

◆ rotationSphere

std::shared_ptr<ObjectMesh> MR::Viewer::rotationSphere

◆ scrollForce

float MR::Viewer::scrollForce { }

◆ selected_viewport_index

size_t MR::Viewer::selected_viewport_index

◆ swapOnLastPostEventsRedraw

bool MR::Viewer::swapOnLastPostEventsRedraw { true }

◆ viewport_list

std::vector<Viewport> MR::Viewer::viewport_list

◆ window

GLFWwindow* MR::Viewer::window

◆ windowMaximized

bool MR::Viewer::windowMaximized { false }

◆ windowOldPos

Vector2i MR::Viewer::windowOldPos

◆ windowSavePos

Vector2i MR::Viewer::windowSavePos

◆ windowSaveSize

Vector2i MR::Viewer::windowSaveSize

◆ windowTitle

std::shared_ptr<ViewerTitle> MR::Viewer::windowTitle

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