diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/Sample.h b/Code/Mantid/Framework/API/inc/MantidAPI/Sample.h index 2d44b3a4d63df9c27e1ea9026c196cc4c3c2cda3..3b7b36f0d34801dc174eaaa32fc1dd99548dcfc5 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/Sample.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/Sample.h @@ -6,15 +6,20 @@ //------------------------------------------------------------------------------ #include "MantidAPI/DllConfig.h" #include "MantidKernel/V3D.h" -#include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/Material.h" -#include <MantidGeometry/Crystal/OrientedLattice.h> +#include "MantidGeometry/Objects/Object.h" #include <vector> -using Mantid::Geometry::OrientedLattice; namespace Mantid { + //----------------------------------------------------------------------------- + // Geometry forward declarations + //------------------------------------------------------------------------------ + namespace Geometry + { + class OrientedLattice; + } namespace API { @@ -101,11 +106,11 @@ namespace Mantid /** @name Access the sample's lattice structure and orientation */ //@{ /// Get a reference to the sample's OrientedLattice - const OrientedLattice & getOrientedLattice() const; + const Geometry::OrientedLattice & getOrientedLattice() const; /// Get a reference to the sample's OrientedLattice - OrientedLattice & getOrientedLattice(); + Geometry::OrientedLattice & getOrientedLattice(); /// Set the OrientedLattice defining the sample's lattice and orientation - void setOrientedLattice(OrientedLattice * latt); + void setOrientedLattice(Geometry::OrientedLattice * latt); bool hasOrientedLattice() const; //@} @@ -143,7 +148,7 @@ namespace Mantid /// An owned pointer to the SampleEnvironment object boost::shared_ptr<SampleEnvironment> m_environment; /// Pointer to the OrientedLattice of the sample, NULL if not set. - OrientedLattice * m_lattice; + Geometry::OrientedLattice * m_lattice; /// Vector of child samples std::vector<boost::shared_ptr<Sample> > m_samples; diff --git a/Code/Mantid/Framework/API/src/FrameworkManager.cpp b/Code/Mantid/Framework/API/src/FrameworkManager.cpp index e4235982debc14c0105d3953960e911f764ac342..27a424d991dd057b49dc254fc8c830ad79acf7cd 100644 --- a/Code/Mantid/Framework/API/src/FrameworkManager.cpp +++ b/Code/Mantid/Framework/API/src/FrameworkManager.cpp @@ -73,8 +73,8 @@ void FrameworkManagerImpl::setGlobalLocaleToAscii() void FrameworkManagerImpl::clear() { clearAlgorithms(); - clearData(); clearInstruments(); + clearData(); MemoryManager::Instance().releaseFreeMemory(); } diff --git a/Code/Mantid/Framework/API/src/Sample.cpp b/Code/Mantid/Framework/API/src/Sample.cpp index d7f639b9934f3db5264d3584d5efde09fea2a73e..381ce12acd0206147a11115e7429c3245d2ffbd2 100644 --- a/Code/Mantid/Framework/API/src/Sample.cpp +++ b/Code/Mantid/Framework/API/src/Sample.cpp @@ -7,19 +7,20 @@ #include "MantidGeometry/IComponent.h" #include "MantidGeometry/Crystal/OrientedLattice.h" #include "MantidGeometry/Objects/ShapeFactory.h" + #include "MantidNexusCPP/NeXusException.hpp" -using namespace Mantid::Kernel; -using Mantid::Geometry::ShapeFactory; namespace Mantid { namespace API { - + using namespace Mantid::Kernel; + using Geometry::ShapeFactory; using Geometry::Object; using Geometry::Material; + using Geometry::OrientedLattice; using Kernel::V3D; /** diff --git a/Code/Mantid/Framework/API/test/ExperimentInfoTest.h b/Code/Mantid/Framework/API/test/ExperimentInfoTest.h index bcc6b593c67f5379d8c0e6a7cf3cc0a3669c6c01..c0952a027866a6daa96078645aa287ecc2e2c36f 100644 --- a/Code/Mantid/Framework/API/test/ExperimentInfoTest.h +++ b/Code/Mantid/Framework/API/test/ExperimentInfoTest.h @@ -14,6 +14,7 @@ #include <set> #include "MantidKernel/ConfigService.h" #include "MantidKernel/SingletonHolder.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" using namespace Mantid::API; using namespace Mantid::Kernel; diff --git a/Code/Mantid/Framework/Algorithms/src/CopySample.cpp b/Code/Mantid/Framework/Algorithms/src/CopySample.cpp index 96fa01e8d731388a48301bc41d613ec76c9bfead..71d06d4c0e683fb58db6b08f4d770b85fca2d92a 100644 --- a/Code/Mantid/Framework/Algorithms/src/CopySample.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CopySample.cpp @@ -15,6 +15,7 @@ The following information can be copied: #include "MantidKernel/System.h" #include "MantidAPI/IMDEventWorkspace.h" #include "MantidAPI/SampleEnvironment.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" namespace Mantid { @@ -149,7 +150,7 @@ namespace Algorithms to.setThickness(from.getThickness()); to.setWidth(from.getWidth()); } - if ((latticeFlag) && from.hasOrientedLattice()) to.setOrientedLattice(new OrientedLattice(from.getOrientedLattice())); + if ((latticeFlag) && from.hasOrientedLattice()) to.setOrientedLattice(new Geometry::OrientedLattice(from.getOrientedLattice())); } diff --git a/Code/Mantid/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h b/Code/Mantid/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h index a10894bc56a6a7a177b31ddb442579a828fa699d..4f2fb147e4b1bb9ac612564363991a4f75c56a4f 100644 --- a/Code/Mantid/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h +++ b/Code/Mantid/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h @@ -7,6 +7,7 @@ #include "MantidAPI/Algorithm.h" #include <boost/tuple/tuple.hpp> #include "MantidAPI/IPeaksWorkspace.h" +#include "MantidGeometry/Crystal/UnitCell.h" #include "MantidKernel/V3D.h" #include <set> diff --git a/Code/Mantid/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h b/Code/Mantid/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h index 23b8fdc53fa2659c88dc71b1bcfd0b33288653b4..710798922656d00f15f882c106b9f420101d268c 100644 --- a/Code/Mantid/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h +++ b/Code/Mantid/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h @@ -60,7 +60,7 @@ namespace Crystal /// Counter of possible peaks size_t numInRange; /// Crystal applied - OrientedLattice crystal; + Geometry::OrientedLattice crystal; /// Min D spacing to apply. double minD; /// Max D spacing to apply. diff --git a/Code/Mantid/Framework/Crystal/src/CalculateUMatrix.cpp b/Code/Mantid/Framework/Crystal/src/CalculateUMatrix.cpp index e06162cbd392f4f5da395ed38b671ecda4c7a90b..30665aeeba3b66810a268cf7899787502ffaf947 100644 --- a/Code/Mantid/Framework/Crystal/src/CalculateUMatrix.cpp +++ b/Code/Mantid/Framework/Crystal/src/CalculateUMatrix.cpp @@ -124,6 +124,7 @@ namespace Crystal using namespace Mantid::Kernel; using namespace Mantid::API; using namespace Mantid::DataObjects; + using Mantid::Geometry::OrientedLattice; //---------------------------------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/Crystal/src/LoadIsawUB.cpp b/Code/Mantid/Framework/Crystal/src/LoadIsawUB.cpp index 037024c8a53a27ad4a4147720d2c7fb75ec71799..dcf7db574b0c28d8bf21740c20f3f85b0e8358d8 100644 --- a/Code/Mantid/Framework/Crystal/src/LoadIsawUB.cpp +++ b/Code/Mantid/Framework/Crystal/src/LoadIsawUB.cpp @@ -20,6 +20,7 @@ The ISAW UB Matrix file format is: TODO using namespace Mantid::Kernel::Strings; using Mantid::Kernel::DblMatrix; using Mantid::Geometry::UnitCell; +using Mantid::Geometry::OrientedLattice; namespace Mantid { diff --git a/Code/Mantid/Framework/Crystal/src/PeakIntegration.cpp b/Code/Mantid/Framework/Crystal/src/PeakIntegration.cpp index d3c0b2066a3d3ebb9489d6d72621118d43c3fcd1..9b1037022555ce1e95d52fb9bfe552f4df70f40d 100644 --- a/Code/Mantid/Framework/Crystal/src/PeakIntegration.cpp +++ b/Code/Mantid/Framework/Crystal/src/PeakIntegration.cpp @@ -25,6 +25,7 @@ Integrate and calculate error of integration of each peak from single crystal da #include "MantidGeometry/IComponent.h" #include "MantidGeometry/ICompAssembly.h" #include "MantidGeometry/Instrument/RectangularDetector.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include <boost/algorithm/string.hpp> #include "MantidKernel/VectorHelper.h" diff --git a/Code/Mantid/Framework/Crystal/src/SaveIsawUB.cpp b/Code/Mantid/Framework/Crystal/src/SaveIsawUB.cpp index 242bcdcf87266c5598ba36a1a785b31516af3adf..f7dd682a39624d75b688ce203c2db2e1afa7bb55 100644 --- a/Code/Mantid/Framework/Crystal/src/SaveIsawUB.cpp +++ b/Code/Mantid/Framework/Crystal/src/SaveIsawUB.cpp @@ -17,6 +17,7 @@ using Mantid::Kernel::DblMatrix; using Mantid::Geometry::UnitCell; +using Mantid::Geometry::OrientedLattice; namespace Mantid { diff --git a/Code/Mantid/Framework/Crystal/src/SetUB.cpp b/Code/Mantid/Framework/Crystal/src/SetUB.cpp index 2f09abf44f984dbaa3225a4dcfa3c8bffbb9a2cf..92563766904a09b532468142eca91ab40b66d9f3 100644 --- a/Code/Mantid/Framework/Crystal/src/SetUB.cpp +++ b/Code/Mantid/Framework/Crystal/src/SetUB.cpp @@ -14,6 +14,7 @@ If the UB matrix is all zeros (default), it will calculate it from lattice param using namespace Mantid::Kernel; using namespace Mantid::API; +using Mantid::Geometry::OrientedLattice; namespace Mantid { diff --git a/Code/Mantid/Framework/Crystal/test/CalculateUMatrixTest.h b/Code/Mantid/Framework/Crystal/test/CalculateUMatrixTest.h index 74c84e3d04afcb7209779b0ab48b54981f5a68b8..38cca516ead807e74b6085cdbee0b07d02feea10 100644 --- a/Code/Mantid/Framework/Crystal/test/CalculateUMatrixTest.h +++ b/Code/Mantid/Framework/Crystal/test/CalculateUMatrixTest.h @@ -15,8 +15,10 @@ #include "MantidDataObjects/PeaksWorkspace.h" #include "MantidKernel/V3D.h" #include "MantidTestHelpers/ComponentCreationHelper.h" + using namespace Mantid; using namespace Mantid::Crystal; +using Mantid::Geometry::OrientedLattice; using namespace Mantid::API; using namespace Mantid::DataObjects; using namespace Mantid::Kernel; diff --git a/Code/Mantid/Framework/Crystal/test/FindUBUsingFFTTest.h b/Code/Mantid/Framework/Crystal/test/FindUBUsingFFTTest.h index fa5a42aa7f7386ead07cc8d0d2b9a21ddd771331..b6a67ce6bb2d922a18186d86cc294c362f5bbd9b 100644 --- a/Code/Mantid/Framework/Crystal/test/FindUBUsingFFTTest.h +++ b/Code/Mantid/Framework/Crystal/test/FindUBUsingFFTTest.h @@ -14,6 +14,7 @@ using namespace Mantid; using namespace Mantid::Crystal; +using Mantid::Geometry::OrientedLattice; using namespace Mantid::API; using namespace Mantid::DataObjects; using namespace Mantid::Kernel; diff --git a/Code/Mantid/Framework/Crystal/test/FindUBUsingIndexedPeaksTest.h b/Code/Mantid/Framework/Crystal/test/FindUBUsingIndexedPeaksTest.h index 53c4c3c4c5a6a9410f5dfe2767e032c9bb7d9b68..413aa94bfce5681e82b6f517788b53047d8d0096 100644 --- a/Code/Mantid/Framework/Crystal/test/FindUBUsingIndexedPeaksTest.h +++ b/Code/Mantid/Framework/Crystal/test/FindUBUsingIndexedPeaksTest.h @@ -14,9 +14,12 @@ using namespace Mantid; using namespace Mantid::Crystal; +using Mantid::Geometry::OrientedLattice; using namespace Mantid::API; using namespace Mantid::DataObjects; using namespace Mantid::Kernel; + + class FindUBUsingIndexedPeaksTest : public CxxTest::TestSuite { public: diff --git a/Code/Mantid/Framework/Crystal/test/FindUBUsingLatticeParametersTest.h b/Code/Mantid/Framework/Crystal/test/FindUBUsingLatticeParametersTest.h index aa6c6242ea403230f9325e1e69603da009926430..7663a4ee099306438e678d7e149ab91fd105628c 100644 --- a/Code/Mantid/Framework/Crystal/test/FindUBUsingLatticeParametersTest.h +++ b/Code/Mantid/Framework/Crystal/test/FindUBUsingLatticeParametersTest.h @@ -14,6 +14,7 @@ using namespace Mantid; using namespace Mantid::Crystal; +using Mantid::Geometry::OrientedLattice; using namespace Mantid::API; using namespace Mantid::DataObjects; using namespace Mantid::Kernel; diff --git a/Code/Mantid/Framework/Crystal/test/FindUBUsingMinMaxDTest.h b/Code/Mantid/Framework/Crystal/test/FindUBUsingMinMaxDTest.h index b762e2e4d6bc2a82eae765b6ffe282ce83a01bfb..10c5580ab7b88592a066a275e80eb54a55f69e1d 100644 --- a/Code/Mantid/Framework/Crystal/test/FindUBUsingMinMaxDTest.h +++ b/Code/Mantid/Framework/Crystal/test/FindUBUsingMinMaxDTest.h @@ -14,6 +14,7 @@ using namespace Mantid; using namespace Mantid::Crystal; +using Mantid::Geometry::OrientedLattice; using namespace Mantid::API; using namespace Mantid::DataObjects; using namespace Mantid::Kernel; diff --git a/Code/Mantid/Framework/Crystal/test/LoadIsawUBTest.h b/Code/Mantid/Framework/Crystal/test/LoadIsawUBTest.h index 506a9f6d90110e6122546eed9d615099322e1814..8db4bf11eef3e540410f81bd1067d54f2a0ea86d 100644 --- a/Code/Mantid/Framework/Crystal/test/LoadIsawUBTest.h +++ b/Code/Mantid/Framework/Crystal/test/LoadIsawUBTest.h @@ -8,6 +8,7 @@ #include "MantidKernel/System.h" #include "MantidKernel/Timer.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include <cxxtest/TestSuite.h> #include <iomanip> #include <iostream> diff --git a/Code/Mantid/Framework/Crystal/test/SetUBTest.h b/Code/Mantid/Framework/Crystal/test/SetUBTest.h index b1c8450ce74df34fc85f229a5a59485571c7b961..6139c63856a6ae635c21e5a2978fa42077998d2b 100644 --- a/Code/Mantid/Framework/Crystal/test/SetUBTest.h +++ b/Code/Mantid/Framework/Crystal/test/SetUBTest.h @@ -10,6 +10,7 @@ #include "MantidCrystal/SetUB.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h" #include "MantidDataObjects/Workspace2D.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include "MantidKernel/Matrix.h" using namespace Mantid; @@ -17,6 +18,7 @@ using namespace Mantid::Crystal; using namespace Mantid::API; using namespace Mantid::Kernel; using namespace Mantid::DataObjects; +using Mantid::Geometry::OrientedLattice; class SetUBTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/AngleUnits.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/AngleUnits.h new file mode 100644 index 0000000000000000000000000000000000000000..f2af003166cf9ad04cc528d08f171498ea20938c --- /dev/null +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/AngleUnits.h @@ -0,0 +1,49 @@ +#ifndef MANTID_GEOMETRY_ANGLEUNITS_H_ +#define MANTID_GEOMETRY_ANGLEUNITS_H_ + +#include "MantidGeometry/DllConfig.h" +#include <cmath> + +namespace Mantid +{ + namespace Geometry + { + /** + Defines units/enum for Crystal work + + 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> + */ + + + /// Degrees to radians conversion factor + const double deg2rad=M_PI/180.; + + /// Radians to degrees conversion factor + const double rad2deg=180./M_PI; + + /// Flag for angle units used in UnitCell class + enum AngleUnits { angDegrees, angRadians}; + + } +} + + +#endif /* MANTID_GEOMETRY_ANGLEUNITS_H_ */ diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h index 868ce473d1460a588aea84fa887d9f4ab043bc1f..038e32a05867fc729ea1e9f27ddaf4ad5a661633 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h @@ -1,6 +1,7 @@ #ifndef MANTID_GEOMETRY_ORIENTEDLATTICE_H_ #define MANTID_GEOMETRY_ORIENTEDLATTICE_H_ -#include <MantidGeometry/Crystal/UnitCell.h> + +#include "MantidGeometry/Crystal/UnitCell.h" #include "MantidNexusCPP/NeXusFile.hpp" namespace Mantid @@ -70,7 +71,7 @@ namespace Geometry Kernel::DblMatrix UB; /** Make recalculateFromGstar private. */ - void recalculateFromGstar(Kernel::DblMatrix& NewGstar) + void recalculateFromGstar(const Kernel::DblMatrix& NewGstar) { UnitCell::recalculateFromGstar(NewGstar); } }; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/UnitCell.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/UnitCell.h index 108c0f376c99e70b23bf01829e89c95c56bcc5bd..fdce801da030683d89444913d3a3d1f39ac7175a 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/UnitCell.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/UnitCell.h @@ -2,6 +2,7 @@ #define MANTID_GEOMETRY_UNITCELL_H_ #include "MantidGeometry/DllConfig.h" +#include "MantidGeometry/Crystal/AngleUnits.h" #include "MantidKernel/PhysicalConstants.h" #include "MantidKernel/Matrix.h" #include "MantidKernel/Quat.h" @@ -49,15 +50,6 @@ namespace Geometry File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>. Code Documentation is available at: <http://doxygen.mantidproject.org> */ - - /// Degrees to radians conversion factor - const double deg2rad=M_PI/180.; - /// Radians to degrees conversion factor - const double rad2deg=180./M_PI; - /// Flag for angle units used in UnitCell class - enum AngleUnits {angDegrees/** Degrees*/ - ,angRadians/** Radians*/}; - class MANTID_GEOMETRY_DLL UnitCell { public: @@ -124,7 +116,7 @@ namespace Geometry double recAngle(double h1, double k1, double l1, double h2, double k2, double l2, const int angleunit=angDegrees) const; double volume()const; double recVolume() const; - virtual void recalculateFromGstar(Kernel::Matrix<double>& NewGstar); + virtual void recalculateFromGstar(const Kernel::Matrix<double>& NewGstar); private: /// Lattice parameter a,b,c,alpha,beta,gamma (in \f$ \mbox{ \AA } \f$ and radians) diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h index 77439c43bb5e03c66b400e1df1042df982e16b47..e644970403aed49856bc3689fd1967207e9af72a 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h @@ -1,9 +1,9 @@ #ifndef MANTID_GEOMETRY_GONIOMETER_H_ #define MANTID_GEOMETRY_GONIOMETER_H_ -#include <MantidKernel/Matrix.h> -#include <MantidKernel/V3D.h> -#include <MantidGeometry/Crystal/UnitCell.h> //for angle units +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" +#include "MantidGeometry/Crystal/AngleUnits.h" #include <string> #include "MantidNexusCPP/NeXusFile.hpp" @@ -53,7 +53,7 @@ namespace Geometry Kernel::V3D rotationaxis; /// GoniometerAxis direction double angle; /// Rotation angle int sense; /// Rotation sense (1 for CCW, -1 for CW) - int angleunit; ///angle units are angDegrees or angRadians (see UnitCell.h) + int angleunit; ///angle units are angDegrees or angRadians (see AngleUnits.h) /// Constructor GoniometerAxis(std::string initname, Kernel::V3D initrotationaxis,double initangle,int initsense,int initangleunit):name(initname),rotationaxis(initrotationaxis),angle(initangle),sense(initsense),angleunit(initangleunit){} GoniometerAxis() : name("") {} diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/UnitCell.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/UnitCell.cpp index a413fa5df0deb5f0477353b5d7da83706a1a5f09..8ba0950e836e5d04dee27d0c23ef61a539daa23d 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/UnitCell.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/UnitCell.cpp @@ -503,8 +503,15 @@ namespace Geometry /// Recalculate lattice from reciprocal metric tensor (Gstar=transpose(UB)*UB) - void UnitCell::recalculateFromGstar(DblMatrix& NewGstar) + void UnitCell::recalculateFromGstar(const DblMatrix& NewGstar) { + if( NewGstar.numRows() != 3 || NewGstar.numCols() != 3 ) + { + std::ostringstream msg; + msg << "UnitCell::recalculateFromGstar - Expected a 3x3 matrix but was given a " << NewGstar.numRows() << "x" << NewGstar.numCols(); + throw std::invalid_argument(msg.str()); + } + if (NewGstar[0][0]*NewGstar[1][1]*NewGstar[2][2]<=0.) throw std::invalid_argument("NewGstar"); Gstar=NewGstar; calculateReciprocalLattice(); diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMDEvents.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMDEvents.cpp index a0655cf9bd8e0b999fd7722a2808c7379d440786..afb4cd02e6f1fca60dd972ae5d448ac153e747fd 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMDEvents.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMDEvents.cpp @@ -25,6 +25,7 @@ #include "MantidAPI/WorkspaceValidators.h" // #include "MantidGeometry/MDGeometry/MDHistoDimension.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include "MantidMDEvents/MDEvent.h" #include "MantidMDEvents/MDEventFactory.h" // diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToQ3DdE.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToQ3DdE.cpp index d6b913978c30a0c3ab9c4fc69c4664534c38671b..ffcf0a1a3fe824422b73f74b03ef0e513fbec008 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToQ3DdE.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToQ3DdE.cpp @@ -17,6 +17,7 @@ #include "MantidMDEvents/MDEvent.h" #include "MantidGeometry/MDGeometry/MDHistoDimension.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include "MantidDataObjects/Workspace2D.h" #include "MantidKernel/IPropertyManager.h" diff --git a/Code/Mantid/Framework/MDAlgorithms/test/ConvertToQ3DdETest.h b/Code/Mantid/Framework/MDAlgorithms/test/ConvertToQ3DdETest.h index c114d9fe4f48a12fc6711ab810242e0dc56001e4..999e56f145f21e75a8973abcd1b3073aca9612c2 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/ConvertToQ3DdETest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/ConvertToQ3DdETest.h @@ -5,6 +5,7 @@ #include "MantidKernel/System.h" #include "MantidKernel/Timer.h" #include "MantidMDAlgorithms/ConvertToQ3DdE.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include "MantidTestHelpers/ComponentCreationHelper.h" #include "MantidTestHelpers/MDEventsTestHelper.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h" @@ -14,6 +15,7 @@ using namespace Mantid; using namespace Mantid::Kernel; +using Mantid::Geometry::OrientedLattice; using namespace Mantid::API; using namespace Mantid::DataObjects; using namespace Mantid::MDAlgorithms; diff --git a/Code/Mantid/Framework/MDEvents/src/ConvertToDiffractionMDWorkspace.cpp b/Code/Mantid/Framework/MDEvents/src/ConvertToDiffractionMDWorkspace.cpp index a39ac166859b081fb585619cc3b42147ef02a774..6131d3e1aecc3493a6fc738325d754cc02e6d676 100644 --- a/Code/Mantid/Framework/MDEvents/src/ConvertToDiffractionMDWorkspace.cpp +++ b/Code/Mantid/Framework/MDEvents/src/ConvertToDiffractionMDWorkspace.cpp @@ -26,6 +26,7 @@ If the OutputWorkspace does NOT already exist, a default one is created. In orde #include "MantidGeometry/MDGeometry/MDHistoDimension.h" #include "MantidDataObjects/Workspace2D.h" #include "MantidKernel/ArrayProperty.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" using namespace Mantid; using namespace Mantid::Kernel; diff --git a/Code/Mantid/Framework/MDEvents/src/LoadSQW.cpp b/Code/Mantid/Framework/MDEvents/src/LoadSQW.cpp index d42df5c71ec406f3e904050ab68917244ff71a15..93c40d3e87490f29d7e19cac2ee87c2ab666ad14 100644 --- a/Code/Mantid/Framework/MDEvents/src/LoadSQW.cpp +++ b/Code/Mantid/Framework/MDEvents/src/LoadSQW.cpp @@ -12,6 +12,7 @@ If the OutputWorkspace does NOT already exist, a default one is created. This is #include "MantidAPI/Progress.h" #include "MantidAPI/WorkspaceProperty.h" #include "MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include "MantidKernel/CPUTimer.h" #include "MantidKernel/DiskMRU.h" #include "MantidKernel/Matrix.h" @@ -25,6 +26,7 @@ If the OutputWorkspace does NOT already exist, a default one is created. This is using namespace Mantid::Kernel; using namespace Mantid::API; +using Mantid::Geometry::OrientedLattice; namespace Mantid { diff --git a/Code/Mantid/Framework/MDEvents/test/LoadSQWTest.h b/Code/Mantid/Framework/MDEvents/test/LoadSQWTest.h index 1c3ce1b4ebb1739fe9a330da4ab5c0d2a8a2de29..8b3d799138234baec02bac1b4ac7b5fb754dc2f8 100644 --- a/Code/Mantid/Framework/MDEvents/test/LoadSQWTest.h +++ b/Code/Mantid/Framework/MDEvents/test/LoadSQWTest.h @@ -3,10 +3,12 @@ #include <cxxtest/TestSuite.h> #include "MantidMDEvents/LoadSQW.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include "MantidMDEvents/IMDBox.h" #include <boost/shared_ptr.hpp> using namespace Mantid::MDEvents; +using Mantid::Geometry::OrientedLattice; //===================================================================================== // Functional Tests diff --git a/Code/Mantid/Framework/PythonAPI/inc/MantidPythonAPI/geometryhelper.h b/Code/Mantid/Framework/PythonAPI/inc/MantidPythonAPI/geometryhelper.h index a57ee3d39bba55c2c0b303976c4471f76eeaf5cf..23aa1bd033211249ac4d7e47289a886953361bc8 100644 --- a/Code/Mantid/Framework/PythonAPI/inc/MantidPythonAPI/geometryhelper.h +++ b/Code/Mantid/Framework/PythonAPI/inc/MantidPythonAPI/geometryhelper.h @@ -36,7 +36,7 @@ namespace Mantid PyObject *m_self; }; - class OrientedLatticeWrapper: public OrientedLattice + class OrientedLatticeWrapper: public Geometry::OrientedLattice { public: /// Constructor diff --git a/Code/Mantid/Framework/PythonAPI/src/api_exports.cpp b/Code/Mantid/Framework/PythonAPI/src/api_exports.cpp index 9d2b0d4fdd3b47111d370afec0d823065430f940..fda2d821467712026d7999048a5de616cac4e393 100644 --- a/Code/Mantid/Framework/PythonAPI/src/api_exports.cpp +++ b/Code/Mantid/Framework/PythonAPI/src/api_exports.cpp @@ -23,6 +23,7 @@ #include "MantidAPI/WorkspaceValidators.h" #include "MantidAPI/WorkspaceHistory.h" #include "MantidGeometry/MDGeometry/IMDDimension.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include "MantidPythonAPI/PyAlgorithmWrapper.h" //Poco diff --git a/Code/Mantid/Framework/PythonAPI/src/geometryhelper.cpp b/Code/Mantid/Framework/PythonAPI/src/geometryhelper.cpp index f162fb16e5096ce5f0ff290834555bb271652096..5ddde72f152c3bbaf2d3155f5e0088447ed2fcd8 100644 --- a/Code/Mantid/Framework/PythonAPI/src/geometryhelper.cpp +++ b/Code/Mantid/Framework/PythonAPI/src/geometryhelper.cpp @@ -35,7 +35,6 @@ PyObject* UnitCellWrapper::getB(UnitCell& self) void UnitCellWrapper::recalculateFromGStar(UnitCell& self,PyObject* p) { Kernel::DblMatrix m=MantidVecHelper::getMatrixFromArray(p); - if ((m.numRows()!=3) || (m.numCols()!=3)) throw std::invalid_argument("Not 3x3 matrix"); self.recalculateFromGstar(m); } diff --git a/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp b/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp index 4fac734f3195a60e30e27f8056c3390a97b78892..5cca186d82154cc3ef62e3a1f43e419ba4d2d72a 100644 --- a/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp +++ b/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp @@ -5,6 +5,7 @@ #include "MantidGeometry/Instrument/ParameterMap.h" #include "MantidGeometry/Instrument/OneToOneSpectraDetectorMap.h" #include "MantidGeometry/Objects/ShapeFactory.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include "MantidTestHelpers/ComponentCreationHelper.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h" #include <cmath> diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/WorkspaceMementoCollection.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/WorkspaceMementoCollection.cpp index 25d1a062f7deddcd3751e23ff8db6813f719ce69..9ecdca72c2cb812224025a49fbeb02396b7d468c 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/WorkspaceMementoCollection.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/WorkspaceMementoCollection.cpp @@ -3,6 +3,7 @@ #include "MantidAPI/TableRow.h" #include "MantidAPI/WorkspaceFactory.h" #include "MantidAPI/MatrixWorkspace.h" +#include "MantidGeometry/Crystal/OrientedLattice.h" #include "MantidQtCustomInterfaces/WorkspaceMemento.h" #include "MantidQtCustomInterfaces/WorkspaceMementoItem.h" @@ -73,7 +74,7 @@ namespace MantidQt } if(ws->sample().hasOrientedLattice()) { - OrientedLattice lattice = ws->sample().getOrientedLattice(); + Mantid::Geometry::OrientedLattice lattice = ws->sample().getOrientedLattice(); service.setLatticeParameters(lattice.a(), lattice.b(), lattice.c(), lattice.alpha(), lattice.beta(), lattice.gamma()); } else @@ -196,4 +197,4 @@ namespace MantidQt } } -} \ No newline at end of file +}