Skip to content

Commit

Permalink
Merge pull request #628 from mantidproject/feature/11602_remove_cut_f…
Browse files Browse the repository at this point in the history
…ilter_when_switching

Bugfix for removing cut filter when switching to splatterplot
  • Loading branch information
FedeMPouzols committed Apr 22, 2015
2 parents 06e2f13 + eb95f4e commit 644358c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ namespace SimpleGui

// Check if Peak Workspace. This workspace should not contribute to colorscale
if (QString(proxy->GetXMLName()).contains("Peaks Source") ||
QString(proxy->GetXMLName()).contains("SinglePeakMarkerSource"))
QString(proxy->GetXMLName()).contains("SinglePeakMarkerSource") ||
QString(proxy->GetXMLName()).contains("Threshold") ||
QString(proxy->GetXMLName()).contains("ProbePoint"))
{
minValue = DBL_MAX;
maxValue = -DBL_MAX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,9 @@ ModeControlWidget::Views MdViewerWidget::checkViewAgainstWorkspace(ModeControlWi
// Histo workspaces cannot have a splatter plot,
if (view == ModeControlWidget::SPLATTERPLOT)
{
g_log.warning() << "Selected a splatter plot for a histo workspace. Defaulted to standard view. \n";
g_log.notice() << "The preferred initial view favours the splatterplot as initial view, "
<< "but an MDHisto workspace is being loaded. An MDHisto workspace "
<< "cannot be loaded into a splatterplot view. Defaulted to standard view. \n";

selectedView = ModeControlWidget::STANDARD;
}
Expand Down
10 changes: 8 additions & 2 deletions Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
#include <pqAnimationScene.h>
#include <pqApplicationCore.h>
#include <pqDataRepresentation.h>
#include <pqDeleteReaction.h>
#include <pqObjectBuilder.h>
#include <pqPipelineSource.h>
#include <pqPipelineFilter.h>
#include <pqPipelineRepresentation.h>
#include <pqPipelineSource.h>
#include <pqPVApplicationCore.h>
#include <pqRenderView.h>
#include <pqScalarsToColors.h>
Expand All @@ -33,6 +34,7 @@
#include <QDebug>
#include <QHBoxLayout>
#include <QPointer>
#include <QSet>

#include <stdexcept>

Expand Down Expand Up @@ -91,19 +93,23 @@ pqRenderView* ViewBase::createRenderView(QWidget* widget, QString viewName)
*/
void ViewBase::destroyFilter(pqObjectBuilder *builder, const QString &name)
{
(void) builder;

pqServer *server = pqActiveObjects::instance().activeServer();
pqServerManagerModel *smModel = pqApplicationCore::instance()->getServerManagerModel();
QList<pqPipelineSource *> sources;
QList<pqPipelineSource *>::Iterator source;
sources = smModel->findItems<pqPipelineSource *>(server);
QSet<pqPipelineSource*> toDelete;
for (source = sources.begin(); source != sources.end(); ++source)
{
const QString sourceName = (*source)->getSMName();
if (sourceName.startsWith(name))
{
builder->destroy(*source);
toDelete.insert(*source);
}
}
pqDeleteReaction::deleteSources(toDelete);
}

/**
Expand Down

0 comments on commit 644358c

Please sign in to comment.