MeshLib
 
Loading...
Searching...
No Matches
MRViewerPlugin.h
Go to the documentation of this file.
1#pragma once
2
3// TODO:
4// * create plugins/skeleton.h
5// * pass time in draw function
6// * remove Preview3D from comments
7// * clean comments
8
9#include "MRViewerInstance.h"
10#include <filesystem>
11#include <vector>
12
13namespace MR
14{
15
16// Abstract class for plugins
17// All plugins MUST have this class as their parent and may implement any/all
18// the callbacks marked `virtual` here.
19//
20// /////For an example of a basic plugins see plugins/skeleton.h
21//
22// Return value of callbacks: returning true to any of the callbacks tells
23// Viewer that the event has been handled and that it should not be passed to
24// other plugins or to other internal functions of Viewer
25
27{
28public:
30 {
31 plugin_name = "dummy";
32 }
33
34 virtual ~ViewerPlugin()
35 {
36 }
37
38 // This function is called when the viewer is initialized (no mesh will be loaded at this stage)
39 virtual void init( Viewer *_viewer )
40 {
41 viewer = _viewer;
42 }
43
44 // This function is called before shutdown
45 virtual void shutdown()
46 {
47 }
48
49 std::string plugin_name;
50protected:
51 // Pointer to the main Viewer class
53};
54
55}
Definition MRViewerPlugin.h:27
ViewerPlugin()
Definition MRViewerPlugin.h:29
virtual void init(Viewer *_viewer)
Definition MRViewerPlugin.h:39
virtual void shutdown()
Definition MRViewerPlugin.h:45
Viewer * viewer
Definition MRViewerPlugin.h:52
virtual ~ViewerPlugin()
Definition MRViewerPlugin.h:34
std::string plugin_name
Definition MRViewerPlugin.h:49
Definition MRViewer.h:80
Definition MRCameraOrientationPlugin.h:7
MRVIEWER_API Viewer & getViewerInstance()