Skip to content

Commit

Permalink
Add type action to TransformationPlugin base class
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasKroes committed Nov 25, 2024
1 parent a136e05 commit a4bcf9d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
15 changes: 7 additions & 8 deletions ManiVault/src/TransformationPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
#include "TransformationPlugin.h"
#include "Application.h"

namespace mv
{

namespace plugin
namespace mv::plugin
{

TransformationPlugin::TransformationPlugin(const PluginFactory* factory) :
Plugin(factory),
_inputDatasets()
_typeAction(this, "Type")
{

}

mv::Datasets TransformationPlugin::getInputDatasets() const
Expand All @@ -33,10 +29,14 @@ void TransformationPlugin::setInputDataset(const Dataset<DatasetImpl>& inputData
setInputDatasets({ inputDataset });
}

gui::OptionAction& TransformationPlugin::getTypeAction()
{
return _typeAction;
}

TransformationPluginFactory::TransformationPluginFactory() :
PluginFactory(Type::TRANSFORMATION)
{

}

QIcon TransformationPluginFactory::getIcon(const QColor& color /*= Qt::black*/) const
Expand All @@ -50,4 +50,3 @@ QIcon TransformationPluginFactory::getCategoryIcon() const
}

}
}
24 changes: 14 additions & 10 deletions ManiVault/src/TransformationPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
#pragma once

#include "Plugin.h"
#include "actions/OptionAction.h"

#include "Set.h"

namespace mv
{

namespace plugin
namespace mv::plugin
{

/**
Expand Down Expand Up @@ -46,8 +44,8 @@ class CORE_EXPORT TransformationPlugin : public Plugin
Dataset<DatasetType> getInputDataset() {
if (_inputDatasets.size() > 0)
return Dataset<DatasetType>(_inputDatasets[0].get<DatasetType>());
else
return Dataset<DatasetImpl>();

return {};
}

/**
Expand All @@ -62,8 +60,16 @@ class CORE_EXPORT TransformationPlugin : public Plugin
*/
void setInputDataset(const Dataset<DatasetImpl>& inputDataset);


/**
* Get type action
* @return Reference to type action
*/
gui::OptionAction& getTypeAction();

private:
Datasets _inputDatasets; /** One, or more, input dataset */
Datasets _inputDatasets; /** One, or more, input dataset */
gui::OptionAction _typeAction; /** Transformation type action */
};

/**
Expand All @@ -81,7 +87,7 @@ class CORE_EXPORT TransformationPluginFactory : public PluginFactory
TransformationPluginFactory();

/** Destructor */
~TransformationPluginFactory() = default;
~TransformationPluginFactory() override = default;

/**
* Get plugin icon
Expand All @@ -102,6 +108,4 @@ class CORE_EXPORT TransformationPluginFactory : public PluginFactory

}

}

Q_DECLARE_INTERFACE(mv::plugin::TransformationPluginFactory, "ManiVault.TransformationPluginFactory")

0 comments on commit a4bcf9d

Please sign in to comment.