Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions DVRTransferFunction/src/TransferFunctionPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,12 @@ TransferFunctionPlugin::TransferFunctionPlugin(const PluginFactory* factory) :
if (datasetsMimeData->getDatasets().count() > 1)
return dropRegions;

const auto& dataset = datasetsMimeData->getDatasets().first();
const auto datasetGuiName = dataset->text();
const auto datasetId = dataset->getId();
const auto dataType = dataset->getDataType();
const auto dataTypes = DataTypes({ PointType , ColorType, ClusterType });

// Check if the data type can be dropped
if (!dataTypes.contains(dataType))
dropRegions << new DropWidget::DropRegion(this, "Incompatible data", "This type of data is not supported", "exclamation-circle", false);
const auto dataset = datasetsMimeData->getDatasets().first();

// Points dataset is about to be dropped
if (dataType == PointType) {
if (dataset->getDataType() == PointType) {
const auto datasetGuiName = dataset->text();
const auto datasetId = dataset->getId();

// Get points dataset from the core
auto candidateDataset = mv::data().getDataset<Points>(datasetId);
Expand All @@ -125,6 +119,10 @@ TransferFunctionPlugin::TransferFunctionPlugin(const PluginFactory* factory) :
}
}
}
else
{
dropRegions << new DropWidget::DropRegion(this, "Incompatible data", "This type of data is not supported", "exclamation-circle", false);
}

return dropRegions;
});
Expand Down Expand Up @@ -155,10 +153,6 @@ TransferFunctionPlugin::TransferFunctionPlugin(const PluginFactory* factory) :
getLearningCenterAction().addVideos(QStringList({ "Practitioner", "Developer" }));
}

TransferFunctionPlugin::~TransferFunctionPlugin()
{
}

void TransferFunctionPlugin::init()
{
auto layout = new QVBoxLayout();
Expand Down
4 changes: 1 addition & 3 deletions DVRTransferFunction/src/TransferFunctionPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TransferFunctionPlugin : public ViewPlugin

public:
TransferFunctionPlugin(const PluginFactory* factory);
~TransferFunctionPlugin() override;
~TransferFunctionPlugin() override = default;

void init() override;

Expand Down Expand Up @@ -95,8 +95,6 @@ class TransferFunctionPlugin : public ViewPlugin
QPointer<MaterialSettings> _materialSettings; /** Material settings action */
QPointer<HorizontalToolbarAction> _primaryToolbarAction; /** Horizontal toolbar for primary content */

static const std::int32_t LAZY_UPDATE_INTERVAL = 2;

};

// =============================================================================
Expand Down
Loading