Skip to content

Commit

Permalink
Refs #6352. Method to switch peak coordinates in SplatterPlot view.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed Jan 17, 2013
1 parent 8a2251a commit 19abe76
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public slots:
void checkPeaksCoordinates();

protected slots:
/// Check state of toggle button with respect to peak coordinates.
void onOverridePeakCoordToggled(bool state);
/**
* Create and apply a threshold filter to the data.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="overridePeakCoordsButton">
<property name="toolTip">
<string>Override the peak coordinates instead of matching them to the MD workspace</string>
</property>
<property name="text">
<string>Override PC</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ SplatterPlotView::SplatterPlotView(QWidget *parent) : ViewBase(parent)
QObject::connect(this->ui.thresholdButton, SIGNAL(clicked()),
this, SLOT(onThresholdButtonClicked()));

// Set connection to toggle button for peak coordinate checking
QObject::connect(this->ui.overridePeakCoordsButton,
SIGNAL(toggled(bool)),
this,
SLOT(onOverridePeakCoordToggled(bool)));

this->view = this->createRenderView(this->ui.renderFrame);
}

Expand Down Expand Up @@ -130,9 +136,25 @@ void SplatterPlotView::resetDisplay()
this->view->resetDisplay();
}

/**
* This function checks to see if the Override PC button has been
* toggled. If the state is unchecked (false), we want to make sure
* that the coordniates are matched back to the MD workspace.
* @param state : true is button is checked, false if not
*/
void SplatterPlotView::onOverridePeakCoordToggled(bool state)
{
if (!state)
{
this->checkPeaksCoordinates();
emit this->triggerAccept();
}
}

void SplatterPlotView::checkPeaksCoordinates()
{
if (!this->peaksSource.isEmpty())
if (!this->peaksSource.isEmpty() &&
!this->ui.overridePeakCoordsButton->isChecked())
{
int peakViewCoords = vtkSMPropertyHelper(this->origSrc->getProxy(),
"SpecialCoordinates").GetAsInt();
Expand Down

0 comments on commit 19abe76

Please sign in to comment.