MeshLib Documentation
Loading...
Searching...
No Matches
MRViewer.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRViewerInstance.h"
4#include "MRMouse.h"
5#include "MRSignalCombiners.h"
6#include "MRMakeSlot.h"
7#include <MRMesh/MRVector2.h>
9#include "MRMesh/MRSignal.h"
11#include <cstdint>
12#include <filesystem>
13
14struct GLFWwindow;
15
17#define ENQUEUE_VIEWER_METHOD( NAME, METHOD ) MR::getViewerInstance().emplaceEvent( NAME, [] { \
18 MR::getViewerInstance() . METHOD (); \
19} )
20#define ENQUEUE_VIEWER_METHOD_ARGS( NAME, METHOD, ... ) MR::getViewerInstance().emplaceEvent( NAME, [__VA_ARGS__] { \
21 MR::getViewerInstance() . METHOD ( __VA_ARGS__ ); \
22} )
23#define ENQUEUE_VIEWER_METHOD_ARGS_SKIPABLE( NAME, METHOD, ... ) MR::getViewerInstance().emplaceEvent( NAME, [__VA_ARGS__] { \
24 MR::getViewerInstance() . METHOD ( __VA_ARGS__ ); \
25}, true )
26
27namespace MR
28{
29
30class SpaceMouseHandler;
31
32// This struct contains rules for viewer launch
34{
35 bool fullscreen{ false }; // if true starts fullscreen
36 int width{ 0 };
37 int height{ 0 };
39 {
40 Show, // Show window immediately
41 HideInit, // Show window after init
42 Hide, // Don't show window
43 TryHidden, // Launches in "Hide" mode if OpenGL is present and "NoWindow" if it is not
44 NoWindow // Don't initialize GL window (don't call GL functions)(force `isAnimating`)
45 } windowMode{ HideInit };
47 bool preferOpenGL3{ false };
48 bool render3dSceneInTexture{ true }; // If not set renders scene each frame
49 bool developerFeatures{ false }; // If set shows some developer features useful for debugging
50 std::string name{ "MRViewer" }; // Window name
51 bool startEventLoop{ true }; // If false - does not start event loop
52 bool close{ true }; // If !startEventLoop close immediately after start, otherwise close on window close, make sure you call `launchShut` manually if this flag is false
53 bool console{ false }; // If true - shows developers console
54 int argc{ 0 }; // Pass argc
55 char** argv{ nullptr }; // Pass argv
56
57 bool showMRVersionInTitle{ false }; // if true - print version info in window title
58 bool isAnimating{ false }; // if true - calls render without system events
59 int animationMaxFps{ 30 }; // max fps if animating
60 bool unloadPluginsAtEnd{ false }; // unload all extended libraries right before program exit
61
62 std::shared_ptr<SplashWindow> splashWindow; // if present will show this window while initializing plugins (after menu initialization)
63};
64
66{
68 const char * undoPrefix = "Open ";
69
70 // true here will replace existing scene even if more than one file is open
71 bool forceReplaceScene = false;
72};
73
74// GLFW-based mesh viewer
75class MRVIEWER_CLASS Viewer
76{
77public:
80
82
83 // Accumulate launch params from cmd args
84 MRVIEWER_API static void parseLaunchParams( LaunchParams& params );
85
86 // Launch viewer with given params
87 MRVIEWER_API int launch( const LaunchParams& params );
88 // Starts event loop
89 MRVIEWER_API void launchEventLoop();
90 // Terminate window
91 MRVIEWER_API void launchShut();
92
93 bool isLaunched() const { return isLaunched_; }
94
95 // get full parameters with witch viewer was launched
96 const LaunchParams& getLaunchParams() const { return launchParams_; }
97
98 // provides non const access to viewer
99 static Viewer* instance() { return &getViewerInstance(); }
100 static Viewer& instanceRef() { return getViewerInstance(); }
101 // provide const access to viewer
102 static const Viewer* constInstance() { return &getViewerInstance(); }
103 static const Viewer& constInstanceRef() { return getViewerInstance(); }
104
105 template<typename PluginType>
106 PluginType* getPluginInstance()
107 {
108 for ( auto& plugin : plugins )
109 {
110 auto p = dynamic_cast< PluginType* >( plugin );
111 if ( p )
112 {
113 return p;
114 }
115 }
116 return nullptr;
117 }
118
119 // Mesh IO
120 // Check the supported file format
121 MRVIEWER_API bool isSupportedFormat( const std::filesystem::path& file_name );
122
123 // Load objects / scenes from files
124 // Note! load files with progress bar in next frame if it possible, otherwise load directly inside this function
125 MRVIEWER_API bool loadFiles( const std::vector< std::filesystem::path>& filesList, const FileLoadOptions & options = {} );
126
127 // Save first selected objects to file
128 MRVIEWER_API bool saveToFile( const std::filesystem::path & mesh_file_name );
129
130 // Callbacks
131 MRVIEWER_API bool keyPressed( unsigned int unicode_key, int modifier );
132 MRVIEWER_API bool keyDown( int key, int modifier );
133 MRVIEWER_API bool keyUp( int key, int modifier );
134 MRVIEWER_API bool keyRepeat( int key, int modifier );
135 MRVIEWER_API bool mouseDown( MouseButton button, int modifier );
136 MRVIEWER_API bool mouseUp( MouseButton button, int modifier );
137 MRVIEWER_API bool mouseMove( int mouse_x, int mouse_y );
138 MRVIEWER_API bool mouseScroll( float delta_y );
139 MRVIEWER_API bool mouseClick( MouseButton button, int modifier );
140 MRVIEWER_API bool dragStart( MouseButton button, int modifier );
141 MRVIEWER_API bool dragEnd( MouseButton button, int modifier );
142 MRVIEWER_API bool drag( int mouse_x, int mouse_y );
143 MRVIEWER_API bool spaceMouseMove( const Vector3f& translate, const Vector3f& rotate );
144 MRVIEWER_API bool spaceMouseDown( int key );
145 MRVIEWER_API bool spaceMouseUp( int key );
146 MRVIEWER_API bool spaceMouseRepeat( int key );
147 MRVIEWER_API bool dragDrop( const std::vector<std::filesystem::path>& paths );
148 // Touch callbacks (now used in EMSCRIPTEN build only)
149 MRVIEWER_API bool touchStart( int id, int x, int y );
150 MRVIEWER_API bool touchMove( int id, int x, int y );
151 MRVIEWER_API bool touchEnd( int id, int x, int y );
152 // Touchpad gesture callbacks
153 MRVIEWER_API bool touchpadRotateGestureBegin();
154 MRVIEWER_API bool touchpadRotateGestureUpdate( float angle );
155 MRVIEWER_API bool touchpadRotateGestureEnd();
156 MRVIEWER_API bool touchpadSwipeGestureBegin();
157 MRVIEWER_API bool touchpadSwipeGestureUpdate( float dx, float dy, bool kinetic );
158 MRVIEWER_API bool touchpadSwipeGestureEnd();
159 MRVIEWER_API bool touchpadZoomGestureBegin();
160 MRVIEWER_API bool touchpadZoomGestureUpdate( float scale, bool kinetic );
161 MRVIEWER_API bool touchpadZoomGestureEnd();
162 // This function is called when window should close, if return value is true, window will stay open
163 MRVIEWER_API bool interruptWindowClose();
164 // callback to update connected / disconnected joystick
165 MRVIEWER_API void joystickUpdateConnected( int jid, int event );
166
167 // Draw everything
168 MRVIEWER_API void draw( bool force = false );
169 // Draw 3d scene with UI
170 MRVIEWER_API void drawFull( bool dirtyScene );
171 // Draw 3d scene without UI
172 MRVIEWER_API void drawScene();
173 // Call this function to force redraw scene into scene texture
174 void setSceneDirty() { dirtyScene_ = true; }
175 // Setup viewports views
176 MRVIEWER_API void setupScene();
177 // Cleans framebuffers for all viewports (sets its background)
178 MRVIEWER_API void clearFramebuffers();
179 // OpenGL context resize
180 MRVIEWER_API void resize( int w, int h ); // explicitly set framebuffer size
181 MRVIEWER_API void postResize( int w, int h ); // external resize due to user interaction
182 MRVIEWER_API void postSetPosition( int xPos, int yPos ); // external set position due to user interaction
183 MRVIEWER_API void postSetMaximized( bool maximized ); // external set maximized due to user interaction
184 MRVIEWER_API void postSetIconified( bool iconified ); // external set iconified due to user interaction
185 MRVIEWER_API void postFocus( bool focused ); // external focus handler due to user interaction
186 MRVIEWER_API void postRescale( float x, float y ); // external rescale due to user interaction
187 MRVIEWER_API void postClose(); // called when close signal received
188
190 // Multi-mesh methods //
192
193 // reset objectRoot with newRoot, append all RenderObjects and basis objects
194 MRVIEWER_API void set_root( SceneRootObject& newRoot );
195
196 // removes all objects from scene
197 MRVIEWER_API void clearScene();
198
200 // Multi-viewport methods //
202
203 // Return the current viewport, or the viewport corresponding to a given unique identifier
204 //
205 // Inputs:
206 // viewportId unique identifier corresponding to the desired viewport (current viewport if 0)
207 MRVIEWER_API Viewport& viewport( ViewportId viewportId = {} );
208 MRVIEWER_API const Viewport& viewport( ViewportId viewportId = {} ) const;
209
210 // Append a new "slot" for a viewport (i.e., copy properties of the current viewport, only
211 // changing the viewport size/position)
212 //
213 // Inputs:
214 // viewport Vector specifying the viewport origin and size in screen coordinates.
215 // append_empty If true, existing meshes are hidden on the new viewport.
216 //
217 // Returns the unique id of the newly inserted viewport. There can be a maximum of 31
218 // viewports created in the same viewport. Erasing a viewport does not change the id of
219 // other existing viewports
220 MRVIEWER_API ViewportId append_viewport( const ViewportRectangle & viewportRect, bool append_empty = false );
221
222 // Calculates and returns viewports bounds in gl space:
223 // (0,0) - lower left angle
224 MRVIEWER_API Box2f getViewportsBounds() const;
225
226 // Erase a viewport
227 //
228 // Inputs:
229 // index index of the viewport to erase
230 MRVIEWER_API bool erase_viewport( const size_t index );
231 MRVIEWER_API bool erase_viewport( ViewportId viewport_id );
232
233 // Retrieve viewport index from its unique identifier
234 // Returns -1 if not found
235 MRVIEWER_API int viewport_index( ViewportId viewport_id ) const;
236
237 // Get unique id of the vieport containing the mouse
238 // if mouse is out of any viewport returns index of last selected viewport
239 // (current_mouse_x, current_mouse_y)
240 MRVIEWER_API ViewportId getHoveredViewportId() const;
241
242 // Change selected_core_index to the viewport containing the mouse
243 // (current_mouse_x, current_mouse_y)
244 MRVIEWER_API void select_hovered_viewport();
245
246 // Calls fitData for single/each viewport in viewer
247 // fill = 0.6 parameter means that scene will 0.6 of screen,
248 // snapView - to snap camera angle to closest canonical quaternion
249 MRVIEWER_API void fitDataViewport( MR::ViewportMask vpList = MR::ViewportMask::all(), float fill = 0.6f, bool snapView = true );
250
251 // Calls fitBox for single/each viewport in viewer
252 // fill = 0.6 parameter means that scene will 0.6 of screen,
253 // snapView - to snap camera angle to closest canonical quaternion
254 MRVIEWER_API void fitBoxViewport( const Box3f& box, MR::ViewportMask vpList = MR::ViewportMask::all(), float fill = 0.6f, bool snapView = true );
255
256 // Calls fitData and change FOV to match the screen size then
257 // params - params fit data
259 MRVIEWER_API void preciseFitDataViewport( MR::ViewportMask vpList, const FitDataParams& param );
260
261 MRVIEWER_API size_t getTotalFrames() const;
262 MRVIEWER_API size_t getSwappedFrames() const;
263 MRVIEWER_API size_t getFPS() const;
264 MRVIEWER_API double getPrevFrameDrawTimeMillisec() const;
265
266 // Returns memory amount used by shared GL memory buffer
267 MRVIEWER_API size_t getStaticGLBufferSize() const;
268
269 // if true only last frame of force redraw after events will be swapped, otherwise each will be swapped
270 bool swapOnLastPostEventsRedraw{ true };
271 // minimum auto increment force redraw frames after events
272 int forceRedrawMinimumIncrementAfterEvents{ 4 };
273
274 // Increment number of forced frames to redraw in event loop
275 // if `swapOnLastOnly` only last forced frame will be present on screen and all previous will not
276 MRVIEWER_API void incrementForceRedrawFrames( int i = 1, bool swapOnLastOnly = false );
277
278 // Returns true if current frame will be shown on display
279 MRVIEWER_API bool isCurrentFrameSwapping() const;
280
281 // types of counted events
282 enum class EventType
283 {
284 MouseDown,
285 MouseUp,
286 MouseMove,
287 MouseScroll,
288 KeyDown,
289 KeyUp,
290 KeyRepeat,
291 CharPressed,
292 Count
293 };
294 // Returns number of events of given type
295 MRVIEWER_API size_t getEventsCount( EventType type )const;
296
297 // types of gl primitives counters
299 {
300 // arrays and elements are different gl calls
301 PointArraySize,
302 LineArraySize,
303 TriangleArraySize,
304 PointElementsNum,
305 LineElementsNum,
306 TriangleElementsNum,
307 Count
308 };
309 // Returns number of events of given type
310 MRVIEWER_API size_t getLastFrameGLPrimitivesCount( GLPrimitivesType type ) const;
311 // Increment number of gl primitives drawed in this frame
312 MRVIEWER_API void incrementThisFrameGLPrimitivesCount( GLPrimitivesType type, size_t num );
313
314
315 // Returns mask of present viewports
316 ViewportMask getPresentViewports() const { return presentViewportsMask_; }
317
318 // Restes frames counter and events counter
319 MRVIEWER_API void resetAllCounters();
320
325 MRVIEWER_API Image captureSceneScreenShot( const Vector2i& resolution = Vector2i() );
326
333 MRVIEWER_API void captureUIScreenShot( std::function<void( const Image& )> callback,
334 const Vector2i& pos = Vector2i(), const Vector2i& size = Vector2i() );
335
336 // Returns true if can enable alpha sort
337 MRVIEWER_API bool isAlphaSortAvailable() const;
338 // Tries to enable alpha sort,
339 // returns true if value was changed, return false otherwise
340 MRVIEWER_API bool enableAlphaSort( bool on );
341 // Returns true if alpha sort is enabled, false otherwise
342 bool isAlphaSortEnabled() const { return alphaSortEnabled_; }
343
344 // Returns if scene texture is now bound
345 MRVIEWER_API bool isSceneTextureBound() const;
346 // Binds or unbinds scene texture (should be called only with valid window)
347 // note that it does not clear framebuffer
348 MRVIEWER_API void bindSceneTexture( bool bind );
349
350 // Sets manager of viewer settings which loads user personal settings on beginning of app
351 // and saves it in app's ending
352 MRVIEWER_API void setViewportSettingsManager( std::unique_ptr<IViewerSettingsManager> mng );
353 MRVIEWER_API const std::unique_ptr<IViewerSettingsManager>& getViewerSettingsManager() const { return settingsMng_; }
354
356 // Finds point in all spaces from screen space pixel point
357 MRVIEWER_API PointInAllSpaces getPixelPointInfo( const Vector3f& screenPoint ) const;
358 // Finds point under mouse in all spaces and under mouse viewport id
360
361 // Converts screen space coordinate to viewport space coordinate
362 // (0,0) if viewport does not exist
363 // screen space: X [0,framebufferSize.x], Y [0,framebufferSize.y] - (0,0) is upper left of window
364 // viewport space: X [0,viewport_width], Y [0,viewport_height] - (0,0) is upper left of viewport
365 // Z [0,1] - 0 is Dnear, 1 is Dfar
366 MRVIEWER_API Vector3f screenToViewport( const Vector3f& screenPoint, ViewportId id ) const;
367 // Converts viewport space coordinate to screen space coordinate
368 // (0,0) if viewport does not exist
369 // screen space: X [0,framebufferSize.x], Y [0,framebufferSize.y] - (0,0) is upper left of window
370 // viewport space: X [0,viewport_width], Y [0,viewport_height] - (0,0) is upper left of viewport
371 // Z [0,1] - 0 is Dnear, 1 is Dfar
372 MRVIEWER_API Vector3f viewportToScreen( const Vector3f& viewportPoint, ViewportId id ) const;
373
374 // Returns viewports satisfying given mask
375 MRVIEWER_API std::vector<std::reference_wrapper<Viewport>> getViewports( ViewportMask mask = ViewportMask::any() );
376
377 // Enables or disables global history (clears it on disable)
378 MRVIEWER_API void enableGlobalHistory( bool on );
379 // Return true if global history is enabled, false otherwise
380 bool isGlobalHistoryEnabled() const { return bool( globalHistoryStore_ ); };
381 // Appends history action to current stack position (clearing redo)
382 // if global history is disabled do nothing
383 MRVIEWER_API void appendHistoryAction( const std::shared_ptr<HistoryAction>& action );
384 // Applies undo if global history is enabled
385 // return true if undo was applied
386 MRVIEWER_API bool globalHistoryUndo();
387 // Applies redo if global history is enabled
388 // return true if redo was applied
389 MRVIEWER_API bool globalHistoryRedo();
390 // Returns global history store
391 const std::shared_ptr<HistoryStore>& getGlobalHistoryStore() const { return globalHistoryStore_; }
392 // Return spacemouse handler
393 const std::shared_ptr<SpaceMouseHandler>& getSpaceMouseHandler() const { return spaceMouseHandler_; }
394
395 // This method is called after successful scene saving to update scene root, window title and undo
396 MRVIEWER_API void onSceneSaved( const std::filesystem::path& savePath, bool storeInRecent = true );
397
398 // Get/Set menu plugin (which is separated from other plugins to be inited first before splash window starts)
399 MRVIEWER_API const std::shared_ptr<ImGuiMenu>& getMenuPlugin() const;
400 MRVIEWER_API void setMenuPlugin( std::shared_ptr<ImGuiMenu> menu );
401
402 // get menu plugin casted in RibbonMenu
403 MRVIEWER_API std::shared_ptr<RibbonMenu> getRibbonMenu() const;
404
405 // Get the menu plugin casted in given type
406 template <typename T>
407 std::shared_ptr<T> getMenuPluginAs() const { return std::dynamic_pointer_cast<T>( getMenuPlugin() ); }
408
409 // sets stop event loop flag (this flag is glfwShouldWindowClose equivalent)
410 MRVIEWER_API void stopEventLoop();
411 // get stop event loop flag (this flag is glfwShouldWindowClose equivalent)
412 bool getStopEventLoopFlag() const { return stopEventLoop_; }
413
414 // return true if window should close
415 // calls interrupt signal and if no slot interrupts return true, otherwise return false
417
418 // returns true if viewer has valid GL context
419 // note that sometimes it is not enough, for example to free GL memory in destructor,
420 // glInitialized_ can be already reset and it requires `loadGL()` check too
421 bool isGLInitialized() const { return glInitialized_; }
422
423 // update the title of the main window and, if any scene was opened, show its filename
424 MRVIEWER_API void makeTitleFromSceneRootPath();
425
426 // returns true if the system framebuffer is scaled (valid for macOS and Wayland)
427 bool hasScaledFramebuffer() const { return hasScaledFramebuffer_; }
428
429public:
431 // Member variables //
433 GLFWwindow* window;
434
435 // A function to reset setting to initial state
436 // Overrides should call previous function
437 std::function<void( Viewer* viewer )> resetSettingsFunction;
438
439 // Stores all the viewing options
440 std::vector<Viewport> viewport_list;
442
443 // List of registered plugins
444 std::vector<ViewerPlugin*> plugins;
445
446 float pixelRatio{ 1.0f };
448 Vector2i windowSavePos; // pos to save
449 Vector2i windowSaveSize; // size to save
450 Vector2i windowOldPos;
451 bool windowMaximized{ false };
452
453 // if true - calls render without system events
454 bool isAnimating{ false };
455 // max fps if animating
456 int animationMaxFps{ 30 };
457 // this parameter can force up/down mouse scroll
458 // useful for WebAssembler version because it has too powerful scroll
459 float scrollForce{ }; // init in resetSettingsFunction()
460 // opengl-based pick window radius in pixels
461 uint16_t glPickRadius{ }; // init in resetSettingsFunction()
462 // Experimental/developer features enabled
463 bool experimentalFeatures{ };
464 // command arguments, each parsed arg should be erased from here not to affect other parsers
465 std::vector<std::string> commandArgs;
466
467 std::shared_ptr<ObjectMesh> basisAxes;
468 std::shared_ptr<ObjectMesh> globalBasisAxes;
469 std::shared_ptr<ObjectMesh> rotationSphere;
470 // Stores clipping plane mesh
471 std::shared_ptr<ObjectMesh> clippingPlaneObject;
472
473 // the window title that should be always displayed
475
476 //*********
477 // SIGNALS
478 //*********
480 // Mouse events
481 using MouseUpDownSignal = boost::signals2::signal<bool( MouseButton btn, int modifier ), SignalStopHandler>;
482 using MouseMoveSignal = boost::signals2::signal<bool( int x, int y ), SignalStopHandler>;
483 using MouseScrollSignal = boost::signals2::signal<bool( float delta ), SignalStopHandler>;
484 MouseUpDownSignal mouseDownSignal; // signal is called on mouse down
485 MouseUpDownSignal mouseUpSignal; // signal is called on mouse up
486 MouseMoveSignal mouseMoveSignal; // signal is called on mouse move, note that input x and y are in screen space
487 MouseScrollSignal mouseScrollSignal; // signal is called on mouse is scrolled
488 // High-level mouse events for clicks and dragging, emitted by MouseController
489 // When mouseClickSignal has connections, a small delay for click detection is introduced into camera operations and dragging
490 // Dragging starts if dragStartSignal is handled (returns true), and ends on button release
491 // When dragging is active, dragSignal and dragEndSignal are emitted instead of mouseMove and mouseUp
492 // mouseDown handler have priority over dragStart
493 MouseUpDownSignal mouseClickSignal; // signal is called when mouse button is pressed and immediately released
494 MouseUpDownSignal dragStartSignal; // signal is called when mouse button is pressed (deterred if click behavior is on)
495 MouseUpDownSignal dragEndSignal; // signal is called when mouse button used to start drag is released
496 MouseMoveSignal dragSignal; // signal is called when mouse is being dragged with button down
497 // Cursor enters/leaves
498 using CursorEntranceSignal = boost::signals2::signal<void(bool)>;
500 // Keyboard event
501 using CharPressedSignal = boost::signals2::signal<bool( unsigned unicodeKey, int modifier ), SignalStopHandler>;
502 using KeySignal = boost::signals2::signal<bool( int key, int modifier ), SignalStopHandler>;
503 CharPressedSignal charPressedSignal; // signal is called when unicode char on/is down/pressed for some time
504 KeySignal keyUpSignal; // signal is called on key up
505 KeySignal keyDownSignal; // signal is called on key down
506 KeySignal keyRepeatSignal; // signal is called when key is pressed for some time
507 // SpaceMouseEvents
508 using SpaceMouseMoveSignal = boost::signals2::signal<bool( const Vector3f& translate, const Vector3f& rotate ), SignalStopHandler>;
509 using SpaceMouseKeySignal = boost::signals2::signal<bool( int ), SignalStopHandler>;
510 SpaceMouseMoveSignal spaceMouseMoveSignal; // signal is called on spacemouse 3d controller (joystick) move
511 SpaceMouseKeySignal spaceMouseDownSignal; // signal is called on spacemouse key down
512 SpaceMouseKeySignal spaceMouseUpSignal; // signal is called on spacemouse key up
513 SpaceMouseKeySignal spaceMouseRepeatSignal; // signal is called when spacemouse key is pressed for some time
514 // Render events
515 using RenderSignal = boost::signals2::signal<void()>;
516 RenderSignal preDrawSignal; // signal is called before scene draw (but after scene setup)
517 RenderSignal preDrawPostViewportSignal; // signal is called before scene draw but after viewport.preDraw()
518 RenderSignal drawSignal; // signal is called on scene draw (after objects tree but before viewport.postDraw())
519 RenderSignal postDrawPreViewportSignal; // signal is called after scene draw but after before viewport.postDraw()
520 RenderSignal postDrawSignal; // signal is called after scene draw
521 // Scene events
522 using DragDropSignal = boost::signals2::signal<bool( const std::vector<std::filesystem::path>& paths ), SignalStopHandler>;
523 using PostResizeSignal = boost::signals2::signal<void( int x, int y )>;
524 using PostRescaleSignal = boost::signals2::signal<void( float xscale, float yscale )>;
525 using InterruptCloseSignal = boost::signals2::signal<bool(), SignalStopHandler>;
526 DragDropSignal dragDropSignal; // signal is called on drag and drop file
527 PostResizeSignal postResizeSignal; // signal is called after window resize
528 PostRescaleSignal postRescaleSignal; // signal is called after window rescale
529 InterruptCloseSignal interruptCloseSignal; // signal is called before close window (return true will prevent closing)
530 // Touch signals
531 using TouchSignal = boost::signals2::signal<bool(int,int,int), SignalStopHandler>;
532 TouchSignal touchStartSignal; // signal is called when any touch starts
533 TouchSignal touchMoveSignal; // signal is called when touch moves
534 TouchSignal touchEndSignal; // signal is called when touch stops
535 // Touchpad gesture events
536 using TouchpadGestureBeginSignal = boost::signals2::signal<bool(), SignalStopHandler>;
537 using TouchpadGestureEndSignal = boost::signals2::signal<bool(), SignalStopHandler>;
538 using TouchpadRotateGestureUpdateSignal = boost::signals2::signal<bool( float angle ), SignalStopHandler>;
539 using TouchpadSwipeGestureUpdateSignal = boost::signals2::signal<bool( float deltaX, float deltaY, bool kinetic ), SignalStopHandler>;
540 using TouchpadZoomGestureUpdateSignal = boost::signals2::signal<bool( float scale, bool kinetic ), SignalStopHandler>;
541 TouchpadGestureBeginSignal touchpadRotateGestureBeginSignal; // signal is called on touchpad rotate gesture beginning
542 TouchpadRotateGestureUpdateSignal touchpadRotateGestureUpdateSignal; // signal is called on touchpad rotate gesture update
543 TouchpadGestureEndSignal touchpadRotateGestureEndSignal; // signal is called on touchpad rotate gesture end
544 TouchpadGestureBeginSignal touchpadSwipeGestureBeginSignal; // signal is called on touchpad swipe gesture beginning
545 TouchpadSwipeGestureUpdateSignal touchpadSwipeGestureUpdateSignal; // signal is called on touchpad swipe gesture update
546 TouchpadGestureEndSignal touchpadSwipeGestureEndSignal; // signal is called on touchpad swipe gesture end
547 TouchpadGestureBeginSignal touchpadZoomGestureBeginSignal; // signal is called on touchpad zoom gesture beginning
548 TouchpadZoomGestureUpdateSignal touchpadZoomGestureUpdateSignal; // signal is called on touchpad zoom gesture update
549 TouchpadGestureEndSignal touchpadZoomGestureEndSignal; // signal is called on touchpad zoom gesture end
550 // Window focus signal
551 using PostFocusSignal = boost::signals2::signal<void( bool )>;
553
556 MRVIEWER_API void emplaceEvent( std::string name, ViewerEventCallback cb, bool skipable = false );
557 // pop all events from the queue while they have this name
558 MRVIEWER_API void popEventByName( const std::string& name );
559
560 MRVIEWER_API void postEmptyEvent();
561
562 [[nodiscard]] MRVIEWER_API const TouchpadParameters & getTouchpadParameters() const;
563 MRVIEWER_API void setTouchpadParameters( const TouchpadParameters & );
564
565 [[nodiscard]] MRVIEWER_API SpaceMouseParameters getSpaceMouseParameters() const;
566 MRVIEWER_API void setSpaceMouseParameters( const SpaceMouseParameters & );
567
568 [[nodiscard]] const MouseController &mouseController() const { return *mouseController_; }
569 [[nodiscard]] MouseController &mouseController() { return *mouseController_; }
570
571 // Store of recently opened files
572 [[nodiscard]] const RecentFilesStore &recentFilesStore() const { return *recentFilesStore_; }
573 [[nodiscard]] RecentFilesStore &recentFilesStore() { return *recentFilesStore_; }
574
575private:
576 Viewer();
577 ~Viewer();
578
579 // Init window
580 int launchInit_( const LaunchParams& params );
581 // Return true if OpenGL loaded successfully
582 bool checkOpenGL_(const LaunchParams& params );
583 // Init base objects
584 void init_();
585 // Init all plugins on start
586 void initPlugins_();
587 // Shut all plugins at the end
588 void shutdownPlugins_();
589#ifdef __EMSCRIPTEN__
590 void mainLoopFunc_();
591 static void emsMainInfiniteLoop();
592#endif
593 // returns true if was swapped
594 bool draw_( bool force );
595
596 void drawUiRenderObjects_();
597
598 // the minimum number of frames to be rendered even if the scene is unchanged
599 int forceRedrawFrames_{ 0 };
600 // Should be `<= forceRedrawFrames_`. The next N frames will not be shown on screen.
601 int forceRedrawFramesWithoutSwap_{ 0 };
602
603 // if this flag is set shows some developer features useful for debugging
604 bool enableDeveloperFeatures_{ false };
605
606 std::unique_ptr<ViewerEventQueue> eventQueue_;
607
608 // special plugin for menu (initialized before splash window starts)
609 std::shared_ptr<ImGuiMenu> menuPlugin_;
610
611 std::unique_ptr<TouchpadController> touchpadController_;
612 std::unique_ptr<SpaceMouseController> spaceMouseController_;
613 std::unique_ptr<TouchesController> touchesController_;
614 std::unique_ptr<MouseController> mouseController_;
615
616 std::unique_ptr<RecentFilesStore> recentFilesStore_;
617 std::unique_ptr<FrameCounter> frameCounter_;
618
619 mutable struct EventsCounter
620 {
621 std::array<size_t, size_t( EventType::Count )> counter{};
622 void reset();
623 } eventsCounter_;
624
625 mutable struct GLPrimitivesCounter
626 {
627 std::array<size_t, size_t( GLPrimitivesType::Count )> counter{};
628 void reset();
629 } glPrimitivesCounter_;
630
631
632 // creates glfw window with gl version major.minor, false if failed;
633 bool tryCreateWindow_( bool fullscreen, int& width, int& height, const std::string& name, int major, int minor );
634
635 bool needRedraw_() const;
636 void resetRedraw_();
637
638 void recursiveDraw_( const Viewport& vp, const Object& obj, const AffineXf3f& parentXf, RenderModelPassMask renderType, int* numDraws = nullptr ) const;
639
640 void initGlobalBasisAxesObject_();
641 void initBasisAxesObject_();
642 void initClippingPlaneObject_();
643 void initRotationCenterObject_();
644 void initSpaceMouseHandler_();
645
646 // recalculate pixel ratio
647 void updatePixelRatio_();
648
649 bool stopEventLoop_{ false };
650
651 bool isLaunched_{ false };
652 // this flag is needed to know if all viewer setup was already done, and we can call draw
653 bool focusRedrawReady_{ false };
654
655 std::unique_ptr<SceneTextureGL> sceneTexture_;
656 std::unique_ptr<AlphaSortGL> alphaSorter_;
657
658 bool alphaSortEnabled_{false};
659
660 bool glInitialized_{ false };
661
662 bool isInDraw_{ false };
663 bool dirtyScene_{ false };
664
665 bool hasScaledFramebuffer_{ false };
666
667 LaunchParams launchParams_;
668
669 ViewportId getFirstAvailableViewportId_() const;
670 ViewportMask presentViewportsMask_;
671
672 std::unique_ptr<IViewerSettingsManager> settingsMng_;
673
674 std::shared_ptr<HistoryStore> globalHistoryStore_;
675
676 std::shared_ptr<SpaceMouseHandler> spaceMouseHandler_;
677
678 boost::signals2::scoped_connection updateGlobalBasis_, updateBasisAxes_;
679
680 friend MRVIEWER_API Viewer& getViewerInstance();
681};
682
683// starts default viewer with given params and setup
684MRVIEWER_API int launchDefaultViewer( const Viewer::LaunchParams& params, const ViewerSetup& setup );
685
686// call this function to load MRViewer.dll
687MRVIEWER_API void loadMRViewerDll();
688
689} // end namespace
angle
Definition MRObjectDimensionsEnum.h:13
Definition MRMouseController.h:21
Definition MRRecentFilesStore.h:17
Object that is parent of all scene.
Definition MRSceneRoot.h:11
Definition MRSetupViewer.h:11
boost::signals2::signal< bool(const Vector3f &translate, const Vector3f &rotate), SignalStopHandler > SpaceMouseMoveSignal
Definition MRViewer.h:508
bool hasScaledFramebuffer() const
Definition MRViewer.h:427
MRVIEWER_API bool saveToFile(const std::filesystem::path &mesh_file_name)
MRVIEWER_API bool keyUp(int key, int modifier)
PostResizeSignal postResizeSignal
Definition MRViewer.h:527
bool windowShouldClose()
TouchpadGestureBeginSignal touchpadRotateGestureBeginSignal
Definition MRViewer.h:541
MRVIEWER_API void fitDataViewport(MR::ViewportMask vpList=MR::ViewportMask::all(), float fill=0.6f, bool snapView=true)
MRVIEWER_API bool isAlphaSortAvailable() const
boost::signals2::signal< bool(), SignalStopHandler > InterruptCloseSignal
Definition MRViewer.h:525
MRVIEWER_API ViewportId getHoveredViewportId() const
boost::signals2::signal< void()> RenderSignal
Definition MRViewer.h:515
boost::signals2::signal< bool(int x, int y), SignalStopHandler > MouseMoveSignal
Definition MRViewer.h:482
MRVIEWER_API void setViewportSettingsManager(std::unique_ptr< IViewerSettingsManager > mng)
PostFocusSignal postFocusSignal
Definition MRViewer.h:552
TouchpadGestureBeginSignal touchpadSwipeGestureBeginSignal
Definition MRViewer.h:544
TouchpadRotateGestureUpdateSignal touchpadRotateGestureUpdateSignal
Definition MRViewer.h:542
RenderSignal preDrawPostViewportSignal
Definition MRViewer.h:517
MRVIEWER_API bool keyRepeat(int key, int modifier)
MRVIEWER_API std::vector< std::reference_wrapper< Viewport > > getViewports(ViewportMask mask=ViewportMask::any())
const MouseController & mouseController() const
Definition MRViewer.h:568
MRVIEWER_API void appendHistoryAction(const std::shared_ptr< HistoryAction > &action)
boost::signals2::signal< bool(MouseButton btn, int modifier), SignalStopHandler > MouseUpDownSignal
Definition MRViewer.h:481
MRVIEWER_API PointInAllSpaces getMousePointInfo() const
MouseUpDownSignal dragStartSignal
Definition MRViewer.h:494
boost::signals2::signal< bool(int key, int modifier), SignalStopHandler > KeySignal
Definition MRViewer.h:502
MRVIEWER_API const std::shared_ptr< ImGuiMenu > & getMenuPlugin() const
MRVIEWER_API void resize(int w, int h)
MRVIEWER_API bool mouseClick(MouseButton button, int modifier)
std::vector< ViewerPlugin * > plugins
Definition MRViewer.h:444
static MRVIEWER_API void parseLaunchParams(LaunchParams &params)
RenderSignal drawSignal
Definition MRViewer.h:518
MRVIEWER_API Box2f getViewportsBounds() const
boost::signals2::signal< void(bool)> CursorEntranceSignal
Definition MRViewer.h:498
TouchpadGestureBeginSignal touchpadZoomGestureBeginSignal
Definition MRViewer.h:547
Vector2i windowSaveSize
Definition MRViewer.h:449
EventType
Definition MRViewer.h:283
RenderSignal postDrawPreViewportSignal
Definition MRViewer.h:519
ViewportMask getPresentViewports() const
Definition MRViewer.h:316
MRVIEWER_API bool touchpadSwipeGestureEnd()
MRVIEWER_API bool erase_viewport(ViewportId viewport_id)
MRVIEWER_API SpaceMouseParameters getSpaceMouseParameters() const
InterruptCloseSignal interruptCloseSignal
Definition MRViewer.h:529
MRVIEWER_API void fitBoxViewport(const Box3f &box, MR::ViewportMask vpList=MR::ViewportMask::all(), float fill=0.6f, bool snapView=true)
RenderSignal postDrawSignal
Definition MRViewer.h:520
MRVIEWER_API void setSpaceMouseParameters(const SpaceMouseParameters &)
MRVIEWER_API size_t getEventsCount(EventType type) const
KeySignal keyUpSignal
Definition MRViewer.h:504
std::shared_ptr< T > getMenuPluginAs() const
Definition MRViewer.h:407
const std::shared_ptr< HistoryStore > & getGlobalHistoryStore() const
Definition MRViewer.h:391
boost::signals2::signal< void(float xscale, float yscale)> PostRescaleSignal
Definition MRViewer.h:524
bool isGLInitialized() const
Definition MRViewer.h:421
MRVIEWER_API void onSceneSaved(const std::filesystem::path &savePath, bool storeInRecent=true)
boost::signals2::signal< bool(), SignalStopHandler > TouchpadGestureBeginSignal
Definition MRViewer.h:536
MRVIEWER_API bool touchStart(int id, int x, int y)
std::string defaultWindowTitle
Definition MRViewer.h:474
MRVIEWER_API bool mouseMove(int mouse_x, int mouse_y)
std::shared_ptr< ObjectMesh > rotationSphere
Definition MRViewer.h:469
MRVIEWER_API void clearFramebuffers()
Vector2i windowOldPos
Definition MRViewer.h:450
boost::signals2::signal< bool(int), SignalStopHandler > SpaceMouseKeySignal
Definition MRViewer.h:509
std::vector< std::string > commandArgs
Definition MRViewer.h:465
TouchpadGestureEndSignal touchpadZoomGestureEndSignal
Definition MRViewer.h:549
MRVIEWER_API Vector3f viewportToScreen(const Vector3f &viewportPoint, ViewportId id) const
boost::signals2::signal< bool(unsigned unicodeKey, int modifier), SignalStopHandler > CharPressedSignal
Definition MRViewer.h:501
MouseUpDownSignal dragEndSignal
Definition MRViewer.h:495
boost::signals2::signal< void(bool)> PostFocusSignal
Definition MRViewer.h:551
MouseUpDownSignal mouseClickSignal
Definition MRViewer.h:493
KeySignal keyDownSignal
Definition MRViewer.h:505
MRVIEWER_API bool isCurrentFrameSwapping() const
MRVIEWER_API double getPrevFrameDrawTimeMillisec() const
MRVIEWER_API void enableGlobalHistory(bool on)
MRVIEWER_API int launch(const LaunchParams &params)
MouseScrollSignal mouseScrollSignal
Definition MRViewer.h:487
MRVIEWER_API size_t getSwappedFrames() const
MRVIEWER_API void popEventByName(const std::string &name)
const LaunchParams & getLaunchParams() const
Definition MRViewer.h:96
std::function< void(Viewer *viewer)> resetSettingsFunction
Definition MRViewer.h:437
TouchSignal touchEndSignal
Definition MRViewer.h:534
MRVIEWER_API bool touchMove(int id, int x, int y)
MouseMoveSignal mouseMoveSignal
Definition MRViewer.h:486
MRVIEWER_API bool erase_viewport(const size_t index)
SpaceMouseMoveSignal spaceMouseMoveSignal
Definition MRViewer.h:510
MRVIEWER_API bool touchpadSwipeGestureBegin()
MRVIEWER_API bool dragDrop(const std::vector< std::filesystem::path > &paths)
MRVIEWER_API bool spaceMouseDown(int key)
MRVIEWER_API bool touchpadSwipeGestureUpdate(float dx, float dy, bool kinetic)
friend MRVIEWER_API Viewer & getViewerInstance()
returns global instance of Viewer class
TouchpadZoomGestureUpdateSignal touchpadZoomGestureUpdateSignal
Definition MRViewer.h:548
MRVIEWER_API PointInAllSpaces getPixelPointInfo(const Vector3f &screenPoint) const
bool isAlphaSortEnabled() const
Definition MRViewer.h:342
MRVIEWER_API void emplaceEvent(std::string name, ViewerEventCallback cb, bool skipable=false)
MRVIEWER_API void joystickUpdateConnected(int jid, int event)
MRVIEWER_API bool spaceMouseUp(int key)
CharPressedSignal charPressedSignal
Definition MRViewer.h:503
MRVIEWER_API void incrementForceRedrawFrames(int i=1, bool swapOnLastOnly=false)
size_t selected_viewport_index
Definition MRViewer.h:441
MRVIEWER_API const TouchpadParameters & getTouchpadParameters() const
MRVIEWER_API void postSetMaximized(bool maximized)
const std::shared_ptr< SpaceMouseHandler > & getSpaceMouseHandler() const
Definition MRViewer.h:393
static Viewer * instance()
Definition MRViewer.h:99
MRVIEWER_API bool mouseUp(MouseButton button, int modifier)
MRVIEWER_API bool enableAlphaSort(bool on)
PluginType * getPluginInstance()
Definition MRViewer.h:106
MRVIEWER_API bool mouseScroll(float delta_y)
bool isLaunched() const
Definition MRViewer.h:93
MRVIEWER_API void postEmptyEvent()
static const Viewer * constInstance()
Definition MRViewer.h:102
TouchpadGestureEndSignal touchpadRotateGestureEndSignal
Definition MRViewer.h:543
RenderSignal preDrawSignal
Definition MRViewer.h:516
MRVIEWER_API size_t getFPS() const
TouchpadGestureEndSignal touchpadSwipeGestureEndSignal
Definition MRViewer.h:546
MRVIEWER_API Vector3f screenToViewport(const Vector3f &screenPoint, ViewportId id) const
MRVIEWER_API bool dragEnd(MouseButton button, int modifier)
boost::signals2::signal< bool(int, int, int), SignalStopHandler > TouchSignal
Definition MRViewer.h:531
std::shared_ptr< ObjectMesh > clippingPlaneObject
Definition MRViewer.h:471
TouchpadSwipeGestureUpdateSignal touchpadSwipeGestureUpdateSignal
Definition MRViewer.h:545
MRVIEWER_API const Viewport & viewport(ViewportId viewportId={}) const
static const Viewer & constInstanceRef()
Definition MRViewer.h:103
MRVIEWER_API bool touchpadZoomGestureEnd()
MRVIEWER_API Image captureSceneScreenShot(const Vector2i &resolution=Vector2i())
MouseUpDownSignal mouseDownSignal
Definition MRViewer.h:484
boost::signals2::signal< bool(float scale, bool kinetic), SignalStopHandler > TouchpadZoomGestureUpdateSignal
Definition MRViewer.h:540
MRVIEWER_API bool touchpadRotateGestureBegin()
MRVIEWER_API bool mouseDown(MouseButton button, int modifier)
std::shared_ptr< ObjectMesh > globalBasisAxes
Definition MRViewer.h:468
RecentFilesStore & recentFilesStore()
Definition MRViewer.h:573
MRVIEWER_API void select_hovered_viewport()
MRVIEWER_API ViewportId append_viewport(const ViewportRectangle &viewportRect, bool append_empty=false)
MRVIEWER_API bool touchpadRotateGestureUpdate(float angle)
MRVIEWER_API bool spaceMouseRepeat(int key)
MRVIEWER_API void incrementThisFrameGLPrimitivesCount(GLPrimitivesType type, size_t num)
MRVIEWER_API void postRescale(float x, float y)
static Viewer & instanceRef()
Definition MRViewer.h:100
std::shared_ptr< ObjectMesh > basisAxes
Definition MRViewer.h:467
MRVIEWER_API bool touchpadZoomGestureBegin()
MRVIEWER_API void bindSceneTexture(bool bind)
MRVIEWER_API bool touchpadZoomGestureUpdate(float scale, bool kinetic)
MRVIEWER_API void set_root(SceneRootObject &newRoot)
MRVIEWER_API void stopEventLoop()
MRVIEWER_API void launchEventLoop()
PostRescaleSignal postRescaleSignal
Definition MRViewer.h:528
DragDropSignal dragDropSignal
Definition MRViewer.h:526
MRVIEWER_API void captureUIScreenShot(std::function< void(const Image &)> callback, const Vector2i &pos=Vector2i(), const Vector2i &size=Vector2i())
boost::signals2::signal< void(int x, int y)> PostResizeSignal
Definition MRViewer.h:523
MRVIEWER_API void launchShut()
MRVIEWER_API bool globalHistoryUndo()
MRVIEWER_API std::shared_ptr< RibbonMenu > getRibbonMenu() const
MRVIEWER_API const std::unique_ptr< IViewerSettingsManager > & getViewerSettingsManager() const
Definition MRViewer.h:353
boost::signals2::signal< bool(), SignalStopHandler > TouchpadGestureEndSignal
Definition MRViewer.h:537
MRVIEWER_API void preciseFitDataViewport(MR::ViewportMask vpList=MR::ViewportMask::all())
Vector2i framebufferSize
Definition MRViewer.h:447
CursorEntranceSignal cursorEntranceSignal
Definition MRViewer.h:499
MRVIEWER_API bool keyDown(int key, int modifier)
MRVIEWER_API void setupScene()
MRVIEWER_API void setMenuPlugin(std::shared_ptr< ImGuiMenu > menu)
MRVIEWER_API Viewport & viewport(ViewportId viewportId={})
MouseUpDownSignal mouseUpSignal
Definition MRViewer.h:485
MRVIEWER_API size_t getStaticGLBufferSize() const
GLPrimitivesType
Definition MRViewer.h:299
boost::signals2::signal< bool(float deltaX, float deltaY, bool kinetic), SignalStopHandler > TouchpadSwipeGestureUpdateSignal
Definition MRViewer.h:539
Vector2i windowSavePos
Definition MRViewer.h:448
MRVIEWER_API size_t getLastFrameGLPrimitivesCount(GLPrimitivesType type) const
MRVIEWER_API bool dragStart(MouseButton button, int modifier)
MRVIEWER_API void drawFull(bool dirtyScene)
SpaceMouseKeySignal spaceMouseUpSignal
Definition MRViewer.h:512
TouchSignal touchStartSignal
Definition MRViewer.h:532
MRVIEWER_API void drawScene()
GLFWwindow * window
Definition MRViewer.h:433
MRVIEWER_API bool drag(int mouse_x, int mouse_y)
SpaceMouseKeySignal spaceMouseDownSignal
Definition MRViewer.h:511
MRVIEWER_API void postSetIconified(bool iconified)
MRVIEWER_API bool globalHistoryRedo()
MRVIEWER_API void makeTitleFromSceneRootPath()
MRVIEWER_API size_t getTotalFrames() const
MRVIEWER_API void postFocus(bool focused)
void setSceneDirty()
Definition MRViewer.h:174
MRVIEWER_API void resetAllCounters()
MRVIEWER_API bool isSupportedFormat(const std::filesystem::path &file_name)
MouseMoveSignal dragSignal
Definition MRViewer.h:496
boost::signals2::signal< bool(const std::vector< std::filesystem::path > &paths), SignalStopHandler > DragDropSignal
Definition MRViewer.h:522
MRVIEWER_API void draw(bool force=false)
MRVIEWER_API int viewport_index(ViewportId viewport_id) const
MRVIEWER_API bool touchpadRotateGestureEnd()
boost::signals2::signal< bool(float angle), SignalStopHandler > TouchpadRotateGestureUpdateSignal
Definition MRViewer.h:538
MouseController & mouseController()
Definition MRViewer.h:569
MRVIEWER_API bool isSceneTextureBound() const
MRVIEWER_API bool touchEnd(int id, int x, int y)
boost::signals2::signal< bool(float delta), SignalStopHandler > MouseScrollSignal
Definition MRViewer.h:483
SpaceMouseKeySignal spaceMouseRepeatSignal
Definition MRViewer.h:513
MRVIEWER_API bool loadFiles(const std::vector< std::filesystem::path > &filesList, const FileLoadOptions &options={})
const RecentFilesStore & recentFilesStore() const
Definition MRViewer.h:572
MRVIEWER_API bool interruptWindowClose()
MRVIEWER_API bool spaceMouseMove(const Vector3f &translate, const Vector3f &rotate)
MRVIEWER_API void setTouchpadParameters(const TouchpadParameters &)
MRVIEWER_API void preciseFitDataViewport(MR::ViewportMask vpList, const FitDataParams &param)
bool isGlobalHistoryEnabled() const
Definition MRViewer.h:380
KeySignal keyRepeatSignal
Definition MRViewer.h:506
MRVIEWER_API void postResize(int w, int h)
TouchSignal touchMoveSignal
Definition MRViewer.h:533
MRVIEWER_API bool keyPressed(unsigned int unicode_key, int modifier)
MRVIEWER_API void postSetPosition(int xPos, int yPos)
MRVIEWER_API void clearScene()
std::vector< Viewport > viewport_list
Definition MRViewer.h:440
MRVIEWER_API void postClose()
bool getStopEventLoopFlag() const
Definition MRViewer.h:412
Definition MRViewportId.h:16
stores mask of viewport unique identifiers
Definition MRViewportId.h:38
static ViewportMask all()
mask meaning all or any viewports
Definition MRViewportId.h:45
Definition MRViewport.h:49
Definition MRCameraOrientationPlugin.h:8
MRVIEWER_API void loadMRViewerDll()
MouseMode
Definition MRMouse.h:19
MouseButton
Definition MRMouse.h:9
MRVIEWER_API Viewer & getViewerInstance()
returns global instance of Viewer class
MRVIEWER_API int launchDefaultViewer(const Viewer::LaunchParams &params, const ViewerSetup &setup)
Box2f ViewportRectangle
Viewport size.
Definition MRViewerFwd.h:12
std::function< void()> ViewerEventCallback
Definition MRViewerFwd.h:65
Definition Viewer.dox.py:1
Definition MRViewer.h:66
const char * undoPrefix
first part of undo name
Definition MRViewer.h:68
bool forceReplaceScene
Definition MRViewer.h:71
Definition MRFitData.h:28
Definition MRImage.h:15
Definition MRViewer.h:34
WindowMode
Definition MRViewer.h:39
@ HideInit
Definition MRViewer.h:41
@ NoWindow
Definition MRViewer.h:44
@ TryHidden
Definition MRViewer.h:43
@ Hide
Definition MRViewer.h:42
@ Show
Definition MRViewer.h:40
bool render3dSceneInTexture
Definition MRViewer.h:48
bool console
Definition MRViewer.h:53
bool developerFeatures
Definition MRViewer.h:49
char ** argv
Definition MRViewer.h:55
bool startEventLoop
Definition MRViewer.h:51
bool fullscreen
Definition MRViewer.h:35
int animationMaxFps
Definition MRViewer.h:59
int argc
Definition MRViewer.h:54
std::shared_ptr< SplashWindow > splashWindow
Definition MRViewer.h:62
bool unloadPluginsAtEnd
Definition MRViewer.h:60
bool close
Definition MRViewer.h:52
bool showMRVersionInTitle
Definition MRViewer.h:57
bool enableTransparentBackground
Definition MRViewer.h:46
int height
Definition MRViewer.h:37
bool preferOpenGL3
Definition MRViewer.h:47
int width
Definition MRViewer.h:36
enum MR::LaunchParams::WindowMode HideInit
std::string name
Definition MRViewer.h:50
bool isAnimating
Definition MRViewer.h:58
Definition MRPointInAllSpaces.h:13
Definition MRSpaceMouseParameters.h:10
Definition MRSignalCombiners.h:8
Definition MRTouchpadParameters.h:9