forked from Rsnelllenberg/VolumeProjectorPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDVRViewPlugin.h
More file actions
127 lines (98 loc) · 4.41 KB
/
Copy pathDVRViewPlugin.h
File metadata and controls
127 lines (98 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#pragma once
#include <ViewPlugin.h>
#include <Dataset.h>
#include <actions/PluginStatusBarAction.h>
#include <widgets/DropWidget.h>
#include <PointData/PointData.h>
#include <ImageData/ImageData.h>
#include <ImageData/Images.h>
#include "SettingsAction.h"
#include <QWidget>
#include <DVRVolumeData/Volumes.h>
/** All plugin related classes are in the ManiVault plugin namespace */
using namespace mv::plugin;
/** Drop widget used in this plugin is located in the ManiVault gui namespace */
using namespace mv::gui;
/** Dataset reference used in this plugin is located in the ManiVault util namespace */
using namespace mv::util;
class DVRWidget;
/**
* DVR view plugin class
*/
class DVRViewPlugin : public ViewPlugin
{
Q_OBJECT
public:
/**
* Constructor
* @param factory Pointer to the plugin factory
*/
DVRViewPlugin(const PluginFactory* factory);
/** Destructor */
~DVRViewPlugin() override = default;
/** This function is called by the core after the view plugin has been created */
void init() override;
/** Store a private reference to the data set that should be displayed */
void loadData(const mv::Dataset<Points>& datasets);
void loadTfData(const mv::Dataset<Images>& datasets);
void loadReducedPosData(const mv::Dataset<Points>& datasets);
void loadMaterialTransitionData(const mv::Dataset<Images>& datasets);
void loadMaterialPositionsData(const mv::Dataset<Images>& datasets);
void updateShowDropIndicator();
/** Updates the render settings */
void updateRenderSettings();
void updateVolumeData();
void updateTfData();
void updateReducedPosData();
void updateMaterialTransitionData();
void updateMaterialPositionsData();
private:
/** We create and publish some data in order to provide a self-contained DVR project */
std::vector<std::uint32_t> generateSequence(int n);
QString getVolumeDataSetID() const;
QString getTfDatasetID() const;
QString getReducedPosDataSetID() const;
QString getMaterialTransitionDataSetID() const;
QString getMaterialPositionsDataSetID() const;
protected:
DropWidget* _dropWidget; /** Widget for drag and drop behavior */
DVRWidget* _DVRWidget; /** The OpenGL widget */
SettingsAction _settingsAction; /** Settings action */
mv::Dataset<Volumes> _volumeDataset; /** Volume containing the multivariate dataset */
mv::Dataset<Images> _tfTexture; /** Texture containing the color transfer function data */
mv::Dataset<Images> _materialTransitionTexture; /** Texture containing material transition data */
mv::Dataset<Images> _materialPositionTexture; /** Texture containing material position data */
mv::Dataset<Points> _reducedPosDataset; /** Dataset containing the dimensionality reduced locations of all the points in the volume */
std::vector<unsigned int> _currentDimensions; /** Stores which dimensions of the current data are shown */
};
/**
* DVR view plugin factory class
*
* Note: Factory does not need to be altered (merely responsible for generating new plugins when requested)
*/
class DVRViewPluginFactory : public ViewPluginFactory
{
Q_INTERFACES(mv::plugin::ViewPluginFactory mv::plugin::PluginFactory)
Q_OBJECT
Q_PLUGIN_METADATA(IID "studio.manivault.DVRViewPlugin"
FILE "PluginInfo.json")
public:
/** Default constructor */
DVRViewPluginFactory();
/** Perform post-construction initialization */
void initialize() override;
/** Creates an instance of the DVR view plugin */
ViewPlugin* produce() override;
/** Returns the data types that are supported by the DVR view plugin */
mv::DataTypes supportedDataTypes() const override;
/**
* Get plugin trigger actions given \p datasets
* @param datasets Vector of input datasets
* @return Vector of plugin trigger actions
*/
PluginTriggerActions getPluginTriggerActions(const mv::Datasets& datasets) const override;
private:
PluginStatusBarAction* _statusBarAction; /** For global action in a status bar */
HorizontalGroupAction _statusBarPopupGroupAction; /** Popup group action for status bar action */
StringAction _statusBarPopupAction; /** Popup action for the status bar */
};