Skip to content
Snippets Groups Projects
Commit 02671af1 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Run clang-tidy's performance-* checks on vates folder.

parent fd042c85
No related branches found
No related tags found
No related merge requests found
Showing
with 115 additions and 132 deletions
...@@ -66,7 +66,7 @@ public: ...@@ -66,7 +66,7 @@ public:
protected: protected:
bool m_isValid; bool m_isValid;
std::string parameterXMLTemplate(std::string valueXMLtext) const { std::string parameterXMLTemplate(const std::string &valueXMLtext) const {
using namespace Poco::XML; using namespace Poco::XML;
AutoPtr<Document> pDoc = new Document; AutoPtr<Document> pDoc = new Document;
AutoPtr<Element> paramElement = pDoc->createElement("Parameter"); AutoPtr<Element> paramElement = pDoc->createElement("Parameter");
......
...@@ -69,7 +69,7 @@ LogFilterGenerator::generateFilter(const std::string &logName) const { ...@@ -69,7 +69,7 @@ LogFilterGenerator::generateFilter(const std::string &logName) const {
break; break;
} }
return std::move(flt); return flt;
} }
/** /**
......
...@@ -108,7 +108,7 @@ private: ...@@ -108,7 +108,7 @@ private:
mutable IMDDimension_const_sptr m_spTDimension; mutable IMDDimension_const_sptr m_spTDimension;
/// Instantiate and apply the checking policy. /// Instantiate and apply the checking policy.
void applyPolicyChecking(IMDDimension_const_sptr dimensionToAdd) const; void applyPolicyChecking(const IMDDimension &dimensionToAdd) const;
/// Flag indicating that some change in the inputs has occured. Triggers full /// Flag indicating that some change in the inputs has occured. Triggers full
/// recreation. /// recreation.
...@@ -125,17 +125,16 @@ private: ...@@ -125,17 +125,16 @@ private:
@date May 2011 @date May 2011
@version 1.0 @version 1.0
*/ */
struct MANTID_GEOMETRY_DLL StrictDimensionPolicy struct MANTID_GEOMETRY_DLL StrictDimensionPolicy {
: public std::unary_function<IMDDimension_const_sptr, void> {
public: public:
StrictDimensionPolicy() {} StrictDimensionPolicy() {}
void operator()(IMDDimension_const_sptr item) { void operator()(const IMDDimension &item) {
if (true == item->getIsIntegrated()) { if (true == item.getIsIntegrated()) {
std::string message = "StrictDimensionPolicy bans the use of integrated " std::string message = "StrictDimensionPolicy bans the use of integrated "
"IMDDimensions mapped to x, y, z or t in a " "IMDDimensions mapped to x, y, z or t in a "
"IMDWorkspace."; "IMDWorkspace."
message += "Attempted to do so with IMDDimension: " +
"Attempted to do so with IMDDimension: " + item->getDimensionId(); item.getDimensionId();
throw std::invalid_argument(message); throw std::invalid_argument(message);
} }
} }
...@@ -147,9 +146,8 @@ public: ...@@ -147,9 +146,8 @@ public:
@author Owen Arnold @author Owen Arnold
@date May 2011 @date May 2011
*/ */
struct MANTID_GEOMETRY_DLL NoDimensionPolicy struct MANTID_GEOMETRY_DLL NoDimensionPolicy {
: public std::unary_function<IMDDimension_const_sptr, void> { void operator()(const IMDDimension &) {
void operator()(IMDDimension_const_sptr) {
// Do nothing. // Do nothing.
} }
}; };
......
...@@ -23,14 +23,13 @@ namespace Geometry { ...@@ -23,14 +23,13 @@ namespace Geometry {
@author Owen Arnold @author Owen Arnold
@date May 2011 @date May 2011
*/ */
struct CompareIMDDimension_const_sptr struct CompareIMDDimension_const_sptr {
: public std::unary_function<IMDDimension_const_sptr, bool> {
private: private:
IMDDimension_const_sptr _a; IMDDimension_const_sptr _a;
public: public:
explicit CompareIMDDimension_const_sptr(IMDDimension_const_sptr a) : _a(a) {} explicit CompareIMDDimension_const_sptr(IMDDimension_const_sptr a)
bool operator()(IMDDimension_const_sptr b) { : _a(std::move(a)) {}
bool operator()(const IMDDimension_const_sptr &b) {
return _a->getDimensionId() == b->getDimensionId(); return _a->getDimensionId() == b->getDimensionId();
} }
}; };
...@@ -44,12 +43,12 @@ template <typename CheckDimensionPolicy> ...@@ -44,12 +43,12 @@ template <typename CheckDimensionPolicy>
bool MDGeometryBuilderXML<CheckDimensionPolicy>::addOrdinaryDimension( bool MDGeometryBuilderXML<CheckDimensionPolicy>::addOrdinaryDimension(
IMDDimension_const_sptr dimensionToAdd) const { IMDDimension_const_sptr dimensionToAdd) const {
bool bAdded = false; // Addition fails by default. bool bAdded = false; // Addition fails by default.
if (dimensionToAdd.get() != nullptr) { if (dimensionToAdd) {
CompareIMDDimension_const_sptr comparitor(dimensionToAdd); CompareIMDDimension_const_sptr comparitor(dimensionToAdd);
auto location = std::find_if(m_vecDimensions.begin(), m_vecDimensions.end(), auto location = std::find_if(m_vecDimensions.begin(), m_vecDimensions.end(),
comparitor); comparitor);
if (location == m_vecDimensions.end()) { if (location == m_vecDimensions.end()) {
m_vecDimensions.push_back(dimensionToAdd); m_vecDimensions.push_back(std::move(dimensionToAdd));
bAdded = true; bAdded = true;
m_changed = true; m_changed = true;
} }
...@@ -104,7 +103,7 @@ MDGeometryBuilderXML<CheckDimensionPolicy> & ...@@ -104,7 +103,7 @@ MDGeometryBuilderXML<CheckDimensionPolicy> &
*/ */
template <typename CheckDimensionPolicy> template <typename CheckDimensionPolicy>
void MDGeometryBuilderXML<CheckDimensionPolicy>::applyPolicyChecking( void MDGeometryBuilderXML<CheckDimensionPolicy>::applyPolicyChecking(
IMDDimension_const_sptr dimensionToAdd) const { const IMDDimension &dimensionToAdd) const {
CheckDimensionPolicy policy; CheckDimensionPolicy policy;
policy(dimensionToAdd); policy(dimensionToAdd);
} }
...@@ -119,10 +118,10 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addXDimension( ...@@ -119,10 +118,10 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addXDimension(
IMDDimension_const_sptr dimension) const { IMDDimension_const_sptr dimension) const {
bool bAdded = false; bool bAdded = false;
if (dimension.get() != nullptr) { if (dimension) {
applyPolicyChecking(dimension); applyPolicyChecking(*dimension);
addOrdinaryDimension(dimension); addOrdinaryDimension(dimension);
m_spXDimension = dimension; m_spXDimension = std::move(dimension);
m_changed = true; m_changed = true;
bAdded = true; bAdded = true;
} }
...@@ -139,10 +138,10 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addYDimension( ...@@ -139,10 +138,10 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addYDimension(
IMDDimension_const_sptr dimension) const { IMDDimension_const_sptr dimension) const {
bool bAdded = false; bool bAdded = false;
if (dimension.get() != nullptr) { if (dimension) {
applyPolicyChecking(dimension); applyPolicyChecking(*dimension);
addOrdinaryDimension(dimension); addOrdinaryDimension(dimension);
m_spYDimension = dimension; m_spYDimension = std::move(dimension);
m_changed = true; m_changed = true;
bAdded = true; bAdded = true;
} }
...@@ -158,10 +157,10 @@ template <typename CheckDimensionPolicy> ...@@ -158,10 +157,10 @@ template <typename CheckDimensionPolicy>
bool MDGeometryBuilderXML<CheckDimensionPolicy>::addZDimension( bool MDGeometryBuilderXML<CheckDimensionPolicy>::addZDimension(
IMDDimension_const_sptr dimension) const { IMDDimension_const_sptr dimension) const {
bool bAdded = false; bool bAdded = false;
if (dimension.get() != nullptr) { if (dimension) {
applyPolicyChecking(dimension); applyPolicyChecking(*dimension);
addOrdinaryDimension(dimension); addOrdinaryDimension(dimension);
m_spZDimension = dimension; m_spZDimension = std::move(dimension);
m_changed = true; m_changed = true;
bAdded = true; bAdded = true;
} }
...@@ -178,10 +177,10 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addTDimension( ...@@ -178,10 +177,10 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addTDimension(
IMDDimension_const_sptr dimension) const { IMDDimension_const_sptr dimension) const {
bool bAdded = false; bool bAdded = false;
if (dimension.get() != nullptr) { if (dimension) {
applyPolicyChecking(dimension); applyPolicyChecking(*dimension);
addOrdinaryDimension(dimension); addOrdinaryDimension(dimension);
m_spTDimension = dimension; m_spTDimension = std::move(dimension);
m_changed = true; m_changed = true;
bAdded = true; bAdded = true;
} }
......
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
#include <boost/type_traits.hpp> #include <boost/type_traits.hpp>
#endif #endif
#include <vector>
#include <unordered_set> #include <unordered_set>
#include <utility>
#include <vector>
namespace Json { namespace Json {
class Value; class Value;
...@@ -296,11 +297,12 @@ protected: ...@@ -296,11 +297,12 @@ protected:
*/ */
void declareProperty( void declareProperty(
const std::string &name, const char *value, const std::string &name, const char *value,
IValidator_sptr validator = IValidator_sptr(new NullValidator), IValidator_sptr validator = boost::make_shared<NullValidator>(),
const std::string &doc = "", const std::string &doc = std::string(),
const unsigned int direction = Direction::Input) { const unsigned int direction = Direction::Input) {
// Simply call templated method, converting character array to a string // Simply call templated method, converting character array to a string
declareProperty(name, std::string(value), validator, doc, direction); declareProperty(name, std::string(value), std::move(validator), doc,
direction);
} }
/** Specialised version of declareProperty template method to prevent the /** Specialised version of declareProperty template method to prevent the
...@@ -325,7 +327,8 @@ protected: ...@@ -325,7 +327,8 @@ protected:
IValidator_sptr validator = IValidator_sptr(new NullValidator), IValidator_sptr validator = IValidator_sptr(new NullValidator),
const unsigned int direction = Direction::Input) { const unsigned int direction = Direction::Input) {
// Simply call templated method, converting character array to a string // Simply call templated method, converting character array to a string
declareProperty(name, std::string(value), validator, doc, direction); declareProperty(name, std::string(value), std::move(validator), doc,
direction);
} }
/** Add a property of string type to the list of managed properties /** Add a property of string type to the list of managed properties
......
...@@ -57,7 +57,7 @@ namespace Strings { ...@@ -57,7 +57,7 @@ namespace Strings {
*/ */
template <typename ITERATOR_TYPE> template <typename ITERATOR_TYPE>
DLLExport std::string join(ITERATOR_TYPE begin, ITERATOR_TYPE end, DLLExport std::string join(ITERATOR_TYPE begin, ITERATOR_TYPE end,
const std::string separator) { const std::string &separator) {
std::ostringstream output; std::ostringstream output;
ITERATOR_TYPE it; ITERATOR_TYPE it;
for (it = begin; it != end;) { for (it = begin; it != end;) {
......
...@@ -3,26 +3,26 @@ ...@@ -3,26 +3,26 @@
#include "vtkBox.h" #include "vtkBox.h"
#include "vtkInformation.h" #include "vtkInformation.h"
#include "vtkInformationVector.h" #include "vtkInformationVector.h"
#include "vtkNew.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
#include "vtkPVClipDataSet.h" #include "vtkPVClipDataSet.h"
#include "vtkPVInformationKeys.h" #include "vtkPVInformationKeys.h"
#include "vtkUnstructuredGridAlgorithm.h"
#include "vtkUnstructuredGrid.h"
#include "vtkStreamingDemandDrivenPipeline.h" #include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkNew.h" #include "vtkUnstructuredGrid.h"
#include "vtkUnstructuredGridAlgorithm.h"
#include "MantidVatesAPI/BoxInfo.h"
#include "MantidAPI/IMDWorkspace.h"
#include "MantidAPI/IMDEventWorkspace.h" #include "MantidAPI/IMDEventWorkspace.h"
#include "MantidAPI/IMDWorkspace.h"
#include "MantidKernel/WarningSuppressions.h"
#include "MantidVatesAPI/ADSWorkspaceProvider.h"
#include "MantidVatesAPI/BoxInfo.h"
#include "MantidVatesAPI/FilteringUpdateProgressAction.h"
#include "MantidVatesAPI/MDEWInMemoryLoadingPresenter.h" #include "MantidVatesAPI/MDEWInMemoryLoadingPresenter.h"
#include "MantidVatesAPI/MDLoadingViewAdapter.h" #include "MantidVatesAPI/MDLoadingViewAdapter.h"
#include "MantidVatesAPI/ADSWorkspaceProvider.h" #include "MantidVatesAPI/vtkMD0DFactory.h"
#include "MantidVatesAPI/vtkMDHexFactory.h" #include "MantidVatesAPI/vtkMDHexFactory.h"
#include "MantidVatesAPI/vtkMDQuadFactory.h"
#include "MantidVatesAPI/vtkMDLineFactory.h" #include "MantidVatesAPI/vtkMDLineFactory.h"
#include "MantidVatesAPI/vtkMD0DFactory.h" #include "MantidVatesAPI/vtkMDQuadFactory.h"
#include "MantidVatesAPI/FilteringUpdateProgressAction.h"
#include "MantidKernel/WarningSuppressions.h"
#include <boost/optional.hpp> #include <boost/optional.hpp>
...@@ -44,13 +44,11 @@ vtkMDEWSource::~vtkMDEWSource() {} ...@@ -44,13 +44,11 @@ vtkMDEWSource::~vtkMDEWSource() {}
Setter for the recursion depth Setter for the recursion depth
@param depth : recursion depth to use @param depth : recursion depth to use
*/ */
void vtkMDEWSource::SetDepth(int depth) void vtkMDEWSource::SetDepth(int depth) {
{
size_t temp = depth; size_t temp = depth;
if(m_depth != temp) if (m_depth != temp) {
{ this->m_depth = temp;
this->m_depth = temp; this->Modified();
this->Modified();
} }
} }
...@@ -58,10 +56,8 @@ void vtkMDEWSource::SetDepth(int depth) ...@@ -58,10 +56,8 @@ void vtkMDEWSource::SetDepth(int depth)
Setter for the workspace name. Setter for the workspace name.
@param name : workspace name to extract from ADS. @param name : workspace name to extract from ADS.
*/ */
void vtkMDEWSource::SetWsName(std::string name) void vtkMDEWSource::SetWsName(const std::string &name) {
{ if (m_wsName != name && name != "") {
if(m_wsName != name && name != "")
{
m_wsName = name; m_wsName = name;
this->Modified(); this->Modified();
} }
...@@ -147,32 +143,32 @@ std::string vtkMDEWSource::GetInstrument() { ...@@ -147,32 +143,32 @@ std::string vtkMDEWSource::GetInstrument() {
} }
/** /**
Set the normalization option. This is how the signal data will be normalized before viewing. Set the normalization option. This is how the signal data will be normalized
before viewing.
@param option : Normalization option @param option : Normalization option
*/ */
void vtkMDEWSource::SetNormalization(int option) void vtkMDEWSource::SetNormalization(int option) {
{
m_normalization = static_cast<Mantid::VATES::VisualNormalization>(option); m_normalization = static_cast<Mantid::VATES::VisualNormalization>(option);
this->Modified(); this->Modified();
} }
int vtkMDEWSource::RequestData(vtkInformation *, vtkInformationVector **,
int vtkMDEWSource::RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *outputVector) vtkInformationVector *outputVector) {
{ if (m_presenter->canReadFile()) {
if(m_presenter->canReadFile())
{
using namespace Mantid::VATES; using namespace Mantid::VATES;
//get the info objects // get the info objects
vtkInformation *outInfo = outputVector->GetInformationObject(0); vtkInformation *outInfo = outputVector->GetInformationObject(0);
if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP())) if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP())) {
{
// usually only one actual step requested // usually only one actual step requested
m_time =outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()); m_time =
outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
} }
FilterUpdateProgressAction<vtkMDEWSource> loadingProgressUpdate(this, "Loading..."); FilterUpdateProgressAction<vtkMDEWSource> loadingProgressUpdate(
FilterUpdateProgressAction<vtkMDEWSource> drawingProgressUpdate(this, "Drawing..."); this, "Loading...");
FilterUpdateProgressAction<vtkMDEWSource> drawingProgressUpdate(
this, "Drawing...");
auto hexahedronFactory = auto hexahedronFactory =
Mantid::Kernel::make_unique<vtkMDHexFactory>(m_normalization); Mantid::Kernel::make_unique<vtkMDHexFactory>(m_normalization);
...@@ -189,7 +185,8 @@ int vtkMDEWSource::RequestData(vtkInformation *, vtkInformationVector **, vtkInf ...@@ -189,7 +185,8 @@ int vtkMDEWSource::RequestData(vtkInformation *, vtkInformationVector **, vtkInf
product = m_presenter->execute( product = m_presenter->execute(
hexahedronFactory.get(), loadingProgressUpdate, drawingProgressUpdate); hexahedronFactory.get(), loadingProgressUpdate, drawingProgressUpdate);
//-------------------------------------------------------- Corrects problem whereby boundaries not set propertly in PV. //-------------------------------------------------------- Corrects problem
// whereby boundaries not set propertly in PV.
auto box = vtkSmartPointer<vtkBox>::New(); auto box = vtkSmartPointer<vtkBox>::New();
box->SetBounds(product->GetBounds()); box->SetBounds(product->GetBounds());
auto clipper = vtkSmartPointer<vtkPVClipDataSet>::New(); auto clipper = vtkSmartPointer<vtkPVClipDataSet>::New();
...@@ -201,18 +198,16 @@ int vtkMDEWSource::RequestData(vtkInformation *, vtkInformationVector **, vtkInf ...@@ -201,18 +198,16 @@ int vtkMDEWSource::RequestData(vtkInformation *, vtkInformationVector **, vtkInf
//-------------------------------------------------------- //--------------------------------------------------------
vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast( vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT())); outInfo->Get(vtkDataObject::DATA_OBJECT()));
output->ShallowCopy(clipperOutput); output->ShallowCopy(clipperOutput);
try try {
{ auto workspaceProvider = Mantid::Kernel::make_unique<
auto workspaceProvider = Mantid::Kernel::make_unique<ADSWorkspaceProvider<Mantid::API::IMDWorkspace>>(); ADSWorkspaceProvider<Mantid::API::IMDWorkspace>>();
m_presenter->makeNonOrthogonal(output, std::move(workspaceProvider), m_presenter->makeNonOrthogonal(output, std::move(workspaceProvider),
&drawingProgressUpdate); &drawingProgressUpdate);
} } catch (std::invalid_argument &e) {
catch (std::invalid_argument &e) std::string error = e.what();
{
std::string error = e.what();
vtkDebugMacro(<< "Workspace does not have correct information to " vtkDebugMacro(<< "Workspace does not have correct information to "
<< "plot non-orthogonal axes. " << error); << "plot non-orthogonal axes. " << error);
// Add the standard change of basis matrix and set the boundaries // Add the standard change of basis matrix and set the boundaries
...@@ -239,9 +234,10 @@ int vtkMDEWSource::RequestInformation( ...@@ -239,9 +234,10 @@ int vtkMDEWSource::RequestInformation(
if (m_presenter->canReadFile()) { if (m_presenter->canReadFile()) {
// If the MDEvent workspace has had top level splitting applied to it, // If the MDEvent workspace has had top level splitting applied to it,
// then use the a deptgit stah of 1 // then use the a deptgit stah of 1
auto workspaceProvider = Mantid::Kernel::make_unique<ADSWorkspaceProvider<Mantid::API::IMDEventWorkspace>>(); auto workspaceProvider = Mantid::Kernel::make_unique<
if (auto split = ADSWorkspaceProvider<Mantid::API::IMDEventWorkspace>>();
Mantid::VATES::findRecursionDepthForTopLevelSplitting(m_wsName, std::move(workspaceProvider))) { if (auto split = Mantid::VATES::findRecursionDepthForTopLevelSplitting(
m_wsName, *workspaceProvider)) {
SetDepth(split.get()); SetDepth(split.get());
} }
...@@ -254,24 +250,21 @@ int vtkMDEWSource::RequestInformation( ...@@ -254,24 +250,21 @@ int vtkMDEWSource::RequestInformation(
return 1; return 1;
} }
void vtkMDEWSource::PrintSelf(ostream& os, vtkIndent indent) void vtkMDEWSource::PrintSelf(ostream &os, vtkIndent indent) {
{
this->Superclass::PrintSelf(os, indent); this->Superclass::PrintSelf(os, indent);
} }
/** Helper function to setup the time range. /** Helper function to setup the time range.
@param outputVector : vector onto which the time range will be set. @param outputVector : vector onto which the time range will be set.
*/ */
void vtkMDEWSource::setTimeRange(vtkInformationVector* outputVector) void vtkMDEWSource::setTimeRange(vtkInformationVector *outputVector) {
{ if (m_presenter->hasTDimensionAvailable()) {
if(m_presenter->hasTDimensionAvailable())
{
vtkInformation *outInfo = outputVector->GetInformationObject(0); vtkInformation *outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkPVInformationKeys::TIME_LABEL_ANNOTATION(), outInfo->Set(vtkPVInformationKeys::TIME_LABEL_ANNOTATION(),
m_presenter->getTimeStepLabel().c_str()); m_presenter->getTimeStepLabel().c_str());
std::vector<double> timeStepValues = m_presenter->getTimeStepValues(); std::vector<double> timeStepValues = m_presenter->getTimeStepValues();
outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &timeStepValues[0], outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),
static_cast<int> (timeStepValues.size())); &timeStepValues[0], static_cast<int>(timeStepValues.size()));
double timeRange[2]; double timeRange[2];
timeRange[0] = timeStepValues.front(); timeRange[0] = timeStepValues.front();
timeRange[1] = timeStepValues.back(); timeRange[1] = timeStepValues.back();
...@@ -284,35 +277,26 @@ void vtkMDEWSource::setTimeRange(vtkInformationVector* outputVector) ...@@ -284,35 +277,26 @@ void vtkMDEWSource::setTimeRange(vtkInformationVector* outputVector)
Getter for the recursion depth. Getter for the recursion depth.
@return depth @return depth
*/ */
size_t vtkMDEWSource::getRecursionDepth() const size_t vtkMDEWSource::getRecursionDepth() const { return this->m_depth; }
{
return this->m_depth;
}
/* /*
Getter for the load in memory status Getter for the load in memory status
@return true. @return true.
*/ */
bool vtkMDEWSource::getLoadInMemory() const bool vtkMDEWSource::getLoadInMemory() const { return true; }
{
return true;
}
/*Getter for the time /*Getter for the time
@return the time. @return the time.
*/ */
double vtkMDEWSource::getTime() const double vtkMDEWSource::getTime() const { return m_time; }
{
return m_time;
}
/* /*
Setter for the algorithm progress. Setter for the algorithm progress.
@param progress : progress increment @param progress : progress increment
@param message : progress message @param message : progress message
*/ */
void vtkMDEWSource::updateAlgorithmProgress(double progress, const std::string& message) void vtkMDEWSource::updateAlgorithmProgress(double progress,
{ const std::string &message) {
this->SetProgressText(message.c_str()); this->SetProgressText(message.c_str());
this->UpdateProgress(progress); this->UpdateProgress(progress);
} }
......
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
vtkTypeMacro(vtkMDEWSource, vtkUnstructuredGridAlgorithm) void PrintSelf( vtkTypeMacro(vtkMDEWSource, vtkUnstructuredGridAlgorithm) void PrintSelf(
ostream &os, vtkIndent indent) override; ostream &os, vtkIndent indent) override;
void SetWsName(std::string wsName); void SetWsName(const std::string &wsName);
void SetDepth(int depth); void SetDepth(int depth);
void SetNormalization(int option); void SetNormalization(int option);
......
...@@ -40,8 +40,7 @@ vtkPeaksSource::~vtkPeaksSource() ...@@ -40,8 +40,7 @@ vtkPeaksSource::~vtkPeaksSource()
Setter for the workspace name. Setter for the workspace name.
@param name : workspace name to extract from ADS. @param name : workspace name to extract from ADS.
*/ */
void vtkPeaksSource::SetWsName(std::string name) void vtkPeaksSource::SetWsName(const std::string &name) {
{
if (!name.empty()) if (!name.empty())
{ {
m_wsName = name; m_wsName = name;
......
...@@ -45,7 +45,7 @@ public: ...@@ -45,7 +45,7 @@ public:
vtkPolyDataAlgorithm) void PrintSelf(ostream &os, vtkPolyDataAlgorithm) void PrintSelf(ostream &os,
vtkIndent indent) override; vtkIndent indent) override;
void SetWsName(std::string wsName); void SetWsName(const std::string &wsName);
void SetPeakDimension(int dim); void SetPeakDimension(int dim);
/// Setter for the unitegrated peak marker size /// Setter for the unitegrated peak marker size
void SetUnintPeakMarkerSize(double mSize); void SetUnintPeakMarkerSize(double mSize);
......
...@@ -42,7 +42,7 @@ Code Documentation is available at: <http://doxygen.mantidproject.org> ...@@ -42,7 +42,7 @@ Code Documentation is available at: <http://doxygen.mantidproject.org>
*/ */
boost::optional<int> DLLExport findRecursionDepthForTopLevelSplitting( boost::optional<int> DLLExport findRecursionDepthForTopLevelSplitting(
const std::string &workspaceName, const std::string &workspaceName,
std::unique_ptr<WorkspaceProvider> workspaceProvider); const WorkspaceProvider &workspaceProvider);
} }
} }
......
...@@ -37,9 +37,9 @@ public: ...@@ -37,9 +37,9 @@ public:
void removePresenter(const std::string &peaksWorkspaceName); void removePresenter(const std::string &peaksWorkspaceName);
void updateWorkspaces(const std::vector<std::string> &peaksWorkspaceNames); void updateWorkspaces(const std::vector<std::string> &peaksWorkspaceNames);
void sortPeaksWorkspace(const std::string &, const bool) override {} void sortPeaksWorkspace(const std::string &, const bool) override {}
void sortPeaksWorkspace( void sortPeaksWorkspace(const std::string &columnToSortBy,
const std::string &columnToSortBy, const bool sortedAscending, const bool sortedAscending,
boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS); const Mantid::API::IPeaksWorkspace *peaksWS);
bool hasPeaks(); bool hasPeaks();
private: private:
...@@ -48,4 +48,4 @@ private: ...@@ -48,4 +48,4 @@ private:
}; };
} }
} }
#endif #endif
\ No newline at end of file
...@@ -32,7 +32,7 @@ public: ...@@ -32,7 +32,7 @@ public:
private: private:
/// Get the max radius. /// Get the max radius.
double getMaxRadius(Mantid::Geometry::PeakShape_sptr shape) const; double getMaxRadius(const Mantid::Geometry::PeakShape &shape) const;
/// Viewable Peaks /// Viewable Peaks
mutable std::vector<bool> m_viewablePeaks; mutable std::vector<bool> m_viewablePeaks;
/// The viewable region /// The viewable region
...@@ -44,4 +44,4 @@ private: ...@@ -44,4 +44,4 @@ private:
}; };
} }
} }
#endif #endif
\ No newline at end of file
...@@ -37,7 +37,7 @@ class MDLoadingView; ...@@ -37,7 +37,7 @@ class MDLoadingView;
class DLLExport EventNexusLoadingPresenter : public MDEWLoadingPresenter { class DLLExport EventNexusLoadingPresenter : public MDEWLoadingPresenter {
public: public:
EventNexusLoadingPresenter(std::unique_ptr<MDLoadingView> view, EventNexusLoadingPresenter(std::unique_ptr<MDLoadingView> view,
const std::string fileName); const std::string &fileName);
vtkSmartPointer<vtkDataSet> vtkSmartPointer<vtkDataSet>
execute(vtkDataSetFactory *factory, ProgressAction &loadingProgressUpdate, execute(vtkDataSetFactory *factory, ProgressAction &loadingProgressUpdate,
ProgressAction &drawingProgressUpdate) override; ProgressAction &drawingProgressUpdate) override;
......
...@@ -33,8 +33,8 @@ void DLLExport applyCOBMatrixSettingsToVtkDataSet( ...@@ -33,8 +33,8 @@ void DLLExport applyCOBMatrixSettingsToVtkDataSet(
std::unique_ptr<Mantid::VATES::WorkspaceProvider> workspaceProvider); std::unique_ptr<Mantid::VATES::WorkspaceProvider> workspaceProvider);
/// Function to get clipped data sets. /// Function to get clipped data sets.
vtkSmartPointer<vtkPVClipDataSet> DLLExport vtkSmartPointer<vtkPVClipDataSet>
getClippedDataSet(vtkSmartPointer<vtkDataSet> dataSet); DLLExport getClippedDataSet(const vtkSmartPointer<vtkDataSet> &dataSet);
/// Create name with timestamp attached. /// Create name with timestamp attached.
std::string DLLExport createTimeStampedName(const std::string &name); std::string DLLExport createTimeStampedName(const std::string &name);
......
...@@ -41,7 +41,7 @@ class DLLExport FieldDataToMetadata ...@@ -41,7 +41,7 @@ class DLLExport FieldDataToMetadata
: public std::binary_function<vtkFieldData *, std::string, std::string> { : public std::binary_function<vtkFieldData *, std::string, std::string> {
public: public:
/// Act as Functor. /// Act as Functor.
std::string operator()(vtkFieldData *fieldData, std::string id) const; std::string operator()(vtkFieldData *fieldData, const std::string &id) const;
/// Explicit call to Functor execution. /// Explicit call to Functor execution.
std::string execute(vtkFieldData *fieldData, const std::string &id) const; std::string execute(vtkFieldData *fieldData, const std::string &id) const;
......
...@@ -45,13 +45,13 @@ public: ...@@ -45,13 +45,13 @@ public:
/// Destructor /// Destructor
~IMDDimensionComparitor(); ~IMDDimensionComparitor();
bool isXDimension(Mantid::Geometry::IMDDimension_const_sptr queryDimension); bool isXDimension(const Mantid::Geometry::IMDDimension &queryDimension);
bool isYDimension(Mantid::Geometry::IMDDimension_const_sptr queryDimension); bool isYDimension(const Mantid::Geometry::IMDDimension &queryDimension);
bool isZDimension(Mantid::Geometry::IMDDimension_const_sptr queryDimension); bool isZDimension(const Mantid::Geometry::IMDDimension &queryDimension);
bool istDimension(Mantid::Geometry::IMDDimension_const_sptr queryDimension); bool istDimension(const Mantid::Geometry::IMDDimension &queryDimension);
private: private:
/// imd workspace shared ptr. /// imd workspace shared ptr.
......
...@@ -38,7 +38,7 @@ class MDLoadingView; ...@@ -38,7 +38,7 @@ class MDLoadingView;
class DLLExport MDHWNexusLoadingPresenter : public MDHWLoadingPresenter { class DLLExport MDHWNexusLoadingPresenter : public MDHWLoadingPresenter {
public: public:
MDHWNexusLoadingPresenter(std::unique_ptr<MDLoadingView> view, MDHWNexusLoadingPresenter(std::unique_ptr<MDLoadingView> view,
const std::string fileName); const std::string &fileName);
vtkSmartPointer<vtkDataSet> vtkSmartPointer<vtkDataSet>
execute(vtkDataSetFactory *factory, ProgressAction &rebinningProgressUpdate, execute(vtkDataSetFactory *factory, ProgressAction &rebinningProgressUpdate,
ProgressAction &drawingProgressUpdate) override; ProgressAction &drawingProgressUpdate) override;
......
...@@ -47,14 +47,14 @@ public: ...@@ -47,14 +47,14 @@ public:
* @param workspace A pointer to the workspace * @param workspace A pointer to the workspace
* @returns A pair of minimum and maximum values. * @returns A pair of minimum and maximum values.
*/ */
QwtDoubleInterval getMinAndMax(Mantid::API::IMDWorkspace_sptr workspace); QwtDoubleInterval getMinAndMax(const Mantid::API::IMDWorkspace *workspace);
/** /**
* Extracts the instrument from the workspace. * Extracts the instrument from the workspace.
* @param workspace A pointer to a workspace. * @param workspace A pointer to a workspace.
* @returns The instrument. * @returns The instrument.
*/ */
std::string extractInstrument(Mantid::API::IMDWorkspace_sptr workspace); std::string extractInstrument(const Mantid::API::IMDWorkspace *workspace);
private: private:
/** /**
...@@ -69,4 +69,4 @@ private: ...@@ -69,4 +69,4 @@ private:
}; };
} }
} }
#endif #endif
\ No newline at end of file
...@@ -43,9 +43,9 @@ public: ...@@ -43,9 +43,9 @@ public:
std::string getSerializedJson(); std::string getSerializedJson();
void readInSerializedJson(std::string serializedJson); void readInSerializedJson(const std::string &serializedJson);
void setInstrument(std::string instrument); void setInstrument(const std::string &instrument);
std::string &getInstrument(); std::string &getInstrument();
void setMinValue(double minValue); void setMinValue(double minValue);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment