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
51 MRVIEWER_API virtual bool setupMcp() const;
52
57 MRVIEWER_API virtual bool shutdownMcp() const;
58
60 std::function<void()> setupCustomLogSink;
61
63 std::function<void()> shutdownCustomLogSink;
64
65private:
66#ifndef __EMSCRIPTEN__
67 struct LoadedModule
68 {
69 std::filesystem::path filename;
70#if _WIN32
71 HMODULE module = nullptr;
72#else
73 void * module = nullptr;
74#endif
75 };
76 mutable std::vector<LoadedModule> loadedModules_;
77#endif
78};
79
80}
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:60
virtual void setupSettingsManager(Viewer *viewer, const std::string &appName, bool reset=false) const
virtual void setupCommonPlugins(Viewer *) const
Setups custom plugins to viewer.
Definition MRSetupViewer.h:32
virtual void unloadExtendedLibraries() const
free all libraries loaded in setupExtendedLibraries()
virtual void setupBasePlugins(Viewer *) const
Setups Menu Save and Open plugins.
ViewerSetup(const ViewerSetup &)=default
std::filesystem::path filename
Definition MRSetupViewer.h:69
virtual void setupConfiguration(Viewer *viewer) const
virtual bool shutdownMcp() const
ViewerSetup(ViewerSetup &&)=default
virtual void setupCommonModifiers(Viewer *) const
Setups modifiers to Menu plugin if it is present in viewer.
Definition MRSetupViewer.h:29
std::function< void()> shutdownCustomLogSink
functor to shutdown custom log sink, i.e. send all remaining logs to web before exit
Definition MRSetupViewer.h:63
virtual void setupExtendedLibraries() const
virtual ~ViewerSetup()=default
ViewerSetup()=default
explicitly define ctors to avoid warning C5267: definition of implicit copy constructor is deprecated...
virtual bool setupMcp() const
only for bindings generation
Definition MRCameraOrientationPlugin.h:8