diff --git a/Framework/API/inc/MantidAPI/ImplicitFunctionParameter.h b/Framework/API/inc/MantidAPI/ImplicitFunctionParameter.h index 4c846f12313be81a78104827e3c6b81f2f729107..f8a5a4bcc7d2bc17494c6f9e50a7bc57eb869aba 100644 --- a/Framework/API/inc/MantidAPI/ImplicitFunctionParameter.h +++ b/Framework/API/inc/MantidAPI/ImplicitFunctionParameter.h @@ -66,7 +66,7 @@ public: protected: bool m_isValid; - std::string parameterXMLTemplate(std::string valueXMLtext) const { + std::string parameterXMLTemplate(const std::string &valueXMLtext) const { using namespace Poco::XML; AutoPtr<Document> pDoc = new Document; AutoPtr<Element> paramElement = pDoc->createElement("Parameter"); diff --git a/Framework/API/src/LogFilterGenerator.cpp b/Framework/API/src/LogFilterGenerator.cpp index badb1d6af9db53d2f2a6c941a4c5a3a628bcb8a3..bbf0ebbab67e8bdb0fd2758dbe6d12015fd76edd 100644 --- a/Framework/API/src/LogFilterGenerator.cpp +++ b/Framework/API/src/LogFilterGenerator.cpp @@ -69,7 +69,7 @@ LogFilterGenerator::generateFilter(const std::string &logName) const { break; } - return std::move(flt); + return flt; } /** diff --git a/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h b/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h index 15addeb270351e4b842b85724ff2220849c366c5..40753107697782a78c8c9f7b9ac4e10193e90d34 100644 --- a/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h +++ b/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h @@ -108,7 +108,7 @@ private: mutable IMDDimension_const_sptr m_spTDimension; /// 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 /// recreation. @@ -125,17 +125,16 @@ private: @date May 2011 @version 1.0 */ -struct MANTID_GEOMETRY_DLL StrictDimensionPolicy - : public std::unary_function<IMDDimension_const_sptr, void> { +struct MANTID_GEOMETRY_DLL StrictDimensionPolicy { public: StrictDimensionPolicy() {} - void operator()(IMDDimension_const_sptr item) { - if (true == item->getIsIntegrated()) { + void operator()(const IMDDimension &item) { + if (true == item.getIsIntegrated()) { std::string message = "StrictDimensionPolicy bans the use of integrated " "IMDDimensions mapped to x, y, z or t in a " - "IMDWorkspace."; - message += - "Attempted to do so with IMDDimension: " + item->getDimensionId(); + "IMDWorkspace." + "Attempted to do so with IMDDimension: " + + item.getDimensionId(); throw std::invalid_argument(message); } } @@ -147,9 +146,8 @@ public: @author Owen Arnold @date May 2011 */ -struct MANTID_GEOMETRY_DLL NoDimensionPolicy - : public std::unary_function<IMDDimension_const_sptr, void> { - void operator()(IMDDimension_const_sptr) { +struct MANTID_GEOMETRY_DLL NoDimensionPolicy { + void operator()(const IMDDimension &) { // Do nothing. } }; diff --git a/Framework/Geometry/src/MDGeometry/MDGeometryXMLBuilder.cpp b/Framework/Geometry/src/MDGeometry/MDGeometryXMLBuilder.cpp index 036968a097705ebf82c2ecda830f7f9b7d6b1d2c..2d4760c9b1a5a47e2bf37e7fb8f34483662a0079 100644 --- a/Framework/Geometry/src/MDGeometry/MDGeometryXMLBuilder.cpp +++ b/Framework/Geometry/src/MDGeometry/MDGeometryXMLBuilder.cpp @@ -23,14 +23,13 @@ namespace Geometry { @author Owen Arnold @date May 2011 */ -struct CompareIMDDimension_const_sptr - : public std::unary_function<IMDDimension_const_sptr, bool> { +struct CompareIMDDimension_const_sptr { private: IMDDimension_const_sptr _a; - public: - explicit CompareIMDDimension_const_sptr(IMDDimension_const_sptr a) : _a(a) {} - bool operator()(IMDDimension_const_sptr b) { + explicit CompareIMDDimension_const_sptr(IMDDimension_const_sptr a) + : _a(std::move(a)) {} + bool operator()(const IMDDimension_const_sptr &b) { return _a->getDimensionId() == b->getDimensionId(); } }; @@ -44,12 +43,12 @@ template <typename CheckDimensionPolicy> bool MDGeometryBuilderXML<CheckDimensionPolicy>::addOrdinaryDimension( IMDDimension_const_sptr dimensionToAdd) const { bool bAdded = false; // Addition fails by default. - if (dimensionToAdd.get() != nullptr) { + if (dimensionToAdd) { CompareIMDDimension_const_sptr comparitor(dimensionToAdd); auto location = std::find_if(m_vecDimensions.begin(), m_vecDimensions.end(), comparitor); if (location == m_vecDimensions.end()) { - m_vecDimensions.push_back(dimensionToAdd); + m_vecDimensions.push_back(std::move(dimensionToAdd)); bAdded = true; m_changed = true; } @@ -104,7 +103,7 @@ MDGeometryBuilderXML<CheckDimensionPolicy> & */ template <typename CheckDimensionPolicy> void MDGeometryBuilderXML<CheckDimensionPolicy>::applyPolicyChecking( - IMDDimension_const_sptr dimensionToAdd) const { + const IMDDimension &dimensionToAdd) const { CheckDimensionPolicy policy; policy(dimensionToAdd); } @@ -119,10 +118,10 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addXDimension( IMDDimension_const_sptr dimension) const { bool bAdded = false; - if (dimension.get() != nullptr) { - applyPolicyChecking(dimension); + if (dimension) { + applyPolicyChecking(*dimension); addOrdinaryDimension(dimension); - m_spXDimension = dimension; + m_spXDimension = std::move(dimension); m_changed = true; bAdded = true; } @@ -139,10 +138,10 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addYDimension( IMDDimension_const_sptr dimension) const { bool bAdded = false; - if (dimension.get() != nullptr) { - applyPolicyChecking(dimension); + if (dimension) { + applyPolicyChecking(*dimension); addOrdinaryDimension(dimension); - m_spYDimension = dimension; + m_spYDimension = std::move(dimension); m_changed = true; bAdded = true; } @@ -158,10 +157,10 @@ template <typename CheckDimensionPolicy> bool MDGeometryBuilderXML<CheckDimensionPolicy>::addZDimension( IMDDimension_const_sptr dimension) const { bool bAdded = false; - if (dimension.get() != nullptr) { - applyPolicyChecking(dimension); + if (dimension) { + applyPolicyChecking(*dimension); addOrdinaryDimension(dimension); - m_spZDimension = dimension; + m_spZDimension = std::move(dimension); m_changed = true; bAdded = true; } @@ -178,10 +177,10 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addTDimension( IMDDimension_const_sptr dimension) const { bool bAdded = false; - if (dimension.get() != nullptr) { - applyPolicyChecking(dimension); + if (dimension) { + applyPolicyChecking(*dimension); addOrdinaryDimension(dimension); - m_spTDimension = dimension; + m_spTDimension = std::move(dimension); m_changed = true; bAdded = true; } diff --git a/Framework/Kernel/inc/MantidKernel/IPropertyManager.h b/Framework/Kernel/inc/MantidKernel/IPropertyManager.h index c38d263cb912f508ce34fff631f0bba3dfd8c31e..c1777dcf3bb088e5be28412d64efe79066d1b768 100644 --- a/Framework/Kernel/inc/MantidKernel/IPropertyManager.h +++ b/Framework/Kernel/inc/MantidKernel/IPropertyManager.h @@ -10,8 +10,9 @@ #include <boost/type_traits.hpp> #endif -#include <vector> #include <unordered_set> +#include <utility> +#include <vector> namespace Json { class Value; @@ -296,11 +297,12 @@ protected: */ void declareProperty( const std::string &name, const char *value, - IValidator_sptr validator = IValidator_sptr(new NullValidator), - const std::string &doc = "", + IValidator_sptr validator = boost::make_shared<NullValidator>(), + const std::string &doc = std::string(), const unsigned int direction = Direction::Input) { // 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 @@ -325,7 +327,8 @@ protected: IValidator_sptr validator = IValidator_sptr(new NullValidator), const unsigned int direction = Direction::Input) { // 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 diff --git a/Framework/Kernel/inc/MantidKernel/Strings.h b/Framework/Kernel/inc/MantidKernel/Strings.h index a199e97c3699207731e1ee22ec251ce148feed6a..a43f38a95c6059d2244ea97604d83db3112a27da 100644 --- a/Framework/Kernel/inc/MantidKernel/Strings.h +++ b/Framework/Kernel/inc/MantidKernel/Strings.h @@ -57,7 +57,7 @@ namespace Strings { */ template <typename ITERATOR_TYPE> DLLExport std::string join(ITERATOR_TYPE begin, ITERATOR_TYPE end, - const std::string separator) { + const std::string &separator) { std::ostringstream output; ITERATOR_TYPE it; for (it = begin; it != end;) { diff --git a/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx b/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx index 3587d242d44d88daeeb34ce363d09b3cdb832631..dce861abf3707c19c39753c2e096a8a4240e36d4 100644 --- a/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx +++ b/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx @@ -3,26 +3,26 @@ #include "vtkBox.h" #include "vtkInformation.h" #include "vtkInformationVector.h" +#include "vtkNew.h" #include "vtkObjectFactory.h" #include "vtkPVClipDataSet.h" #include "vtkPVInformationKeys.h" -#include "vtkUnstructuredGridAlgorithm.h" -#include "vtkUnstructuredGrid.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/IMDWorkspace.h" +#include "MantidKernel/WarningSuppressions.h" +#include "MantidVatesAPI/ADSWorkspaceProvider.h" +#include "MantidVatesAPI/BoxInfo.h" +#include "MantidVatesAPI/FilteringUpdateProgressAction.h" #include "MantidVatesAPI/MDEWInMemoryLoadingPresenter.h" #include "MantidVatesAPI/MDLoadingViewAdapter.h" -#include "MantidVatesAPI/ADSWorkspaceProvider.h" +#include "MantidVatesAPI/vtkMD0DFactory.h" #include "MantidVatesAPI/vtkMDHexFactory.h" -#include "MantidVatesAPI/vtkMDQuadFactory.h" #include "MantidVatesAPI/vtkMDLineFactory.h" -#include "MantidVatesAPI/vtkMD0DFactory.h" -#include "MantidVatesAPI/FilteringUpdateProgressAction.h" -#include "MantidKernel/WarningSuppressions.h" +#include "MantidVatesAPI/vtkMDQuadFactory.h" #include <boost/optional.hpp> @@ -44,13 +44,11 @@ vtkMDEWSource::~vtkMDEWSource() {} Setter for the recursion depth @param depth : recursion depth to use */ -void vtkMDEWSource::SetDepth(int depth) -{ +void vtkMDEWSource::SetDepth(int depth) { size_t temp = depth; - if(m_depth != temp) - { - this->m_depth = temp; - this->Modified(); + if (m_depth != temp) { + this->m_depth = temp; + this->Modified(); } } @@ -58,10 +56,8 @@ void vtkMDEWSource::SetDepth(int depth) Setter for the workspace name. @param name : workspace name to extract from ADS. */ -void vtkMDEWSource::SetWsName(std::string name) -{ - if(m_wsName != name && name != "") - { +void vtkMDEWSource::SetWsName(const std::string &name) { + if (m_wsName != name && name != "") { m_wsName = name; this->Modified(); } @@ -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 */ -void vtkMDEWSource::SetNormalization(int option) -{ +void vtkMDEWSource::SetNormalization(int option) { m_normalization = static_cast<Mantid::VATES::VisualNormalization>(option); this->Modified(); } - -int vtkMDEWSource::RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *outputVector) -{ - if(m_presenter->canReadFile()) - { +int vtkMDEWSource::RequestData(vtkInformation *, vtkInformationVector **, + vtkInformationVector *outputVector) { + if (m_presenter->canReadFile()) { using namespace Mantid::VATES; - //get the info objects + // get the info objects 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 - m_time =outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()); + m_time = + outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()); } - FilterUpdateProgressAction<vtkMDEWSource> loadingProgressUpdate(this, "Loading..."); - FilterUpdateProgressAction<vtkMDEWSource> drawingProgressUpdate(this, "Drawing..."); + FilterUpdateProgressAction<vtkMDEWSource> loadingProgressUpdate( + this, "Loading..."); + FilterUpdateProgressAction<vtkMDEWSource> drawingProgressUpdate( + this, "Drawing..."); auto hexahedronFactory = Mantid::Kernel::make_unique<vtkMDHexFactory>(m_normalization); @@ -189,7 +185,8 @@ int vtkMDEWSource::RequestData(vtkInformation *, vtkInformationVector **, vtkInf product = m_presenter->execute( 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(); box->SetBounds(product->GetBounds()); auto clipper = vtkSmartPointer<vtkPVClipDataSet>::New(); @@ -201,18 +198,16 @@ int vtkMDEWSource::RequestData(vtkInformation *, vtkInformationVector **, vtkInf //-------------------------------------------------------- vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast( - outInfo->Get(vtkDataObject::DATA_OBJECT())); + outInfo->Get(vtkDataObject::DATA_OBJECT())); output->ShallowCopy(clipperOutput); - try - { - auto workspaceProvider = Mantid::Kernel::make_unique<ADSWorkspaceProvider<Mantid::API::IMDWorkspace>>(); + try { + auto workspaceProvider = Mantid::Kernel::make_unique< + ADSWorkspaceProvider<Mantid::API::IMDWorkspace>>(); m_presenter->makeNonOrthogonal(output, std::move(workspaceProvider), &drawingProgressUpdate); - } - catch (std::invalid_argument &e) - { - std::string error = e.what(); + } catch (std::invalid_argument &e) { + std::string error = e.what(); vtkDebugMacro(<< "Workspace does not have correct information to " << "plot non-orthogonal axes. " << error); // Add the standard change of basis matrix and set the boundaries @@ -239,9 +234,10 @@ int vtkMDEWSource::RequestInformation( if (m_presenter->canReadFile()) { // If the MDEvent workspace has had top level splitting applied to it, // then use the a deptgit stah of 1 - auto workspaceProvider = Mantid::Kernel::make_unique<ADSWorkspaceProvider<Mantid::API::IMDEventWorkspace>>(); - if (auto split = - Mantid::VATES::findRecursionDepthForTopLevelSplitting(m_wsName, std::move(workspaceProvider))) { + auto workspaceProvider = Mantid::Kernel::make_unique< + ADSWorkspaceProvider<Mantid::API::IMDEventWorkspace>>(); + if (auto split = Mantid::VATES::findRecursionDepthForTopLevelSplitting( + m_wsName, *workspaceProvider)) { SetDepth(split.get()); } @@ -254,24 +250,21 @@ int vtkMDEWSource::RequestInformation( return 1; } -void vtkMDEWSource::PrintSelf(ostream& os, vtkIndent indent) -{ +void vtkMDEWSource::PrintSelf(ostream &os, vtkIndent indent) { this->Superclass::PrintSelf(os, indent); } /** Helper function to setup the time range. @param outputVector : vector onto which the time range will be set. */ -void vtkMDEWSource::setTimeRange(vtkInformationVector* outputVector) -{ - if(m_presenter->hasTDimensionAvailable()) - { +void vtkMDEWSource::setTimeRange(vtkInformationVector *outputVector) { + if (m_presenter->hasTDimensionAvailable()) { vtkInformation *outInfo = outputVector->GetInformationObject(0); outInfo->Set(vtkPVInformationKeys::TIME_LABEL_ANNOTATION(), m_presenter->getTimeStepLabel().c_str()); std::vector<double> timeStepValues = m_presenter->getTimeStepValues(); - outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &timeStepValues[0], - static_cast<int> (timeStepValues.size())); + outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), + &timeStepValues[0], static_cast<int>(timeStepValues.size())); double timeRange[2]; timeRange[0] = timeStepValues.front(); timeRange[1] = timeStepValues.back(); @@ -284,35 +277,26 @@ void vtkMDEWSource::setTimeRange(vtkInformationVector* outputVector) Getter for the recursion depth. @return depth */ -size_t vtkMDEWSource::getRecursionDepth() const -{ - return this->m_depth; -} +size_t vtkMDEWSource::getRecursionDepth() const { return this->m_depth; } /* Getter for the load in memory status @return true. */ -bool vtkMDEWSource::getLoadInMemory() const -{ - return true; -} +bool vtkMDEWSource::getLoadInMemory() const { return true; } /*Getter for the time @return the time. */ -double vtkMDEWSource::getTime() const -{ - return m_time; -} +double vtkMDEWSource::getTime() const { return m_time; } /* Setter for the algorithm progress. @param progress : progress increment @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->UpdateProgress(progress); } diff --git a/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.h b/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.h index 2636d28f80e2ea5687cd7b5cdcc3b9bdee2baf50..58112cacf74914fd8e6df29674b9f1a663eded8c 100644 --- a/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.h +++ b/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.h @@ -50,7 +50,7 @@ public: vtkTypeMacro(vtkMDEWSource, vtkUnstructuredGridAlgorithm) void PrintSelf( ostream &os, vtkIndent indent) override; - void SetWsName(std::string wsName); + void SetWsName(const std::string &wsName); void SetDepth(int depth); void SetNormalization(int option); diff --git a/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx b/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx index 4767ff540bb2e682515738808b76e5b0c0492183..d223689aa168c990ec134bee8b154cab2872b02d 100644 --- a/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx +++ b/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx @@ -40,8 +40,7 @@ vtkPeaksSource::~vtkPeaksSource() Setter for the workspace name. @param name : workspace name to extract from ADS. */ -void vtkPeaksSource::SetWsName(std::string name) -{ +void vtkPeaksSource::SetWsName(const std::string &name) { if (!name.empty()) { m_wsName = name; diff --git a/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.h b/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.h index 33a1e5e8b38575b678fbab684130ff4bc7e9356c..a0671b26f981994fd5bc00f3739a4feb6934cff1 100644 --- a/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.h +++ b/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.h @@ -45,7 +45,7 @@ public: vtkPolyDataAlgorithm) void PrintSelf(ostream &os, vtkIndent indent) override; - void SetWsName(std::string wsName); + void SetWsName(const std::string &wsName); void SetPeakDimension(int dim); /// Setter for the unitegrated peak marker size void SetUnintPeakMarkerSize(double mSize); diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/BoxInfo.h b/Vates/VatesAPI/inc/MantidVatesAPI/BoxInfo.h index 4ade66519b1767f59f52ca5c02f09bd9c7082124..ec6fd5774d21741399162742cfe6b2b63b2d9f9c 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/BoxInfo.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/BoxInfo.h @@ -42,7 +42,7 @@ Code Documentation is available at: <http://doxygen.mantidproject.org> */ boost::optional<int> DLLExport findRecursionDepthForTopLevelSplitting( const std::string &workspaceName, - std::unique_ptr<WorkspaceProvider> workspaceProvider); + const WorkspaceProvider &workspaceProvider); } } diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/CompositePeaksPresenterVsi.h b/Vates/VatesAPI/inc/MantidVatesAPI/CompositePeaksPresenterVsi.h index a3a171b5661746d7bc08c3175027d7c53e975aca..659c18a21fff3c6ee95967ae4a55c6a4a22dd49d 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/CompositePeaksPresenterVsi.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/CompositePeaksPresenterVsi.h @@ -37,9 +37,9 @@ public: void removePresenter(const std::string &peaksWorkspaceName); void updateWorkspaces(const std::vector<std::string> &peaksWorkspaceNames); void sortPeaksWorkspace(const std::string &, const bool) override {} - void sortPeaksWorkspace( - const std::string &columnToSortBy, const bool sortedAscending, - boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS); + void sortPeaksWorkspace(const std::string &columnToSortBy, + const bool sortedAscending, + const Mantid::API::IPeaksWorkspace *peaksWS); bool hasPeaks(); private: @@ -48,4 +48,4 @@ private: }; } } -#endif \ No newline at end of file +#endif diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/ConcretePeaksPresenterVsi.h b/Vates/VatesAPI/inc/MantidVatesAPI/ConcretePeaksPresenterVsi.h index 244373c7f3e63b8e1e06ed60d457bbb9e4673c0d..568db60d77224ff30edb690069332439d311eca9 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/ConcretePeaksPresenterVsi.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/ConcretePeaksPresenterVsi.h @@ -32,7 +32,7 @@ public: private: /// Get the max radius. - double getMaxRadius(Mantid::Geometry::PeakShape_sptr shape) const; + double getMaxRadius(const Mantid::Geometry::PeakShape &shape) const; /// Viewable Peaks mutable std::vector<bool> m_viewablePeaks; /// The viewable region @@ -44,4 +44,4 @@ private: }; } } -#endif \ No newline at end of file +#endif diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/EventNexusLoadingPresenter.h b/Vates/VatesAPI/inc/MantidVatesAPI/EventNexusLoadingPresenter.h index ec25c11c51bd4a22f17520d925e1959991762dd2..c01ad069a8332aba4fa01d2d3ceaeb2704e9aa09 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/EventNexusLoadingPresenter.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/EventNexusLoadingPresenter.h @@ -37,7 +37,7 @@ class MDLoadingView; class DLLExport EventNexusLoadingPresenter : public MDEWLoadingPresenter { public: EventNexusLoadingPresenter(std::unique_ptr<MDLoadingView> view, - const std::string fileName); + const std::string &fileName); vtkSmartPointer<vtkDataSet> execute(vtkDataSetFactory *factory, ProgressAction &loadingProgressUpdate, ProgressAction &drawingProgressUpdate) override; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/FactoryChains.h b/Vates/VatesAPI/inc/MantidVatesAPI/FactoryChains.h index bf7c1828b57cc90e5c88323fda9aaed41feb10cc..c2a12325bc0d7a8621f9a91edc52f41628c2b22a 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/FactoryChains.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/FactoryChains.h @@ -33,8 +33,8 @@ void DLLExport applyCOBMatrixSettingsToVtkDataSet( std::unique_ptr<Mantid::VATES::WorkspaceProvider> workspaceProvider); /// Function to get clipped data sets. -vtkSmartPointer<vtkPVClipDataSet> DLLExport -getClippedDataSet(vtkSmartPointer<vtkDataSet> dataSet); +vtkSmartPointer<vtkPVClipDataSet> + DLLExport getClippedDataSet(const vtkSmartPointer<vtkDataSet> &dataSet); /// Create name with timestamp attached. std::string DLLExport createTimeStampedName(const std::string &name); diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/FieldDataToMetadata.h b/Vates/VatesAPI/inc/MantidVatesAPI/FieldDataToMetadata.h index 694dce9654540ec293645568ef7d2815d815e3a2..24fff10ab06ab04b5da04d6fa0630a362a5ac278 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/FieldDataToMetadata.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/FieldDataToMetadata.h @@ -41,7 +41,7 @@ class DLLExport FieldDataToMetadata : public std::binary_function<vtkFieldData *, std::string, std::string> { public: /// 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. std::string execute(vtkFieldData *fieldData, const std::string &id) const; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/IMDDimensionComparitor.h b/Vates/VatesAPI/inc/MantidVatesAPI/IMDDimensionComparitor.h index 046285fdec3bd0b5f1f243af64476aa494b44614..b22ab7dd6c1d08a739dc3a5a0bba77e67ec83199 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/IMDDimensionComparitor.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/IMDDimensionComparitor.h @@ -45,13 +45,13 @@ public: /// Destructor ~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: /// imd workspace shared ptr. diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/MDHWNexusLoadingPresenter.h b/Vates/VatesAPI/inc/MantidVatesAPI/MDHWNexusLoadingPresenter.h index 52f89d5de2268c5af542a62ef376d1392e3076f1..70749725770082db426f8553f6e3c104698d20ea 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/MDHWNexusLoadingPresenter.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/MDHWNexusLoadingPresenter.h @@ -38,7 +38,7 @@ class MDLoadingView; class DLLExport MDHWNexusLoadingPresenter : public MDHWLoadingPresenter { public: MDHWNexusLoadingPresenter(std::unique_ptr<MDLoadingView> view, - const std::string fileName); + const std::string &fileName); vtkSmartPointer<vtkDataSet> execute(vtkDataSetFactory *factory, ProgressAction &rebinningProgressUpdate, ProgressAction &drawingProgressUpdate) override; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/MetaDataExtractorUtils.h b/Vates/VatesAPI/inc/MantidVatesAPI/MetaDataExtractorUtils.h index 124d6deb36531b46bf4f21950e0f5f5ae4e85fd1..fb99f28721a6dbce85d43427a7ff5ffa10aeff54 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/MetaDataExtractorUtils.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/MetaDataExtractorUtils.h @@ -47,14 +47,14 @@ public: * @param workspace A pointer to the workspace * @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. * @param workspace A pointer to a workspace. * @returns The instrument. */ - std::string extractInstrument(Mantid::API::IMDWorkspace_sptr workspace); + std::string extractInstrument(const Mantid::API::IMDWorkspace *workspace); private: /** @@ -69,4 +69,4 @@ private: }; } } -#endif \ No newline at end of file +#endif diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/MetadataJsonManager.h b/Vates/VatesAPI/inc/MantidVatesAPI/MetadataJsonManager.h index baf689d60f8bc781ded8b7021afb8e0b60f4702c..40adb76d91758bd193f07c9c1eff44855cbc69d4 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/MetadataJsonManager.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/MetadataJsonManager.h @@ -43,9 +43,9 @@ public: 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(); void setMinValue(double minValue); diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/SQWLoadingPresenter.h b/Vates/VatesAPI/inc/MantidVatesAPI/SQWLoadingPresenter.h index ead0a17c1e0450cce3387764c1c369d1779869d5..1e189152ccd1fb2edd7b73fb850ac73337361575 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/SQWLoadingPresenter.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/SQWLoadingPresenter.h @@ -36,7 +36,7 @@ class MDLoadingView; class DLLExport SQWLoadingPresenter : public MDEWLoadingPresenter { public: SQWLoadingPresenter(std::unique_ptr<MDLoadingView> view, - const std::string fileName); + const std::string &fileName); vtkSmartPointer<vtkDataSet> execute(vtkDataSetFactory *factory, ProgressAction &rebinningProgressUpdate, ProgressAction &drawingProgressUpdate) override; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/SaveMDWorkspaceToVTKImpl.h b/Vates/VatesAPI/inc/MantidVatesAPI/SaveMDWorkspaceToVTKImpl.h index 24f5e2fc83ddcb5265be1f90b2dda68a73eb765f..2918056e6573b79923ca58bda6bad56227299b99 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/SaveMDWorkspaceToVTKImpl.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/SaveMDWorkspaceToVTKImpl.h @@ -47,7 +47,7 @@ class DLLExport SaveMDWorkspaceToVTKImpl { public: SaveMDWorkspaceToVTKImpl(SaveMDWorkspaceToVTK *parent = nullptr); ~SaveMDWorkspaceToVTKImpl() {} - void saveMDWorkspace(Mantid::API::IMDWorkspace_sptr workspace, + void saveMDWorkspace(const Mantid::API::IMDWorkspace_sptr &workspace, const std::string &filename, VisualNormalization normalization, int recursionDepth, const std::string &compressorType) const; @@ -58,18 +58,19 @@ public: std::vector<std::string> getAllowedNormalizationsInStringRepresentation() const; VisualNormalization - translateStringToVisualNormalization(const std::string normalization) const; - bool is3DWorkspace(Mantid::API::IMDWorkspace_sptr workspace) const; + translateStringToVisualNormalization(const std::string &normalization) const; + bool is3DWorkspace(const Mantid::API::IMDWorkspace &workspace) const; private: mutable API::Progress m_progress; std::map<std::string, VisualNormalization> m_normalizations; void setupMembers(); - bool is4DWorkspace(Mantid::API::IMDWorkspace_sptr workspace) const; + bool is4DWorkspace(const Mantid::API::IMDWorkspace &workspace) const; int writeDataSetToVTKFile(vtkXMLWriter *writer, vtkDataSet *dataSet, const std::string &filename, vtkXMLWriter::CompressorType compressor) const; - double selectTimeSliceValue(Mantid::API::IMDWorkspace_sptr workspace) const; + double + selectTimeSliceValue(const Mantid::API::IMDWorkspace_sptr &workspace) const; std::string getFullFilename(std::string filename, bool isHistoWorkspace) const; vtkSmartPointer<vtkXMLWriter> getXMLWriter(bool isHistoWorkspace) const; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/VatesKnowledgeSerializer.h b/Vates/VatesAPI/inc/MantidVatesAPI/VatesKnowledgeSerializer.h index c23f4c6d099679e6d4a361f829435e598bd65618..a478ecf115573388776a487a039cd5689681c4e3 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/VatesKnowledgeSerializer.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/VatesKnowledgeSerializer.h @@ -70,14 +70,13 @@ public: boost::shared_ptr<const Mantid::Geometry::MDImplicitFunction> spFunction); /// Set the workspace name to apply. - void - setWorkspace(boost::shared_ptr<const Mantid::API::IMDWorkspace> workspace); + void setWorkspace(const Mantid::API::IMDWorkspace &workspace); /// Set the workspace name to apply. - void setWorkspaceName(std::string wsName); + void setWorkspaceName(const std::string &wsName); /// Set the geometry xml to apply. - void setGeometryXML(std::string geomXML); + void setGeometryXML(const std::string &geomXML); /// Create the xml string correponding to the set values. std::string createXMLString() const; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/ViewFrustum.h b/Vates/VatesAPI/inc/MantidVatesAPI/ViewFrustum.h index 682fe0c221f6d7df446f0f76090b61aaa6c65175..7c1cbb085de4302297f98e0c331631a8b3bcadbd 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/ViewFrustum.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/ViewFrustum.h @@ -56,9 +56,9 @@ typedef FrustumPlane<NEARPLANE, double> NearPlane; class DLLExport ViewFrustum { public: - ViewFrustum(const LeftPlane leftPlane, const RightPlane rightPlane, - const BottomPlane bottomPlane, const TopPlane topPlane, - const FarPlane farPlane, const NearPlane nearPlane); + ViewFrustum(const LeftPlane &leftPlane, const RightPlane &rightPlane, + const BottomPlane &bottomPlane, const TopPlane &topPlane, + const FarPlane &farPlane, const NearPlane &nearPlane); ViewFrustum(const ViewFrustum &other); ~ViewFrustum(); ViewFrustum &operator=(const ViewFrustum &other); diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetFactory.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetFactory.h index ef0097126e0bf259430153981911ff6792764aab..31e1e19b1fc0e81ad824c578762c65967dcf8675 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetFactory.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetFactory.h @@ -70,7 +70,7 @@ public: virtual vtkSmartPointer<vtkDataSet> create(ProgressAction &) const = 0; /// Initalize with a target workspace. - virtual void initialize(Mantid::API::Workspace_sptr) = 0; + virtual void initialize(const Mantid::API::Workspace_sptr &) = 0; /// Create the product in one step. virtual vtkSmartPointer<vtkDataSet> oneStepCreate(Mantid::API::Workspace_sptr, diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMD0DFactory.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMD0DFactory.h index 9512af51ffb9808f2458c3b84fdec3e9b8a7381d..32106bd8621b8a0d031022d41753b2fc0268416f 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMD0DFactory.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMD0DFactory.h @@ -44,7 +44,7 @@ public: vtkSmartPointer<vtkDataSet> create(ProgressAction &progressUpdating) const override; - void initialize(Mantid::API::Workspace_sptr) override; + void initialize(const Mantid::API::Workspace_sptr &) override; std::string getFactoryTypeName() const override { return "vtkMD0DFactory"; } diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHexFactory.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHexFactory.h index a8e45ed75f613848dd052b9b13e0505515fbf8f3..a5474d8424a7f02afe398f43d49777d6a0d7468d 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHexFactory.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHexFactory.h @@ -68,7 +68,7 @@ public: create(ProgressAction &progressUpdate) const override; /// Initalize with a target workspace. - void initialize(Mantid::API::Workspace_sptr) override; + void initialize(const Mantid::API::Workspace_sptr &) override; /// Get the name of the type. std::string getFactoryTypeName() const override { return "vtkMDHexFactory"; } @@ -79,10 +79,11 @@ public: void setTime(double timeStep); private: - coord_t getNextBinBoundary(Mantid::API::IMDEventWorkspace_sptr imdws) const; - coord_t - getPreviousBinBoundary(Mantid::API::IMDEventWorkspace_sptr imdws) const; + getNextBinBoundary(const Mantid::API::IMDEventWorkspace_sptr &imdws) const; + + coord_t getPreviousBinBoundary( + const Mantid::API::IMDEventWorkspace_sptr &imdws) const; template <typename MDE, size_t nd> void doCreate(typename MDEventWorkspace<MDE, nd>::sptr ws) const; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoHex4DFactory.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoHex4DFactory.h index 8010ead4403950003918aab1848564473cf5f20c..0ed83ee2ced646afdebda12cd3e9cd849a4d636e 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoHex4DFactory.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoHex4DFactory.h @@ -60,7 +60,7 @@ public: ~vtkMDHistoHex4DFactory() override; /// Initialize the object with a workspace. - void initialize(Mantid::API::Workspace_sptr workspace) override; + void initialize(const Mantid::API::Workspace_sptr &workspace) override; /// Factory method vtkSmartPointer<vtkDataSet> diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoHexFactory.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoHexFactory.h index 26fcc615711b94532ac1fe18cd07e1f0895d7b45..e2e0f0ad0f84306cdb5b085a67aea3a5ee816a4b 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoHexFactory.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoHexFactory.h @@ -56,7 +56,7 @@ public: ~vtkMDHistoHexFactory() override; /// Initialize the object with a workspace. - void initialize(Mantid::API::Workspace_sptr workspace) override; + void initialize(const Mantid::API::Workspace_sptr &workspace) override; /// Factory method vtkSmartPointer<vtkDataSet> diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoLineFactory.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoLineFactory.h index d5ad7fbd7ca1a8f3f8b22c060c8cfa242b70ddd3..63973a55e1c0c3aadb5d47e2b906738e96dabde3 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoLineFactory.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoLineFactory.h @@ -57,7 +57,7 @@ public: vtkSmartPointer<vtkDataSet> create(ProgressAction &progressUpdating) const override; - void initialize(Mantid::API::Workspace_sptr) override; + void initialize(const Mantid::API::Workspace_sptr &) override; typedef std::vector<UnstructuredPoint> Column; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoQuadFactory.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoQuadFactory.h index 36f7f626124e7763e2e52c0a584109e0a147242b..6f7ba4b0b1ae136a345cb90a71649fa837c52980 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoQuadFactory.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHistoQuadFactory.h @@ -60,7 +60,7 @@ public: vtkSmartPointer<vtkDataSet> create(ProgressAction &progressUpdating) const override; - void initialize(Mantid::API::Workspace_sptr) override; + void initialize(const Mantid::API::Workspace_sptr &) override; typedef std::vector<std::vector<UnstructuredPoint>> Plane; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDLineFactory.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDLineFactory.h index 4da0b1f42a0da1c865952cfaa79258d8a4dd0b2d..a82c1e7eba27aeb8811760a3818916e58dc51fca 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDLineFactory.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDLineFactory.h @@ -49,7 +49,7 @@ public: create(ProgressAction &progressUpdating) const override; /// Initalize with a target workspace. - void initialize(Mantid::API::Workspace_sptr) override; + void initialize(const Mantid::API::Workspace_sptr &) override; /// Get the name of the type. std::string getFactoryTypeName() const override; @@ -68,4 +68,4 @@ private: } } -#endif \ No newline at end of file +#endif diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDQuadFactory.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDQuadFactory.h index 88b8003d3f429c3150e16a4f45121eded072780b..9bdc5c3baf41dbebd3866f77efa1017950fc439e 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDQuadFactory.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDQuadFactory.h @@ -50,7 +50,7 @@ public: create(ProgressAction &progressUpdating) const override; /// Initalize with a target workspace. - void initialize(Mantid::API::Workspace_sptr) override; + void initialize(const Mantid::API::Workspace_sptr &) override; /// Get the name of the type. std::string getFactoryTypeName() const override; @@ -69,4 +69,4 @@ private: } } -#endif \ No newline at end of file +#endif diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkSplatterPlotFactory.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkSplatterPlotFactory.h index 10ee7441590ca6a0427c1c00c72f5a6e39a92cf2..f23a8067eb3d4561ae2fdc54f29679a7301cf003 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkSplatterPlotFactory.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkSplatterPlotFactory.h @@ -66,7 +66,7 @@ public: create(ProgressAction &progressUpdating) const override; /// Initalize with a target workspace. - void initialize(Mantid::API::Workspace_sptr) override; + void initialize(const Mantid::API::Workspace_sptr &) override; /// Get the name of the type. std::string getFactoryTypeName() const override { @@ -99,15 +99,16 @@ private: void doCreate(typename MDEventWorkspace<MDE, nd>::sptr ws) const; /// Check if the MDHisto workspace is 3D or 4D in nature - bool doMDHisto4D(Mantid::API::IMDHistoWorkspace_sptr workspace) const; + bool doMDHisto4D(const Mantid::API::IMDHistoWorkspace_sptr &workspace) const; /// Generate the vtkDataSet from the objects input MDHistoWorkspace - void doCreateMDHisto(Mantid::API::IMDHistoWorkspace_sptr workspace) const; + void + doCreateMDHisto(const Mantid::API::IMDHistoWorkspace_sptr &workspace) const; /// Set the signals and the valid points which are to be displayed - signal_t extractScalarSignal(Mantid::API::IMDHistoWorkspace_sptr workspace, - bool do4D, const int x, const int y, - const int z) const; + signal_t + extractScalarSignal(const Mantid::API::IMDHistoWorkspace_sptr &workspace, + bool do4D, const int x, const int y, const int z) const; /// Template Method pattern to validate the factory before use. void validate() const override; diff --git a/Vates/VatesAPI/src/BoxInfo.cpp b/Vates/VatesAPI/src/BoxInfo.cpp index 753962929ea3fc1f885a319b046f5a208e7d2797..93857ce57aa46efc34565bd3ba5a27c4dc8012eb 100644 --- a/Vates/VatesAPI/src/BoxInfo.cpp +++ b/Vates/VatesAPI/src/BoxInfo.cpp @@ -9,13 +9,13 @@ namespace VATES { boost::optional<int> findRecursionDepthForTopLevelSplitting( const std::string &workspaceName, - std::unique_ptr<WorkspaceProvider> workspaceProvider) { + const WorkspaceProvider &workspaceProvider) { const int topLevelRecursionDepth = 1; boost::optional<int> recursionDepth; - if (workspaceProvider->canProvideWorkspace(workspaceName)) { + if (workspaceProvider.canProvideWorkspace(workspaceName)) { auto workspace = boost::dynamic_pointer_cast<Mantid::API::IMDEventWorkspace>( - workspaceProvider->fetchWorkspace(workspaceName)); + workspaceProvider.fetchWorkspace(workspaceName)); auto boxController = workspace->getBoxController(); boost::optional<std::vector<size_t>> topLevelSplits = boxController->getSplitTopInto(); diff --git a/Vates/VatesAPI/src/CompositePeaksPresenterVsi.cpp b/Vates/VatesAPI/src/CompositePeaksPresenterVsi.cpp index 016f820a6ba011091d3e5910ed36918b6691e3a7..38d495bb49b092cb614cee74ed1873af3ab26197 100644 --- a/Vates/VatesAPI/src/CompositePeaksPresenterVsi.cpp +++ b/Vates/VatesAPI/src/CompositePeaksPresenterVsi.cpp @@ -162,9 +162,9 @@ bool CompositePeaksPresenterVsi::hasPeaks() { */ void CompositePeaksPresenterVsi::sortPeaksWorkspace( const std::string &columnToSortBy, const bool sortedAscending, - boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS) { + const Mantid::API::IPeaksWorkspace *peaksWS) { for (const auto &presenter : m_peaksPresenters) { - if (presenter->getPeaksWorkspace() == peaksWS) { + if (presenter->getPeaksWorkspace().get() == peaksWS) { presenter->sortPeaksWorkspace(columnToSortBy, sortedAscending); } } diff --git a/Vates/VatesAPI/src/ConcretePeaksPresenterVsi.cpp b/Vates/VatesAPI/src/ConcretePeaksPresenterVsi.cpp index 444bd47d63b60aebb0a7aec1cb0e6321d22d5453..9816c7ed3a46632fcf4721db69df7546601e5cd8 100644 --- a/Vates/VatesAPI/src/ConcretePeaksPresenterVsi.cpp +++ b/Vates/VatesAPI/src/ConcretePeaksPresenterVsi.cpp @@ -127,7 +127,7 @@ void ConcretePeaksPresenterVsi::getPeaksInfo( // Peak radius Mantid::Geometry::PeakShape_sptr shape( peaksWorkspace->getPeakPtr(row)->getPeakShape().clone()); - radius = getMaxRadius(shape); + radius = getMaxRadius(*shape); } /** @@ -136,11 +136,11 @@ void ConcretePeaksPresenterVsi::getPeaksInfo( * @returns The maximal radius of the peak. */ double ConcretePeaksPresenterVsi::getMaxRadius( - Mantid::Geometry::PeakShape_sptr shape) const { + const Mantid::Geometry::PeakShape &shape) const { const double defaultRadius = 1.0; boost::optional<double> radius = - shape->radius(Mantid::Geometry::PeakShape::Radius); + shape.radius(Mantid::Geometry::PeakShape::Radius); if (radius) { return radius.get(); } else { diff --git a/Vates/VatesAPI/src/EventNexusLoadingPresenter.cpp b/Vates/VatesAPI/src/EventNexusLoadingPresenter.cpp index 36de7830aa4731e3e59f6a112e28c3f446658ccf..72f9f932108be9198b967126a34b4757b1d3aa21 100644 --- a/Vates/VatesAPI/src/EventNexusLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/EventNexusLoadingPresenter.cpp @@ -26,7 +26,7 @@ namespace VATES { @throw logic_error if cannot use the reader-presenter for this filetype. */ EventNexusLoadingPresenter::EventNexusLoadingPresenter( - std::unique_ptr<MDLoadingView> view, const std::string filename) + std::unique_ptr<MDLoadingView> view, const std::string &filename) : MDEWLoadingPresenter(std::move(view)), m_filename(filename), m_wsTypeName("") { if (this->m_filename.empty()) { diff --git a/Vates/VatesAPI/src/FieldDataToMetadata.cpp b/Vates/VatesAPI/src/FieldDataToMetadata.cpp index 561cf506093abfbd9a2cc1e379b2e11993d49856..0d2c4966f24cfd0b74aa7731e4bf4e9f18d1ba62 100644 --- a/Vates/VatesAPI/src/FieldDataToMetadata.cpp +++ b/Vates/VatesAPI/src/FieldDataToMetadata.cpp @@ -7,7 +7,7 @@ namespace Mantid { namespace VATES { std::string FieldDataToMetadata::operator()(vtkFieldData *fieldData, - std::string id) const { + const std::string &id) const { return execute(fieldData, id); } diff --git a/Vates/VatesAPI/src/IMDDimensionComparitor.cpp b/Vates/VatesAPI/src/IMDDimensionComparitor.cpp index 38323a2abc4e67c1ac079c9884bfe8c06c3a885c..bcaa67212de470612b7933a31e5ae0ba45c585c7 100644 --- a/Vates/VatesAPI/src/IMDDimensionComparitor.cpp +++ b/Vates/VatesAPI/src/IMDDimensionComparitor.cpp @@ -10,20 +10,20 @@ IMDDimensionComparitor::IMDDimensionComparitor( IMDDimensionComparitor::~IMDDimensionComparitor() {} bool IMDDimensionComparitor::isXDimension( - Mantid::Geometry::IMDDimension_const_sptr queryDimension) { + const Mantid::Geometry::IMDDimension &queryDimension) { // Compare dimensions on the basis of their ids. Mantid::Geometry::IMDDimension_const_sptr actualXDimension = m_workspace->getXDimension(); - return queryDimension->getDimensionId() == actualXDimension->getDimensionId(); + return queryDimension.getDimensionId() == actualXDimension->getDimensionId(); } bool IMDDimensionComparitor::isYDimension( - Mantid::Geometry::IMDDimension_const_sptr queryDimension) { + const Mantid::Geometry::IMDDimension &queryDimension) { Mantid::Geometry::IMDDimension_const_sptr actualYDimension = m_workspace->getYDimension(); if (actualYDimension) { // Compare dimensions on the basis of their ids. - return queryDimension->getDimensionId() == + return queryDimension.getDimensionId() == actualYDimension->getDimensionId(); } else { return false; // MDImages may have 1 dimension or more. @@ -31,12 +31,12 @@ bool IMDDimensionComparitor::isYDimension( } bool IMDDimensionComparitor::isZDimension( - Mantid::Geometry::IMDDimension_const_sptr queryDimension) { + const Mantid::Geometry::IMDDimension &queryDimension) { Mantid::Geometry::IMDDimension_const_sptr actualZDimension = m_workspace->getZDimension(); if (actualZDimension) { // Compare dimensions on the basis of their ids. - return queryDimension->getDimensionId() == + return queryDimension.getDimensionId() == actualZDimension->getDimensionId(); } else { return false; // MDImages may have 1 dimension or more. @@ -44,12 +44,12 @@ bool IMDDimensionComparitor::isZDimension( } bool IMDDimensionComparitor::istDimension( - Mantid::Geometry::IMDDimension_const_sptr queryDimension) { + const Mantid::Geometry::IMDDimension &queryDimension) { Mantid::Geometry::IMDDimension_const_sptr actualtDimension = m_workspace->getTDimension(); if (actualtDimension) { // Compare dimensions on the basis of their ids. - return queryDimension->getDimensionId() == + return queryDimension.getDimensionId() == actualtDimension->getDimensionId(); } else { return false; // MDImages may have 1 dimension or more. diff --git a/Vates/VatesAPI/src/LoadVTK.cpp b/Vates/VatesAPI/src/LoadVTK.cpp index 700481dc305a04233c986610747e52a0ddd41542..224521850ddc4a1e1231ca26f3f8c1213d007035 100644 --- a/Vates/VatesAPI/src/LoadVTK.cpp +++ b/Vates/VatesAPI/src/LoadVTK.cpp @@ -250,9 +250,9 @@ void LoadVTK::execMDEvent(vtkDataSet *readDataset, bc->setSplitInto(2); bc->setSplitThreshold(10); bc->setMaxDepth(7); - ws->addDimension(dimX); - ws->addDimension(dimY); - ws->addDimension(dimZ); + ws->addDimension(std::move(dimX)); + ws->addDimension(std::move(dimY)); + ws->addDimension(std::move(dimZ)); ws->initialize(); if (errorsSQ) { diff --git a/Vates/VatesAPI/src/MDEWInMemoryLoadingPresenter.cpp b/Vates/VatesAPI/src/MDEWInMemoryLoadingPresenter.cpp index ec930737942e52615b08a44469bcb613c2bc9944..1b1320b050e67602fdbfd37881ebe81150c252cc 100644 --- a/Vates/VatesAPI/src/MDEWInMemoryLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/MDEWInMemoryLoadingPresenter.cpp @@ -113,13 +113,13 @@ void MDEWInMemoryLoadingPresenter::executeLoadMetadata() { // Set the minimum and maximum of the workspace data. QwtDoubleInterval minMaxContainer = - m_metaDataExtractor->getMinAndMax(eventWs); + m_metaDataExtractor->getMinAndMax(eventWs.get()); m_metadataJsonManager->setMinValue(minMaxContainer.minValue()); m_metadataJsonManager->setMaxValue(minMaxContainer.maxValue()); // Set the instrument which is associated with the workspace. m_metadataJsonManager->setInstrument( - m_metaDataExtractor->extractInstrument(eventWs)); + m_metaDataExtractor->extractInstrument(eventWs.get())); // Set the special coordinates m_metadataJsonManager->setSpecialCoordinates(m_specialCoords); diff --git a/Vates/VatesAPI/src/MDHWInMemoryLoadingPresenter.cpp b/Vates/VatesAPI/src/MDHWInMemoryLoadingPresenter.cpp index a4d9346b5f548ad0bd6c76d693b4bdcdf9af41b0..133941d87ab192f4feee97ed6d5e1dcccbb8f0ce 100644 --- a/Vates/VatesAPI/src/MDHWInMemoryLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/MDHWInMemoryLoadingPresenter.cpp @@ -202,13 +202,13 @@ void MDHWInMemoryLoadingPresenter::executeLoadMetadata() { // Set the minimum and maximum of the workspace data. QwtDoubleInterval minMaxContainer = - m_metaDataExtractor->getMinAndMax(histoWs); + m_metaDataExtractor->getMinAndMax(histoWs.get()); m_metadataJsonManager->setMinValue(minMaxContainer.minValue()); m_metadataJsonManager->setMaxValue(minMaxContainer.maxValue()); // Set the instrument which is associated with the workspace. m_metadataJsonManager->setInstrument( - m_metaDataExtractor->extractInstrument(m_cachedVisualHistoWs)); + m_metaDataExtractor->extractInstrument(m_cachedVisualHistoWs.get())); // Set the special coordinates m_metadataJsonManager->setSpecialCoordinates(m_specialCoords); diff --git a/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp b/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp index 58459754a807b6e458e0b3bc3dd1bba1c57f9482..e8654c3c990a163327961a2d90c1ba6170b48bfa 100644 --- a/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp @@ -24,7 +24,7 @@ namespace VATES { * @throw logic_error if cannot use the reader-presenter for this filetype. */ MDHWNexusLoadingPresenter::MDHWNexusLoadingPresenter( - std::unique_ptr<MDLoadingView> view, const std::string filename) + std::unique_ptr<MDLoadingView> view, const std::string &filename) : MDHWLoadingPresenter(std::move(view)), m_filename(filename), m_wsTypeName("") { if (this->m_filename.empty()) { diff --git a/Vates/VatesAPI/src/MetaDataExtractorUtils.cpp b/Vates/VatesAPI/src/MetaDataExtractorUtils.cpp index 662b3f84d185cc2a746adaa659ee1bb5f382a891..746045cc2ad39987e59c94b2607bfa41ae0c5292 100644 --- a/Vates/VatesAPI/src/MetaDataExtractorUtils.cpp +++ b/Vates/VatesAPI/src/MetaDataExtractorUtils.cpp @@ -31,11 +31,11 @@ MetaDataExtractorUtils::~MetaDataExtractorUtils() {} * @returns The instrument name or an empty string. */ std::string MetaDataExtractorUtils::extractInstrument( - Mantid::API::IMDWorkspace_sptr workspace) { - Mantid::API::IMDEventWorkspace_sptr eventWorkspace = - boost::dynamic_pointer_cast<Mantid::API::IMDEventWorkspace>(workspace); - Mantid::API::IMDHistoWorkspace_sptr histoWorkspace = - boost::dynamic_pointer_cast<Mantid::API::IMDHistoWorkspace>(workspace); + const Mantid::API::IMDWorkspace *workspace) { + auto eventWorkspace = + dynamic_cast<const Mantid::API::IMDEventWorkspace *>(workspace); + auto histoWorkspace = + dynamic_cast<const Mantid::API::IMDHistoWorkspace *>(workspace); std::string instrument = ""; @@ -74,8 +74,8 @@ std::string MetaDataExtractorUtils::extractInstrument( * @param workspace Rreference to an IMD workspace * @returns The minimum and maximum value of the workspace dataset. */ -QwtDoubleInterval -MetaDataExtractorUtils::getMinAndMax(Mantid::API::IMDWorkspace_sptr workspace) { +QwtDoubleInterval MetaDataExtractorUtils::getMinAndMax( + const Mantid::API::IMDWorkspace *workspace) { if (!workspace) throw std::invalid_argument("The workspace is empty."); diff --git a/Vates/VatesAPI/src/MetadataJsonManager.cpp b/Vates/VatesAPI/src/MetadataJsonManager.cpp index af3ac67541c50c116e88a62c8b4c033ad00aa6dd..731caa197f3812b574287746a50653dfc30eb4d1 100644 --- a/Vates/VatesAPI/src/MetadataJsonManager.cpp +++ b/Vates/VatesAPI/src/MetadataJsonManager.cpp @@ -3,6 +3,8 @@ #include <json/writer.h> #include <json/reader.h> +#include <utility> + namespace Mantid { namespace VATES { // Note that we need to have a non-empty default string @@ -32,7 +34,8 @@ std::string MetadataJsonManager::getSerializedJson() { * Read in the serialized JSON data and opulate the JSON container * @param serializedJson The serialized JSON string. */ -void MetadataJsonManager::readInSerializedJson(std::string serializedJson) { +void MetadataJsonManager::readInSerializedJson( + const std::string &serializedJson) { Json::Reader reader; metadataContainer.clear(); @@ -106,7 +109,7 @@ double MetadataJsonManager::getMinValue() { return minValue; } * Set the instrument. * @param instrument The instrument associated with the workspace. */ -void MetadataJsonManager::setInstrument(std::string instrument) { +void MetadataJsonManager::setInstrument(const std::string &instrument) { this->instrument = instrument; } @@ -130,4 +133,4 @@ void MetadataJsonManager::setSpecialCoordinates(int specialCoordinates) { */ int MetadataJsonManager::getSpecialCoordinates() { return specialCoordinates; } } -} \ No newline at end of file +} diff --git a/Vates/VatesAPI/src/PresenterUtilities.cpp b/Vates/VatesAPI/src/PresenterUtilities.cpp index 8577c9a5186cefbce8ba0795645875f9dd8d4726..743672342c7ea8635aa003be4539b494fe7ca16a 100644 --- a/Vates/VatesAPI/src/PresenterUtilities.cpp +++ b/Vates/VatesAPI/src/PresenterUtilities.cpp @@ -32,7 +32,7 @@ namespace VATES { * @returns a clipped object */ vtkSmartPointer<vtkPVClipDataSet> -getClippedDataSet(vtkSmartPointer<vtkDataSet> dataSet) { +getClippedDataSet(const vtkSmartPointer<vtkDataSet> &dataSet) { auto box = vtkSmartPointer<vtkBox>::New(); box->SetBounds(dataSet->GetBounds()); auto clipper = vtkSmartPointer<vtkPVClipDataSet>::New(); diff --git a/Vates/VatesAPI/src/SQWLoadingPresenter.cpp b/Vates/VatesAPI/src/SQWLoadingPresenter.cpp index d8109833b6003a25f8cb7cc0bb921e8df09dd669..3a9d022aa09032232b23a180ddab026685eb89d0 100644 --- a/Vates/VatesAPI/src/SQWLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/SQWLoadingPresenter.cpp @@ -22,7 +22,7 @@ namespace VATES { @throw logic_error if cannot use the reader-presenter for this filetype. */ SQWLoadingPresenter::SQWLoadingPresenter(std::unique_ptr<MDLoadingView> view, - const std::string filename) + const std::string &filename) : MDEWLoadingPresenter(std::move(view)), m_filename(filename), m_wsTypeName("") { if (this->m_filename.empty()) { @@ -74,7 +74,7 @@ SQWLoadingPresenter::execute(vtkDataSetFactory *factory, // Default is not to load into memory and when this is the case, generate a // nxs backend for output. if (!this->m_view->getLoadInMemory()) { - size_t pos = this->m_filename.find("."); + size_t pos = this->m_filename.find('.'); std::string backEndFile = this->m_filename.substr(0, pos) + ".nxs"; alg->setPropertyValue("OutputFilename", backEndFile); } diff --git a/Vates/VatesAPI/src/SaveMDWorkspaceToVTK.cpp b/Vates/VatesAPI/src/SaveMDWorkspaceToVTK.cpp index d57f061b27a5145e68ba9d8ed24c5b94c9d71366..b10e7924bd8ddd6e234958a1aa721edf1128acc2 100644 --- a/Vates/VatesAPI/src/SaveMDWorkspaceToVTK.cpp +++ b/Vates/VatesAPI/src/SaveMDWorkspaceToVTK.cpp @@ -104,7 +104,7 @@ std::map<std::string, std::string> SaveMDWorkspaceToVTK::validateInputs() { } // Check for the dimensionality - if (!saver->is3DWorkspace(inputWS)) { + if (!saver->is3DWorkspace(*inputWS)) { errorMessage.emplace("InputWorkspace", "The MD workspace must be 3D."); } diff --git a/Vates/VatesAPI/src/SaveMDWorkspaceToVTKImpl.cpp b/Vates/VatesAPI/src/SaveMDWorkspaceToVTKImpl.cpp index 0552e1b5577f9353429fe0e0b4211697b18a8134..6309c82347d0e6e83a10b339cad8c545ac143e8d 100644 --- a/Vates/VatesAPI/src/SaveMDWorkspaceToVTKImpl.cpp +++ b/Vates/VatesAPI/src/SaveMDWorkspaceToVTKImpl.cpp @@ -26,6 +26,7 @@ #include <boost/make_shared.hpp> #include <boost/math/special_functions/round.hpp> #include <memory> +#include <utility> namespace { // This progress object gets called by PV (and is used by the plugins), @@ -45,10 +46,10 @@ bool has_suffix(const std::string &stringToCheck, const std::string &suffix) { return isSuffixInString; } -bool isNDWorkspace(Mantid::API::IMDWorkspace_sptr workspace, +bool isNDWorkspace(const Mantid::API::IMDWorkspace &workspace, const size_t dimensionality) { auto actualNonIntegratedDimensionality = - workspace->getNonIntegratedDimensions().size(); + workspace.getNonIntegratedDimensions().size(); return actualNonIntegratedDimensionality == dimensionality; } } @@ -74,9 +75,9 @@ SaveMDWorkspaceToVTKImpl::SaveMDWorkspaceToVTKImpl(SaveMDWorkspaceToVTK *parent) * from which level data should be displayed */ void SaveMDWorkspaceToVTKImpl::saveMDWorkspace( - Mantid::API::IMDWorkspace_sptr workspace, const std::string &filename, - VisualNormalization normalization, int recursionDepth, - const std::string &compressorType) const { + const Mantid::API::IMDWorkspace_sptr &workspace, + const std::string &filename, VisualNormalization normalization, + int recursionDepth, const std::string &compressorType) const { auto isHistoWorkspace = boost::dynamic_pointer_cast<Mantid::API::IMDHistoWorkspace>(workspace) != nullptr; @@ -249,7 +250,7 @@ SaveMDWorkspaceToVTKImpl::getAllowedNormalizationsInStringRepresentation() VisualNormalization SaveMDWorkspaceToVTKImpl::translateStringToVisualNormalization( - const std::string normalization) const { + const std::string &normalization) const { return m_normalizations.at(normalization); } @@ -269,9 +270,9 @@ void SaveMDWorkspaceToVTKImpl::setupMembers() { * @return either the first time entry in case of a 4D workspace or else 0.0 */ double SaveMDWorkspaceToVTKImpl::selectTimeSliceValue( - Mantid::API::IMDWorkspace_sptr workspace) const { + const Mantid::API::IMDWorkspace_sptr &workspace) const { double time = 0.0; - if (is4DWorkspace(workspace)) { + if (is4DWorkspace(*workspace)) { auto timeLikeDimension = workspace->getDimension(3); time = static_cast<double>(timeLikeDimension->getMinimum()); } @@ -284,7 +285,7 @@ double SaveMDWorkspaceToVTKImpl::selectTimeSliceValue( * @return true if the workspace is 4D else false */ bool SaveMDWorkspaceToVTKImpl::is4DWorkspace( - Mantid::API::IMDWorkspace_sptr workspace) const { + const Mantid::API::IMDWorkspace &workspace) const { const size_t dimensionality = 4; return isNDWorkspace(workspace, dimensionality); } @@ -295,7 +296,7 @@ bool SaveMDWorkspaceToVTKImpl::is4DWorkspace( * @return true if the workspace is 3D else false */ bool SaveMDWorkspaceToVTKImpl::is3DWorkspace( - Mantid::API::IMDWorkspace_sptr workspace) const { + const Mantid::API::IMDWorkspace &workspace) const { const size_t dimensionality = 3; return isNDWorkspace(workspace, dimensionality); } diff --git a/Vates/VatesAPI/src/VatesKnowledgeSerializer.cpp b/Vates/VatesAPI/src/VatesKnowledgeSerializer.cpp index f729a37f300106149a513cb86a9cfbd5383f4171..f59b6db5ccb0082cb0c2ee27d2141c4ab0b15074 100644 --- a/Vates/VatesAPI/src/VatesKnowledgeSerializer.cpp +++ b/Vates/VatesAPI/src/VatesKnowledgeSerializer.cpp @@ -1,11 +1,12 @@ -#include <MantidGeometry/MDGeometry/MDImplicitFunction.h> -#include <boost/shared_ptr.hpp> +#include "MantidVatesAPI/VatesKnowledgeSerializer.h" +#include "MantidGeometry/MDGeometry/MDGeometryXMLDefinitions.h" +#include "MantidVatesAPI/VatesXMLDefinitions.h" #include <MantidAPI/IMDWorkspace.h> +#include <MantidGeometry/MDGeometry/MDImplicitFunction.h> #include <boost/algorithm/string.hpp> #include <boost/format.hpp> -#include "MantidGeometry/MDGeometry/MDGeometryXMLDefinitions.h" -#include "MantidVatesAPI/VatesKnowledgeSerializer.h" -#include "MantidVatesAPI/VatesXMLDefinitions.h" +#include <boost/shared_ptr.hpp> +#include <utility> using Mantid::Geometry::MDGeometryXMLDefinitions; namespace Mantid { @@ -16,30 +17,30 @@ VatesKnowledgeSerializer::VatesKnowledgeSerializer() void VatesKnowledgeSerializer::setImplicitFunction( boost::shared_ptr<const Mantid::Geometry::MDImplicitFunction> spFunction) { - this->m_spFunction = spFunction; + this->m_spFunction = std::move(spFunction); } /// Set the workspace name to apply. void VatesKnowledgeSerializer::setWorkspace( - boost::shared_ptr<const Mantid::API::IMDWorkspace> workspace) { + const Mantid::API::IMDWorkspace &workspace) { this->m_wsNameXML = MDGeometryXMLDefinitions::workspaceNameXMLTagStart() + - workspace->getName() + + workspace.getName() + MDGeometryXMLDefinitions::workspaceNameXMLTagEnd(); this->m_wsLocationXML = MDGeometryXMLDefinitions::workspaceLocationXMLTagStart() + "" + MDGeometryXMLDefinitions::workspaceLocationXMLTagEnd(); - this->m_geomXML = workspace->getGeometryXML(); + this->m_geomXML = workspace.getGeometryXML(); } -void VatesKnowledgeSerializer::setWorkspaceName(std::string wsName) { +void VatesKnowledgeSerializer::setWorkspaceName(const std::string &wsName) { this->m_wsName = wsName; this->m_wsNameXML = std::string(MDGeometryXMLDefinitions::workspaceNameXMLTagStart() + wsName + MDGeometryXMLDefinitions::workspaceNameXMLTagEnd()); } -void VatesKnowledgeSerializer::setGeometryXML(std::string geomXML) { +void VatesKnowledgeSerializer::setGeometryXML(const std::string &geomXML) { this->m_geomXML = geomXML; } diff --git a/Vates/VatesAPI/src/ViewFrustum.cpp b/Vates/VatesAPI/src/ViewFrustum.cpp index a7b895bd9904d51b8a9f98a714534306ad88a6ca..61d7d25b0cc8d6cb4f5fb3cacda98718c77f9db1 100644 --- a/Vates/VatesAPI/src/ViewFrustum.cpp +++ b/Vates/VatesAPI/src/ViewFrustum.cpp @@ -17,9 +17,11 @@ namespace VATES { * @param farPlane The far plane. * @param nearPlane The near plane. */ -ViewFrustum::ViewFrustum(const LeftPlane leftPlane, const RightPlane rightPlane, - const BottomPlane bottomPlane, const TopPlane topPlane, - const FarPlane farPlane, const NearPlane nearPlane) +ViewFrustum::ViewFrustum(const LeftPlane &leftPlane, + const RightPlane &rightPlane, + const BottomPlane &bottomPlane, + const TopPlane &topPlane, const FarPlane &farPlane, + const NearPlane &nearPlane) : m_leftPlane(leftPlane), m_rightPlane(rightPlane), m_topPlane(topPlane), m_bottomPlane(bottomPlane), m_farPlane(farPlane), m_nearPlane(nearPlane) { } diff --git a/Vates/VatesAPI/src/vtkDataSetFactory.cpp b/Vates/VatesAPI/src/vtkDataSetFactory.cpp index 57fdf45b78bc3783e08e2bd06526517a6e84b6c4..56515c1b1bd2a1348b4eff24e4f42a1a90486222 100644 --- a/Vates/VatesAPI/src/vtkDataSetFactory.cpp +++ b/Vates/VatesAPI/src/vtkDataSetFactory.cpp @@ -1,6 +1,7 @@ #include "MantidVatesAPI/vtkDataSetFactory.h" #include "MantidVatesAPI/ProgressAction.h" #include <stdexcept> +#include <utility> namespace Mantid { namespace VATES { @@ -51,7 +52,7 @@ Convenience function. Creates an output visualisation data set in one-shot. vtkSmartPointer<vtkDataSet> vtkDataSetFactory::oneStepCreate(Mantid::API::Workspace_sptr ws, ProgressAction &progressUpdater) { - this->initialize(ws); + this->initialize(std::move(ws)); return this->create(progressUpdater); } diff --git a/Vates/VatesAPI/src/vtkMD0DFactory.cpp b/Vates/VatesAPI/src/vtkMD0DFactory.cpp index 6434862d90305f29d57e7488fd8fb6ab23f137f4..cc61b68f56f17a60f56fd09bbcec808bc4abdf95 100644 --- a/Vates/VatesAPI/src/vtkMD0DFactory.cpp +++ b/Vates/VatesAPI/src/vtkMD0DFactory.cpp @@ -37,7 +37,7 @@ vtkSmartPointer<vtkDataSet> vtkMD0DFactory::create(ProgressAction &) const { } /// Initalize with a target workspace. -void vtkMD0DFactory::initialize(Mantid::API::Workspace_sptr) {} +void vtkMD0DFactory::initialize(const Mantid::API::Workspace_sptr &) {} /// Validate the workspace void vtkMD0DFactory::validate() const {} diff --git a/Vates/VatesAPI/src/vtkMDHexFactory.cpp b/Vates/VatesAPI/src/vtkMDHexFactory.cpp index acbf4e96e72d5d0dfe367d8f8e9d2ee38751eb79..24039b1bd8485ee05c4b0dcf0697e131bfc81e39 100644 --- a/Vates/VatesAPI/src/vtkMDHexFactory.cpp +++ b/Vates/VatesAPI/src/vtkMDHexFactory.cpp @@ -254,7 +254,7 @@ vtkMDHexFactory::create(ProgressAction &progressUpdating) const { * Get the next highest bin boundary */ coord_t -vtkMDHexFactory::getNextBinBoundary(IMDEventWorkspace_sptr imdws) const { +vtkMDHexFactory::getNextBinBoundary(const IMDEventWorkspace_sptr &imdws) const { auto t_dim = imdws->getTDimension(); coord_t bin_width = t_dim->getBinWidth(); coord_t dim_min = t_dim->getMinimum(); @@ -264,8 +264,8 @@ vtkMDHexFactory::getNextBinBoundary(IMDEventWorkspace_sptr imdws) const { /* * Get the previous bin boundary, or the current one if m_time is on a boundary */ -coord_t -vtkMDHexFactory::getPreviousBinBoundary(IMDEventWorkspace_sptr imdws) const { +coord_t vtkMDHexFactory::getPreviousBinBoundary( + const IMDEventWorkspace_sptr &imdws) const { auto t_dim = imdws->getTDimension(); coord_t bin_width = t_dim->getBinWidth(); coord_t dim_min = t_dim->getMinimum(); @@ -295,7 +295,7 @@ dataobjects (workspaces) to run against at a later time. If workspace is not an IMDEventWorkspace, attempts to use any run-time successor set. @Param ws : Workspace to use. */ -void vtkMDHexFactory::initialize(Mantid::API::Workspace_sptr ws) { +void vtkMDHexFactory::initialize(const Mantid::API::Workspace_sptr &ws) { IMDEventWorkspace_sptr imdws = doInitialize<IMDEventWorkspace, 3>(ws, false); m_workspace = imdws; } diff --git a/Vates/VatesAPI/src/vtkMDHistoHex4DFactory.cpp b/Vates/VatesAPI/src/vtkMDHistoHex4DFactory.cpp index 64254cae6b80e3965da345bf0acf832d21066eed..908620f13c145e673ba7657b7316acf364577ff6 100644 --- a/Vates/VatesAPI/src/vtkMDHistoHex4DFactory.cpp +++ b/Vates/VatesAPI/src/vtkMDHistoHex4DFactory.cpp @@ -47,7 +47,7 @@ vtkMDHistoHex4DFactory<TimeMapper>::vtkMDHistoHex4DFactory( template <typename TimeMapper> void vtkMDHistoHex4DFactory<TimeMapper>::initialize( - Mantid::API::Workspace_sptr workspace) { + const Mantid::API::Workspace_sptr &workspace) { m_workspace = doInitialize<MDHistoWorkspace, 4>(workspace); if (m_workspace) { double tMax = m_workspace->getTDimension()->getMaximum(); diff --git a/Vates/VatesAPI/src/vtkMDHistoHexFactory.cpp b/Vates/VatesAPI/src/vtkMDHistoHexFactory.cpp index 6aa96e138ab77718063a72049419e5e1487f4729..f589b7605022d7b2c4c088666ad5b51af91b3a4b 100644 --- a/Vates/VatesAPI/src/vtkMDHistoHexFactory.cpp +++ b/Vates/VatesAPI/src/vtkMDHistoHexFactory.cpp @@ -53,7 +53,8 @@ vtkMDHistoHexFactory::vtkMDHistoHexFactory(const vtkMDHistoHexFactory &other) { this->m_workspace = other.m_workspace; } -void vtkMDHistoHexFactory::initialize(Mantid::API::Workspace_sptr workspace) { +void vtkMDHistoHexFactory::initialize( + const Mantid::API::Workspace_sptr &workspace) { m_workspace = doInitialize<MDHistoWorkspace, 3>(workspace); } diff --git a/Vates/VatesAPI/src/vtkMDHistoLineFactory.cpp b/Vates/VatesAPI/src/vtkMDHistoLineFactory.cpp index 1673b55e92d6a18e382c786bb067bed066d226fc..95e55256b9234c1b767ef86d13716fd26231d75a 100644 --- a/Vates/VatesAPI/src/vtkMDHistoLineFactory.cpp +++ b/Vates/VatesAPI/src/vtkMDHistoLineFactory.cpp @@ -160,7 +160,7 @@ vtkMDHistoLineFactory::create(ProgressAction &progressUpdating) const { } void vtkMDHistoLineFactory::initialize( - Mantid::API::Workspace_sptr wspace_sptr) { + const Mantid::API::Workspace_sptr &wspace_sptr) { m_workspace = this->doInitialize<MDHistoWorkspace, 1>(wspace_sptr); } diff --git a/Vates/VatesAPI/src/vtkMDHistoQuadFactory.cpp b/Vates/VatesAPI/src/vtkMDHistoQuadFactory.cpp index 868e67d77e3dc0e4e5b1de3dd278eaf3eb88e1af..c4b624440b050688790eefd361cae50c5152758f 100644 --- a/Vates/VatesAPI/src/vtkMDHistoQuadFactory.cpp +++ b/Vates/VatesAPI/src/vtkMDHistoQuadFactory.cpp @@ -234,7 +234,7 @@ vtkMDHistoQuadFactory::create(ProgressAction &progressUpdating) const { } void vtkMDHistoQuadFactory::initialize( - Mantid::API::Workspace_sptr wspace_sptr) { + const Mantid::API::Workspace_sptr &wspace_sptr) { m_workspace = doInitialize<MDHistoWorkspace, 2>(wspace_sptr); } diff --git a/Vates/VatesAPI/src/vtkMDLineFactory.cpp b/Vates/VatesAPI/src/vtkMDLineFactory.cpp index bff1b97490f7b670253ecec16a335e133e4210d4..3379a5bf4a51a0d2e2d2ed3cc3b3c96e7aba6c42 100644 --- a/Vates/VatesAPI/src/vtkMDLineFactory.cpp +++ b/Vates/VatesAPI/src/vtkMDLineFactory.cpp @@ -169,7 +169,7 @@ vtkMDLineFactory::create(ProgressAction &progressUpdating) const { } /// Initalize with a target workspace. -void vtkMDLineFactory::initialize(Mantid::API::Workspace_sptr ws) { +void vtkMDLineFactory::initialize(const Mantid::API::Workspace_sptr &ws) { m_workspace = doInitialize<IMDEventWorkspace, 1>(ws); } diff --git a/Vates/VatesAPI/src/vtkMDQuadFactory.cpp b/Vates/VatesAPI/src/vtkMDQuadFactory.cpp index 544ffcbf235d70a9333f6c13e7fc5653aa0a609e..5fa55dc5f3f50d8d416945a71ad1d0064de4b72f 100644 --- a/Vates/VatesAPI/src/vtkMDQuadFactory.cpp +++ b/Vates/VatesAPI/src/vtkMDQuadFactory.cpp @@ -167,7 +167,7 @@ vtkMDQuadFactory::create(ProgressAction &progressUpdating) const { } /// Initalize with a target workspace. -void vtkMDQuadFactory::initialize(Mantid::API::Workspace_sptr ws) { +void vtkMDQuadFactory::initialize(const Mantid::API::Workspace_sptr &ws) { m_workspace = doInitialize<IMDEventWorkspace, 2>(ws); } diff --git a/Vates/VatesAPI/src/vtkSplatterPlotFactory.cpp b/Vates/VatesAPI/src/vtkSplatterPlotFactory.cpp index b3434c11d029e9d9fdb2df7f8bce00eeae8579b3..4a0f879e73e6c679cc2fece27b3b40671b8548ff 100644 --- a/Vates/VatesAPI/src/vtkSplatterPlotFactory.cpp +++ b/Vates/VatesAPI/src/vtkSplatterPlotFactory.cpp @@ -243,7 +243,7 @@ void vtkSplatterPlotFactory::sortBoxesByDecreasingSignal( * scalar data. */ void vtkSplatterPlotFactory::doCreateMDHisto( - IMDHistoWorkspace_sptr workspace) const { + const IMDHistoWorkspace_sptr &workspace) const { // Acquire a scoped read-only lock to the workspace (prevent segfault // from algos modifying wworkspace) ReadLock lock(*workspace); @@ -349,10 +349,9 @@ void vtkSplatterPlotFactory::doCreateMDHisto( * @param z The z coordinate. * @returns The scalar signal. */ -signal_t -vtkSplatterPlotFactory::extractScalarSignal(IMDHistoWorkspace_sptr workspace, - bool do4D, const int x, const int y, - const int z) const { +signal_t vtkSplatterPlotFactory::extractScalarSignal( + const IMDHistoWorkspace_sptr &workspace, bool do4D, const int x, + const int y, const int z) const { signal_t signalScalar; if (do4D) { @@ -373,7 +372,7 @@ vtkSplatterPlotFactory::extractScalarSignal(IMDHistoWorkspace_sptr workspace, * @returns Is the workspace 4D? */ bool vtkSplatterPlotFactory::doMDHisto4D( - IMDHistoWorkspace_sptr workspace) const { + const IMDHistoWorkspace_sptr &workspace) const { bool do4D = false; bool bExactMatch = true; @@ -441,7 +440,7 @@ vtkSplatterPlotFactory::create(ProgressAction &progressUpdating) const { CALL_MDEVENT_FUNCTION(this->doCreate, m_workspace); // Set the instrument - m_instrument = m_metaDataExtractor->extractInstrument(m_workspace); + m_instrument = m_metaDataExtractor->extractInstrument(m_workspace.get()); double *range = nullptr; if (dataSet) { @@ -480,7 +479,7 @@ vtkSplatterPlotFactory::create(ProgressAction &progressUpdating) const { * not an IMDEventWorkspace, throws an invalid argument exception. * @param ws : Workspace to use. */ -void vtkSplatterPlotFactory::initialize(Mantid::API::Workspace_sptr ws) { +void vtkSplatterPlotFactory::initialize(const Mantid::API::Workspace_sptr &ws) { this->m_workspace = boost::dynamic_pointer_cast<IMDWorkspace>(ws); this->validate(); } @@ -532,7 +531,7 @@ void vtkSplatterPlotFactory::addMetadata() const { m_metadataJsonManager->setMinValue(m_minValue); m_metadataJsonManager->setMaxValue(m_maxValue); m_metadataJsonManager->setInstrument( - m_metaDataExtractor->extractInstrument(m_workspace)); + m_metaDataExtractor->extractInstrument(m_workspace.get())); m_metadataJsonManager->setSpecialCoordinates( static_cast<int>(m_workspace->getSpecialCoordinateSystem())); diff --git a/Vates/VatesAPI/test/BoxInfoTest.h b/Vates/VatesAPI/test/BoxInfoTest.h index 385daf0ddd762700ddbacfbb6fe7b8f2e2d124bf..bf3d5175bae92ac45d22700850ee1e9e377d3a83 100644 --- a/Vates/VatesAPI/test/BoxInfoTest.h +++ b/Vates/VatesAPI/test/BoxInfoTest.h @@ -31,7 +31,7 @@ public: TSM_ASSERT("Should have no recursion depth for top level splitting.", boost::none == Mantid::VATES::findRecursionDepthForTopLevelSplitting( - wsName, std::move(workspaceProvider))); + wsName, *workspaceProvider)); // Clean up AnalysisDataService::Instance().remove(wsName); @@ -48,7 +48,7 @@ public: TSM_ASSERT("Should have no recursion depth for top level splitting.", boost::none == Mantid::VATES::findRecursionDepthForTopLevelSplitting( - wsName, std::move(workspaceProvider))); + wsName, *workspaceProvider)); // Clean up AnalysisDataService::Instance().remove(wsName); @@ -70,7 +70,7 @@ public: // Act auto result = Mantid::VATES::findRecursionDepthForTopLevelSplitting( - wsName, std::move(workspaceProvider)); + wsName, *workspaceProvider); // Assert TSM_ASSERT("Should have recursion depth of 1 for top level splitting.", diff --git a/Vates/VatesAPI/test/MetaDataExtractorUtilsTest.h b/Vates/VatesAPI/test/MetaDataExtractorUtilsTest.h index d2a620d23b6e4620c18cfe20d3116fbcf5f0a349..09868bf266c874604e5bf6f8b928fd08df2c1c91 100644 --- a/Vates/VatesAPI/test/MetaDataExtractorUtilsTest.h +++ b/Vates/VatesAPI/test/MetaDataExtractorUtilsTest.h @@ -52,7 +52,7 @@ public: // Act MetaDataExtractorUtils extractor; - QwtDoubleInterval minMax = extractor.getMinAndMax(histoWorkspace); + QwtDoubleInterval minMax = extractor.getMinAndMax(histoWorkspace.get()); // Assert TSM_ASSERT("Should find the a min which is smaller/equal to max ", @@ -67,7 +67,7 @@ public: MetaDataExtractorUtils extractor; // Act - QwtDoubleInterval minMax = extractor.getMinAndMax(eventWorkspace); + QwtDoubleInterval minMax = extractor.getMinAndMax(eventWorkspace.get()); // Assert TSM_ASSERT("Should find the a min which is smaller/equal to max ", @@ -85,7 +85,7 @@ public: MetaDataExtractorUtils extractor; // Act - std::string instrument = extractor.extractInstrument(histoWorkspace); + std::string instrument = extractor.extractInstrument(histoWorkspace.get()); // Assert TSM_ASSERT("Should find an empty instrment for invalid workspace", diff --git a/Vates/VatesAPI/test/MockObjects.h b/Vates/VatesAPI/test/MockObjects.h index 90355657d8328428e7b186c673f904a244128046..b0ef1c98f9f24448fe6aa9d26ef049ce681c10d1 100644 --- a/Vates/VatesAPI/test/MockObjects.h +++ b/Vates/VatesAPI/test/MockObjects.h @@ -141,7 +141,7 @@ public: create, vtkSmartPointer<vtkDataSet>(Mantid::VATES::ProgressAction &)); MOCK_CONST_METHOD0(createMeshOnly, vtkDataSet *()); MOCK_CONST_METHOD0(createScalarArray, vtkFloatArray *()); - MOCK_METHOD1(initialize, void(Mantid::API::Workspace_sptr)); + MOCK_METHOD1(initialize, void(const Mantid::API::Workspace_sptr &)); MOCK_METHOD1(setSuccessorProxy, void(vtkDataSetFactory *)); MOCK_CONST_METHOD0(hasSuccessor, bool()); MOCK_CONST_METHOD0(validate, void()); diff --git a/Vates/VatesAPI/test/SaveMDWorkspaceToVTKImplTest.h b/Vates/VatesAPI/test/SaveMDWorkspaceToVTKImplTest.h index 66ced7db7af6082f2cf888e93a6393c688e90723..a08c62d5b76917cacc7f2f124d9554421ee0c97d 100644 --- a/Vates/VatesAPI/test/SaveMDWorkspaceToVTKImplTest.h +++ b/Vates/VatesAPI/test/SaveMDWorkspaceToVTKImplTest.h @@ -69,7 +69,7 @@ public: auto workspace = MDEventsTestHelper::makeFakeMDHistoWorkspace(1.0, numDims); // Act - const auto is3D = saveMDToVTK.is3DWorkspace(workspace); + const auto is3D = saveMDToVTK.is3DWorkspace(*workspace); // Assert TSM_ASSERT("Detects a non-3D MD workspace", !is3D); @@ -82,7 +82,7 @@ public: auto workspace = MDEventsTestHelper::makeFakeMDHistoWorkspace(1.0, numDims); // Act - const auto is3D = saveMDToVTK.is3DWorkspace(workspace); + const auto is3D = saveMDToVTK.is3DWorkspace(*workspace); // Assert TSM_ASSERT("Detects that a 3D MD workspace", is3D); diff --git a/Vates/VatesAPI/test/VatesKnowledgeSerializerTest.h b/Vates/VatesAPI/test/VatesKnowledgeSerializerTest.h index c9e42504658477361cf67278c9976049c78e3196..db580dd97bbfba6baaaae7957c8b52ffa79a90da 100644 --- a/Vates/VatesAPI/test/VatesKnowledgeSerializerTest.h +++ b/Vates/VatesAPI/test/VatesKnowledgeSerializerTest.h @@ -56,7 +56,7 @@ public: VatesKnowledgeSerializer generator; // Location is not required. generator.setImplicitFunction(impFunction); - generator.setWorkspace(workspace); + generator.setWorkspace(*workspace); TSM_ASSERT_THROWS_NOTHING("The location is not mandatory, should not throw", generator.createXMLString()); @@ -70,7 +70,7 @@ public: boost::shared_ptr<const Mantid::API::IMDWorkspace> workspace(pWorkspace); VatesKnowledgeSerializer generator; generator.setImplicitFunction(impFunction); - generator.setWorkspace(workspace); + generator.setWorkspace(*workspace); TSM_ASSERT_THROWS("Cannot create the xml without the workspace name", generator.createXMLString(), std::runtime_error); diff --git a/Vates/VatesAPI/test/vtkDataSetFactoryTest.h b/Vates/VatesAPI/test/vtkDataSetFactoryTest.h index 2cb9cf290fa82211335a095a3446bc04920495e0..99cfedb581f3b2f5ac0805eba050affcce327f08 100644 --- a/Vates/VatesAPI/test/vtkDataSetFactoryTest.h +++ b/Vates/VatesAPI/test/vtkDataSetFactoryTest.h @@ -30,7 +30,8 @@ private: GCC_DIAG_OFF_SUGGEST_OVERRIDE MOCK_CONST_METHOD1( create, vtkSmartPointer<vtkDataSet>(Mantid::VATES::ProgressAction &)); - MOCK_METHOD1(initialize, void(boost::shared_ptr<Mantid::API::Workspace>)); + MOCK_METHOD1(initialize, + void(const boost::shared_ptr<Mantid::API::Workspace> &)); MOCK_CONST_METHOD0(validate, void()); MOCK_CONST_METHOD0(getFactoryTypeName, std::string()); GCC_DIAG_ON_SUGGEST_OVERRIDE diff --git a/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/GeometryParser.h b/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/GeometryParser.h index aeaef286f4fa37aed31696cd8d43a839f39a687a..2e980eda96aaeb0b8185bf73359e5afd43d63e22 100644 --- a/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/GeometryParser.h +++ b/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/GeometryParser.h @@ -62,7 +62,7 @@ public: * @param dimension the XML string containing the axis information * @return an axis information object containing the given information */ - AxisInformation *getAxisInfo(const std::string dimension); + AxisInformation *getAxisInfo(const std::string &dimension); private: /** @@ -70,7 +70,7 @@ private: * @param val the axis bound to convert * @return the double representation of the bound */ - double convertBounds(Poco::XML::XMLString val); + double convertBounds(const Poco::XML::XMLString &val); Poco::AutoPtr<Poco::XML::Document> pDoc; ///< A XML document handle }; diff --git a/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/ModeControlWidget.h b/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/ModeControlWidget.h index fe0e013cff60037c02f362feeacecd37a402229f..d2d14d67df53270730dbad436bc852624bf2580f 100644 --- a/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/ModeControlWidget.h +++ b/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/ModeControlWidget.h @@ -73,7 +73,7 @@ public slots: void setToSelectedView(ModeControlWidget::Views view); /// Convert a string into an enum - ModeControlWidget::Views getViewFromString(QString view); + ModeControlWidget::Views getViewFromString(const QString &view); signals: /** diff --git a/Vates/VatesSimpleGui/QtWidgets/src/GeometryParser.cpp b/Vates/VatesSimpleGui/QtWidgets/src/GeometryParser.cpp index 72b57b2ed795a7d41d021bd5af247bcf42d64378..67a8ed6cdd674c4a12d63944afa23bc5d912feaa 100644 --- a/Vates/VatesSimpleGui/QtWidgets/src/GeometryParser.cpp +++ b/Vates/VatesSimpleGui/QtWidgets/src/GeometryParser.cpp @@ -23,7 +23,7 @@ GeometryParser::GeometryParser(const char *xml) { this->pDoc = parser.parseString(Poco::XML::XMLString(xml)); } -AxisInformation *GeometryParser::getAxisInfo(const std::string dimension) { +AxisInformation *GeometryParser::getAxisInfo(const std::string &dimension) { AxisInformation *axis = new AxisInformation(); Poco::AutoPtr<Poco::XML::NodeList> pNodes = @@ -49,7 +49,7 @@ AxisInformation *GeometryParser::getAxisInfo(const std::string dimension) { title = label; for (unsigned long int j = 0; j < cNodes->length(); ++j) { Poco::XML::Node *cNode = cNodes->item(j); - Poco::XML::XMLString elem = cNode->nodeName(); + const Poco::XML::XMLString &elem = cNode->nodeName(); // Keeping below around in case we go back to using axis name /* if (elem == Poco::XML::XMLString("Name")) @@ -72,7 +72,7 @@ AxisInformation *GeometryParser::getAxisInfo(const std::string dimension) { return axis; } -double GeometryParser::convertBounds(Poco::XML::XMLString val) { +double GeometryParser::convertBounds(const Poco::XML::XMLString &val) { double temp; std::stringstream number(val); number >> temp; diff --git a/Vates/VatesSimpleGui/QtWidgets/src/ModeControlWidget.cpp b/Vates/VatesSimpleGui/QtWidgets/src/ModeControlWidget.cpp index 4b11798beab1e57b1b059571f54f4c3d109f13ba..4d718d61e9d718dea706bc04b799d3b3b4d3732e 100644 --- a/Vates/VatesSimpleGui/QtWidgets/src/ModeControlWidget.cpp +++ b/Vates/VatesSimpleGui/QtWidgets/src/ModeControlWidget.cpp @@ -165,7 +165,8 @@ void ModeControlWidget::enableViewButton(ModeControlWidget::Views mode, * @param view A selected view. * @returns The selected view as enum or the standard view. */ -ModeControlWidget::Views ModeControlWidget::getViewFromString(QString view) { +ModeControlWidget::Views +ModeControlWidget::getViewFromString(const QString &view) { if (!view.isEmpty() && mapFromStringToView.count(view) == 1) { return mapFromStringToView[view]; } else { diff --git a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h index 0e05332882f2b3c796be6152a7d4a3e2309918b7..5994b095d3acf541e1d06c30bccb0827ef0be902 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h +++ b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h @@ -118,7 +118,7 @@ protected slots: /// Triggered when panel is changed. void panelChanged(); /// On rebin - void onRebin(std::string algorithmType); + void onRebin(const std::string &algorithmType); /// On unbin void onUnbin(); /// On switching an MDEvent source to a temporary source. @@ -227,7 +227,7 @@ private: void updateAppState(); /// Get the initial view for the current workspace and user setting ModeControlWidget::Views getInitialView(int workspaceType, - std::string instrumentName); + const std::string &instrumentName); /// Check that the view is valid for teh workspace type ModeControlWidget::Views checkViewAgainstWorkspace(ModeControlWidget::Views view, int workspaceType); @@ -243,10 +243,10 @@ private: void resetCurrentView(int workspaceType, const std::string &instrumentName); /// Render rebinned workspace pqPipelineSource * - prepareRebinnedWorkspace(const std::string rebinnedWorkspaceName, - std::string sourceType); + prepareRebinnedWorkspace(const std::string &rebinnedWorkspaceName, + const std::string &sourceType); /// Handle drag and drop of peaks workspcaes - void handleDragAndDropPeaksWorkspaces(QEvent *e, QString text, + void handleDragAndDropPeaksWorkspaces(QEvent *e, const QString &text, QStringList &wsNames); /// Set up the default color for the background of the view. void setColorForBackground(); @@ -254,7 +254,7 @@ private: void setColorMap(); /// Render the original workspace pqPipelineSource * - renderOriginalWorkspace(const std::string originalWorkspaceName); + renderOriginalWorkspace(const std::string &originalWorkspaceName); /// Remove the rebinning when switching views or otherwise. void diff --git a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksTabWidget.h b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksTabWidget.h index 301dc32e5c2098f2fbfb2a760c8093f09b5c0ff5..ff78b144c9d8ca9dff0bde68e03c1c211fa29b7d 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksTabWidget.h +++ b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksTabWidget.h @@ -36,8 +36,8 @@ public: void setupMvc(std::map<std::string, std::vector<bool>> visiblePeaks); void addNewPeaksWorkspace(Mantid::API::IPeaksWorkspace_sptr peaksWorkspace, std::vector<bool> visiblePeaks); - void updateTabs(std::map<std::string, std::vector<bool>> visiblePeaks, - std::map<std::string, QColor> colors); + void updateTabs(std::map<std::string, std::vector<bool>> &visiblePeaks, + std::map<std::string, QColor> &colors); signals: void zoomToPeak(Mantid::API::IPeaksWorkspace_sptr ws, int row); void sortPeaks(const std::string &columnToSortBy, const bool sortAscending, @@ -47,10 +47,11 @@ public slots: private: /// Update a certain tab. - void updateTab(std::vector<bool> visiblePeaks, QColor color, int index); + void updateTab(const std::vector<bool> &visiblePeaks, const QColor &color, + int index); /// Adds a new tab to the tab widget. void addNewTab(Mantid::API::IPeaksWorkspace_sptr peaksWorkspace, - std::string tabName, std::vector<bool> visiblePeaks); + const std::string &tabName, std::vector<bool> visiblePeaks); /// Auto-generated UI controls. Ui::PeaksTabWidget ui; /// Peaks workspace to view. diff --git a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksTableControllerVsi.h b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksTableControllerVsi.h index c0f9ef3bcd4df83b9bde339131b28d5bc59f035b..54f26ae9536b4de4b2f420f431edea9a64aa4963 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksTableControllerVsi.h +++ b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksTableControllerVsi.h @@ -32,7 +32,7 @@ public: bool hasPeaks(); void showFullTable(); void removeTable(); - std::string getConcatenatedWorkspaceNames(std::string delimiter); + std::string getConcatenatedWorkspaceNames(const std::string &delimiter); void updatePeaksWorkspaces(const QList<QPointer<pqPipelineSource>> &peakSources, pqPipelineSource *splatSource); @@ -43,7 +43,7 @@ public slots: void onZoomToPeak(Mantid::API::IPeaksWorkspace_sptr peaksWorkspace, int row); void onPeaksSorted(const std::string &columnToSortBy, const bool sortAscending, - Mantid::API::IPeaksWorkspace_sptr ws); + const Mantid::API::IPeaksWorkspace *ws); void destroySinglePeakSource(); void onPeakMarkerDestroyed(); diff --git a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksWidget.h b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksWidget.h index ae7aee329f254bf0c1bb27f2e7390d123b9779f3..be443de82d024c85f833f991e80eb7a278d0305a 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksWidget.h +++ b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/PeaksWidget.h @@ -26,7 +26,7 @@ signals: void sortPeaks(const std::string &columnToSortBy, const bool sortAscending, Mantid::API::IPeaksWorkspace_sptr ws); public slots: - void onCurrentChanged(QModelIndex current, QModelIndex); + void onCurrentChanged(const QModelIndex ¤t, const QModelIndex &); void onPeaksSorted(const std::string &columnToSortBy, const bool sortAscending); diff --git a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/RebinAlgorithmDialogProvider.h b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/RebinAlgorithmDialogProvider.h index 8255d596c1bf2484e4578803ca8b15016d9ec049..13a6d7c571ff6ff9c9477547c53b26ddac505bc8 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/RebinAlgorithmDialogProvider.h +++ b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/RebinAlgorithmDialogProvider.h @@ -48,19 +48,22 @@ public: ~RebinAlgorithmDialogProvider(); - void showDialog(std::string inputWorkspace, std::string outputWorkspace, - std::string algorithmType); + void showDialog(const std::string &inputWorkspace, + const std::string &outputWorkspace, + const std::string &algorithmType); static const size_t BinCutOffValue; private: - MantidQt::API::AlgorithmDialog *createDialog( - Mantid::API::IAlgorithm_sptr algorithm, const std::string &inputWorkspace, - const std::string &outputWorkspace, const std::string &algorithmType); + MantidQt::API::AlgorithmDialog * + createDialog(const Mantid::API::IAlgorithm &algorithm, + const std::string &inputWorkspace, + const std::string &outputWorkspace, + const std::string &algorithmType); void setAxisDimensions(MantidQt::MantidWidgets::SlicingAlgorithmDialog *dialog, - std::string inputWorkspace); + const std::string &inputWorkspace); Mantid::API::IMDEventWorkspace_sptr getWorkspace(const std::string &workspaceName); diff --git a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/RebinnedSourcesManager.h b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/RebinnedSourcesManager.h index 0f06707f15b0312985f6889b128831b0a578dbb6..fba876c3f22ceb0238fed0fae9484b9e2f2116f7 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/RebinnedSourcesManager.h +++ b/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/RebinnedSourcesManager.h @@ -132,7 +132,7 @@ private: pqPipelineSource *m_rebinnedSource; std::vector<pqPipelineSource *> - findAllRebinnedSourcesForWorkspace(std::string workspaceName); + findAllRebinnedSourcesForWorkspace(const std::string &workspaceName); void swapSources(pqPipelineSource *source1, pqPipelineSource *source2); @@ -142,9 +142,9 @@ private: std::string &outputWorkspace, pqPipelineSource *source, std::string workspaceName, - std::string algorithmType); + const std::string &algorithmType); - void untrackWorkspaces(std::pair<std::string, std::string> key); + void untrackWorkspaces(const std::pair<std::string, std::string> &key); void copyProperties(pqPipelineFilter *filter1, pqPipelineFilter *filter2); diff --git a/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp b/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp index 6b9fa7fb35d329a9f5cbc9b8d60c0d1589919f21..0e093e75d8c75a014133ff3465831c81520aafbf 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp +++ b/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp @@ -3,6 +3,7 @@ #include <boost/shared_ptr.hpp> #include <set> #include <string> +#include <utility> #include <vector> #include "MantidAPI/AnalysisDataService.h" @@ -440,7 +441,7 @@ void MdViewerWidget::setParaViewComponentsForView() { * Reaction for a rebin event * @param algorithmType The type of rebinning algorithm */ -void MdViewerWidget::onRebin(std::string algorithmType) { +void MdViewerWidget::onRebin(const std::string &algorithmType) { pqPipelineSource *source = pqActiveObjects::instance().activeSource(); std::string inputWorkspaceName; @@ -459,8 +460,8 @@ void MdViewerWidget::onRebin(std::string algorithmType) { void MdViewerWidget::onSwitchSources(std::string rebinnedWorkspaceName, std::string sourceType) { // Create the rebinned workspace - pqPipelineSource *rebinnedSource = - prepareRebinnedWorkspace(rebinnedWorkspaceName, sourceType); + pqPipelineSource *rebinnedSource = prepareRebinnedWorkspace( + std::move(rebinnedWorkspaceName), std::move(sourceType)); try { // Repipe the filters to the rebinned source @@ -515,7 +516,7 @@ void MdViewerWidget::onResetViewsStateToAllData() { * @param sourceType The name of the source plugin. */ pqPipelineSource *MdViewerWidget::prepareRebinnedWorkspace( - const std::string rebinnedWorkspaceName, std::string sourceType) { + const std::string &rebinnedWorkspaceName, const std::string &sourceType) { // Load a new source plugin auto gridAxesOn = areGridAxesOn(); pqPipelineSource *newRebinnedSource = this->currentView->setPluginSource( @@ -542,7 +543,7 @@ pqPipelineSource *MdViewerWidget::prepareRebinnedWorkspace( * @param originalWorkspaceName The name of the original workspace */ pqPipelineSource *MdViewerWidget::renderOriginalWorkspace( - const std::string originalWorkspaceName) { + const std::string &originalWorkspaceName) { // Load a new source plugin QString sourcePlugin = "MDEW Source"; auto gridAxesOn = areGridAxesOn(); @@ -763,7 +764,8 @@ void MdViewerWidget::resetCurrentView(int workspaceType, * @returns An initial view. */ ModeControlWidget::Views -MdViewerWidget::getInitialView(int workspaceType, std::string instrumentName) { +MdViewerWidget::getInitialView(int workspaceType, + const std::string &instrumentName) { // Get the possible initial views QString initialViewFromUserProperties = mdSettings.getUserSettingInitialView(); @@ -1607,7 +1609,8 @@ bool otherWorkspacePresent() { * @param wsNames Reference to a list of workspaces names, which are being * extracted. */ -void MdViewerWidget::handleDragAndDropPeaksWorkspaces(QEvent *e, QString text, +void MdViewerWidget::handleDragAndDropPeaksWorkspaces(QEvent *e, + const QString &text, QStringList &wsNames) { int endIndex = 0; while (text.indexOf("[\"", endIndex) > -1) { diff --git a/Vates/VatesSimpleGui/ViewWidgets/src/PeaksTabWidget.cpp b/Vates/VatesSimpleGui/ViewWidgets/src/PeaksTabWidget.cpp index 8c7bbfb057ecca28b780b15dde4b26de30c7c39e..2767f5d305c1cdef87090f8ea094e020f80bbf46 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/src/PeaksTabWidget.cpp +++ b/Vates/VatesSimpleGui/ViewWidgets/src/PeaksTabWidget.cpp @@ -4,12 +4,13 @@ #include "MantidQtSliceViewer/QPeaksTableModel.h" #include "MantidVatesSimpleGuiViewWidgets/PeaksWidget.h" -#include <QWidget> #include <QItemSelectionModel> #include <QModelIndex> -#include <vector> -#include <string> +#include <QWidget> #include <map> +#include <string> +#include <utility> +#include <vector> namespace Mantid { namespace Vates { @@ -53,11 +54,11 @@ void PeaksTabWidget::setupMvc( } void PeaksTabWidget::addNewTab(Mantid::API::IPeaksWorkspace_sptr peaksWorkspace, - std::string tabName, + const std::string &tabName, std::vector<bool> visiblePeaks) { PeaksWidget *widget = - new PeaksWidget(peaksWorkspace, m_coordinateSystem, this); - widget->setupMvc(visiblePeaks); + new PeaksWidget(std::move(peaksWorkspace), m_coordinateSystem, this); + widget->setupMvc(std::move(visiblePeaks)); // Connect to the output of the widget QObject::connect( @@ -81,7 +82,7 @@ void PeaksTabWidget::addNewTab(Mantid::API::IPeaksWorkspace_sptr peaksWorkspace, */ void PeaksTabWidget::onZoomToPeak(Mantid::API::IPeaksWorkspace_sptr ws, int row) { - emit zoomToPeak(ws, row); + emit zoomToPeak(std::move(ws), row); } /** @@ -90,8 +91,8 @@ void PeaksTabWidget::onZoomToPeak(Mantid::API::IPeaksWorkspace_sptr ws, * @param colors The color of the tabs */ void PeaksTabWidget::updateTabs( - std::map<std::string, std::vector<bool>> visiblePeaks, - std::map<std::string, QColor> colors) { + std::map<std::string, std::vector<bool>> &visiblePeaks, + std::map<std::string, QColor> &colors) { // Iterate over all tabs for (int i = 0; i < m_tabWidget->count(); i++) { QString label = m_tabWidget->tabText(i); @@ -114,10 +115,10 @@ void PeaksTabWidget::updateTabs( * @param color * @param index The tab index. */ -void PeaksTabWidget::updateTab(std::vector<bool> visiblePeaks, QColor color, - int index) { +void PeaksTabWidget::updateTab(const std::vector<bool> &visiblePeaks, + const QColor &color, int index) { PeaksWidget *widget = qobject_cast<PeaksWidget *>(m_tabWidget->widget(index)); - widget->updateModel(visiblePeaks); + widget->updateModel(std::move(visiblePeaks)); m_tabWidget->tabBar()->setTabTextColor(index, color); } @@ -129,8 +130,8 @@ void PeaksTabWidget::updateTab(std::vector<bool> visiblePeaks, QColor color, void PeaksTabWidget::addNewPeaksWorkspace( Mantid::API::IPeaksWorkspace_sptr peaksWorkspace, std::vector<bool> visiblePeaks) { - m_ws.push_back(peaksWorkspace); - addNewTab(peaksWorkspace, peaksWorkspace->getName(), visiblePeaks); + m_ws.push_back(std::move(peaksWorkspace)); + addNewTab(peaksWorkspace, peaksWorkspace->getName(), std::move(visiblePeaks)); } } } // namespace diff --git a/Vates/VatesSimpleGui/ViewWidgets/src/PeaksTableControllerVsi.cpp b/Vates/VatesSimpleGui/ViewWidgets/src/PeaksTableControllerVsi.cpp index 13d5fe01600c3e3844d95ae6d26c075ff2613720..a9c6e27dd8d32d7040501681cce04b4c5c9ac84f 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/src/PeaksTableControllerVsi.cpp +++ b/Vates/VatesSimpleGui/ViewWidgets/src/PeaksTableControllerVsi.cpp @@ -49,12 +49,13 @@ #include <QLayoutItem> #include <QColor> +#include <algorithm> #include <boost/make_shared.hpp> #include <boost/shared_ptr.hpp> -#include <stdexcept> -#include <algorithm> #include <map> #include <sstream> +#include <stdexcept> +#include <utility> namespace Mantid { namespace Vates { @@ -165,7 +166,8 @@ void PeaksTableControllerVsi::addWorkspace( m_presenter->getInitializedViewablePeaks(); m_peaksTabWidget->addNewPeaksWorkspace( peaksWorkspace, viewablePeaks[peaksWorkspace->getName()]); - m_peaksTabWidget->updateTabs(viewablePeaks, getColors()); + auto colors = this->getColors(); + m_peaksTabWidget->updateTabs(viewablePeaks, colors); updatePeakWorkspaceColor(); } } catch (Mantid::Kernel::Exception::NotFoundError &) { @@ -357,7 +359,8 @@ void PeaksTableControllerVsi::createTable() { layout()->addWidget(widget); m_peaksTabWidget = widget; // Set the color - m_peaksTabWidget->updateTabs(viewablePeaks, getColors()); + auto colors = this->getColors(); + m_peaksTabWidget->updateTabs(viewablePeaks, colors); updatePeakWorkspaceColor(); } catch (std::runtime_error &ex) { g_log.warning() @@ -411,7 +414,7 @@ void PeaksTableControllerVsi::onZoomToPeak( double radius; Mantid::Kernel::V3D position; - m_presenter->getPeaksInfo(peaksWorkspace, row, position, radius, + m_presenter->getPeaksInfo(std::move(peaksWorkspace), row, position, radius, m_coordinateSystem); // Reset camera @@ -528,8 +531,8 @@ void PeaksTableControllerVsi::resetSinglePeaksSource(double position1, * @param delimiter The delimiter to concatenate workspace names. * @returns The concatenated workspace names. */ -std::string -PeaksTableControllerVsi::getConcatenatedWorkspaceNames(std::string delimiter) { +std::string PeaksTableControllerVsi::getConcatenatedWorkspaceNames( + const std::string &delimiter) { std::vector<std::string> peaksWorkspaceNames = m_presenter->getPeaksWorkspaceNames(); std::stringstream stream; @@ -581,8 +584,9 @@ void PeaksTableControllerVsi::updatePeaksWorkspaces( // Now update all the presenter m_presenter->updateWorkspaces(peaksWorkspaceNames); if (!peakSources.empty() && m_peaksTabWidget) { - m_peaksTabWidget->updateTabs(m_presenter->getInitializedViewablePeaks(), - getColors()); + auto colors = this->getColors(); + auto peaks = m_presenter->getInitializedViewablePeaks(); + m_peaksTabWidget->updateTabs(peaks, colors); updatePeakWorkspaceColor(); } @@ -600,7 +604,7 @@ void PeaksTableControllerVsi::updatePeaksWorkspaces( */ void PeaksTableControllerVsi::onPeaksSorted( const std::string &columnToSortBy, const bool sortAscending, - Mantid::API::IPeaksWorkspace_sptr ws) { + const Mantid::API::IPeaksWorkspace *ws) { // Invoke the ording command on the presenters m_presenter->sortPeaksWorkspace(columnToSortBy, sortAscending, ws); // Update the tabs diff --git a/Vates/VatesSimpleGui/ViewWidgets/src/PeaksWidget.cpp b/Vates/VatesSimpleGui/ViewWidgets/src/PeaksWidget.cpp index a3059e7b04757a9dc64043450777a2dc5b528b1a..55c5a1502813431f977f746bbfe75d6501ed76a1 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/src/PeaksWidget.cpp +++ b/Vates/VatesSimpleGui/ViewWidgets/src/PeaksWidget.cpp @@ -74,7 +74,8 @@ void PeaksWidget::setupMvc(std::vector<bool> visiblePeaks) { * Detects a newly selectedd peaks workspace. * @param current The currently selected index. */ -void PeaksWidget::onCurrentChanged(QModelIndex current, QModelIndex) { +void PeaksWidget::onCurrentChanged(const QModelIndex ¤t, + const QModelIndex &) { if (current.isValid()) { emit zoomToPeak(m_ws, current.row()); } diff --git a/Vates/VatesSimpleGui/ViewWidgets/src/RebinAlgorithmDialogProvider.cpp b/Vates/VatesSimpleGui/ViewWidgets/src/RebinAlgorithmDialogProvider.cpp index 88896543cc26305f12fad85ea99372ec865b0340..ef9da55bf904a39c9ce8e095e0c11334bb82bbe1 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/src/RebinAlgorithmDialogProvider.cpp +++ b/Vates/VatesSimpleGui/ViewWidgets/src/RebinAlgorithmDialogProvider.cpp @@ -50,9 +50,9 @@ RebinAlgorithmDialogProvider::~RebinAlgorithmDialogProvider() {} * @param outputWorkspace The name of the output workspace. * @param algorithmType The type of algorithm which is to be used for rebinning. */ -void RebinAlgorithmDialogProvider::showDialog(std::string inputWorkspace, - std::string outputWorkspace, - std::string algorithmType) { +void RebinAlgorithmDialogProvider::showDialog( + const std::string &inputWorkspace, const std::string &outputWorkspace, + const std::string &algorithmType) { if (inputWorkspace.empty() || outputWorkspace.empty()) { return; } @@ -65,7 +65,7 @@ void RebinAlgorithmDialogProvider::showDialog(std::string inputWorkspace, } MantidQt::API::AlgorithmDialog *rebinDialog = - createDialog(algorithm, inputWorkspace, outputWorkspace, algorithmType); + createDialog(*algorithm, inputWorkspace, outputWorkspace, algorithmType); rebinDialog->show(); rebinDialog->raise(); @@ -124,13 +124,13 @@ RebinAlgorithmDialogProvider::createAlgorithm(const std::string &algorithmName, * @returns The algorithm dialog */ MantidQt::API::AlgorithmDialog *RebinAlgorithmDialogProvider::createDialog( - Mantid::API::IAlgorithm_sptr algorithm, const std::string &inputWorkspace, + const Mantid::API::IAlgorithm &algorithm, const std::string &inputWorkspace, const std::string &outputWorkspace, const std::string &algorithmType) { QHash<QString, QString> presets; // Check if a workspace is selected in the dock and set this as a preference // for the input workspace // This is an optional message displayed at the top of the GUI. - QString optional_msg(algorithm->summary().c_str()); + QString optional_msg(algorithm.summary().c_str()); MantidQt::API::AlgorithmDialog *dialog = nullptr; @@ -170,7 +170,7 @@ MantidQt::API::AlgorithmDialog *RebinAlgorithmDialogProvider::createDialog( */ void RebinAlgorithmDialogProvider::setAxisDimensions( MantidQt::MantidWidgets::SlicingAlgorithmDialog *dialog, - std::string inputWorkspace) { + const std::string &inputWorkspace) { Mantid::API::IMDEventWorkspace_sptr eventWorkspace = getWorkspace(inputWorkspace); diff --git a/Vates/VatesSimpleGui/ViewWidgets/src/RebinnedSourcesManager.cpp b/Vates/VatesSimpleGui/ViewWidgets/src/RebinnedSourcesManager.cpp index 083c83c20cadcc780376d9c15c0931387d89300e..0d13c4c1adcee6ff1bd2603d63db83f90ba78e08 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/src/RebinnedSourcesManager.cpp +++ b/Vates/VatesSimpleGui/ViewWidgets/src/RebinnedSourcesManager.cpp @@ -34,9 +34,10 @@ #if defined(__INTEL_COMPILER) #pragma warning enable 1170 #endif -#include <QList> #include "boost/shared_ptr.hpp" #include <Poco/ActiveResult.h> +#include <QList> +#include <utility> namespace Mantid { namespace Vates { @@ -152,7 +153,7 @@ void RebinnedSourcesManager::checkSource(pqPipelineSource *src, // anything if (isHistoWorkspace || isEventWorkspace) { processWorkspaceNames(inputWorkspace, outputWorkspace, source, - workspaceName, algorithmType); + workspaceName, std::move(algorithmType)); } } @@ -307,7 +308,7 @@ void RebinnedSourcesManager::getStoredWorkspaceNames( */ std::vector<pqPipelineSource *> RebinnedSourcesManager::findAllRebinnedSourcesForWorkspace( - std::string workspaceName) { + const std::string &workspaceName) { std::vector<std::string> linkedSources; // We need to iterate over the map for (std::map<std::pair<std::string, std::string>, @@ -371,11 +372,10 @@ bool RebinnedSourcesManager::doesSourceNeedToBeDeleted( * @param workspaceName The name of the workspace of the current source. * @param algorithmType The algorithm which creates the rebinned source. */ -void RebinnedSourcesManager::processWorkspaceNames(std::string &inputWorkspace, - std::string &outputWorkspace, - pqPipelineSource *source, - std::string workspaceName, - std::string algorithmType) { +void RebinnedSourcesManager::processWorkspaceNames( + std::string &inputWorkspace, std::string &outputWorkspace, + pqPipelineSource *source, std::string workspaceName, + const std::string &algorithmType) { // Reset the temporary tracking elements, which are needed only for the // duration of the rebinning itself m_newWorkspacePairBuffer.clear(); @@ -424,7 +424,7 @@ void RebinnedSourcesManager::processWorkspaceNames(std::string &inputWorkspace, * @param key a key to the tracking map */ void RebinnedSourcesManager::untrackWorkspaces( - std::pair<std::string, std::string> key) { + const std::pair<std::string, std::string> &key) { if (m_rebinnedWorkspaceAndSourceToOriginalWorkspace.count(key) > 0) { m_rebinnedWorkspaceAndSourceToOriginalWorkspace.erase(key); } diff --git a/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp b/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp index 2299bffce5e5f877cf7ac6450b91792f29b20a79..e970106b37eb0bd1e67323a66d885ef945cad6b8 100644 --- a/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp +++ b/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp @@ -305,7 +305,7 @@ pqPipelineSource *ViewBase::setPluginSource(QString pluginName, QString wsName, auto workspaceProvider = Mantid::Kernel::make_unique< Mantid::VATES::ADSWorkspaceProvider<Mantid::API::IMDEventWorkspace>>(); if (auto split = Mantid::VATES::findRecursionDepthForTopLevelSplitting( - wsName.toStdString(), std::move(workspaceProvider))) { + wsName.toStdString(), *workspaceProvider)) { vtkSMPropertyHelper(src->getProxy(), "Recursion Depth").Set(split.get()); } // WORKAROUND END