Skip to content

Commit

Permalink
Refs #4240. Switching to new presenter and cleanup.
Browse files Browse the repository at this point in the history
The source is now switched to the new MDHWInMemoryLoadingPresenter. Also,
the depth parameter has been removed and the recusion depth call is wired
to return zero.
  • Loading branch information
Michael Reuter committed Dec 2, 2011
1 parent 43d483c commit 6e2cd1c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
information_only="1">
<SimpleStringInformationHelper />
</StringVectorProperty>
<IntVectorProperty
name="Recursion Depth"
command="SetDepth"
number_of_elements="1"
default_values="1000">
</IntVectorProperty>
<StringVectorProperty
name="Mantid Workspace Name"
command="SetWsName"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "vtkUnstructuredGrid.h"
#include "vtkStreamingDemandDrivenPipeline.h"

#include "MantidVatesAPI/MDEWInMemoryLoadingPresenter.h"
#include "MantidVatesAPI/MDHWInMemoryLoadingPresenter.h"
#include "MantidVatesAPI/MDLoadingViewAdapter.h"
#include "MantidVatesAPI/ADSWorkspaceProvider.h"
#include "MantidVatesAPI/TimeStepToTimeStep.h"
Expand All @@ -22,7 +22,7 @@ vtkCxxRevisionMacro(vtkMDHWSource, "$Revision: 1.0 $");
vtkStandardNewMacro(vtkMDHWSource);

/// Constructor
vtkMDHWSource::vtkMDHWSource() : m_wsName(""), m_depth(1000), m_time(0), m_presenter(NULL)
vtkMDHWSource::vtkMDHWSource() : m_wsName(""), m_time(0), m_presenter(NULL)
{
this->SetNumberOfInputPorts(0);
this->SetNumberOfOutputPorts(1);
Expand All @@ -34,20 +34,6 @@ vtkMDHWSource::~vtkMDHWSource()
delete m_presenter;
}

/*
Setter for the recursion depth
@param depth : recursion depth to use
*/
void vtkMDHWSource::SetDepth(int depth)
{
size_t temp = depth;
if(m_depth != temp)
{
this->m_depth = temp;
this->Modified();
}
}

/*
Setter for the workspace name.
@param name : workspace name to extract from ADS.
Expand Down Expand Up @@ -124,7 +110,7 @@ int vtkMDHWSource::RequestInformation(vtkInformation *vtkNotUsed(request), vtkIn
{
if(m_presenter == NULL && !m_wsName.empty())
{
m_presenter = new MDEWInMemoryLoadingPresenter(new MDLoadingViewAdapter<vtkMDHWSource>(this), new ADSWorkspaceProvider<Mantid::API::IMDEventWorkspace>, m_wsName);
m_presenter = new MDHWInMemoryLoadingPresenter(new MDLoadingViewAdapter<vtkMDHWSource>(this), new ADSWorkspaceProvider<Mantid::API::IMDHistoWorkspace>, m_wsName);
if(!m_presenter->canReadFile())
{
vtkErrorMacro(<<"Cannot fetch the specified workspace from Mantid ADS.");
Expand Down Expand Up @@ -168,7 +154,7 @@ Getter for the recursion depth.
*/
size_t vtkMDHWSource::getRecursionDepth() const
{
return this->m_depth;
return 0;
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ class VTK_EXPORT vtkMDHWSource : public vtkUnstructuredGridAlgorithm
/// Name of the workspace.
std::string m_wsName;

/// Recursion depth.
size_t m_depth;

/// Time.
double m_time;

Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Vates/VatesAPI/src/ADSWorkspaceProvider.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "MantidVatesAPI/ADSWorkspaceProvider.h"
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/IMDEventWorkspace.h"
#include "MantidAPI/IMDHistoWorkspace.h"
#include "MantidAPI/IMDWorkspace.h"
#include "MantidKernel/Exception.h"

Expand Down Expand Up @@ -50,6 +51,7 @@ namespace Mantid
//Templated assembled types.
template class ADSWorkspaceProvider<Mantid::API::IMDWorkspace>;
template class ADSWorkspaceProvider<Mantid::API::IMDEventWorkspace>;
template class ADSWorkspaceProvider<Mantid::API::IMDHistoWorkspace>;

}
}

0 comments on commit 6e2cd1c

Please sign in to comment.