MeshLib C++ Docs
Loading...
Searching...
No Matches
MRSetupViewer.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRViewerFwd.h"
4#include <string>
5#include <filesystem>
6
7#include "MRPch/MRWinapi.h"
8
9namespace MR
10{
13
14
15class MRVIEWER_CLASS ViewerSetup
16{
17public:
19 ViewerSetup() = default;
20 ViewerSetup( const ViewerSetup & ) = default;
21 ViewerSetup( ViewerSetup && ) = default;
22
23 virtual ~ViewerSetup() = default;
24
26 MRVIEWER_API virtual void setupBasePlugins( Viewer* ) const;
27
29 virtual void setupCommonModifiers( Viewer* ) const {}
30
32 virtual void setupCommonPlugins( Viewer* ) const {}
33
36 MRVIEWER_API virtual void setupSettingsManager( Viewer* viewer, const std::string& appName, bool reset = false ) const;
37
40 MRVIEWER_API virtual void setupConfiguration( Viewer* viewer ) const;
41
44 MRVIEWER_API virtual void setupExtendedLibraries() const;
45
47 MRVIEWER_API virtual void unloadExtendedLibraries() const;
48
50 std::function<void()> setupCustomLogSink;
51
53 std::function<void()> shutdownCustomLogSink;
54
55private:
56#ifndef __EMSCRIPTEN__
57 struct LoadedModule
58 {
59 std::filesystem::path filename;
60#if _WIN32
61 HMODULE module = nullptr;
62#else
63 void * module = nullptr;
64#endif
65 };
66 mutable std::vector<LoadedModule> loadedModules_;
67#endif
68};
69
70}
Definition MRSetupViewer.h:16
GLFW-based mesh viewer.
Definition MRViewer.h:69
std::function< void()> setupCustomLogSink
functor to setup custom log sink, i.e. sending logs to web
Definition MRSetupViewer.h:50
virtual void setupCommonPlugins(Viewer *) const
Setups custom plugins to viewer.
Definition MRSetupViewer.h:32
virtual MRVIEWER_API void setupSettingsManager(Viewer *viewer, const std::string &appName, bool reset=false) const
virtual MRVIEWER_API void setupExtendedLibraries() const
ViewerSetup(const ViewerSetup &)=default
std::filesystem::path filename
Definition MRSetupViewer.h:59
ViewerSetup(ViewerSetup &&)=default
virtual void setupCommonModifiers(Viewer *) const
Setups modifiers to Menu plugin if it is present in viewer.
Definition MRSetupViewer.h:29
virtual MRVIEWER_API void setupBasePlugins(Viewer *) const
Setups Menu Save and Open plugins.
std::function< void()> shutdownCustomLogSink
functor to shutdown custom log sink, i.e. send all remaining logs to web before exit
Definition MRSetupViewer.h:53
virtual MRVIEWER_API void setupConfiguration(Viewer *viewer) const
virtual ~ViewerSetup()=default
ViewerSetup()=default
explicitly define ctors to avoid warning C5267: definition of implicit copy constructor is deprecated...
virtual MRVIEWER_API void unloadExtendedLibraries() const
free all libraries loaded in setupExtendedLibraries()
only for bindings generation
Definition MRCameraOrientationPlugin.h:8