Skip to content

Commit

Permalink
Refs #11677 handle further crash scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonPiccardoSelg committed May 8, 2015
1 parent 4f8014e commit 9c7636c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
Expand Up @@ -149,11 +149,16 @@ void SplatterPlotView::render()
{
pqPipelineSource *src = NULL;
src = pqActiveObjects::instance().activeSource();

// Hedge for no active source
if (!src)
{
g_log.warning() << "SplatterPlotView: Active source is NULL. Cannot render.";
bool isPeaksWorkspace = this->isPeaksWorkspace(src);
// Hedge for two things.
// 1. If there is no active source
// 2. If we are loading a peak workspace without haveing
// a splatterplot source in place
bool isBadInput = !src || (isPeaksWorkspace && this->splatSource == NULL);
if (isBadInput)
{
g_log.warning() << "SplatterPlotView: Could not render source. You are either loading an active source "
<< "or you are loading a peak source without having a splatterplot source in place.\n";
return;
}

Expand All @@ -175,7 +180,6 @@ void SplatterPlotView::render()
return;
}

bool isPeaksWorkspace = this->isPeaksWorkspace(src);
if (!isPeaksWorkspace)
{
this->origSrc = src;
Expand Down Expand Up @@ -512,7 +516,7 @@ void SplatterPlotView::createPeaksFilter()
updatePeaksFilter(m_peaksFilter);

// Create point representation of the source and set the point size
const double pointSize = 4;
const double pointSize = 2;
pqDataRepresentation *dataRepresentation = m_peaksFilter->getRepresentation(this->view);
vtkSMPropertyHelper(dataRepresentation->getProxy(), "Representation").Set("Points");
vtkSMPropertyHelper(dataRepresentation->getProxy(), "PointSize").Set(pointSize);
Expand Down
Expand Up @@ -243,9 +243,9 @@ void StandardView::closeSubWindows()
*/
void StandardView::setRebinAndUnbinButtons()
{
int numberOfInternallyRebinnedWorkspaces = 0;
int numberOfTrueMDHistoWorkspaces = 0;
int numberOfPeakWorkspaces = 0;
unsigned int numberOfInternallyRebinnedWorkspaces = 0;
unsigned int numberOfTrueMDHistoWorkspaces = 0;
unsigned int numberOfPeakWorkspaces = 0;

pqServer *server = pqActiveObjects::instance().activeServer();
pqServerManagerModel *smModel = pqApplicationCore::instance()->getServerManagerModel();
Expand All @@ -271,8 +271,7 @@ void StandardView::setRebinAndUnbinButtons()
this->allowRebinningOptions(allowRebinning);

// If there are no internally rebinned workspaces the button should be disabled.
const bool allowUnbin = !( numberOfInternallyRebinnedWorkspaces == 0 );
allowUnbinOption(allowUnbin);
allowUnbinOption(numberOfInternallyRebinnedWorkspaces > 0);
}


Expand Down

0 comments on commit 9c7636c

Please sign in to comment.