Skip to content

Commit

Permalink
Refs #6352. Getting peak coordinates to switch when asked.
Browse files Browse the repository at this point in the history
I had to do this as a post-accept check to stop PV from setting the parameter
back to the default when I tried to set the parameter before the accept call.
Found out in the process that the signal connections in MdViewerWidget for
the MultiSliceView don't work anymore. That's why the check signature is now
different. NOTE: Things are currently wired to switch to sample coords. There
is sample code in SplatterPlotView::checkPeakCoordinates() to get things the
right way.
  • Loading branch information
Michael Reuter committed Jan 11, 2013
1 parent 1e3cdd7 commit 134b486
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS SplatterPlotView : public Vie
*/
void resetDisplay();

public slots:
/// Check the coordinates for the peaks overlay if necessary
void checkPeaksCoordinates();

protected slots:
/**
* Create and apply a threshold filter to the data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ void MdViewerWidget::setParaViewComponentsForView()
QObject::connect(this->currentView, SIGNAL(triggerAccept()),
this->ui.proxyTabWidget->getObjectInspector(),
SLOT(accept()));

if (this->currentView->inherits("MultiSliceView"))
{
QObject::connect(this->ui.pipelineBrowser,
Expand All @@ -354,6 +355,15 @@ void MdViewerWidget::setParaViewComponentsForView()
SLOT(updateSelectedIndicator()));
}

SplatterPlotView *spv = dynamic_cast<SplatterPlotView *>(this->currentView);
if (spv)
{
QObject::connect(this->ui.proxyTabWidget->getObjectInspector(),
SIGNAL(postaccept()),
static_cast<SplatterPlotView *>(this->currentView),
SLOT(checkPeaksCoordinates()));
}

QObject::connect(this->currentView, SIGNAL(setViewsStatus(bool)),
this->ui.modeControlWidget, SLOT(enableViewButtons(bool)));
QObject::connect(this->currentView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,27 @@ void SplatterPlotView::resetDisplay()
this->view->resetDisplay();
}

void SplatterPlotView::checkPeaksCoordinates()
{
if (!this->peaksSource.isEmpty())
{
/*
// Use this to get the correct parameter. Name and type can change, but
// input to set call below is integer.
int peakViewCoords = vtkSMPropertyHelper(this->origSrc->getProxy(),
"DataView").GetAsInt();
*/
// Remove below when above is fixed.
int peakViewCoords = 1;
foreach(pqPipelineSource *src, this->peaksSource)
{
vtkSMPropertyHelper(src->getProxy(),
"Peak Dimensions").Set(peakViewCoords);
src->getProxy()->UpdateVTKObjects();
}
}
}

void SplatterPlotView::onThresholdButtonClicked()
{
pqObjectBuilder* builder = pqApplicationCore::instance()->getObjectBuilder();
Expand Down

0 comments on commit 134b486

Please sign in to comment.