-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add plugin global settings for ExampleViewOpenGl plugin (#17)
* Add ExampleViewGL global settings action Add default point size action to the global settings action Initialize point size from global settings default point size Simplified the SettingsAction (derive from group action instead of WidgetAction) Correctly connect lambdas to ExampleViewGLPlugin::updatePlot() in SettingsAction Add ExampleViewGLPlugin SettingsAction as a docking widget * Fix small typo * Fix small typo * Add example OpenGL view default point opacity global setting
- Loading branch information
1 parent
80e86ce
commit 5d757a2
Showing
7 changed files
with
99 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "GlobalSettingsAction.h" | ||
|
||
#include <QHBoxLayout> | ||
|
||
using namespace mv; | ||
using namespace mv::gui; | ||
|
||
GlobalSettingsAction::GlobalSettingsAction(QObject* parent, const plugin::PluginFactory* pluginFactory) : | ||
PluginGlobalSettingsGroupAction(parent, pluginFactory), | ||
_defaultPointSizeAction(this, "Default point Size", 1, 50, 10), | ||
_defaultPointOpacityAction(this, "Default point opacity", 0.f, 1.f, 0.5f) | ||
{ | ||
_defaultPointSizeAction.setToolTip("Default size of individual points"); | ||
_defaultPointOpacityAction.setToolTip("Default opacity of individual points"); | ||
|
||
// The add action automatically assigns a settings prefix to _pointSizeAction so there is no need to do this manually | ||
addAction(&_defaultPointSizeAction); | ||
addAction(&_defaultPointOpacityAction); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include <PluginGlobalSettingsGroupAction.h> | ||
|
||
#include <actions/DecimalAction.h> | ||
|
||
namespace mv { | ||
namespace plugin { | ||
class PluginFactory; | ||
} | ||
} | ||
|
||
/** | ||
* Global settings action class | ||
* | ||
* Action class for configuring global settings | ||
* | ||
* This group action (once assigned to the plugin factory, see ExampleViewGLPluginFactory::initialize()) is | ||
* added to the global settings panel, accessible through the file > settings menu. | ||
* | ||
*/ | ||
class GlobalSettingsAction : public mv::gui::PluginGlobalSettingsGroupAction | ||
{ | ||
public: | ||
|
||
/** | ||
* Construct with pointer to \p parent object and \p pluginFactory | ||
* @param parent Pointer to parent object | ||
* @param pluginFactory Pointer to plugin factory | ||
*/ | ||
Q_INVOKABLE GlobalSettingsAction(QObject* parent, const mv::plugin::PluginFactory* pluginFactory); | ||
|
||
public: // Action getters | ||
|
||
mv::gui::DecimalAction& getDefaultPointSizeAction() { return _defaultPointSizeAction; } | ||
mv::gui::DecimalAction& getDefaultPointOpacityAction() { return _defaultPointOpacityAction; } | ||
|
||
private: | ||
mv::gui::DecimalAction _defaultPointSizeAction; /** Default point size action */ | ||
mv::gui::DecimalAction _defaultPointOpacityAction; /** Default point opacity action */ | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters