Skip to content

Commit

Permalink
Refs #11814 Change recursion depth to 1 when using top level split
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonPiccardoSelg committed May 20, 2015
1 parent 3d28511 commit ec6b4b1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "vtkUnstructuredGrid.h"
#include "vtkStreamingDemandDrivenPipeline.h"

#include "MantidAPI/BoxController.h"
#include "MantidVatesAPI/MDEWInMemoryLoadingPresenter.h"
#include "MantidVatesAPI/MDLoadingViewAdapter.h"
#include "MantidVatesAPI/ADSWorkspaceProvider.h"
Expand Down Expand Up @@ -230,6 +231,9 @@ int vtkMDEWSource::RequestInformation(vtkInformation *vtkNotUsed(request), vtkIn
}
else
{
// If the MDEvent workspace has had top level splitting applied to it, then use the a depth of 1
setDepthForWorkspaceWithTopLevelSplitting();

m_presenter->executeLoadMetadata();
setTimeRange(outputVector);
}
Expand Down Expand Up @@ -325,3 +329,17 @@ const char* vtkMDEWSource::GetWorkspaceName()
{
return m_wsName.c_str();
}

void vtkMDEWSource::setDepthForWorkspaceWithTopLevelSplitting()
{
// Fetch the workspace from the data analysis service
ADSWorkspaceProvider<Mantid::API::IMDEventWorkspace> workspaceProvider;
auto result = boost::dynamic_pointer_cast<Mantid::API::IMDEventWorkspace>(workspaceProvider.fetchWorkspace(m_wsName));
if (result) {
auto boxController = result->getBoxController();
boost::optional<std::vector<size_t>> topLevelSplits = boxController->getSplitTopInto();
if (topLevelSplits) {
SetDepth(1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,6 @@ class VTK_EXPORT vtkMDEWSource : public vtkUnstructuredGridAlgorithm
vtkMDEWSource(const vtkMDEWSource&);
void operator = (const vtkMDEWSource&);
void setTimeRange(vtkInformationVector* outputVector);
void setDepthForWorkspaceWithTopLevelSplitting();
};
#endif

0 comments on commit ec6b4b1

Please sign in to comment.