Skip to content

Commit

Permalink
Refs #6541. Adding axis labels for the rebinners.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed Feb 11, 2013
1 parent 4aa20e5 commit ca75a6e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ int vtkMDEWRebinningCutter::RequestData(vtkInformation* vtkNotUsed(request), vtk
delete p_1dMDFactory;

output->ShallowCopy(outData);

m_presenter->setAxisLabels(output);
}
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ int vtkRebinningTransformOperator::RequestData(vtkInformation* vtkNotUsed(reques
delete p_1dMDFactory;

output->ShallowCopy(outData);

m_presenter->setAxisLabels(output);
}
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ namespace Mantid

std::vector<double> getTimeStepValues() const;

virtual void setAxisLabels(vtkDataSet* visualDataSet);

/*-----------------------------------End MDRebinningPresenter methods -------------------------------------*/

MDEWRebinningPresenter(vtkDataSet* input, RebinningActionManager* request, MDRebinningView* view, const WorkspaceProvider& wsProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace Mantid
virtual const std::string& getAppliedGeometryXML() const = 0;
virtual bool hasTDimensionAvailable() const = 0;
virtual std::vector<double> getTimeStepValues() const = 0;
virtual void setAxisLabels(vtkDataSet* visualDataSet) = 0;
virtual ~MDRebinningPresenter(){}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ namespace Mantid

virtual bool hasTDimensionAvailable() const;

virtual void setAxisLabels(vtkDataSet* visualDataSet);

virtual ~NullRebinningPresenter();

private:
Expand Down
14 changes: 14 additions & 0 deletions Code/Mantid/Vates/VatesAPI/src/MDEWRebinningPresenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "MantidVatesAPI/vtkDataSetToImplicitFunction.h"
#include "MantidVatesAPI/vtkDataSetToWsLocation.h"
#include "MantidVatesAPI/vtkDataSetToWsName.h"
#include "MantidVatesAPI/Common.h"
#include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/ImplicitFunctionFactory.h"
#include "MantidKernel/VMD.h"
Expand Down Expand Up @@ -416,6 +417,19 @@ namespace Mantid
return timeStepValues;
}

void MDEWRebinningPresenter::setAxisLabels(vtkDataSet *visualDataSet)
{
Mantid::Geometry::MDGeometryXMLParser sourceGeometry(m_view->getAppliedGeometryXML());
sourceGeometry.execute();
vtkFieldData* fieldData = visualDataSet->GetFieldData();
setAxisLabel("AxisTitleForX",
makeAxisTitle(sourceGeometry.getXDimension()), fieldData);
setAxisLabel("AxisTitleForY",
makeAxisTitle(sourceGeometry.getYDimension()), fieldData);
setAxisLabel("AxisTitleForZ",
makeAxisTitle(sourceGeometry.getZDimension()), fieldData);
}

void MDEWRebinningPresenter::persistReductionKnowledge(vtkDataSet* out_ds, const
RebinningKnowledgeSerializer& xmlGenerator, const char* id)
{
Expand Down
5 changes: 5 additions & 0 deletions Code/Mantid/Vates/VatesAPI/src/NullRebinningPresenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@ namespace Mantid
throw std::runtime_error("NullRebinningPresenter does not implement this method. Misused");
}

void NullRebinningPresenter::setAxisLabels(vtkDataSet *visualDataSet)
{
UNUSED_ARG(visualDataSet);
throw std::runtime_error("NullRebinningPresenter does not implement this method. Misused");
}
}
}

0 comments on commit ca75a6e

Please sign in to comment.