diff --git a/Code/Mantid/Build/CMake/CommonVatesSetup.cmake b/Code/Mantid/Build/CMake/CommonVatesSetup.cmake index 8e1cd8d804f1d8f1c7743485b7d97034da9f49ef..28da51d77855e4272ffc2c5e30e781b209cfb138 100644 --- a/Code/Mantid/Build/CMake/CommonVatesSetup.cmake +++ b/Code/Mantid/Build/CMake/CommonVatesSetup.cmake @@ -13,7 +13,6 @@ Framework/DataObjects Framework/DataHandling Framework/MDEvents Framework/MDAlgorithms -Framework/MDDataObjects Framework/Nexus Framework/NexusCPP ) diff --git a/Code/Mantid/Build/cmakelists_utils.py b/Code/Mantid/Build/cmakelists_utils.py index dc0138daae5b948882bb38a173733bfe63c770fb..51d66eaadc086b5cc9797dfc24be7b0b457bd3b8 100644 --- a/Code/Mantid/Build/cmakelists_utils.py +++ b/Code/Mantid/Build/cmakelists_utils.py @@ -90,7 +90,7 @@ def fix_cmake_format(subproject): def fix_all_cmakes(): """ Fix all cmake files """ projects = ["Algorithms", "DataObjects", "MDAlgorithms", "PythonAPI", "API", - "Geometry", "MDDataObjects", "CurveFitting", "ICat", "MDEvents", + "Geometry", "CurveFitting", "ICat", "MDEvents", "DataHandling", "Kernel", "Nexus", "Crystal"] for proj in projects: fix_cmake_format(proj) diff --git a/Code/Mantid/Framework/CMakeLists.txt b/Code/Mantid/Framework/CMakeLists.txt index 2de696845298e1b304ad050cf10a07ff38fa29fd..2876495faec9737cee2cd5eba4a2f06a8e2db40c 100644 --- a/Code/Mantid/Framework/CMakeLists.txt +++ b/Code/Mantid/Framework/CMakeLists.txt @@ -145,9 +145,6 @@ if ( CXXTEST_FOUND ) add_subdirectory (UserAlgorithms) endif () -add_subdirectory (MDDataObjects) -include_directories (MantidMDDataObjects/inc) -set ( MANTIDLIBS ${MANTIDLIBS} MDDataObjects ) add_subdirectory (MDAlgorithms) add_subdirectory (MDEvents) @@ -157,7 +154,7 @@ add_subdirectory (MDEvents) set ( FRAMEWORK_LIBS Kernel Geometry API PythonAPI PythonKernelModule PythonAPIModule DataObjects DataHandling Nexus NexusCPP Algorithms CurveFitting ICat - Crystal MDDataObjects MDAlgorithms MDEvents WorkflowAlgorithms + Crystal MDAlgorithms MDEvents WorkflowAlgorithms ) add_custom_target( Framework DEPENDS ${FRAMEWORK_LIBS} ) diff --git a/Code/Mantid/Framework/Doxygen/Mantid.doxyfile b/Code/Mantid/Framework/Doxygen/Mantid.doxyfile index 58a0fc296cba9b69e134c3215038fd97b0ef9aa5..2034c3a596ec7dcff470dc92b6697ca6b18f652f 100644 --- a/Code/Mantid/Framework/Doxygen/Mantid.doxyfile +++ b/Code/Mantid/Framework/Doxygen/Mantid.doxyfile @@ -99,8 +99,6 @@ INPUT = \ ../MatlabAPI/src \ ../MDAlgorithms/inc/MantidMDAlgorithms \ ../MDAlgorithms/src \ - ../MDDataObjects/inc/MDDataObjects \ - ../MDDataObjects/src \ ../MDEvents/inc/MantidMDEvents \ ../MDEvents/src \ ../Nexus/inc/MantidNexus \ diff --git a/Code/Mantid/Framework/Doxygen/Mantid.noMD.doxyfile b/Code/Mantid/Framework/Doxygen/Mantid.noMD.doxyfile index 4c4912ff52d6362c197bd57dc032b010050fe9e0..b6f95144a32bff5ce0f9b6ead63d73ffbbc0be39 100644 --- a/Code/Mantid/Framework/Doxygen/Mantid.noMD.doxyfile +++ b/Code/Mantid/Framework/Doxygen/Mantid.noMD.doxyfile @@ -125,8 +125,6 @@ EXCLUDE = \ ../ICat/src/GSoapGenerated \ ../MDAlgorithms/inc/MantidMDAlgorithms \ ../MDAlgorithms/src \ - ../MDDataObjects/src \ - ../MDDataObjects/inc/MantidMDDataObjects \ ../Geometry/inc/MantidGeometry/MDGeometry EXCLUDE_SYMLINKS = NO diff --git a/Code/Mantid/Framework/Kernel/src/Property.cpp b/Code/Mantid/Framework/Kernel/src/Property.cpp index 76497cddc8b584c035cc5610dceaa87ed794e0c8..2f8a8ce99d6ff065687a6d491c89d176d662e31e 100644 --- a/Code/Mantid/Framework/Kernel/src/Property.cpp +++ b/Code/Mantid/Framework/Kernel/src/Property.cpp @@ -219,10 +219,6 @@ namespace DataObjects class SpecialWorkspace2D; class Workspace2D; } -namespace MDDataObjects -{ - class MDWorkspace; -} namespace Kernel { @@ -238,7 +234,6 @@ std::string getUnmangledTypeName(const std::type_info& type) using std::make_pair; using namespace Mantid::API; using namespace Mantid::DataObjects; - using namespace Mantid::MDDataObjects; // Compile a lookup table. This is a static local variable that // will get initialized when the function is first used static std::map<string, string> typestrings; @@ -279,8 +274,6 @@ std::string getUnmangledTypeName(const std::type_info& type) string("OffsetsWorkspace"))); typestrings.insert(make_pair(typeid(boost::shared_ptr<SpecialWorkspace2D>).name(), string("SpecialWorkspace2D"))); - typestrings.insert(make_pair(typeid(boost::shared_ptr<MDWorkspace>).name(), - string("MDWorkspace"))); } diff --git a/Code/Mantid/Framework/MDAlgorithms/CMakeLists.txt b/Code/Mantid/Framework/MDAlgorithms/CMakeLists.txt index 048badab6199735cc2ec09f789ea6c91c7c1a3c6..e4b2d72f8a2b1e2cd4c1ab6dbca81b8c784541e4 100644 --- a/Code/Mantid/Framework/MDAlgorithms/CMakeLists.txt +++ b/Code/Mantid/Framework/MDAlgorithms/CMakeLists.txt @@ -128,7 +128,7 @@ set_target_properties ( MDAlgorithms PROPERTIES OUTPUT_NAME MantidMDAlgorithms # Add to the 'Framework' group in VS set_property ( TARGET MDAlgorithms PROPERTY FOLDER "MantidFramework" ) -include_directories ( inc ../MDDataObjects/inc ../MDEvents/inc) +include_directories ( inc ../MDEvents/inc) target_link_libraries ( MDAlgorithms ${MANTIDLIBS} MDEvents) @@ -138,12 +138,12 @@ if ( CXXTEST_FOUND ) ../DataHandling/inc ../DataObjects/inc ) if ( GMOCK_FOUND AND GTEST_FOUND ) cxxtest_add_test ( MDAlgorithmsTest ${TEST_FILES} ${GMOCK_TEST_FILES}) - target_link_libraries( MDAlgorithmsTest MDAlgorithms MDDataObjects CurveFitting MDEvents API DataHandling Nexus + target_link_libraries( MDAlgorithmsTest MDAlgorithms CurveFitting MDEvents API DataHandling Nexus TestHelpers ${GMOCK_LIBRARIES} ${GTEST_LIBRARIES}) else () cxxtest_add_test ( MDAlgorithmsTest ${TEST_FILES} ) - target_link_libraries( MDAlgorithmsTest MDAlgorithms MDDataObjects CurveFitting MDEvents API + target_link_libraries( MDAlgorithmsTest MDAlgorithms CurveFitting MDEvents API TestHelpers DataHandling Nexus ) endif () add_dependencies ( FrameworkTests MDAlgorithmsTest ) diff --git a/Code/Mantid/Framework/MDDataObjects/CMakeLists.txt b/Code/Mantid/Framework/MDDataObjects/CMakeLists.txt deleted file mode 100644 index c574fceb2b40fe7877f012c7f22b9fe92962fa7f..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -# Source files -set ( SRC_FILES - # test helpers - src/MDIndexCalculator.cpp -) - -set ( SRC_UNITY_IGNORE_FILES ) - -# Header files -set ( INC_FILES - # test helpers - inc/MantidMDDataObjects/DllExport.h - inc/MantidMDDataObjects/MDIndexCalculator.h -) - -# Test files. Other source files required. -set ( TEST_FILES - # test some complex test helpers -) - -set ( GMOCK_TEST_FILES - test/MDIndexCalculatorTest.h -) - -if(UNITY_BUILD) - include(UnityBuild) - enable_unity_build(MDDataObjects SRC_FILES SRC_UNITY_IGNORE_FILES 10) -endif(UNITY_BUILD) - -# Use a precompiled header where they are supported -ADD_PRECOMPILED_HEADER( inc/MantidMDDataObjects/PrecompiledHeader.h MantidMDDataObjects src/PrecompiledHeader.cpp SRC_FILES INC_FILES ) -# Add the target for this directory -add_library ( MDDataObjects ${SRC_FILES} ${INC_FILES}) -# Set the name of the generated library -set_target_properties ( MDDataObjects PROPERTIES OUTPUT_NAME MantidMDDataObjects - COMPILE_DEFINITIONS IN_MANTID_MDDATAOBJECTS ) -# Add to the 'Framework' group in VS -set_property ( TARGET MDDataObjects PROPERTY FOLDER "MantidFramework" ) - -include_directories(inc) -target_link_libraries ( MDDataObjects ${MANTIDLIBS}) - -# Create test file projects -if ( CXXTEST_FOUND ) - include_directories(inc) - if ( GMOCK_FOUND AND GTEST_FOUND ) - cxxtest_add_test ( MDDataObjectsTest ${TEST_FILES} ${GMOCK_TEST_FILES} ) - target_link_libraries( MDDataObjectsTest MDDataObjects ${MANTIDLIBS} - ${GMOCK_LIBRARIES} ${GTEST_LIBRARIES}) - #else () - #cxxtest_add_test ( MDDataObjectsTest ${TEST_FILES} ) - #target_link_libraries( MDDataObjectsTest MDDataObjects ${MANTIDLIBS} ) - - add_dependencies ( FrameworkTests MDDataObjectsTest ) - # Add to the 'FrameworkTests' group in VS - set_property ( TARGET MDDataObjectsTest PROPERTY FOLDER "UnitTests" ) - endif () -endif () - -########################################################################### -# Installation settings -########################################################################### - -install ( TARGETS MDDataObjects DESTINATION ${LIB_DIR} ) diff --git a/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/DllConfig.h b/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/DllConfig.h deleted file mode 100644 index 9cf3a354c33a06219584edba66cc0d197bc0da81..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/DllConfig.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef MANTID_MDDATAOBJECTS_DLLCONFIG_H_ -#define MANTID_MDDATAOBJECTS_DLLCONFIG_H_ - -/* - This file contains the DLLExport/DLLImport linkage configuration for the - DataHandling library - - @author Martyn Gigg, Tessella plc - - Copyright © 2011 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory - - This file is part of Mantid. - - Mantid is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - Mantid is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - - File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>. - Code Documentation is available at: <http://doxygen.mantidproject.org> -*/ -#include "MantidKernel/System.h" - -#ifdef IN_MANTID_MDDATAOBJECTS -#define MANTID_MDDATAOBJECTS_DLL DLLExport -#else -#define MANTID_MDDATAOBJECTS_DLL DLLImport -#endif /* IN_MANTID_MDDATAOBJECTS*/ - -#endif // MANTID_MDDATAOBJECTS_DLLCONFIG_H_ diff --git a/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/DllExport.h b/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/DllExport.h deleted file mode 100644 index 2c3c29bd8c4a827578c5a057f65603791260a1a3..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/DllExport.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef MANTID_MDDATAOBJECTS_DLLEXPORT_H_ -#define MANTID_MDDATAOBJECTS_DLLEXPORT_H_ -/** -* Sets the dll import export correctly for members of the KERNEL DLL -**/ -#include <MantidKernel/System.h> - -#ifdef IN_MANTID_MDDATAOBJECTS -#define EXPORT_OPT_MANTID_MDDATAOBJECTS DLLExport -#else -#define EXPORT_OPT_MANTID_MDDATAOBJECTS DLLImport -#endif /* IN_MANTID_MDDATAOBJECTS*/ - -#endif /*MANTID_MDDATAOBJECTS_DLLEXPORT_H_*/ diff --git a/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/MDIndexCalculator.h b/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/MDIndexCalculator.h deleted file mode 100644 index e459e1ade87b92809332c544ac0ea574ab44cc64..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/MDIndexCalculator.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef MANTID_MDDATAOBJECTS_MDINDEXCALCULATOR_H_ -#define MANTID_MDDATAOBJECTS_MDINDEXCALCULATOR_H_ - -/** Handles calculations involving the translation of single dimensional indexes (used for efficient, dimensional agnostic storage) and conceptual - * multidimensional indexes. Peforms inverse calculations. Templated usage for specific dimensinal schenario. - - @author Owen Arnold, RAL ISIS - @date 25/02/2011 - - Copyright © 2007-10 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory - - This file is part of Mantid. - - Mantid is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - Mantid is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - - File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>. - Code Documentation is available at: <http://doxygen.mantidproject.org> -*/ - -//---------------------------------------------------------------------- -// Includes -//---------------------------------------------------------------------- -#include "MantidMDDataObjects/DllExport.h" -#include <vector> -namespace Mantid -{ -namespace MDDataObjects -{ - -typedef std::vector<size_t> VecIndexes; - -class EXPORT_OPT_MANTID_MDDATAOBJECTS MDWorkspaceIndexCalculator -{ -private: - /// - bool m_isSetup; - - /// Stores the number of dimensions == m_dimSizes.size() - unsigned int m_nDimensions; - - /// Stores maximum size in each dimension. - std::vector<size_t> m_dimSizes; // Though biggish value on 64 bit machine, can be reached in some odd scenario - - /// Cached coefficients - std::vector<size_t> m_coeffs; - - /// Calculate coefficients of form i + aj + ck - std::vector<size_t> cacluateCoefficients() const; - - /// Checks that non-zero dimension sizes have been provided for all the required dimensions. - bool checkValidSetUp() const; - -public: - - /// Construct calculator. - MDWorkspaceIndexCalculator(unsigned int nDimensions, int size1 = -1, int size2 = -1, int size3 = -1, int size4 = -1); - - /// Set the dimension size limit for a specified index/dimension. - void setDimensionSize(unsigned int indexOfDimension, size_t size); - - /// Get the dimension size limit for a specified index/dimension. - size_t getDimensionSize(unsigned int indexOfDimension) const; - - /// Checks that non-zero dimension sizes have been provided for all the required dimensions. - bool isValid() const{return m_isSetup;} - - /// Check that the indexes requested are not out of bounds. - void checkValidIndexesProvided(const VecIndexes& indexes) const; - - /// Calculate as single dimension index given a set of indexes relating to individual dimensions. - size_t calculateSingleDimensionIndex(const VecIndexes& indexes) const; - - /// calculate a set of indexes relating to individual dimensions given a single dimension index. - VecIndexes calculateDimensionIndexes(std::size_t singleDimensionIndex) const; - - /// calculate a set of indexes relating to individual dimensions given a single dimension index. - void calculateDimensionIndexes(std::size_t singleDimensionIndex,VecIndexes&) const; - - /// In a single dimensional form, get the upper limit for a single dimensional index value. - size_t getIndexUpperBounds() const; - - /// Get number of dimensions - size_t getNDimensions()const{return m_nDimensions;} - - /// Assignment operator - MDWorkspaceIndexCalculator& operator=(const MDWorkspaceIndexCalculator&); - - /// Copy constructor - MDWorkspaceIndexCalculator(const MDWorkspaceIndexCalculator&); - -}; - - -} -} - -#endif diff --git a/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/PrecompiledHeader.h b/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/PrecompiledHeader.h deleted file mode 100644 index 808374c39cbc7ae23467a62d55130afb0e018a60..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/inc/MantidMDDataObjects/PrecompiledHeader.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef MANTID_MDDATAOBJECTS_PRECOMPILEDHEADER_H_ -#define MANTID_MDDATAOBJECTS_PRECOMPILEDHEADER_H_ - -// Mantid -#include "MantidAPI/IMDWorkspace.h" -#include "MantidAPI/WorkspaceFactory.h" -#include "MantidAPI/IMDWorkspace.h" -#include "MantidGeometry/Instrument.h" - -//STL -#include <vector> -#include <map> -#include <cmath> - -#endif //MANTID_MDDATAOBJECTS_PRECOMPILEDHEADER_H_ diff --git a/Code/Mantid/Framework/MDDataObjects/src/MDIndexCalculator.cpp b/Code/Mantid/Framework/MDDataObjects/src/MDIndexCalculator.cpp deleted file mode 100644 index 14112b971e686d606afd46fa927d367cd1f4836f..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/src/MDIndexCalculator.cpp +++ /dev/null @@ -1,182 +0,0 @@ -#include "MantidMDDataObjects/MDIndexCalculator.h" -#include <stdexcept> - -namespace Mantid -{ -namespace MDDataObjects -{ - -/** - * Constructor. - * @param nDimensions :: Number of dimensions. - * @param size1 :: Size of the first dimension. Passing -1 (default) means the dimension is undefined. - * @param size2 :: Size of the second dimension. Passing -1 (default) means the dimension is undefined. - * @param size3 :: Size of the third dimension. Passing -1 (default) means the dimension is undefined. - * @param size4 :: Size of the fourth dimension. Passing -1 (default) means the dimension is undefined. - */ -MDWorkspaceIndexCalculator::MDWorkspaceIndexCalculator(unsigned int nDimensions, int size1, int size2, int size3, int size4) : - m_isSetup(false),m_nDimensions(nDimensions),m_dimSizes(nDimensions, 0) -{ - if (size1 <= 0) return; - setDimensionSize(0,size1); - if (size2 <= 0 || nDimensions < 2) return; - setDimensionSize(1,size2); - if (size3 <= 0 || nDimensions < 3) return; - setDimensionSize(2,size3); - if (size4 <= 0 || nDimensions < 4) return; - setDimensionSize(3,size4); -} - -/** - * Assigment operator. - * @param other :: other calculator rhs. - */ -MDWorkspaceIndexCalculator& MDWorkspaceIndexCalculator::operator=(const MDWorkspaceIndexCalculator& other) -{ - if(this != &other) - { - m_nDimensions = other.m_nDimensions; - m_coeffs = other.m_coeffs; - m_isSetup = other.m_isSetup; - m_dimSizes = other.m_dimSizes; - } - return *this; -} - -/** - * Copy constructor. - * @param other :: other calculator rhs. - */ -MDWorkspaceIndexCalculator::MDWorkspaceIndexCalculator(const MDWorkspaceIndexCalculator& other): - m_isSetup(other.m_isSetup), - m_nDimensions(other.m_nDimensions), - m_dimSizes(other.m_dimSizes), - m_coeffs(other.m_coeffs) -{ -} - -std::vector<size_t> MDWorkspaceIndexCalculator::cacluateCoefficients() const -{ - std::vector<size_t> coeffs(m_nDimensions); - coeffs[0] = 1; - for (unsigned int i = 1; i < m_nDimensions; i++) - { - coeffs[i] = coeffs[i - 1] * m_dimSizes[i - 1]; - } - return coeffs; -} - -void MDWorkspaceIndexCalculator::setDimensionSize(unsigned int indexOfDimension, size_t size) -{ - if (indexOfDimension >= m_nDimensions) - { - throw std::runtime_error("indexOfDimension is out of bounds"); - } - m_dimSizes[indexOfDimension] = size; - if (checkValidSetUp()) - { - m_coeffs = cacluateCoefficients(); - m_isSetup = true; - } -} - -size_t MDWorkspaceIndexCalculator::getDimensionSize(unsigned int indexOfDimension) const -{ - if (indexOfDimension >= m_nDimensions) - { - throw std::runtime_error("indexOfDimension is out of bounds"); - } - return m_dimSizes[indexOfDimension]; -} - - -bool MDWorkspaceIndexCalculator::checkValidSetUp() const -{ - for (unsigned int i = 0; i < m_nDimensions; i++) - { - if (m_dimSizes[i] == 0) - { - return false; - } - } - return true; -} - - -void MDWorkspaceIndexCalculator::checkValidIndexesProvided(const VecIndexes& indexes) const -{ - if (!m_isSetup) - { - throw std::runtime_error("MDWorkspaceIndexCalculator:: Not all dimensions have sizes set."); - } - if (indexes.size() != m_nDimensions) - { - throw std::range_error("Incorrect number of indexes provided"); - } - for (unsigned int i = 0; i < m_nDimensions; i++) - { - if (indexes[i] >= m_dimSizes[i]) - { - throw std::range_error("index provided is out of bounds wrt the dimension on which it is to act."); - } - } -} - - -size_t MDWorkspaceIndexCalculator::calculateSingleDimensionIndex(const VecIndexes& indexes) const -{ - checkValidIndexesProvided(indexes); - size_t singleDimensionalIndex = 0; - // = i + ni*j + ni*nj*k + ....+ - for (unsigned int i = 0; i < m_nDimensions; i++) - { - singleDimensionalIndex += m_coeffs[i] * indexes[i]; - } - return singleDimensionalIndex; -} - - -VecIndexes MDWorkspaceIndexCalculator::calculateDimensionIndexes( - std::size_t singleDimensionIndex) const -{ - std::vector<size_t> result(m_nDimensions); - calculateDimensionIndexes(singleDimensionIndex,result); - return result; -} - -void MDWorkspaceIndexCalculator::calculateDimensionIndexes( - std::size_t singleDimensionIndex,VecIndexes& indexes) const -{ - if (indexes.size() != m_nDimensions) - { - indexes.resize(m_nDimensions); - } - - size_t sum = 0; - for (int i = m_nDimensions - 1; i >= 0; i--) - { - // single dimension index - all those already accounted for by higher dimensions - size_t truncatedDimensionIndex = (singleDimensionIndex - sum); - indexes[i] = truncatedDimensionIndex / m_coeffs[i]; //Integer division - sum += indexes[i] * m_coeffs[i]; - } -} - - -size_t MDWorkspaceIndexCalculator::getIndexUpperBounds() const -{ - if (!m_isSetup) - { - throw std::runtime_error("MDWorkspaceIndexCalculator:: Not all dimensions have sizes set."); - } - size_t sum = m_dimSizes[0]; - for (unsigned int i = 1; i < m_nDimensions; i++) - { - sum *= m_dimSizes[i]; - } - return sum - 1; -} - - -} // MDDataObjects -} // Mantid diff --git a/Code/Mantid/Framework/MDDataObjects/src/PrecompiledHeader.cpp b/Code/Mantid/Framework/MDDataObjects/src/PrecompiledHeader.cpp deleted file mode 100644 index 06051390cce67980b21f6a87283d5dd9d5ce7032..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/src/PrecompiledHeader.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "MantidMDDataObjects/PrecompiledHeader.h" \ No newline at end of file diff --git a/Code/Mantid/Framework/MDDataObjects/test/MDIndexCalculatorTest.h b/Code/Mantid/Framework/MDDataObjects/test/MDIndexCalculatorTest.h deleted file mode 100644 index afef8e3de62cb0a6f20795ab84bf4ce0952d5242..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/test/MDIndexCalculatorTest.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef MD_INDEX_CALCULATOR_TEST_H_ -#define MD_INDEX_CALCULATOR_TEST_H_ - -#include <cxxtest/TestSuite.h> -#include "MantidMDDataObjects/MDIndexCalculator.h" - -class MDIndexCalculatorTest : public CxxTest::TestSuite -{ - -public: - - void testCalculatorSubdivideIndex() - { - Mantid::MDDataObjects::MDWorkspaceIndexCalculator calculator(3); - calculator.setDimensionSize(0,3); - calculator.setDimensionSize(1,5); - calculator.setDimensionSize(2,4); - TS_ASSERT(calculator.isValid()); - - std::vector<size_t> result = calculator.calculateDimensionIndexes(4); - TS_ASSERT_EQUALS(1, result[0]); - TS_ASSERT_EQUALS(1, result[1]); - TS_ASSERT_EQUALS(0, result[2]); - } - - void testCalculatorGenerateSingleDimensionIndex() - { - std::vector<size_t> indexes; - indexes.push_back(2); // In x - indexes.push_back(4); // In y - indexes.push_back(3); // In z - - Mantid::MDDataObjects::MDWorkspaceIndexCalculator calculator(3); - calculator.setDimensionSize(0,3); - calculator.setDimensionSize(1,5); - calculator.setDimensionSize(2,4); - TS_ASSERT(calculator.isValid()); - - size_t result = calculator.calculateSingleDimensionIndex(indexes); - TS_ASSERT_EQUALS(59, result); - } - - void testSelfCheck() - { - //The two calculation methods are inverse functions of each other. - Mantid::MDDataObjects::MDWorkspaceIndexCalculator calculator(3); - calculator.setDimensionSize(0, 3); - calculator.setDimensionSize(1, 5); - calculator.setDimensionSize(2, 4); - TS_ASSERT(calculator.isValid()); - - size_t startingSingleDimensionIndex = 5; - std::vector<size_t> result = calculator.calculateDimensionIndexes(startingSingleDimensionIndex); - size_t endSingleDimensionIndex = calculator.calculateSingleDimensionIndex(result); - - TSM_ASSERT_EQUALS("inverse relationship is not working.",startingSingleDimensionIndex, endSingleDimensionIndex); - } -}; - -#endif diff --git a/Code/Mantid/Framework/MDDataObjects/test/Mantid.properties b/Code/Mantid/Framework/MDDataObjects/test/Mantid.properties deleted file mode 100644 index 8f22892c1fbe2125ee3a601d41eec202deee0c3d..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/test/Mantid.properties +++ /dev/null @@ -1,45 +0,0 @@ -#framework configuration -mantid.legs = 6 - -#logging configuration -logging.loggers.root.level = information -logging.loggers.root.channel = fileChannel -logging.channels.fileChannel.class = FileChannel -logging.channels.fileChannel.path = Test.log -logging.channels.fileChannel.formatter.class = PatternFormatter -logging.channels.fileChannel.formatter.pattern = %Y-%m-%d %H:%M:%S,%i [%I] %p %s - %t -logging.channels.fileChannel.times = local -logging.channels.fileChannel.formatter.times = local - -#Plugin configuration -plugins.directory = ../../release - -#Where to load instrument definition files from -instrumentDefinition.directory = ../../../../Test/Instrument - -#Where to load instrument definition files from -instrumentDefinition.directory = ../../../../Test/Instrument - -# Where to load parameter definition files from -parameterDefinition.directory = ../../../../Test/Instrument - -# The location of the scripts directory. This is added to the python path by the -# Python API so that Mantid scripts can be imported more easily -pythonscripts.directory = ../../PythonAPI/scripts - -# Data search path -datasearch.directories = ../../../../Test/AutoTestData;../../../../../Test/AutoTestData;../../../../../Test/VATES;../../../../Test/Data;../../../../Test/Data/sns_event_prenexus;../../../../Test/Nexus;../../../../Test/Nexus/SNS - -# Default save directory -defaultsave.directory = . - -# ICat downlaod directory -icatDownload.directory = . - -# Uncommenting the line below will lead to all 2D workspaces being of the ManagedWorkspace2D variety -#ManagedWorkspace.LowerMemoryLimit = 0 -ManagedWorkspace.LowerMemoryLimit = 80 -ManagedWorkspace.DataBlockSize = 4000 -ManagedWorkspace.FilePath = . - -algorithms.retained = 50 diff --git a/Code/Mantid/Framework/MDDataObjects/test/Mantid.user.properties b/Code/Mantid/Framework/MDDataObjects/test/Mantid.user.properties deleted file mode 100644 index d39bd10944bd026e82469af87ea5f076750ffe59..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/test/Mantid.user.properties +++ /dev/null @@ -1,38 +0,0 @@ -# This file can be used to override any properties for this installation. -# Any properties found in this file will override any that are found in the Mantid.Properties file -# As this file will not be replaced with futher installations of Mantid it is a safe place to put -# properties that suit your particular installation. - -#for example -#uncommenting the line below will set the number of algorithms to retain interim results for to be 90 -#overriding any value set in the Mantid.properties file -#algorithms.retained = 90 - -# Where to load instrument definition files from -instrumentDefinition.directory = ../../../../Test/Instrument - -# Where to load parameter definition files from -parameterDefinition.directory = ../../../../Test/Instrument - -# Location of Python scripts that are required for certain aspects of Mantid to function -# correctly, i.e. customized interfaces -# -# WARNING: Altering this value will almost certainly break Mantid functionality -# -requiredpythonscript.directories = ../../PythonAPI/scripts/Crystallography;../../PythonAPI/PythonAPI/scripts/Disordered Materials;../../PythonAPI/PythonAPI/scripts/Engineering;../../PythonAPI/PythonAPI/scripts/Excitations;../../PythonAPI/PythonAPI/scripts/Large Scale Structures;\ -../../PythonAPI/PythonAPI/scripts/Molecular Spectroscopy;../../PythonAPI/PythonAPI/scripts/Muons;../../PythonAPI/PythonAPI/scripts/Neutrinos;../../PythonAPI/PythonAPI/scripts/SANS - -# Additional directory for Python scripts. This is added to the Python path by the -# Python API (DEPRECATED: Use pythonscripts.directories) -# Note that this is NOT recursive -pythonscripts.directory = ../../PythonAPI/PythonAPI/scripts - -# Additional directories for Python scripts. These are added to the Python path by the -# Python API. -# Note that they are NOT recursive -pythonscripts.directories = ../../PythonAPI/PythonAPI/scripts - -# The locations of Python algorithms that are to be loaded at startup -pythonalgorithms.directories = ../../PythonAPI/PythonAPI/PythonAlgorithms -# -logging.loggers.root.level = debug diff --git a/Code/Mantid/Framework/MDDataObjects/test/PrecompiledHeader.cpp b/Code/Mantid/Framework/MDDataObjects/test/PrecompiledHeader.cpp deleted file mode 100644 index f07790a0658793d9236511801b885b4526ebe662..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/test/PrecompiledHeader.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "PrecompiledHeader.h" \ No newline at end of file diff --git a/Code/Mantid/Framework/MDDataObjects/test/PrecompiledHeader.h b/Code/Mantid/Framework/MDDataObjects/test/PrecompiledHeader.h deleted file mode 100644 index cd99ad0b3efaa562b74a40740a1f8d33efeb464c..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/MDDataObjects/test/PrecompiledHeader.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef MANTID_MDDATAOBJECTSTEST_PRECOMPILED_HEADER_H_ -#define MANTID_MDDATAOBJECTSTEST_PRECOMPILED_HEADER_H_ - -// cxxtest -#include <cxxtest/WrappedTestSuite.h> - -// STL -#include <vector> -#include <set> -#include <string> - -#endif //MANTID_MDDATAOBJECTSTEST_PRECOMPILED_HEADER_H_ \ No newline at end of file diff --git a/Code/Mantid/Installers/WinInstaller/generateWxs.py b/Code/Mantid/Installers/WinInstaller/generateWxs.py index 2323c497a3e1a0a9854f9b7b216f8757e8ce2d68..1ab6d48d4f965ecb49357e467d6cc9d2264e6ba5 100644 --- a/Code/Mantid/Installers/WinInstaller/generateWxs.py +++ b/Code/Mantid/Installers/WinInstaller/generateWxs.py @@ -569,7 +569,6 @@ addFileV('MantidCurveFitting','MCF.dll','MantidCurveFitting.dll',MANTIDRELEASE + addFileV('MantidICat','MIC.dll','MantidICat.dll',MANTIDRELEASE + '/MantidICat.dll',Plugins) addFileV('MantidCrystal','MCR.dll','MantidCrystal.dll',MANTIDRELEASE + '/MantidCrystal.dll',Plugins) addFileV('MantidNexus','MNex.dll','MantidNexus.dll',MANTIDRELEASE + '/MantidNexus.dll',Plugins) -addFileV('MantidMDDataObjects', 'MMDO.dll', 'MantidMDDataObjects.dll',MANTIDRELEASE + '/MantidMDDataObjects.dll',Plugins) addFileV('MantidMDAlgorithms', 'MMDA.dll', 'MantidMDAlgorithms.dll',MANTIDRELEASE + '/MantidMDAlgorithms.dll',Plugins) addFileV('MantidMDEvents', 'MMDE.dll', 'MantidMDEvents.dll',MANTIDRELEASE + '/MantidMDEvents.dll',Plugins) diff --git a/Code/Mantid/Vates/CMakeLists.txt b/Code/Mantid/Vates/CMakeLists.txt index 4ae78327a7048e25766facac45806897b329f8f3..231524650d13387b1ebf284295820b8f1288c3c0 100644 --- a/Code/Mantid/Vates/CMakeLists.txt +++ b/Code/Mantid/Vates/CMakeLists.txt @@ -53,7 +53,7 @@ if( ParaView_FOUND AND USE_PARAVIEW ) #On install commands. #1) Check that MantidPath exists. - #2) Append MantidPath/../plugins directory onto path, as it contains libs MDAlgorithms, MDDataObjects etc. + #2) Append MantidPath/../plugins directory onto path, as it contains libs MDAlgorithms, etc. #3) Append the installdir/bin directory onto path as it contains libs MantidVatesAPI etc (required for advanced Paraview plugin loading). #4) Point to the location of the plubin libs. Paraview will then autoload these. set (CPACK_NSIS_EXTRA_INSTALL_COMMANDS " diff --git a/Code/Mantid/Vates/VatesAPI/src/vtkThresholdingLineFactory.cpp b/Code/Mantid/Vates/VatesAPI/src/vtkThresholdingLineFactory.cpp index c21a368c7b96cc78199297a8ec226151992b71f6..3670ed074ee7b49efd66047c1d37fe5b8f5c0669 100644 --- a/Code/Mantid/Vates/VatesAPI/src/vtkThresholdingLineFactory.cpp +++ b/Code/Mantid/Vates/VatesAPI/src/vtkThresholdingLineFactory.cpp @@ -4,7 +4,6 @@ #include "vtkFloatArray.h" #include "vtkSmartPointer.h" #include "vtkLine.h" -#include "MantidMDDataObjects/MDIndexCalculator.h" #include <vector> #include <boost/math/special_functions/fpclassify.hpp> #include "MantidAPI/IMDWorkspace.h" diff --git a/Code/Mantid/Vates/VatesAPI/src/vtkThresholdingQuadFactory.cpp b/Code/Mantid/Vates/VatesAPI/src/vtkThresholdingQuadFactory.cpp index 4a4245bcc4bf80d4124b17e85ad0c5fc870e7831..3de51c45ad65453a06c9f50f6d953c79a7552723 100644 --- a/Code/Mantid/Vates/VatesAPI/src/vtkThresholdingQuadFactory.cpp +++ b/Code/Mantid/Vates/VatesAPI/src/vtkThresholdingQuadFactory.cpp @@ -1,6 +1,5 @@ #include "MantidAPI/IMDWorkspace.h" #include "MantidKernel/CPUTimer.h" -#include "MantidMDDataObjects/MDIndexCalculator.h" #include "MantidMDEvents/MDHistoWorkspace.h" #include "MantidVatesAPI/NullCoordTransform.h" #include "MantidVatesAPI/vtkThresholdingQuadFactory.h" diff --git a/Code/Mantid/Vates/VatesAPI/test/MockObjects.h b/Code/Mantid/Vates/VatesAPI/test/MockObjects.h index c08bea63196fcdf812356e73687d6046bece4c88..9473265d1bf36e2eb4fa1962f641dd8727c6f0aa 100644 --- a/Code/Mantid/Vates/VatesAPI/test/MockObjects.h +++ b/Code/Mantid/Vates/VatesAPI/test/MockObjects.h @@ -18,7 +18,6 @@ #include "MantidVatesAPI/RebinningCutterXMLDefinitions.h" #include "MantidVatesAPI/WorkspaceProvider.h" #include "MantidVatesAPI/NullCoordTransform.h" -#include "MantidMDDataObjects/MDIndexCalculator.h" #include <gmock/gmock.h> #include <vtkFieldData.h> #include <vtkCharArray.h> diff --git a/Code/Mantid/Vates/VatesAPI/test/runTests.sh b/Code/Mantid/Vates/VatesAPI/test/runTests.sh index abd7d3f6609280868d39228febe6475e159568a6..b223a9bad41baf8368e006b617f56baf92c4d61f 100755 --- a/Code/Mantid/Vates/VatesAPI/test/runTests.sh +++ b/Code/Mantid/Vates/VatesAPI/test/runTests.sh @@ -35,8 +35,8 @@ vtk_libpath=/usr/local/2.1.1/linux-x86_64/lib #TODO set path properly gmock_libpath=../../../TestingTools/lib/ubuntu-10.10 -g++ -O0 -g3 -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -o runner.exe runner.cpp -I../../../Framework/Kernel/inc -I../../../Framework/MDDataObjects/inc -I../../../Framework/MDAlgorithms/inc -I../../../Framework/API/inc -I../inc/VisitPlugins -I/usr/local/2.1.1/linux-x86_64/include/vtk/include/vtk-5.0 -I../../../Framework/Geometry/inc -I ../inc \ - -I ../../../../Third_Party/src/cxxtest -I ../../../../Third_Party/include -I ../../../TestingTools/include -L$vtk_libpath -L$mantid_libpath -L$gmock_libpath -lvtkCommon -lvtkFiltering -lMantidKernel -lMantidGeometry -lMantidAPI -lboost_date_time-mt -lgmock -lMantidMDAlgorithms -lMantidDataObjects -lMantidMDDataObjects -lMantidVisitPresenters -lhdf5 -Wno-deprecated +g++ -O0 -g3 -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -o runner.exe runner.cpp -I../../../Framework/Kernel/inc -I../../../Framework/MDAlgorithms/inc -I../../../Framework/API/inc -I../inc/VisitPlugins -I/usr/local/2.1.1/linux-x86_64/include/vtk/include/vtk-5.0 -I../../../Framework/Geometry/inc -I ../inc \ + -I ../../../../Third_Party/src/cxxtest -I ../../../../Third_Party/include -I ../../../TestingTools/include -L$vtk_libpath -L$mantid_libpath -L$gmock_libpath -lvtkCommon -lvtkFiltering -lMantidKernel -lMantidGeometry -lMantidAPI -lboost_date_time-mt -lgmock -lMantidMDAlgorithms -lMantidDataObjects -lMantidVisitPresenters -lhdf5 -Wno-deprecated echo diff --git a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingLineFactoryTest.h b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingLineFactoryTest.h index 55ae8924a5c58ced34453a7c1e6ff5b0d8e7ed11..d57b974388d07c6270efd37f50419e99a45aafba 100644 --- a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingLineFactoryTest.h +++ b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingLineFactoryTest.h @@ -5,7 +5,6 @@ #include "MantidTestHelpers/MDEventsTestHelper.h" #include "MantidVatesAPI/UserDefinedThresholdRange.h" #include "MantidVatesAPI/vtkThresholdingLineFactory.h" -#include "MantidMDDataObjects/MDIndexCalculator.h" #include "MockObjects.h" #include <cxxtest/TestSuite.h> #include <gmock/gmock.h> diff --git a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingQuadFactoryTest.h b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingQuadFactoryTest.h index 7dc742417f343b83aeabff694c1aad30a483bf54..24551c120f41712a8f6a317b933f6d4654b2511c 100644 --- a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingQuadFactoryTest.h +++ b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingQuadFactoryTest.h @@ -5,7 +5,6 @@ #include "MantidTestHelpers/MDEventsTestHelper.h" #include "MantidVatesAPI/UserDefinedThresholdRange.h" #include "MantidVatesAPI/vtkThresholdingQuadFactory.h" -#include "MantidMDDataObjects/MDIndexCalculator.h" #include "MockObjects.h" #include <cxxtest/TestSuite.h> #include <gmock/gmock.h>