Skip to content

Commit

Permalink
Refs #11597 make detection for rebinned workspace more sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonPiccardoSelg committed Apr 22, 2015
1 parent 41bf642 commit c0f5bbd
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace Vates
{
namespace SimpleGui
{

class RebinnedSourcesManager;
/**
*
This class uses the MultiSliceView created by Kitware based on our
Expand Down Expand Up @@ -53,7 +55,7 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS MultiSliceView : public ViewB
* Default constructor.
* @param parent the parent widget of the multislice view widget
*/
MultiSliceView(QWidget *parent = 0);
MultiSliceView(QWidget *parent = 0, RebinnedSourcesManager* rebinnedSourcesManager = 0);
/// Default constructor.
virtual ~MultiSliceView();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Vates
{
namespace SimpleGui
{
class RebinnedSourcesManager;
/**
*
This class creates a scatter plot using the SplatterPlot ParaView plugin. The
Expand Down Expand Up @@ -62,7 +63,7 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS SplatterPlotView : public Vie
* Default constructor.
* @param parent the parent widget for the threeslice view
*/
explicit SplatterPlotView(QWidget *parent = 0);
explicit SplatterPlotView(QWidget *parent = 0, RebinnedSourcesManager* rebinnedSourcesManager = 0);
/// Default destructor
virtual ~SplatterPlotView();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ namespace Vates
{
namespace SimpleGui
{

class RebinnedSourcesManager;
/**
*
This class represents the initial view for the main program. It is meant to
Expand Down Expand Up @@ -51,7 +53,7 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS StandardView : public ViewBas

public:
/// Default constructor.
StandardView(QWidget *parent = 0);
StandardView(QWidget *parent = 0, RebinnedSourcesManager* rebinnedSourcesManager = 0);
/// Default destructor.
virtual ~StandardView();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace Vates
{
namespace SimpleGui
{

class RebinnedSourcesManager;
/**
*
This class creates four views of the given dataset. There are three 2D views
Expand Down Expand Up @@ -54,7 +56,7 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS ThreeSliceView : public ViewB
* Default constructor.
* @param parent the parent widget for the threeslice view
*/
ThreeSliceView(QWidget *parent = 0);
ThreeSliceView(QWidget *parent = 0, RebinnedSourcesManager* rebinnedSourcesManager = 0);
/// Default destructor.
virtual ~ThreeSliceView();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace SimpleGui
{

class ColorSelectionWidget;
class RebinnedSourcesManager;

/**
*
Expand Down Expand Up @@ -59,7 +60,8 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS ViewBase : public QWidget
Q_OBJECT
public:
/// Default constructor.
ViewBase(QWidget *parent = 0);
ViewBase(QWidget *parent = 0, RebinnedSourcesManager* rebinnedSourcesManager = 0);

/// Default destructor.
virtual ~ViewBase() {}

Expand Down Expand Up @@ -244,7 +246,8 @@ public slots:

ColorUpdater colorUpdater; ///< Handle to the color updating delegator
BackgroundRgbProvider backgroundRgbProvider; /// < Holds the manager for background color related tasks.
const pqColorMapModel* m_currentColorMapModel;
RebinnedSourcesManager* m_rebinnedSourcesManager;
const pqColorMapModel* m_currentColorMapModel;

QString m_temporaryWorkspaceIdentifier;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,22 +295,22 @@ ViewBase* MdViewerWidget::setMainViewWidget(QWidget *container,
{
case ModeControlWidget::STANDARD:
{
view = new StandardView(container);
view = new StandardView(container, &m_rebinnedSourcesManager);
}
break;
case ModeControlWidget::THREESLICE:
{
view = new ThreeSliceView(container);
view = new ThreeSliceView(container, &m_rebinnedSourcesManager);
}
break;
case ModeControlWidget::MULTISLICE:
{
view = new MultiSliceView(container);
view = new MultiSliceView(container, &m_rebinnedSourcesManager);
}
break;
case ModeControlWidget::SPLATTERPLOT:
{
view = new SplatterPlotView(container);
view = new SplatterPlotView(container, &m_rebinnedSourcesManager);
}
break;
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "MantidVatesSimpleGuiViewWidgets/MultisliceView.h"

#include "MantidVatesSimpleGuiViewWidgets/RebinnedSourcesManager.h"
#include "MantidVatesSimpleGuiQtWidgets/GeometryParser.h"

#include "MantidGeometry/MDGeometry/MDPlaneImplicitFunction.h"
#include "MantidQtSliceViewer/SliceViewerWindow.h"
#include "MantidQtFactory/WidgetFactory.h"
Expand Down Expand Up @@ -42,7 +41,7 @@ namespace Vates
namespace SimpleGui
{

MultiSliceView::MultiSliceView(QWidget *parent) : ViewBase(parent)
MultiSliceView::MultiSliceView(QWidget *parent, RebinnedSourcesManager* rebinnedSourcesManager) : ViewBase(parent, rebinnedSourcesManager)
{
this->ui.setupUi(this);
pqRenderView *tmp = this->createRenderView(this->ui.renderFrame,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace
}


SplatterPlotView::SplatterPlotView(QWidget *parent) : ViewBase(parent),
SplatterPlotView::SplatterPlotView(QWidget *parent, RebinnedSourcesManager* rebinnedSourcesManager) : ViewBase(parent, rebinnedSourcesManager),
m_cameraManager(boost::make_shared<CameraManager>()),
m_peaksTableController(NULL),
m_peaksWorkspaceNameDelimiter(";")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "MantidVatesSimpleGuiViewWidgets/StandardView.h"
#include "MantidVatesSimpleGuiViewWidgets/RebinnedSourcesManager.h"
// Have to deal with ParaView warnings and Intel compiler the hard way.
#if defined(__INTEL_COMPILER)
#pragma warning disable 1170
Expand Down Expand Up @@ -41,7 +42,8 @@ namespace SimpleGui
* buttons and creates the rendering view.
* @param parent the parent widget for the standard view
*/
StandardView::StandardView(QWidget *parent) : ViewBase(parent),m_binMDAction(NULL),
StandardView::StandardView(QWidget *parent, RebinnedSourcesManager* rebinnedSourcesManager) : ViewBase(parent, rebinnedSourcesManager),
m_binMDAction(NULL),
m_sliceMDAction(NULL),
m_unbinAction(NULL)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace
}


ThreeSliceView::ThreeSliceView(QWidget *parent) : ViewBase(parent)
ThreeSliceView::ThreeSliceView(QWidget *parent, RebinnedSourcesManager* rebinnedSourcesManager) : ViewBase(parent, rebinnedSourcesManager)
{
this->ui.setupUi(this);
this->mainView = this->createRenderView(this->ui.mainRenderFrame,
Expand Down
8 changes: 5 additions & 3 deletions Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "MantidVatesSimpleGuiViewWidgets/ViewBase.h"
#include "MantidVatesSimpleGuiViewWidgets/BackgroundRgbProvider.h"
#include "MantidVatesSimpleGuiViewWidgets/RebinnedSourcesManager.h"

#if defined(__INTEL_COMPILER)
#pragma warning disable 1170
Expand Down Expand Up @@ -47,7 +48,8 @@ namespace SimpleGui
* Default constructor.
* @param parent the parent widget for the view
*/
ViewBase::ViewBase(QWidget *parent) : QWidget(parent), m_currentColorMapModel(NULL), m_temporaryWorkspaceIdentifier("rebinned_vsi")
ViewBase::ViewBase(QWidget *parent, RebinnedSourcesManager* rebinnedSourcesManager) : QWidget(parent),
m_rebinnedSourcesManager(rebinnedSourcesManager), m_currentColorMapModel(NULL), m_temporaryWorkspaceIdentifier("rebinned_vsi")
{
}

Expand Down Expand Up @@ -638,12 +640,12 @@ bool ViewBase::isTemporaryWorkspace(pqPipelineSource *src)
{
wsType = src->getSMName();
}


QString wsName(vtkSMPropertyHelper(src->getProxy(),
"WorkspaceName", true).GetAsString());

if (wsName.contains(m_temporaryWorkspaceIdentifier))
if (wsName.contains(m_temporaryWorkspaceIdentifier) && m_rebinnedSourcesManager->isRebinnedSourceBeingTracked(src))
{
return true;
}
Expand Down

0 comments on commit c0f5bbd

Please sign in to comment.