From cfdffa7ef96317a3dd29da6baff780ed78fa6b56 Mon Sep 17 00:00:00 2001 From: Martyn Gigg <martyn.gigg@stfc.ac.uk> Date: Thu, 16 Jun 2011 11:55:06 +0000 Subject: [PATCH] Refs #3175. Sorry for the huge commit but certain things require Matrix to be in Kernel. Given how Quat, V3D and Matrix inter cooperate it seemed sensible for them to be in the same place and arguably this is where they belong anyway. --- .../Framework/API/inc/MantidAPI/IPeak.h | 22 +-- .../API/inc/MantidAPI/IPeaksWorkspace.h | 2 +- .../API/inc/MantidAPI/ITableWorkspace.h | 8 +- .../API/inc/MantidAPI/MatrixProperty.h | 6 +- Code/Mantid/Framework/API/inc/MantidAPI/Run.h | 4 +- .../Framework/API/inc/MantidAPI/Sample.h | 2 +- .../API/inc/MantidAPI/SampleEnvironment.h | 2 +- .../Framework/API/src/MatrixProperty.cpp | 6 +- .../Framework/API/src/MatrixWorkspace.cpp | 9 +- Code/Mantid/Framework/API/src/Run.cpp | 2 +- Code/Mantid/Framework/API/src/Sample.cpp | 2 +- .../Framework/API/src/SampleEnvironment.cpp | 2 +- .../Framework/API/test/MatrixPropertyTest.h | 4 +- Code/Mantid/Framework/API/test/RunTest.h | 4 +- .../MantidAlgorithms/AbsorptionCorrection.h | 4 +- .../MantidAlgorithms/DetectorEfficiencyCor.h | 10 +- .../DiffractionEventReadDetCal.h | 2 +- .../inc/MantidAlgorithms/GravitySANSHelper.h | 8 +- .../inc/MantidAlgorithms/He3TubeEfficiency.h | 10 +- .../MantidAlgorithms/MonteCarloAbsorption.h | 14 +- .../inc/MantidAlgorithms/SpatialGrouping.h | 6 +- .../Algorithms/src/AlignDetectors.cpp | 4 +- .../Algorithms/src/CaltoDspacemap.cpp | 2 +- .../Algorithms/src/DetectorEfficiencyCor.cpp | 2 +- .../DiffractionEventCalibrateDetectors.cpp | 8 +- .../src/DiffractionEventReadDetCal.cpp | 2 +- .../Algorithms/src/DspacemaptoCal.cpp | 2 +- .../Algorithms/src/FilterBadPulses.cpp | 2 +- .../Algorithms/src/GravitySANSHelper.cpp | 3 +- .../Algorithms/src/He3TubeEfficiency.cpp | 40 ++--- .../Algorithms/src/MonteCarloAbsorption.cpp | 1 + .../Algorithms/src/RemoveLowResTOF.cpp | 6 +- .../Framework/Algorithms/src/SolidAngle.cpp | 2 +- .../Algorithms/src/SpatialGrouping.cpp | 2 +- .../Algorithms/test/CreatePSDBleedMaskTest.h | 2 +- .../test/HRPDSlabCanAbsorptionTest.h | 1 + .../test/MonteCarloAbsorptionTest.h | 1 + .../Crystal/inc/MantidCrystal/PredictPeaks.h | 4 +- .../Crystal/src/IntegratePeakTimeSlices.cpp | 2 +- .../Framework/Crystal/src/LoadIsawUB.cpp | 14 +- .../Crystal/src/MaskPeaksWorkspace.cpp | 2 +- .../Framework/Crystal/src/PeakIntegration.cpp | 2 +- .../Framework/Crystal/src/PredictPeaks.cpp | 2 +- .../Framework/Crystal/src/SaveIsawPeaks.cpp | 2 +- .../Framework/Crystal/src/SetGoniometer.cpp | 2 +- .../Framework/Crystal/test/LoadIsawUBTest.h | 2 +- .../Crystal/test/LoadPeaksFileTest.h | 2 +- .../Framework/Crystal/test/PredictPeaksTest.h | 4 +- .../Crystal/test/SetGoniometerTest.h | 3 +- .../CurveFitting/src/ProductFunctionMW.cpp | 2 - .../CurveFitting/test/BivariateNormalTest.h | 2 +- .../inc/MantidDataHandling/FindDetectorsPar.h | 4 +- .../inc/MantidDataHandling/LoadDetectorInfo.h | 2 +- .../inc/MantidDataHandling/LoadInstrument.h | 13 +- .../MantidDataHandling/LoadParameterFile.h | 6 +- .../inc/MantidDataHandling/SetScalingPSD.h | 8 +- .../DataHandling/src/FindDetectorsPar.cpp | 18 +-- .../DataHandling/src/LoadDspacemap.cpp | 4 +- .../DataHandling/src/LoadInstrument.cpp | 40 ++--- .../src/LoadInstrumentFromNexus.cpp | 2 +- .../src/LoadInstrumentFromRaw.cpp | 2 +- .../src/LoadLOQDistancesFromRaw.cpp | 2 +- .../DataHandling/src/SaveDspacemap.cpp | 2 +- .../Framework/DataHandling/src/SavePHX.cpp | 2 +- .../DataHandling/src/SetScalingPSD.cpp | 44 +++--- .../src/UpdateInstrumentFromFile.cpp | 4 +- .../DataHandling/test/CreateSampleShapeTest.h | 2 +- .../DataHandling/test/SetScalingPSDTest.h | 1 + .../DataObjects/inc/MantidDataObjects/Peak.h | 40 ++--- .../inc/MantidDataObjects/PeaksWorkspace.h | 10 +- .../inc/MantidDataObjects/TableColumn.h | 2 +- .../inc/MantidDataObjects/TableWorkspace.h | 10 +- .../Mantid/Framework/DataObjects/src/Peak.cpp | 28 ++-- .../DataObjects/src/PeaksWorkspace.cpp | 4 +- .../Framework/DataObjects/src/TableColumn.cpp | 4 +- .../DataObjects/test/PeaksWorkspaceTest.h | 2 +- .../DataObjects/test/WorkspaceIteratorTest.h | 18 +-- Code/Mantid/Framework/Geometry/CMakeLists.txt | 10 -- .../MantidGeometry/Crystal/IndexingUtils.h | 12 +- .../MantidGeometry/Crystal/OrientedLattice.h | 22 +-- .../inc/MantidGeometry/Crystal/UnitCell.h | 30 ++-- .../Geometry/inc/MantidGeometry/IComponent.h | 37 +++-- .../Geometry/inc/MantidGeometry/IDetector.h | 15 +- .../Geometry/inc/MantidGeometry/IInstrument.h | 6 +- .../inc/MantidGeometry/IObjComponent.h | 8 +- .../MantidGeometry/Instrument/CompAssembly.h | 4 +- .../inc/MantidGeometry/Instrument/Component.h | 50 ++++--- .../inc/MantidGeometry/Instrument/Detector.h | 4 +- .../MantidGeometry/Instrument/DetectorGroup.h | 40 ++--- .../MantidGeometry/Instrument/Goniometer.h | 14 +- .../MantidGeometry/Instrument/Instrument.h | 12 +- .../Instrument/NearestNeighbours.h | 10 +- .../Instrument/ObjCompAssembly.h | 4 +- .../MantidGeometry/Instrument/ObjComponent.h | 12 +- .../inc/MantidGeometry/Instrument/Parameter.h | 8 +- .../MantidGeometry/Instrument/ParameterMap.h | 30 ++-- .../Instrument/RectangularDetector.h | 10 +- .../MantidGeometry/MDGeometry/IMDDimension.h | 13 +- .../MDGeometry/MDBasisDimension.h | 10 +- .../MantidGeometry/MDGeometry/MDDimension.h | 8 +- .../MDGeometry/MDDimensionRes.h | 6 +- .../MantidGeometry/MDGeometry/MDGeometry.h | 2 +- .../MDGeometry/MDGeometryBasis.h | 2 +- .../MDGeometry/MDGeometryDescription.h | 12 +- .../Geometry/inc/MantidGeometry/Math/Acomp.h | 7 +- .../inc/MantidGeometry/Math/Algebra.h | 2 +- .../inc/MantidGeometry/Math/mathSupport.h | 45 ------ .../inc/MantidGeometry/Objects/BoundingBox.h | 33 +++-- .../Objects/InstrumentRayTracer.h | 10 +- .../inc/MantidGeometry/Objects/Object.h | 42 +++--- .../inc/MantidGeometry/Objects/Rules.h | 14 +- .../inc/MantidGeometry/Objects/ShapeFactory.h | 4 +- .../inc/MantidGeometry/Objects/Track.h | 35 +++-- .../Rendering/BitmapGeometryHandler.h | 2 +- .../Rendering/CacheGeometryHandler.h | 6 +- .../Rendering/CacheGeometryRenderer.h | 6 +- .../Rendering/GeometryHandler.h | 4 +- .../Rendering/GluGeometryHandler.h | 30 ++-- .../Rendering/GluGeometryRenderer.h | 29 ++-- .../inc/MantidGeometry/Surfaces/Cone.h | 24 +-- .../inc/MantidGeometry/Surfaces/Cylinder.h | 28 ++-- .../inc/MantidGeometry/Surfaces/Line.h | 37 ++--- .../Surfaces/LineIntersectVisit.h | 12 +- .../inc/MantidGeometry/Surfaces/Plane.h | 24 +-- .../inc/MantidGeometry/Surfaces/Quadratic.h | 18 +-- .../inc/MantidGeometry/Surfaces/Sphere.h | 20 +-- .../inc/MantidGeometry/Surfaces/Surface.h | 21 +-- .../inc/MantidGeometry/Surfaces/Torus.h | 24 +-- .../Geometry/inc/MantidGeometry/Tolerance.h | 14 -- .../Geometry/src/Crystal/IndexingUtils.cpp | 12 +- .../Geometry/src/Crystal/OrientedLattice.cpp | 3 + .../Geometry/src/Crystal/UnitCell.cpp | 13 +- .../Framework/Geometry/src/IInstrument.cpp | 5 +- .../Geometry/src/Instrument/CompAssembly.cpp | 6 +- .../Geometry/src/Instrument/Component.cpp | 3 + .../Geometry/src/Instrument/Detector.cpp | 3 + .../Geometry/src/Instrument/DetectorGroup.cpp | 4 +- .../Geometry/src/Instrument/Goniometer.cpp | 7 +- .../Geometry/src/Instrument/Instrument.cpp | 18 +-- .../src/Instrument/NearestNeighbours.cpp | 1 + .../src/Instrument/ObjCompAssembly.cpp | 7 +- .../Geometry/src/Instrument/ObjComponent.cpp | 2 + .../Geometry/src/Instrument/Parameter.cpp | 4 +- .../Geometry/src/Instrument/ParameterMap.cpp | 3 + .../src/Instrument/RectangularDetector.cpp | 7 +- .../Geometry/src/InstrumentRayTracer.cpp | 4 +- .../src/MDGeometry/MDBasisDimension.cpp | 2 + .../src/MDGeometry/MDDimensionRes.cpp | 1 + .../Geometry/src/MDGeometry/MDGeometry.cpp | 2 +- .../src/MDGeometry/MDGeometryDescription.cpp | 2 + .../Framework/Geometry/src/Math/Acomp.cpp | 10 +- .../Geometry/src/Math/mathSupport.cpp | 27 ---- .../Geometry/src/Objects/BoundingBox.cpp | 34 +++-- .../Framework/Geometry/src/Objects/Object.cpp | 137 +++++++++--------- .../Geometry/src/Objects/RuleItems.cpp | 17 ++- .../Framework/Geometry/src/Objects/Rules.cpp | 4 +- .../Framework/Geometry/src/Objects/Track.cpp | 9 +- .../src/Rendering/BitmapGeometryHandler.cpp | 2 +- .../src/Rendering/CacheGeometryGenerator.cpp | 4 +- .../src/Rendering/CacheGeometryRenderer.cpp | 4 +- .../src/Rendering/GluGeometryHandler.cpp | 4 +- .../src/Rendering/GluGeometryRenderer.cpp | 4 +- .../src/Rendering/OCGeometryGenerator.cpp | 6 +- .../src/Rendering/OCGeometryRenderer.cpp | 6 +- .../Framework/Geometry/src/Surfaces/Cone.cpp | 35 ++--- .../Geometry/src/Surfaces/Cylinder.cpp | 37 ++--- .../Geometry/src/Surfaces/General.cpp | 2 +- .../Framework/Geometry/src/Surfaces/Line.cpp | 46 +++--- .../src/Surfaces/LineIntersectVisit.cpp | 4 +- .../Framework/Geometry/src/Surfaces/Plane.cpp | 29 ++-- .../Geometry/src/Surfaces/Quadratic.cpp | 50 +++---- .../Geometry/src/Surfaces/Sphere.cpp | 24 +-- .../Geometry/src/Surfaces/Surface.cpp | 6 +- .../Geometry/src/Surfaces/SurfaceFactory.cpp | 4 +- .../Framework/Geometry/src/Surfaces/Torus.cpp | 40 ++--- .../Framework/Geometry/test/AcompTest.h | 2 +- .../Framework/Geometry/test/AlgebraTest.h | 2 +- .../Mantid/Framework/Geometry/test/BnIdTest.h | 2 +- .../Framework/Geometry/test/BoundingBoxTest.h | 3 +- .../Geometry/test/CompAssemblyTest.h | 6 +- .../Framework/Geometry/test/ComponentTest.h | 6 +- .../Mantid/Framework/Geometry/test/ConeTest.h | 4 +- .../Framework/Geometry/test/CylinderTest.h | 5 +- .../Geometry/test/DetectorGroupTest.h | 8 +- .../Framework/Geometry/test/DetectorTest.h | 2 + .../Framework/Geometry/test/GeneralTest.h | 2 +- .../Framework/Geometry/test/GoniometerTest.h | 5 +- .../Geometry/test/IndexingUtilsTest.h | 6 +- .../Geometry/test/InstrumentRayTracerTest.h | 3 +- .../Geometry/test/LineIntersectVisitTest.h | 7 +- .../Mantid/Framework/Geometry/test/LineTest.h | 4 +- .../Framework/Geometry/test/MDDimensionTest.h | 2 + .../Geometry/test/MDGeometryBasisTest.h | 2 +- .../Geometry/test/MDGeometryDescriptionTest.h | 2 + .../Framework/Geometry/test/MDGeometryTest.h | 4 +- .../Framework/Geometry/test/MDPointTest.h | 2 +- .../Framework/Geometry/test/MapSupportTest.h | 2 +- .../Framework/Geometry/test/MathSupportTest.h | 38 ----- .../Geometry/test/NearestNeighboursTest.h | 1 + .../Geometry/test/ObjCompAssemblyTest.h | 6 +- .../Framework/Geometry/test/ObjectTest.h | 21 +-- .../Geometry/test/OrientedLatticeTest.h | 5 +- .../Geometry/test/ParCompAssemblyTest.h | 6 +- .../Framework/Geometry/test/ParDetectorTest.h | 8 +- .../Geometry/test/ParObjCompAssemblyTest.h | 6 +- .../Geometry/test/ParametrizedComponentTest.h | 6 +- .../Framework/Geometry/test/PlaneTest.h | 4 +- .../Mantid/Framework/Geometry/test/PolyTest.h | 2 +- .../Geometry/test/RectangularDetectorTest.h | 6 +- .../Framework/Geometry/test/RotCounterTest.h | 2 +- .../Geometry/test/RulesBoolValueTest.h | 3 +- .../Geometry/test/RulesCompGrpTest.h | 3 +- .../Geometry/test/RulesCompObjTest.h | 3 +- .../Geometry/test/RulesIntersectionTest.h | 3 +- .../Geometry/test/RulesSurfPointTest.h | 3 +- .../Framework/Geometry/test/RulesTest.h | 2 +- .../Framework/Geometry/test/RulesUnionTest.h | 3 +- .../Framework/Geometry/test/SphereTest.h | 7 +- .../Geometry/test/SurfaceFactoryTest.h | 2 +- .../Framework/Geometry/test/SurfaceTest.h | 4 +- .../Framework/Geometry/test/TorusTest.h | 2 +- .../Framework/Geometry/test/TrackTest.h | 4 +- .../Framework/Geometry/test/UnitCellTest.h | 6 +- Code/Mantid/Framework/Kernel/CMakeLists.txt | 12 +- .../Math => Kernel/inc/MantidKernel}/Matrix.h | 33 +++-- .../inc/MantidKernel}/Quat.h | 44 +++--- .../Kernel/inc/MantidKernel/Tolerance.h | 14 ++ .../inc/MantidKernel}/V3D.h | 26 ++-- .../src/Math => Kernel/src}/Matrix.cpp | 99 ++++++++++--- .../{Geometry => Kernel}/src/Quat.cpp | 25 ++-- .../{Geometry => Kernel}/src/V3D.cpp | 10 +- .../{Geometry => Kernel}/test/MatrixTest.h | 9 +- .../{Geometry => Kernel}/test/QuatTest.h | 32 ++-- .../{Geometry => Kernel}/test/V3DTest.h | 16 +- .../MantidMDAlgorithms/CobaltSpinWaveDSHO.h | 2 +- .../PlaneImplicitFunction.h | 4 +- .../inc/MantidMDAlgorithms/RunParam.h | 4 +- .../inc/MantidMDAlgorithms/SimulateMDD.h | 4 +- .../MantidMDAlgorithms/SimulateResolution.h | 14 +- .../inc/MantidMDAlgorithms/TobyFitSimulate.h | 16 +- .../MantidMDAlgorithms/VectorMathematics.h | 8 +- .../MDAlgorithms/src/CobaltSpinWaveDSHO.cpp | 6 +- .../src/PlaneImplicitFunction.cpp | 8 +- .../MDAlgorithms/src/QuadEnBackground.cpp | 4 +- .../Framework/MDAlgorithms/src/RunParam.cpp | 4 +- .../MDAlgorithms/src/SimulateMDD.cpp | 4 +- .../MDAlgorithms/src/SimulateResolution.cpp | 14 +- .../MDAlgorithms/src/TobyFitSimulate.cpp | 16 +- .../MDAlgorithms/src/VectorMathematics.cpp | 14 +- .../MDAlgorithms/test/CP3DxN_RebinningTest.h | 4 +- .../MDAlgorithms/test/CPRebinKeepPixTest.h | 2 +- .../test/PlaneImplicitFunctionTest.h | 2 +- .../MDAlgorithms/test/PlaneInterpreterTest.h | 4 +- .../MDAlgorithms/test/VectorMathematicsTest.h | 6 +- .../inc/MantidMDEvents/CoordTransform.h | 8 +- .../MantidMDEvents/CoordTransformDistance.h | 2 +- .../MakeDiffractionMDEventWorkspace.h | 10 +- .../Framework/MDEvents/src/CoordTransform.cpp | 4 +- .../src/MakeDiffractionMDEventWorkspace.cpp | 6 +- .../MDEvents/test/MDCentroidPeaksTest.h | 1 + .../MDEvents/test/MDEWPeakIntegrationTest.h | 1 + .../Framework/Nexus/src/NexusFileIO.cpp | 4 +- .../inc/MantidPythonAPI/MantidVecHelper.h | 8 +- .../PythonAPI/src/MantidVecHelper.cpp | 8 +- .../PythonAPI/src/geometry_exports.cpp | 60 -------- .../PythonAPI/src/geometryhelper.cpp | 8 +- .../PythonAPI/src/kernel_exports.cpp | 61 +++++++- .../ComponentCreationHelper.h | 12 +- .../src/ComponentCreationHelper.cpp | 2 + .../InstrumentWidget/CompAssemblyActor.cpp | 8 +- .../InstrumentWidget/CompAssemblyActor.h | 10 +- .../src/Mantid/InstrumentWidget/GLActor.h | 4 +- .../InstrumentWidget/GLActorCollection.cpp | 6 +- .../InstrumentWidget/GLActorCollection.h | 8 +- .../Mantid/InstrumentWidget/GLTrackball.cpp | 30 ++-- .../src/Mantid/InstrumentWidget/GLTrackball.h | 22 +-- .../Mantid/InstrumentWidget/GLViewport.cpp | 10 +- .../InstrumentWidget/ICompAssemblyActor.cpp | 4 +- .../InstrumentWidget/ICompAssemblyActor.h | 13 +- .../InstrumentWidget/InstrumentActor.cpp | 50 +++---- .../Mantid/InstrumentWidget/InstrumentActor.h | 16 +- .../InstrumentWidget/InstrumentTreeWidget.cpp | 4 +- .../InstrumentWidget/InstrumentTreeWidget.h | 2 +- .../InstrumentWidget/InstrumentWindow.cpp | 10 +- .../InstrumentWindowPickTab.cpp | 8 +- .../InstrumentWidget/ObjCompAssemblyActor.cpp | 2 +- .../InstrumentWidget/ObjCompAssemblyActor.h | 4 +- .../InstrumentWidget/ObjComponentActor.cpp | 6 +- .../InstrumentWidget/ObjComponentActor.h | 11 +- .../Mantid/InstrumentWidget/Projection3D.cpp | 2 +- .../Mantid/InstrumentWidget/Projection3D.h | 2 +- .../InstrumentWidget/ProjectionSurface.cpp | 2 +- .../InstrumentWidget/ProjectionSurface.h | 14 +- .../RectangularDetectorActor.cpp | 8 +- .../RectangularDetectorActor.h | 12 +- .../InstrumentWidget/UnwrappedCylinder.cpp | 18 +-- .../InstrumentWidget/UnwrappedCylinder.h | 4 +- .../InstrumentWidget/UnwrappedSphere.cpp | 18 +-- .../Mantid/InstrumentWidget/UnwrappedSphere.h | 4 +- .../InstrumentWidget/UnwrappedSurface.cpp | 24 +-- .../InstrumentWidget/UnwrappedSurface.h | 14 +- .../Mantid/MantidPlot/src/Mantid/MantidUI.cpp | 6 +- Code/Mantid/MantidPlot/src/origin/OPJFile.cpp | 1 - Code/Mantid/MantidPlot/src/zlib123/minigzip.c | 2 - .../MantidQtCustomDialogs/MantidGLWidget.h | 2 +- .../CustomDialogs/src/MantidGLWidget.cpp | 2 - .../CustomInterfaces/src/MuonAnalysis.cpp | 2 +- .../CustomInterfaces/src/SANSRunWindow.cpp | 2 +- 308 files changed, 1720 insertions(+), 1603 deletions(-) delete mode 100644 Code/Mantid/Framework/Geometry/inc/MantidGeometry/Tolerance.h rename Code/Mantid/Framework/{Geometry/inc/MantidGeometry/Math => Kernel/inc/MantidKernel}/Matrix.h (88%) rename Code/Mantid/Framework/{Geometry/inc/MantidGeometry => Kernel/inc/MantidKernel}/Quat.h (81%) create mode 100644 Code/Mantid/Framework/Kernel/inc/MantidKernel/Tolerance.h rename Code/Mantid/Framework/{Geometry/inc/MantidGeometry => Kernel/inc/MantidKernel}/V3D.h (88%) rename Code/Mantid/Framework/{Geometry/src/Math => Kernel/src}/Matrix.cpp (93%) rename Code/Mantid/Framework/{Geometry => Kernel}/src/Quat.cpp (96%) rename Code/Mantid/Framework/{Geometry => Kernel}/src/V3D.cpp (98%) rename Code/Mantid/Framework/{Geometry => Kernel}/test/MatrixTest.h (98%) rename Code/Mantid/Framework/{Geometry => Kernel}/test/QuatTest.h (95%) rename Code/Mantid/Framework/{Geometry => Kernel}/test/V3DTest.h (96%) diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IPeak.h b/Code/Mantid/Framework/API/inc/MantidAPI/IPeak.h index 02cd338f4fc..b6b20a176eb 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/IPeak.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/IPeak.h @@ -3,8 +3,8 @@ #include "MantidAPI/DllConfig.h" #include "MantidGeometry/IInstrument.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/PhysicalConstants.h" //#include "MantidKernel/System.h" @@ -38,18 +38,18 @@ namespace API virtual double getH() const = 0; virtual double getK() const = 0; virtual double getL() const = 0; - virtual Mantid::Geometry::V3D getHKL() = 0; + virtual Mantid::Kernel::V3D getHKL() = 0; virtual void setH(double m_H) = 0; virtual void setK(double m_K) = 0; virtual void setL(double m_L) = 0; virtual void setHKL(double H, double K, double L) = 0; - virtual void setHKL(Mantid::Geometry::V3D HKL) = 0; + virtual void setHKL(Mantid::Kernel::V3D HKL) = 0; - virtual Mantid::Geometry::V3D getQLabFrame() const = 0; - virtual Mantid::Geometry::V3D getQSampleFrame() const = 0; + virtual Mantid::Kernel::V3D getQLabFrame() const = 0; + virtual Mantid::Kernel::V3D getQSampleFrame() const = 0; - virtual void setQSampleFrame(Mantid::Geometry::V3D QSampleFrame, double detectorDistance=1.0) = 0; - virtual void setQLabFrame(Mantid::Geometry::V3D QLabFrame, double detectorDistance=1.0) = 0; + virtual void setQSampleFrame(Mantid::Kernel::V3D QSampleFrame, double detectorDistance=1.0) = 0; + virtual void setQLabFrame(Mantid::Kernel::V3D QLabFrame, double detectorDistance=1.0) = 0; virtual void setWavelength(double wavelength) = 0; virtual double getWavelength() const = 0; @@ -70,14 +70,14 @@ namespace API virtual double getBinCount() const = 0; virtual void setBinCount(double m_BinCount) = 0; - virtual Mantid::Geometry::Matrix<double> getGoniometerMatrix() const = 0; - virtual void setGoniometerMatrix(Mantid::Geometry::Matrix<double> m_GoniometerMatrix) = 0; + virtual Mantid::Kernel::Matrix<double> getGoniometerMatrix() const = 0; + virtual void setGoniometerMatrix(Mantid::Kernel::Matrix<double> m_GoniometerMatrix) = 0; virtual std::string getBankName() const = 0; virtual int getRow() const = 0; virtual int getCol() const = 0; - virtual Mantid::Geometry::V3D getDetPos() const = 0; + virtual Mantid::Kernel::V3D getDetPos() const = 0; virtual double getL1() const = 0; virtual double getL2() const = 0; diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IPeaksWorkspace.h b/Code/Mantid/Framework/API/inc/MantidAPI/IPeaksWorkspace.h index 67cc163b15d..0c3f6e11abd 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/IPeaksWorkspace.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/IPeaksWorkspace.h @@ -85,7 +85,7 @@ namespace API * @param detectorDistance :: distance between the sample and the detector. * @return a pointer to a new Peak object. */ - virtual IPeak* createPeak(Mantid::Geometry::V3D QLabFrame, double detectorDistance=1.0) = 0; + virtual IPeak* createPeak(Mantid::Kernel::V3D QLabFrame, double detectorDistance=1.0) = 0; }; diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/ITableWorkspace.h b/Code/Mantid/Framework/API/inc/MantidAPI/ITableWorkspace.h index 9589375d302..f756a6795b4 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/ITableWorkspace.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/ITableWorkspace.h @@ -7,7 +7,7 @@ #include "MantidAPI/Workspace.h" #include "MantidAPI/Column.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <boost/shared_ptr.hpp> #include <boost/lexical_cast.hpp> @@ -61,7 +61,7 @@ public: - "double" for double - "bool" for bool - "str" for std::string - - "V3D" for Mantid::Geometry::V3D + - "V3D" for Mantid::Kernel::V3D User defined types can be used after declaring them with DECLARE_TABLECOLUMN macro: DECLARE_TABLECOLUMN(typeName, UserDefinedType) @@ -276,8 +276,8 @@ public: virtual void find(API::Boolean value,int& row,const int & col)=0; /// find method to get the index of cellstd::string value in a table workspace virtual void find(std::string value,int& row,const int & col)=0; - /// find method to get the index of Mantid::Geometry::V3D cell value in a table workspace - virtual void find(Mantid::Geometry::V3D value,int& row,const int & col)=0; + /// find method to get the index of Mantid::Kernel::V3D cell value in a table workspace + virtual void find(Mantid::Kernel::V3D value,int& row,const int & col)=0; void modified(); diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/MatrixProperty.h b/Code/Mantid/Framework/API/inc/MantidAPI/MatrixProperty.h index 05e5a673ca2..89587aa4145 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/MatrixProperty.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/MatrixProperty.h @@ -5,7 +5,7 @@ // Includes //----------------------------------------------------------------------------- #include "MantidAPI/DllConfig.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidKernel/PropertyWithValue.h" #include "MantidKernel/NullValidator.h" @@ -35,10 +35,10 @@ namespace Mantid Code Documentation is available at: <http://doxygen.mantidproject.org> */ template<class TYPE = double> - class DLLExport MatrixProperty : public Kernel::PropertyWithValue<Geometry::Matrix<TYPE> > + class DLLExport MatrixProperty : public Kernel::PropertyWithValue<Kernel::Matrix<TYPE> > { /// Typedef the held type - typedef Geometry::Matrix<TYPE> HeldType; + typedef Kernel::Matrix<TYPE> HeldType; public: /// Constructor diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/Run.h b/Code/Mantid/Framework/API/inc/MantidAPI/Run.h index 3d295572da7..5a597aaa03a 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/Run.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/Run.h @@ -6,7 +6,7 @@ #include "MantidKernel/PropertyManager.h" #include "MantidKernel/TimeSplitter.h" #include <vector> -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" namespace Mantid @@ -112,7 +112,7 @@ namespace Mantid { return m_goniometer; } // Retrieve the goniometer rotation matrix - Mantid::Geometry::DblMatrix getGoniometerMatrix(); + Mantid::Kernel::DblMatrix getGoniometerMatrix(); /** * Add a log entry diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/Sample.h b/Code/Mantid/Framework/API/inc/MantidAPI/Sample.h index 70762a5e005..0bd6c47db6c 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/Sample.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/Sample.h @@ -5,7 +5,7 @@ // Includes //------------------------------------------------------------------------------ #include "MantidAPI/DllConfig.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/Material.h" #include <MantidGeometry/Crystal/OrientedLattice.h> diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/SampleEnvironment.h b/Code/Mantid/Framework/API/inc/MantidAPI/SampleEnvironment.h index 437671e1bf2..e70dfe25216 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/SampleEnvironment.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/SampleEnvironment.h @@ -55,7 +55,7 @@ namespace Mantid /// shape int add(IComponent* comp); /// Is the point given a valid point within the environment - bool isValid(const Geometry::V3D & point) const; + bool isValid(const Kernel::V3D & point) const; /// Update the given track with intersections within the environment void interceptSurfaces(Geometry::Track & track) const; diff --git a/Code/Mantid/Framework/API/src/MatrixProperty.cpp b/Code/Mantid/Framework/API/src/MatrixProperty.cpp index 32d0a1801ae..2431a0519be 100644 --- a/Code/Mantid/Framework/API/src/MatrixProperty.cpp +++ b/Code/Mantid/Framework/API/src/MatrixProperty.cpp @@ -51,9 +51,9 @@ namespace Mantid * IPropertyManager::getValue definitions so that algorithm.getProperty will work */ ///@cond -DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Geometry::DblMatrix); -DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Geometry::IntMatrix); -DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Geometry::Matrix<float>); +DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::DblMatrix); +DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::IntMatrix); +DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::Matrix<float>); ///@endcond diff --git a/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp b/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp index e0d494748ac..781651c1977 100644 --- a/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp +++ b/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp @@ -29,6 +29,7 @@ namespace Mantid { using std::size_t; using namespace Geometry; + using Kernel::V3D; Kernel::Logger& MatrixWorkspace::g_log = Kernel::Logger::get("MatrixWorkspace"); const std::string MatrixWorkspace::xDimensionId = "xDimension"; @@ -531,8 +532,8 @@ namespace Mantid throw Kernel::Exception::InstrumentDefinitionError("Instrument not sufficiently defined: failed to get source and/or sample"); } - const Geometry::V3D samplePos = sample->getPos(); - const Geometry::V3D beamLine = samplePos - source->getPos(); + const Kernel::V3D samplePos = sample->getPos(); + const Kernel::V3D beamLine = samplePos - source->getPos(); return det->getTwoTheta(samplePos,beamLine); } @@ -1173,8 +1174,8 @@ namespace Mantid /// Get coordinate for index; virtual double getX(size_t ind)const {return m_axis(ind);} // Mess; TODO: clear - virtual Geometry::V3D getDirection(void)const {throw std::runtime_error("Not implemented");} - virtual Geometry::V3D getDirectionCryst(void)const {throw std::runtime_error("Not implemented");} + virtual Kernel::V3D getDirection(void)const {throw std::runtime_error("Not implemented");} + virtual Kernel::V3D getDirectionCryst(void)const {throw std::runtime_error("Not implemented");} /// the function returns the center points of the axis bins; There are nBins of such points /// (when axis has nBins+1 points with point 0 equal rMin and nBins+1 equal rMax) diff --git a/Code/Mantid/Framework/API/src/Run.cpp b/Code/Mantid/Framework/API/src/Run.cpp index a3f6d816560..cf59121c56c 100644 --- a/Code/Mantid/Framework/API/src/Run.cpp +++ b/Code/Mantid/Framework/API/src/Run.cpp @@ -312,7 +312,7 @@ Kernel::Logger& Run::g_log = Kernel::Logger::get("Run"); * * @return 3x3 double rotation matrix */ - Mantid::Geometry::DblMatrix Run::getGoniometerMatrix() + Mantid::Kernel::DblMatrix Run::getGoniometerMatrix() { for (size_t i=0; i < m_goniometer.getNumberAxes(); ++i) { diff --git a/Code/Mantid/Framework/API/src/Sample.cpp b/Code/Mantid/Framework/API/src/Sample.cpp index b76647e8813..5e7a7a5cae5 100644 --- a/Code/Mantid/Framework/API/src/Sample.cpp +++ b/Code/Mantid/Framework/API/src/Sample.cpp @@ -13,7 +13,7 @@ namespace Mantid using Geometry::Object; using Geometry::Material; - using Geometry::V3D; + using Kernel::V3D; /** * Default constructor diff --git a/Code/Mantid/Framework/API/src/SampleEnvironment.cpp b/Code/Mantid/Framework/API/src/SampleEnvironment.cpp index 1d068e2f035..04a1014d79a 100644 --- a/Code/Mantid/Framework/API/src/SampleEnvironment.cpp +++ b/Code/Mantid/Framework/API/src/SampleEnvironment.cpp @@ -13,7 +13,7 @@ namespace Mantid using Geometry::IComponent; using Geometry::IObjComponent; - using Geometry::V3D; + using Kernel::V3D; using Geometry::Track; //------------------------------------------------------------------------------ diff --git a/Code/Mantid/Framework/API/test/MatrixPropertyTest.h b/Code/Mantid/Framework/API/test/MatrixPropertyTest.h index f7d791d6394..8daaef22ef2 100644 --- a/Code/Mantid/Framework/API/test/MatrixPropertyTest.h +++ b/Code/Mantid/Framework/API/test/MatrixPropertyTest.h @@ -8,8 +8,8 @@ #include <cxxtest/TestSuite.h> using Mantid::API::MatrixProperty; -using Mantid::Geometry::DblMatrix; -using Mantid::Geometry::IntMatrix; +using Mantid::Kernel::DblMatrix; +using Mantid::Kernel::IntMatrix; class MatrixPropertyTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/API/test/RunTest.h b/Code/Mantid/Framework/API/test/RunTest.h index 0ec161c50a5..5fbd2bc3b3f 100644 --- a/Code/Mantid/Framework/API/test/RunTest.h +++ b/Code/Mantid/Framework/API/test/RunTest.h @@ -5,10 +5,10 @@ #include "MantidAPI/Run.h" #include "MantidKernel/Exception.h" #include "MantidKernel/Property.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidKernel/TimeSeriesProperty.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" using namespace Mantid::Kernel; using namespace Mantid::API; diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/AbsorptionCorrection.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/AbsorptionCorrection.h index 7e9692b124e..8ce3516ac11 100644 --- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/AbsorptionCorrection.h +++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/AbsorptionCorrection.h @@ -83,10 +83,10 @@ protected: API::MatrixWorkspace_const_sptr m_inputWS; ///< A pointer to the input workspace const Geometry::Object* m_sampleObject; ///< Local cache of sample object. - Geometry::V3D m_beamDirection; ///< The direction of the beam. + Kernel::V3D m_beamDirection; ///< The direction of the beam. std::vector<double> m_L1s, ///< Cached L1 distances m_elementVolumes; ///< Cached element volumes - std::vector<Geometry::V3D> m_elementPositions; ///< Cached element positions + std::vector<Kernel::V3D> m_elementPositions; ///< Cached element positions size_t m_numVolumeElements; ///< The number of volume elements double m_sampleVolume; ///< The total volume of the sample diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h index 2d28e23d301..bf451caaee6 100644 --- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h +++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h @@ -2,7 +2,7 @@ #define MANTID_ALGORITHM_DETECTEFFICIENCYCOR_H_ #include "MantidAPI/Algorithm.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <climits> #include <string> #include <vector> @@ -103,9 +103,9 @@ class DLLExport DetectorEfficiencyCor : public API::Algorithm /// Calculate one over the wave vector for 2 bin bounds double calculateOneOverK(double loBinBound, double uppBinBound) const; /// Sets the detector geometry cache if necessary - void getDetectorGeometry(boost::shared_ptr<Geometry::IDetector> det, double & detRadius, Geometry::V3D & detAxis); + void getDetectorGeometry(boost::shared_ptr<Geometry::IDetector> det, double & detRadius, Kernel::V3D & detAxis); /// Computes the distance to the given shape from a starting point - double distToSurface(const Geometry::V3D start, const Geometry::Object *shape) const; + double distToSurface(const Kernel::V3D start, const Geometry::Object *shape) const; /// Computes the detector efficiency for a given paramater double detectorEfficiency(const double alpha) const; /// Computes an approximate expansion of a Chebysev polynomial @@ -128,9 +128,9 @@ private: double m_ki; /// A lookup of previously seen shape objects used to save calculation time as most detectors have the same shape - std::map<const Geometry::Object *, std::pair<double, Geometry::V3D> > m_shapeCache; + std::map<const Geometry::Object *, std::pair<double, Kernel::V3D> > m_shapeCache; /// Sample position - Geometry::V3D m_samplePos; + Kernel::V3D m_samplePos; /// The spectra numbers that were skipped std::vector<int64_t> m_spectraSkipped; diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventReadDetCal.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventReadDetCal.h index b03a9bca91c..5f71556bca5 100644 --- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventReadDetCal.h +++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventReadDetCal.h @@ -40,7 +40,7 @@ namespace Algorithms File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid> Code Documentation is available at: <http://doxygen.mantidproject.org> */ -class DLLExport DiffractionEventReadDetCal: public API::Algorithm, public Geometry::Quat +class DLLExport DiffractionEventReadDetCal: public API::Algorithm, public Kernel::Quat { public: /// Default constructor diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/GravitySANSHelper.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/GravitySANSHelper.h index 19e17c95ab8..d0f95679438 100644 --- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/GravitySANSHelper.h +++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/GravitySANSHelper.h @@ -42,9 +42,9 @@ namespace Mantid private: /// coordinates of the sample - Geometry::V3D m_samplePos; + Kernel::V3D m_samplePos; /// the displacement from the source to the sample - Geometry::V3D m_beamLine; + Kernel::V3D m_beamLine; /// twice the distance from the source to the sample double m_beamLineNorm; @@ -53,11 +53,11 @@ namespace Mantid /// the drop is proportional to the wavelength squared, storing this drop increases calculation speed a lot double m_dropPerAngstrom2; /// the location that the neutron would have been detected at if it continued in a straight line, without gravity - mutable Geometry::V3D m_cachedLineOfSight; + mutable Kernel::V3D m_cachedLineOfSight; /// the drop that was last caclulated, this allows m_cachedDetLoc to be recalculated each time without its original value being stored mutable double m_cachedDrop; - const Geometry::V3D & getDetLoc(const double wav) const; + const Kernel::V3D & getDetLoc(const double wav) const; /** Calculates the drop very much faster than running the workspace's gravitationalDrop function assuming * the drop is proportional to the wavelength squared * @param wav :: the wave length in Angstrom diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h index 8f60a775271..c390cdc10cb 100644 --- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h +++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h @@ -2,7 +2,7 @@ #define MANTID_ALGORITHM_HE3TUBEEFFICIENCY_H_ #include "MantidAPI/Algorithm.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <map> #include <vector> @@ -75,9 +75,9 @@ private: void correctForEfficiency(int spectraIndex); /// Sets the detector geometry cache if necessary void getDetectorGeometry(boost::shared_ptr<Geometry::IDetector> det, - double & detRadius, Geometry::V3D & detAxis); + double & detRadius, Kernel::V3D & detAxis); /// Computes the distance to the given shape from a starting point - double distToSurface(const Geometry::V3D start, + double distToSurface(const Kernel::V3D start, const Geometry::Object *shape) const; /// Calculate the detector efficiency double detectorEfficiency(const double alpha, @@ -95,9 +95,9 @@ private: /// Map that stores additional properties for detectors const Geometry::ParameterMap *paraMap; /// A lookup of previously seen shape objects used to save calculation time as most detectors have the same shape - std::map<const Geometry::Object *, std::pair<double, Geometry::V3D> > shapeCache; + std::map<const Geometry::Object *, std::pair<double, Kernel::V3D> > shapeCache; /// Sample position - Geometry::V3D samplePos; + Kernel::V3D samplePos; /// The spectra numbers that were skipped std::vector<int> spectraSkipped; /// Algorithm progress keeper diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/MonteCarloAbsorption.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/MonteCarloAbsorption.h index afef133c781..0868fd7b530 100644 --- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/MonteCarloAbsorption.h +++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/MonteCarloAbsorption.h @@ -72,13 +72,13 @@ namespace Mantid const double lambda, double & attenFactor, double & error); /// Randomly select the location initial point within the beam from a square /// distribution - Geometry::V3D sampleBeamProfile() const; + Kernel::V3D sampleBeamProfile() const; /// Select a random location within the sample + container environment - Geometry::V3D selectScatterPoint() const; + Kernel::V3D selectScatterPoint() const; /// Calculate the attenuation factor for the given single scatter setup - double attenuationFactor(const Geometry::V3D & startPos, - const Geometry::V3D & scatterPoint, - const Geometry::V3D & finalPos, const double lambda); + double attenuationFactor(const Kernel::V3D & startPos, + const Kernel::V3D & scatterPoint, + const Kernel::V3D & finalPos, const double lambda); /// Calculate the attenuation for a given length, material and wavelength double attenuation(const double length, const Geometry::Material& material, const double lambda) const; @@ -108,9 +108,9 @@ namespace Mantid /** @name Cached values */ //@{ /// The sample position - Geometry::V3D m_samplePos; + Kernel::V3D m_samplePos; /// The source position - Geometry::V3D m_sourcePos; + Kernel::V3D m_sourcePos; /// Bounding box length double m_bbox_length; /// Half the bounding box length diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/SpatialGrouping.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/SpatialGrouping.h index 74a2989fc38..b839ff160ea 100644 --- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/SpatialGrouping.h +++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/SpatialGrouping.h @@ -8,14 +8,16 @@ namespace Mantid { - +namespace Kernel +{ + class V3D; +} namespace Geometry { /// Forward Declarations class IDetector; class IInstrument; class BoundingBox; -class V3D; } namespace Algorithms diff --git a/Code/Mantid/Framework/Algorithms/src/AlignDetectors.cpp b/Code/Mantid/Framework/Algorithms/src/AlignDetectors.cpp index 5422800cdb4..2cff6b959b3 100644 --- a/Code/Mantid/Framework/Algorithms/src/AlignDetectors.cpp +++ b/Code/Mantid/Framework/Algorithms/src/AlignDetectors.cpp @@ -7,7 +7,7 @@ #include "MantidAPI/WorkspaceValidators.h" #include "MantidDataObjects/EventWorkspace.h" #include "MantidDataObjects/OffsetsWorkspace.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/PhysicalConstants.h" #include "MantidKernel/UnitFactory.h" #include <fstream> @@ -51,7 +51,7 @@ std::map<detid_t, double> * AlignDetectors::calcTofToD_ConversionMap(Mantid::API IInstrument_const_sptr instrument = inputWS->getInstrument(); double l1; - Geometry::V3D beamline,samplePos; + Kernel::V3D beamline,samplePos; double beamline_norm; instrument->getInstrumentParameters(l1,beamline,beamline_norm, samplePos); diff --git a/Code/Mantid/Framework/Algorithms/src/CaltoDspacemap.cpp b/Code/Mantid/Framework/Algorithms/src/CaltoDspacemap.cpp index 3754e471dcc..95d9ff92435 100644 --- a/Code/Mantid/Framework/Algorithms/src/CaltoDspacemap.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CaltoDspacemap.cpp @@ -9,7 +9,7 @@ #include "MantidDataObjects/EventWorkspace.h" #include "MantidDataObjects/OffsetsWorkspace.h" #include "MantidGeometry/Instrument/Instrument.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/BinaryFile.h" #include "MantidKernel/PhysicalConstants.h" #include "MantidKernel/UnitFactory.h" diff --git a/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCor.cpp b/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCor.cpp index 70acb35461b..bbba9f4a0f2 100644 --- a/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCor.cpp +++ b/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCor.cpp @@ -299,7 +299,7 @@ double DetectorEfficiencyCor::calculateOneOverK(double loBinBound, double uppBin void DetectorEfficiencyCor::getDetectorGeometry(boost::shared_ptr<Geometry::IDetector> det, double & detRadius, V3D & detAxis) { boost::shared_ptr<const Object> shape_sptr = det->shape(); - std::map<const Geometry::Object *, std::pair<double, Geometry::V3D> >::const_iterator it = + std::map<const Geometry::Object *, std::pair<double, Kernel::V3D> >::const_iterator it = m_shapeCache.find(shape_sptr.get()); if( it == m_shapeCache.end() ) { diff --git a/Code/Mantid/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp b/Code/Mantid/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp index 55d6f3b3192..c41cfeb9799 100644 --- a/Code/Mantid/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp +++ b/Code/Mantid/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp @@ -503,9 +503,9 @@ namespace Algorithms g_log.information() << "Rotate (Z) = " << gsl_vector_get (s->x, 5) << " \n"; - Geometry::V3D CalCenter=V3D(gsl_vector_get (s->x, 0)*0.01, + Kernel::V3D CalCenter=V3D(gsl_vector_get (s->x, 0)*0.01, gsl_vector_get (s->x, 1)*0.01, gsl_vector_get (s->x, 2)*0.01); - Geometry::V3D Center=detList[det]->getPos()+CalCenter; + Kernel::V3D Center=detList[det]->getPos()+CalCenter; int pixmax = detList[det]->xpixels()-1; int pixmid = (detList[det]->ypixels()-1)/2; BoundingBox box; @@ -513,14 +513,14 @@ namespace Algorithms baseX = box.xMax(); baseY = box.yMax(); baseZ = box.zMax(); - Geometry::V3D Base=V3D(baseX,baseY,baseZ)+CalCenter; + Kernel::V3D Base=V3D(baseX,baseY,baseZ)+CalCenter; pixmid = (detList[det]->xpixels()-1)/2; pixmax = detList[det]->ypixels()-1; detList[det]->getAtXY(pixmid, pixmax)->getBoundingBox(box); upX = box.xMax(); upY = box.yMax(); upZ = box.zMax(); - Geometry::V3D Up=V3D(upX,upY,upZ)+CalCenter; + Kernel::V3D Up=V3D(upX,upY,upZ)+CalCenter; Base-=Center; Up-=Center; //Rotate around x diff --git a/Code/Mantid/Framework/Algorithms/src/DiffractionEventReadDetCal.cpp b/Code/Mantid/Framework/Algorithms/src/DiffractionEventReadDetCal.cpp index bc58ddf5eac..9fdd1305f47 100644 --- a/Code/Mantid/Framework/Algorithms/src/DiffractionEventReadDetCal.cpp +++ b/Code/Mantid/Framework/Algorithms/src/DiffractionEventReadDetCal.cpp @@ -12,7 +12,7 @@ #include "MantidKernel/ArrayProperty.h" #include "MantidKernel/Exception.h" #include "MantidGeometry/Instrument/RectangularDetector.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <Poco/File.h> #include <sstream> #include <numeric> diff --git a/Code/Mantid/Framework/Algorithms/src/DspacemaptoCal.cpp b/Code/Mantid/Framework/Algorithms/src/DspacemaptoCal.cpp index 33554073028..17c7b1491c5 100644 --- a/Code/Mantid/Framework/Algorithms/src/DspacemaptoCal.cpp +++ b/Code/Mantid/Framework/Algorithms/src/DspacemaptoCal.cpp @@ -8,7 +8,7 @@ #include "MantidDataObjects/EventWorkspace.h" #include "MantidDataObjects/GroupingWorkspace.h" #include "MantidDataObjects/OffsetsWorkspace.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/BinaryFile.h" #include "MantidKernel/PhysicalConstants.h" #include "MantidKernel/UnitFactory.h" diff --git a/Code/Mantid/Framework/Algorithms/src/FilterBadPulses.cpp b/Code/Mantid/Framework/Algorithms/src/FilterBadPulses.cpp index 5a4fb7d889b..866f8c56540 100644 --- a/Code/Mantid/Framework/Algorithms/src/FilterBadPulses.cpp +++ b/Code/Mantid/Framework/Algorithms/src/FilterBadPulses.cpp @@ -9,7 +9,7 @@ #include "MantidKernel/PhysicalConstants.h" #include "MantidKernel/TimeSeriesProperty.h" #include "MantidAPI/FileProperty.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <fstream> diff --git a/Code/Mantid/Framework/Algorithms/src/GravitySANSHelper.cpp b/Code/Mantid/Framework/Algorithms/src/GravitySANSHelper.cpp index 551494dfe04..b5561af5e45 100644 --- a/Code/Mantid/Framework/Algorithms/src/GravitySANSHelper.cpp +++ b/Code/Mantid/Framework/Algorithms/src/GravitySANSHelper.cpp @@ -5,7 +5,8 @@ namespace Mantid { namespace Algorithms { - using namespace Geometry; + using Kernel::V3D; + /** sets up the object with workspace data and calculates cached values ready to calculate gravitional * effects across a spectrum * @param ws :: the workspace that contains the neutron counts diff --git a/Code/Mantid/Framework/Algorithms/src/He3TubeEfficiency.cpp b/Code/Mantid/Framework/Algorithms/src/He3TubeEfficiency.cpp index 607626e4c68..097bf816a97 100644 --- a/Code/Mantid/Framework/Algorithms/src/He3TubeEfficiency.cpp +++ b/Code/Mantid/Framework/Algorithms/src/He3TubeEfficiency.cpp @@ -189,7 +189,7 @@ void He3TubeEfficiency::correctForEfficiency(int spectraIndex) "tube_temperature", det); double detRadius(0.0); - Geometry::V3D detAxis; + Kernel::V3D detAxis; this->getDetectorGeometry(det, detRadius, detAxis); double detDiameter = 2.0 * detRadius; double twiceTubeThickness = 2.0 * tubethickness; @@ -197,9 +197,9 @@ void He3TubeEfficiency::correctForEfficiency(int spectraIndex) // now get the sin of the angle, it's the magnitude of the cross product of // unit vector along the detector tube axis and a unit vector directed from // the sample to the detector center - Geometry::V3D vectorFromSample = det->getPos() - this->samplePos; + Kernel::V3D vectorFromSample = det->getPos() - this->samplePos; vectorFromSample.normalize(); - Geometry::Quat rot = det->getRotation(); + Kernel::Quat rot = det->getRotation(); // rotate the original cylinder object axis to get the detector axis in the // actual instrument rot.rotate(detAxis); @@ -247,43 +247,43 @@ void He3TubeEfficiency::correctForEfficiency(int spectraIndex) */ void He3TubeEfficiency::getDetectorGeometry(\ boost::shared_ptr<Geometry::IDetector> det, - double & detRadius, Geometry::V3D & detAxis) + double & detRadius, Kernel::V3D & detAxis) { boost::shared_ptr<const Geometry::Object> shape_sptr = det->shape(); - std::map<const Geometry::Object *, std::pair<double, Geometry::V3D> >::const_iterator it = + std::map<const Geometry::Object *, std::pair<double, Kernel::V3D> >::const_iterator it = this->shapeCache.find(shape_sptr.get()); if( it == this->shapeCache.end() ) { - double xDist = distToSurface( Geometry::V3D(DIST_TO_UNIVERSE_EDGE, 0, 0), + double xDist = distToSurface( Kernel::V3D(DIST_TO_UNIVERSE_EDGE, 0, 0), shape_sptr.get() ); - double zDist = distToSurface( Geometry::V3D(0, 0, DIST_TO_UNIVERSE_EDGE), + double zDist = distToSurface( Kernel::V3D(0, 0, DIST_TO_UNIVERSE_EDGE), shape_sptr.get() ); if ( std::abs(zDist - xDist) < 1e-8 ) { detRadius = zDist / 2.0; - detAxis = Geometry::V3D(0, 1, 0); + detAxis = Kernel::V3D(0, 1, 0); // assume radii in z and x and the axis is in the y PARALLEL_CRITICAL(deteff_shapecachea) { this->shapeCache.insert(std::pair<const Geometry::Object *, - std::pair<double, Geometry::V3D> >(shape_sptr.get(), - std::pair<double, Geometry::V3D>(detRadius, detAxis))); + std::pair<double, Kernel::V3D> >(shape_sptr.get(), + std::pair<double, Kernel::V3D>(detRadius, detAxis))); } return; } - double yDist = distToSurface( Geometry::V3D(0, DIST_TO_UNIVERSE_EDGE, 0), + double yDist = distToSurface( Kernel::V3D(0, DIST_TO_UNIVERSE_EDGE, 0), shape_sptr.get() ); if ( std::abs(yDist - zDist) < 1e-8 ) { detRadius = yDist / 2.0; - detAxis = Geometry::V3D(1, 0, 0); + detAxis = Kernel::V3D(1, 0, 0); // assume that y and z are radii of the cylinder's circular cross-section // and the axis is perpendicular, in the x direction PARALLEL_CRITICAL(deteff_shapecacheb) { this->shapeCache.insert(std::pair<const Geometry::Object *, - std::pair<double, Geometry::V3D> >(shape_sptr.get(), - std::pair<double, Geometry::V3D>(detRadius, detAxis))); + std::pair<double, Kernel::V3D> >(shape_sptr.get(), + std::pair<double, Kernel::V3D>(detRadius, detAxis))); } return; } @@ -291,19 +291,19 @@ void He3TubeEfficiency::getDetectorGeometry(\ if ( std::abs(xDist - yDist) < 1e-8 ) { detRadius = xDist / 2.0; - detAxis = Geometry::V3D(0, 0, 1); + detAxis = Kernel::V3D(0, 0, 1); PARALLEL_CRITICAL(deteff_shapecachec) { this->shapeCache.insert(std::pair<const Geometry::Object *, - std::pair<double, Geometry::V3D> >(shape_sptr.get(), - std::pair<double, Geometry::V3D>(detRadius, detAxis))); + std::pair<double, Kernel::V3D> >(shape_sptr.get(), + std::pair<double, Kernel::V3D>(detRadius, detAxis))); } return; } } else { - std::pair<double, Geometry::V3D> geometry = it->second; + std::pair<double, Kernel::V3D> geometry = it->second; detRadius = it->second.first; detAxis = it->second.second; } @@ -319,11 +319,11 @@ void He3TubeEfficiency::getDetectorGeometry(\ * @throw invalid_argument if there is any error finding the distance * @returns The distance to the surface in metres */ -double He3TubeEfficiency::distToSurface(const Geometry::V3D start, +double He3TubeEfficiency::distToSurface(const Kernel::V3D start, const Geometry::Object *shape) const { // get a vector from the point that was passed to the origin - Geometry::V3D direction = Geometry::V3D(0.0, 0.0, 0.0) - start; + Kernel::V3D direction = Kernel::V3D(0.0, 0.0, 0.0) - start; // it needs to be a unit vector direction.normalize(); // put the point and the vector (direction) together to get a line, diff --git a/Code/Mantid/Framework/Algorithms/src/MonteCarloAbsorption.cpp b/Code/Mantid/Framework/Algorithms/src/MonteCarloAbsorption.cpp index b746896f3b0..58deba9103c 100644 --- a/Code/Mantid/Framework/Algorithms/src/MonteCarloAbsorption.cpp +++ b/Code/Mantid/Framework/Algorithms/src/MonteCarloAbsorption.cpp @@ -37,6 +37,7 @@ namespace Mantid using API::WorkspaceFactory; using API::Progress; using namespace Geometry; + using Kernel::V3D; using Kernel::Direction; //------------------------------------------------------------------------------ diff --git a/Code/Mantid/Framework/Algorithms/src/RemoveLowResTOF.cpp b/Code/Mantid/Framework/Algorithms/src/RemoveLowResTOF.cpp index 63fc2c313af..78887c75a02 100644 --- a/Code/Mantid/Framework/Algorithms/src/RemoveLowResTOF.cpp +++ b/Code/Mantid/Framework/Algorithms/src/RemoveLowResTOF.cpp @@ -221,9 +221,9 @@ void RemoveLowResTOF::execEvent() double RemoveLowResTOF::calcTofMin(const size_t workspaceIndex) { - const Geometry::V3D& sourcePos = m_instrument->getSource()->getPos(); - const Geometry::V3D& samplePos = m_instrument->getSample()->getPos(); - const Geometry::V3D& beamline = samplePos - sourcePos; + const Kernel::V3D& sourcePos = m_instrument->getSource()->getPos(); + const Kernel::V3D& samplePos = m_instrument->getSample()->getPos(); + const Kernel::V3D& beamline = samplePos - sourcePos; double beamline_norm = 2. * beamline.norm(); const specid_t spec = m_inputWS->getAxis(1)->spectraNo(workspaceIndex); diff --git a/Code/Mantid/Framework/Algorithms/src/SolidAngle.cpp b/Code/Mantid/Framework/Algorithms/src/SolidAngle.cpp index 59dd9015d23..0c26edc4e68 100644 --- a/Code/Mantid/Framework/Algorithms/src/SolidAngle.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SolidAngle.cpp @@ -106,7 +106,7 @@ namespace Mantid throw std::logic_error( "Sample location not found, aborting algorithm SoildAngle"); } - Geometry::V3D samplePos = sample->getPos(); + Kernel::V3D samplePos = sample->getPos(); g_log.debug() << "Sample position is " << samplePos << std::endl; int loopIterations = m_MaxSpec-m_MinSpec; diff --git a/Code/Mantid/Framework/Algorithms/src/SpatialGrouping.cpp b/Code/Mantid/Framework/Algorithms/src/SpatialGrouping.cpp index 127011bef64..58d4cf89abd 100644 --- a/Code/Mantid/Framework/Algorithms/src/SpatialGrouping.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SpatialGrouping.cpp @@ -235,7 +235,7 @@ bool SpatialGrouping::expandNet(std::map<specid_t,double> & nearest, specid_t sp if ( inclIt != m_included.end() ) { continue; } // If we get this far, we need to determine if the detector is of a suitable distance - Mantid::Geometry::V3D pos = m_detectors[potIt->first]->getPos(); + Mantid::Kernel::V3D pos = m_detectors[potIt->first]->getPos(); if ( ! bbox.isPointInside(pos) ) { continue; } // Elsewise, it's all good. diff --git a/Code/Mantid/Framework/Algorithms/test/CreatePSDBleedMaskTest.h b/Code/Mantid/Framework/Algorithms/test/CreatePSDBleedMaskTest.h index fe17789202a..ca7053b2921 100644 --- a/Code/Mantid/Framework/Algorithms/test/CreatePSDBleedMaskTest.h +++ b/Code/Mantid/Framework/Algorithms/test/CreatePSDBleedMaskTest.h @@ -121,7 +121,7 @@ private: using Mantid::Geometry::CompAssembly; using Mantid::Geometry::Detector; using Mantid::Geometry::Object_sptr; - using Mantid::Geometry::V3D; + using Mantid::Kernel::V3D; // Need a tube based instrument. // pixels diff --git a/Code/Mantid/Framework/Algorithms/test/HRPDSlabCanAbsorptionTest.h b/Code/Mantid/Framework/Algorithms/test/HRPDSlabCanAbsorptionTest.h index 8ed89dce14d..874f33a3d44 100644 --- a/Code/Mantid/Framework/Algorithms/test/HRPDSlabCanAbsorptionTest.h +++ b/Code/Mantid/Framework/Algorithms/test/HRPDSlabCanAbsorptionTest.h @@ -9,6 +9,7 @@ using namespace Mantid::Geometry; using Mantid::API::MatrixWorkspace_sptr; +using Mantid::Kernel::V3D; class HRPDSlabCanAbsorptionTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Algorithms/test/MonteCarloAbsorptionTest.h b/Code/Mantid/Framework/Algorithms/test/MonteCarloAbsorptionTest.h index e059c088b12..3f299961473 100644 --- a/Code/Mantid/Framework/Algorithms/test/MonteCarloAbsorptionTest.h +++ b/Code/Mantid/Framework/Algorithms/test/MonteCarloAbsorptionTest.h @@ -18,6 +18,7 @@ using namespace Mantid::Geometry; using Mantid::Algorithms::MonteCarloAbsorption; using Mantid::DataObjects::Workspace2D_sptr; using Mantid::Geometry::ShapeFactory; +using Mantid::Kernel::V3D; class MonteCarloAbsorptionTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h b/Code/Mantid/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h index bb27947f717..6bb4a99708c 100644 --- a/Code/Mantid/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h +++ b/Code/Mantid/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h @@ -7,7 +7,7 @@ #include "MantidGeometry/IInstrument.h" #include "MantidKernel/System.h" #include <MantidGeometry/Crystal/OrientedLattice.h> -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" namespace Mantid { @@ -63,7 +63,7 @@ namespace Crystal /// Min D spacing to apply. double minD; /// Rotation matrix - Mantid::Geometry::Matrix<double> mat; + Mantid::Kernel::DblMatrix mat; }; diff --git a/Code/Mantid/Framework/Crystal/src/IntegratePeakTimeSlices.cpp b/Code/Mantid/Framework/Crystal/src/IntegratePeakTimeSlices.cpp index 13261ca6b21..b93f62aeda0 100644 --- a/Code/Mantid/Framework/Crystal/src/IntegratePeakTimeSlices.cpp +++ b/Code/Mantid/Framework/Crystal/src/IntegratePeakTimeSlices.cpp @@ -19,7 +19,7 @@ #include "MantidAPI/SpectraDetectorMap.h" #include "MantidKernel/cow_ptr.h" #include "MantidKernel/Unit.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" // #include <vector> #include <algorithm> diff --git a/Code/Mantid/Framework/Crystal/src/LoadIsawUB.cpp b/Code/Mantid/Framework/Crystal/src/LoadIsawUB.cpp index bbaad751709..20e64fc9aa9 100644 --- a/Code/Mantid/Framework/Crystal/src/LoadIsawUB.cpp +++ b/Code/Mantid/Framework/Crystal/src/LoadIsawUB.cpp @@ -1,6 +1,6 @@ #include "MantidAPI/FileProperty.h" #include "MantidCrystal/LoadIsawUB.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidKernel/Strings.h" #include "MantidKernel/System.h" #include <fstream> @@ -9,7 +9,7 @@ #include <MantidGeometry/Crystal/UnitCell.h> using namespace Mantid::Kernel::Strings; -using Mantid::Geometry::DblMatrix; +using Mantid::Kernel::DblMatrix; using Mantid::Geometry::UnitCell; namespace Mantid @@ -80,7 +80,7 @@ namespace Crystal // Open the file std::ifstream in( Filename.c_str() ); - Geometry::Matrix<double> ub(3,3); + Kernel::DblMatrix ub(3,3); std::string s; double val; @@ -111,7 +111,7 @@ namespace Crystal // // At this point, the UB uses the IPNS convention meaning that // // for us, the output Q vector from UB.hkl = Qz, Qx, Qy -// Geometry::Matrix<double> adjust(3,3); +// Kernel::DblMatrix<double> adjust(3,3); // adjust[0][1] = 1.0; // adjust[1][2] = 1.0; // adjust[2][0] = 1.0; @@ -130,11 +130,11 @@ namespace Crystal // Create the lattice from the file's parameter OrientedLattice * latt = new OrientedLattice(lattPar[0], lattPar[1], lattPar[2], lattPar[3], lattPar[4], lattPar[5]); // Set the UB in there. - Geometry::Matrix<double> Binv = latt->getBinv(); // B^-1 - Geometry::Matrix<double> U = ub * Binv; // U = UB * B^-1 + Kernel::DblMatrix Binv = latt->getBinv(); // B^-1 + Kernel::DblMatrix U = ub * Binv; // U = UB * B^-1 */ // Swap rows around to accound for IPNS convention - Geometry::Matrix<double> U=ol.getU(); + DblMatrix U=ol.getU(); DblMatrix U2 = U; for (size_t r=0; r<3; r++) { diff --git a/Code/Mantid/Framework/Crystal/src/MaskPeaksWorkspace.cpp b/Code/Mantid/Framework/Crystal/src/MaskPeaksWorkspace.cpp index 58759b5b04d..22d317ee23c 100644 --- a/Code/Mantid/Framework/Crystal/src/MaskPeaksWorkspace.cpp +++ b/Code/Mantid/Framework/Crystal/src/MaskPeaksWorkspace.cpp @@ -95,7 +95,7 @@ namespace Mantid l1 = peak.getL1(); col = peak.getCol(); row = peak.getRow(); - Geometry::V3D pos = peak.getDetPos(); + Kernel::V3D pos = peak.getDetPos(); l2 = pos.norm(); wl = peak.getWavelength(); diff --git a/Code/Mantid/Framework/Crystal/src/PeakIntegration.cpp b/Code/Mantid/Framework/Crystal/src/PeakIntegration.cpp index a78825a3dad..b40e09b07d5 100644 --- a/Code/Mantid/Framework/Crystal/src/PeakIntegration.cpp +++ b/Code/Mantid/Framework/Crystal/src/PeakIntegration.cpp @@ -205,7 +205,7 @@ namespace Mantid double col = peak.getCol(); double row = peak.getRow(); - Geometry::V3D pos = peak.getDetPos(); + Kernel::V3D pos = peak.getDetPos(); //Average integer postion; subtract 1 because ISAW starts at 1 not 0 int XPeak = int(col+0.5)-2; diff --git a/Code/Mantid/Framework/Crystal/src/PredictPeaks.cpp b/Code/Mantid/Framework/Crystal/src/PredictPeaks.cpp index c3b418764f7..de673b7d6f4 100644 --- a/Code/Mantid/Framework/Crystal/src/PredictPeaks.cpp +++ b/Code/Mantid/Framework/Crystal/src/PredictPeaks.cpp @@ -3,7 +3,7 @@ #include "MantidDataObjects/PeaksWorkspace.h" #include "MantidGeometry/Crystal/UnitCell.h" #include "MantidGeometry/IInstrument.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidGeometry/Objects/InstrumentRayTracer.h" #include "MantidKernel/PropertyWithValue.h" #include "MantidKernel/System.h" diff --git a/Code/Mantid/Framework/Crystal/src/SaveIsawPeaks.cpp b/Code/Mantid/Framework/Crystal/src/SaveIsawPeaks.cpp index 61d525456f1..24cb99e7ae0 100644 --- a/Code/Mantid/Framework/Crystal/src/SaveIsawPeaks.cpp +++ b/Code/Mantid/Framework/Crystal/src/SaveIsawPeaks.cpp @@ -4,7 +4,7 @@ #include "MantidDataObjects/PeaksWorkspace.h" #include "MantidGeometry/IInstrument.h" #include "MantidGeometry/Instrument/RectangularDetector.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/Strings.h" #include "MantidKernel/System.h" #include <fstream> diff --git a/Code/Mantid/Framework/Crystal/src/SetGoniometer.cpp b/Code/Mantid/Framework/Crystal/src/SetGoniometer.cpp index 2a042e23a1b..d358d830b0d 100644 --- a/Code/Mantid/Framework/Crystal/src/SetGoniometer.cpp +++ b/Code/Mantid/Framework/Crystal/src/SetGoniometer.cpp @@ -4,7 +4,7 @@ #include "MantidKernel/Strings.h" #include "MantidGeometry/Instrument/Goniometer.h" #include <boost/algorithm/string/detail/classification.hpp> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" using Mantid::Geometry::Goniometer; using namespace Mantid::Geometry; diff --git a/Code/Mantid/Framework/Crystal/test/LoadIsawUBTest.h b/Code/Mantid/Framework/Crystal/test/LoadIsawUBTest.h index 3903ef70184..95ec0cdaaf2 100644 --- a/Code/Mantid/Framework/Crystal/test/LoadIsawUBTest.h +++ b/Code/Mantid/Framework/Crystal/test/LoadIsawUBTest.h @@ -4,7 +4,7 @@ #include "MantidCrystal/LoadIsawUB.h" #include "MantidDataObjects/PeaksWorkspace.h" #include "MantidDataObjects/Workspace2D.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidKernel/System.h" #include "MantidKernel/Timer.h" #include "MantidTestHelpers/AlgorithmHelper.h" diff --git a/Code/Mantid/Framework/Crystal/test/LoadPeaksFileTest.h b/Code/Mantid/Framework/Crystal/test/LoadPeaksFileTest.h index da938611ffa..74bf6db1d6d 100644 --- a/Code/Mantid/Framework/Crystal/test/LoadPeaksFileTest.h +++ b/Code/Mantid/Framework/Crystal/test/LoadPeaksFileTest.h @@ -5,7 +5,7 @@ #include "MantidCrystal/LoadPeaksFile.h" #include "MantidDataObjects/Peak.h" #include "MantidDataObjects/PeaksWorkspace.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidKernel/System.h" #include "MantidKernel/Timer.h" #include <cxxtest/TestSuite.h> diff --git a/Code/Mantid/Framework/Crystal/test/PredictPeaksTest.h b/Code/Mantid/Framework/Crystal/test/PredictPeaksTest.h index e20e2d21b52..5ac7f8ab86c 100644 --- a/Code/Mantid/Framework/Crystal/test/PredictPeaksTest.h +++ b/Code/Mantid/Framework/Crystal/test/PredictPeaksTest.h @@ -11,7 +11,7 @@ #include <cxxtest/TestSuite.h> #include <iomanip> #include <iostream> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/IDTypes.h" using namespace Mantid; @@ -19,6 +19,8 @@ using namespace Mantid::Crystal; using namespace Mantid::API; using namespace Mantid::DataObjects; using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::DblMatrix; class PredictPeaksTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Crystal/test/SetGoniometerTest.h b/Code/Mantid/Framework/Crystal/test/SetGoniometerTest.h index cf7c6d4c4a9..f1f7772ee0d 100644 --- a/Code/Mantid/Framework/Crystal/test/SetGoniometerTest.h +++ b/Code/Mantid/Framework/Crystal/test/SetGoniometerTest.h @@ -10,7 +10,7 @@ #include <cxxtest/TestSuite.h> #include <iomanip> #include <iostream> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" using namespace Mantid::Crystal; using namespace Mantid::API; @@ -18,6 +18,7 @@ using namespace Mantid::DataObjects; using namespace Mantid::Geometry; using Mantid::DataObjects::Workspace2D_sptr; using Mantid::Geometry::Goniometer; +using Mantid::Kernel::V3D; class SetGoniometerTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/CurveFitting/src/ProductFunctionMW.cpp b/Code/Mantid/Framework/CurveFitting/src/ProductFunctionMW.cpp index bc304291d87..921ef861cdd 100644 --- a/Code/Mantid/Framework/CurveFitting/src/ProductFunctionMW.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/ProductFunctionMW.cpp @@ -1,5 +1,3 @@ -// To suppress STL warnings -#define _SCL_SECURE_NO_WARNINGS //---------------------------------------------------------------------- // Includes //---------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/CurveFitting/test/BivariateNormalTest.h b/Code/Mantid/Framework/CurveFitting/test/BivariateNormalTest.h index 441753eb5a8..15db0b41a8c 100644 --- a/Code/Mantid/Framework/CurveFitting/test/BivariateNormalTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/BivariateNormalTest.h @@ -10,7 +10,7 @@ #include <cxxtest/TestSuite.h> #include "MantidCurveFitting/BivariateNormal.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidAPI/WorkspaceFactory.h" #include "MantidAPI/MatrixWorkspace.h" #include "MantidDataObjects/Workspace2D.h" diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/FindDetectorsPar.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/FindDetectorsPar.h index fb0dfe1648c..7a5cfc810c0 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/FindDetectorsPar.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/FindDetectorsPar.h @@ -157,13 +157,13 @@ private: /// calculates par values for a detectors ring; void calc_cylDetPar(const Geometry::IDetector_sptr spDet, const Geometry::IObjComponent_const_sptr sample, - const Geometry::V3D &groupCentre, + const Kernel::V3D &groupCentre, double &azim, double &polar, double &azim_width, double &polar_width,double &dist); /// calculates par values for a detectors block or a detector; void calc_rectDetPar(const API::MatrixWorkspace_sptr inputWS, const Geometry::IDetector_sptr spDet, const Geometry::IObjComponent_const_sptr sample, - const Geometry::V3D &groupCentre, + const Kernel::V3D &groupCentre, double &azim, double &polar, double &azim_width, double &polar_width,double &dist); /// if ASCII file is selected as the datasource, this structure describes the type of this file. diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorInfo.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorInfo.h index cc2a3f7b52a..331059fe21f 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorInfo.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorInfo.h @@ -99,7 +99,7 @@ private: /// If set to true then update the detector positions base on the information in the given file bool m_moveDets; /// Store the sample position as we may need it repeatedly - Geometry::V3D m_samplePos; + Kernel::V3D m_samplePos; // Implement abstract Algorithm methods void init(); diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h index 64594862ebe..19574701b95 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h @@ -18,6 +18,10 @@ namespace XML { namespace Mantid { + namespace Kernel + { + class V3D; + } namespace API { class MatrixWorkspace; @@ -29,7 +33,6 @@ namespace Mantid class Component; class Object; class ObjComponent; - class V3D; class Instrument; } @@ -163,7 +166,7 @@ namespace Mantid std::vector< Geometry::ObjComponent* > m_facingComponent; /// Parse position of facing element to V3D - Geometry::V3D parseFacingElementToV3D(Poco::XML::Element* pElem); + Kernel::V3D parseFacingElementToV3D(Poco::XML::Element* pElem); /// Set facing of comp as specified in XML facing element void setFacing(Geometry::IComponent* comp, Poco::XML::Element* pElem); @@ -172,13 +175,13 @@ namespace Mantid bool m_haveDefaultFacing; /// Hold default facing position - Geometry::V3D m_defaultFacing; + Kernel::V3D m_defaultFacing; /// Make the shape defined in 1st argument face the component in the second argument void makeXYplaneFaceComponent(Geometry::IComponent* &in, const Geometry::ObjComponent* facing); /// Make the shape defined in 1st argument face the position in the second argument - void makeXYplaneFaceComponent(Geometry::IComponent* &in, const Geometry::V3D& facingPoint); + void makeXYplaneFaceComponent(Geometry::IComponent* &in, const Kernel::V3D& facingPoint); /// Return true if assembly, false if not assembly and throws exception if string not in assembly bool isAssembly(std::string); @@ -218,7 +221,7 @@ namespace Mantid std::string getNameOfLocationElement(Poco::XML::Element* pElem); /// Calculate the position of comp relative to its parent from info provided by \<location\> element - Geometry::V3D getRelativeTranslation(const Geometry::IComponent* comp, const Poco::XML::Element* pElem); + Kernel::V3D getRelativeTranslation(const Geometry::IComponent* comp, const Poco::XML::Element* pElem); /// when this const equals 1 it means that angle=degree (default) is set in IDF /// otherwise if this const equals 180/pi it means that angle=radian is set in IDF diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadParameterFile.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadParameterFile.h index cb57c6a9fb7..d5ca3135dd4 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadParameterFile.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadParameterFile.h @@ -18,14 +18,16 @@ namespace XML { namespace Mantid { - + namespace Kernel + { + class V3D; + } namespace Geometry { class CompAssembly; class Component; class Object; class ObjComponent; - class V3D; class Instrument; } diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h index ec26869c2ca..af495dbd193 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h @@ -78,19 +78,19 @@ namespace Mantid std::string m_filename; /// An integer option controlling the scaling method int m_scalingOption; - bool processScalingFile(const std::string& scalingFile, std::vector<Geometry::V3D>& truePos); + bool processScalingFile(const std::string& scalingFile, std::vector<Kernel::V3D>& truePos); API::MatrixWorkspace_sptr m_workspace; ///< Pointer to the workspace - //void runMoveInstrumentComp(const int& detIndex, const Geometry::V3D& shift); + //void runMoveInstrumentComp(const int& detIndex, const Kernel::V3D& shift); /// get a vector of shared pointers to each detector in the comp void findAll(boost::shared_ptr<Geometry::IComponent> comp); /// the vector of shared pointers std::vector<boost::shared_ptr<Geometry::IComponent> > m_vectDet; /// apply the shifts in posMap to the detectors in WS - void movePos(API::MatrixWorkspace_sptr& WS, std::map<int,Geometry::V3D>& posMap, + void movePos(API::MatrixWorkspace_sptr& WS, std::map<int,Kernel::V3D>& posMap, std::map<int,double>& scaleMap); /// read the positions of detectors defined in the raw file - void getDetPositionsFromRaw(std::string rawfile,std::vector<int>& detID, std::vector<Geometry::V3D>& pos); + void getDetPositionsFromRaw(std::string rawfile,std::vector<int>& detID, std::vector<Kernel::V3D>& pos); }; } // namespace DataHandling diff --git a/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp b/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp index 45e562da3ba..fe71151ac63 100644 --- a/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp +++ b/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp @@ -122,7 +122,7 @@ FindDetectorsPar::exec() if (spDet->isMonitor())continue; det_ID[ic] = spDet->getID(); - Geometry::V3D groupCentre; + Kernel::V3D groupCentre; Geometry::det_topology group_shape= spDet->getTopology(groupCentre); if(group_shape == Geometry::cyl){ // we have a ring; calc_cylDetPar(spDet,sample,groupCentre,azimuthal[ic], polar[ic], @@ -179,7 +179,7 @@ FindDetectorsPar::set_output_table() void FindDetectorsPar::calc_cylDetPar(const Geometry::IDetector_sptr spDet,const Geometry::IObjComponent_const_sptr sample, - const Geometry::V3D &GroupCenter, + const Kernel::V3D &GroupCenter, double &azim, double &polar, double &azim_width, double &polar_width,double &dist) { // polar values are constants for ring; @@ -194,10 +194,10 @@ FindDetectorsPar::calc_cylDetPar(const Geometry::IDetector_sptr spDet,const Geom double d_azim(0); - std::vector<Geometry::V3D> coord(3); + std::vector<Kernel::V3D> coord(3); // get vector leading from the sample to the ring centre - Geometry::V3D Observer = sample->getPos(); + Kernel::V3D Observer = sample->getPos(); coord[1] = (GroupCenter-Observer); double d0 = coord[1].norm(); coord[1] /= d0; @@ -212,7 +212,7 @@ FindDetectorsPar::calc_cylDetPar(const Geometry::IDetector_sptr spDet,const Geom // loop through all detectors in the group for(size_t i=0;i<pDets.size();i++){ - Geometry::V3D center= pDets[i]->getPos(); + Kernel::V3D center= pDets[i]->getPos(); coord[0] = center-GroupCenter; double d1 = coord[0].norm(); coord[0] /= d1; @@ -243,7 +243,7 @@ FindDetectorsPar::calc_cylDetPar(const Geometry::IDetector_sptr spDet,const Geom void FindDetectorsPar::calc_rectDetPar(const API::MatrixWorkspace_sptr inputWS, const Geometry::IDetector_sptr spDet,const Geometry::IObjComponent_const_sptr sample, - const Geometry::V3D &GroupCentre, + const Kernel::V3D &GroupCentre, double &azim, double &polar, double &azim_width, double &polar_width,double &dist) { // Get Sample->Detector distance @@ -251,11 +251,11 @@ FindDetectorsPar::calc_rectDetPar(const API::MatrixWorkspace_sptr inputWS, polar = inputWS->detectorTwoTheta(spDet)*rad2deg; azim = spDet->getPhi()*rad2deg; // Now let's work out the detector widths on basis of bounding box tangential to the 2Theta=const ring; - Geometry::V3D beamDetVector(GroupCentre.X(),GroupCentre.Y(),0); // group centre minus the projection of this centre to the beamline + Kernel::V3D beamDetVector(GroupCentre.X(),GroupCentre.Y(),0); // group centre minus the projection of this centre to the beamline beamDetVector.normalize(); - std::vector<Geometry::V3D> coord(3); + std::vector<Kernel::V3D> coord(3); coord[0] = beamDetVector; - coord[1] = Geometry::V3D(0,0,1); // along beamline, which is always oz; (can be amended) + coord[1] = Kernel::V3D(0,0,1); // along beamline, which is always oz; (can be amended) coord[2] = coord[0].cross_prod(coord[1]); // tangential to the ring and anticloakwise; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadDspacemap.cpp b/Code/Mantid/Framework/DataHandling/src/LoadDspacemap.cpp index ca2b1b61ae3..61103791b8b 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadDspacemap.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadDspacemap.cpp @@ -7,7 +7,7 @@ #include "MantidDataObjects/GroupingWorkspace.h" #include "MantidDataObjects/OffsetsWorkspace.h" #include "MantidGeometry/IInstrument.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/BinaryFile.h" #include "MantidKernel/PhysicalConstants.h" #include "MantidKernel/System.h" @@ -139,7 +139,7 @@ namespace DataHandling // Get a pointer to the instrument contained in the workspace IInstrument_const_sptr instrument = offsetsWS->getInstrument(); double l1; - Geometry::V3D beamline,samplePos; + Kernel::V3D beamline,samplePos; double beamline_norm; instrument->getInstrumentParameters(l1,beamline,beamline_norm, samplePos); diff --git a/Code/Mantid/Framework/DataHandling/src/LoadInstrument.cpp b/Code/Mantid/Framework/DataHandling/src/LoadInstrument.cpp index 9da5be995cd..026039f2840 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadInstrument.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadInstrument.cpp @@ -919,10 +919,10 @@ namespace Mantid * * @return Thrown if second argument is not a pointer to a 'location' XML element */ - Geometry::V3D LoadInstrument::getRelativeTranslation(const Geometry::IComponent* comp, const Poco::XML::Element* pElem) + Kernel::V3D LoadInstrument::getRelativeTranslation(const Geometry::IComponent* comp, const Poco::XML::Element* pElem) { - Geometry::V3D retVal; // position relative to parent + Kernel::V3D retVal; // position relative to parent // Polar coordinates can be labelled as (r,t,p) or (R,theta,phi) if ( pElem->hasAttribute("r") || pElem->hasAttribute("t") || pElem->hasAttribute("p") || @@ -944,7 +944,7 @@ namespace Mantid // so need to do some extra calculation before they're stored internally as x,y,z offsets. // Temporary vector to hold the parent's absolute position (will be 0,0,0 if no parent) - Geometry::V3D parentPos; + Kernel::V3D parentPos; // Get the parent's absolute position (if the component has a parent) if ( comp->getParent() ) { @@ -971,7 +971,7 @@ namespace Mantid m_tempPosHolder[comp] = tmp; // Create a V3D and set its position to be the child's absolute position - Geometry::V3D absPos; + Kernel::V3D absPos; absPos.spherical(R,theta,phi); // Subtract the two V3D's to get what we want (child's relative position in x,y,z) @@ -1017,7 +1017,7 @@ namespace Mantid throw std::logic_error( "Second argument to function setLocation must be a pointer to an XML element with tag name location." ); } - //Geometry::V3D pos; // position for <location> + //Kernel::V3D pos; // position for <location> comp->translate(getRelativeTranslation(comp, pElem)); @@ -1041,7 +1041,7 @@ namespace Mantid if ( pElem->hasAttribute("axis-z") ) axis_z = atof( (pElem->getAttribute("axis-z")).c_str() ); - comp->rotate(Geometry::Quat(rotAngle, Geometry::V3D(axis_x,axis_y,axis_z))); + comp->rotate(Kernel::Quat(rotAngle, Kernel::V3D(axis_x,axis_y,axis_z))); } @@ -1067,7 +1067,7 @@ namespace Mantid stillTransElement = false; } - Geometry::V3D posTrans; + Kernel::V3D posTrans; if (tElem) { @@ -1102,7 +1102,7 @@ namespace Mantid if ( rElem->hasAttribute("axis-z") ) axis_z = atof( (rElem->getAttribute("axis-z")).c_str() ); - comp->rotate(Geometry::Quat(rotAngle, Geometry::V3D(axis_x,axis_y,axis_z))); + comp->rotate(Kernel::Quat(rotAngle, Kernel::V3D(axis_x,axis_y,axis_z))); // for recursive action pRecursive = rElem; @@ -1284,7 +1284,7 @@ namespace Mantid */ void LoadInstrument::makeXYplaneFaceComponent(Geometry::IComponent* &in, const Geometry::ObjComponent* facing) { - const Geometry::V3D facingPoint = facing->getPos(); + const Kernel::V3D facingPoint = facing->getPos(); makeXYplaneFaceComponent(in, facingPoint); } @@ -1299,13 +1299,13 @@ namespace Mantid * @param in :: Component to be rotated * @param facingPoint :: position to face */ - void LoadInstrument::makeXYplaneFaceComponent(Geometry::IComponent* &in, const Geometry::V3D& facingPoint) + void LoadInstrument::makeXYplaneFaceComponent(Geometry::IComponent* &in, const Kernel::V3D& facingPoint) { - Geometry::V3D pos = in->getPos(); + Kernel::V3D pos = in->getPos(); // vector from facing object to component we want to rotate - Geometry::V3D facingDirection = pos - facingPoint; + Kernel::V3D facingDirection = pos - facingPoint; facingDirection.normalize(); if ( facingDirection.norm() == 0.0 ) return; @@ -1314,22 +1314,22 @@ namespace Mantid // now aim to rotate shape such that the z-axis of of the object we want to rotate // points in the direction of facingDirection. That way the XY plane faces the 'facing object'. - Geometry::V3D z = Geometry::V3D(0,0,1); - Geometry::Quat R = in->getRotation(); + Kernel::V3D z = Kernel::V3D(0,0,1); + Kernel::Quat R = in->getRotation(); R.inverse(); R.rotate(facingDirection); - Geometry::V3D normal = facingDirection.cross_prod(z); + Kernel::V3D normal = facingDirection.cross_prod(z); normal.normalize(); double theta = (180.0/M_PI)*facingDirection.angle(z); if ( normal.norm() > 0.0 ) - in->rotate(Geometry::Quat(-theta, normal)); + in->rotate(Kernel::Quat(-theta, normal)); else { // To take into account the case where the facing direction is in the (0,0,1) // or (0,0,-1) direction. - in->rotate(Geometry::Quat(-theta, Geometry::V3D(0,1,0))); + in->rotate(Kernel::Quat(-theta, Kernel::V3D(0,1,0))); } } @@ -1340,10 +1340,10 @@ namespace Mantid * @param pElem :: Facing type element to parse * @return Return parsed position as a V3D */ - Geometry::V3D LoadInstrument::parseFacingElementToV3D(Poco::XML::Element* pElem) + Kernel::V3D LoadInstrument::parseFacingElementToV3D(Poco::XML::Element* pElem) { - Geometry::V3D retV3D; + Kernel::V3D retV3D; // Polar coordinates can be labelled as (r,t,p) or (R,theta,phi) if ( pElem->hasAttribute("r") || pElem->hasAttribute("t") || pElem->hasAttribute("p") || @@ -1402,7 +1402,7 @@ namespace Mantid if ( facingElem->hasAttribute("rot") ) { double rotAngle = m_angleConvertConst*atof( (facingElem->getAttribute("rot")).c_str() ); // assumed to be in degrees - comp->rotate(Geometry::Quat(rotAngle, Geometry::V3D(0,0,1))); + comp->rotate(Kernel::Quat(rotAngle, Kernel::V3D(0,0,1))); } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadInstrumentFromNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadInstrumentFromNexus.cpp index 521f0049a87..68c74cc9bf5 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadInstrumentFromNexus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadInstrumentFromNexus.cpp @@ -110,7 +110,7 @@ void LoadInstrumentFromNexus::exec() { // Create a new detector. Instrument will take ownership of pointer so no need to delete. Geometry::Detector *detector = new Geometry::Detector("det",samplepos); - Geometry::V3D pos; + Kernel::V3D pos; pos.spherical(r[i], angle[i], 0.0); detector->setPos(pos); diff --git a/Code/Mantid/Framework/DataHandling/src/LoadInstrumentFromRaw.cpp b/Code/Mantid/Framework/DataHandling/src/LoadInstrumentFromRaw.cpp index 9ff390f1c1e..4879a1b11e9 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadInstrumentFromRaw.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadInstrumentFromRaw.cpp @@ -127,7 +127,7 @@ void LoadInstrumentFromRaw::exec() { // Create a new detector. Instrument will take ownership of pointer so no need to delete. Geometry::Detector *detector = new Geometry::Detector("det",detID[i],samplepos); - Geometry::V3D pos; + Kernel::V3D pos; if(phiPresent) pos.spherical(r[i], angle[i], phi[i]); diff --git a/Code/Mantid/Framework/DataHandling/src/LoadLOQDistancesFromRaw.cpp b/Code/Mantid/Framework/DataHandling/src/LoadLOQDistancesFromRaw.cpp index 9a722e4c281..f067a2e17d1 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadLOQDistancesFromRaw.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadLOQDistancesFromRaw.cpp @@ -5,7 +5,7 @@ #include "MantidAPI/FileProperty.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/IComponent.h" // The isis RAW data structure diff --git a/Code/Mantid/Framework/DataHandling/src/SaveDspacemap.cpp b/Code/Mantid/Framework/DataHandling/src/SaveDspacemap.cpp index 23f745df38f..a1afc65ffcd 100644 --- a/Code/Mantid/Framework/DataHandling/src/SaveDspacemap.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SaveDspacemap.cpp @@ -85,7 +85,7 @@ namespace DataHandling // Get a pointer to the instrument contained in the workspace IInstrument_const_sptr instrument = offsetsWS->getInstrument(); double l1; - Geometry::V3D beamline,samplePos; + Kernel::V3D beamline,samplePos; double beamline_norm; instrument->getInstrumentParameters(l1,beamline,beamline_norm, samplePos); diff --git a/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp b/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp index 501b9583cce..631421c156d 100644 --- a/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp @@ -37,7 +37,7 @@ void SavePHX::exec() { MatrixWorkspace_sptr inputWorkspace = getProperty("InputWorkspace"); // Get the sample position - const Geometry::V3D samplePos = + const Kernel::V3D samplePos = inputWorkspace->getInstrument()->getSample()->getPos(); // Retrieve the filename from the properties diff --git a/Code/Mantid/Framework/DataHandling/src/SetScalingPSD.cpp b/Code/Mantid/Framework/DataHandling/src/SetScalingPSD.cpp index cad6e68d5e1..f2787697605 100644 --- a/Code/Mantid/Framework/DataHandling/src/SetScalingPSD.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SetScalingPSD.cpp @@ -72,7 +72,7 @@ namespace DataHandling //m_workspace = getPropertyValue("Workspace"); m_workspace = getProperty("Workspace"); m_scalingOption = getProperty("ScalingOption"); - std::vector<Geometry::V3D> truepos; + std::vector<Kernel::V3D> truepos; processScalingFile(m_filename,truepos); //calculateDetectorShifts(truepos); @@ -84,15 +84,15 @@ namespace DataHandling * @param truepos :: V3D vector of actual positions as read from the file * @return False if unable to open file, True otherwise */ - bool SetScalingPSD::processScalingFile(const std::string& scalingFile, std::vector<Geometry::V3D>& truepos) + bool SetScalingPSD::processScalingFile(const std::string& scalingFile, std::vector<Kernel::V3D>& truepos) { // Read the scaling information from a text file (.sca extension) or from a raw file (.raw) // This is really corrected positions as (r,theta,phi) for each detector // Compare these with the instrument values to determine the change in position and the scaling // which may be necessary for each pixel if in a tube. // movePos is used to updated positions - std::map<int,Geometry::V3D> posMap; - std::map<int,Geometry::V3D>::iterator it; + std::map<int,Kernel::V3D> posMap; + std::map<int,Kernel::V3D>::iterator it; std::map<int,double> scaleMap; std::map<int,double>::iterator its; @@ -122,7 +122,7 @@ namespace DataHandling truepos.reserve(detectorCount); getline(sFile,str); // skip title line int detIdLast=-10; - Geometry:: V3D truPosLast,detPosLast; + Kernel::V3D truPosLast,detPosLast; Progress prog(this,0.0,0.5,detectorCount); // Now loop through lines, one for each detector/monitor. The latter are ignored. @@ -144,7 +144,7 @@ namespace DataHandling g_log.error("Position angle data out of range in .sca file"); throw std::runtime_error("Position angle data out of range in .sca file"); } - Geometry::V3D truPos; + Kernel::V3D truPos; // use abs as correction file has -ve l2 for first few detectors truPos.spherical(fabs(l2),theta,phi); truepos.push_back(truPos); @@ -158,17 +158,17 @@ namespace DataHandling { continue; } - Geometry::V3D detPos = det->getPos(); - Geometry::V3D shift=truPos-detPos; + Kernel::V3D detPos = det->getPos(); + Kernel::V3D shift=truPos-detPos; double scale=1.0; // scaling applied to dets that are not monitors and have sequential IDs if(detIdLast==detIndex-1 && !det->isMonitor()) { - Geometry::V3D diffI=detPos-detPosLast; - Geometry::V3D diffT=truPos-truPosLast; + Kernel::V3D diffI=detPos-detPosLast; + Kernel::V3D diffT=truPos-truPosLast; scale=diffT.norm()/diffI.norm(); - Geometry::V3D scaleDir=diffT/diffT.norm(); + Kernel::V3D scaleDir=diffT/diffT.norm(); // Wish to store the scaling in a map, if we already have a scaling // for this detector (i.e. from the other side) we average the two // values. End of tube detectors only have one scaling estimate. @@ -191,7 +191,7 @@ namespace DataHandling else if(scalingFile.find(".raw")!=std::string::npos || scalingFile.find(".RAW")!=std::string::npos ) { std::vector<int> detID; - std::vector<Geometry::V3D> truepos; + std::vector<Kernel::V3D> truepos; getDetPositionsFromRaw(scalingFile,detID,truepos); // int detectorCount = static_cast<int>(detID.size()); @@ -201,7 +201,7 @@ namespace DataHandling throw std::runtime_error("Failed to read any detectors from RAW file"); } int detIdLast=-10; - Geometry:: V3D truPosLast,detPosLast; + Kernel::V3D truPosLast,detPosLast; Progress prog(this,0.0,0.5,detectorCount); for(int i=0;i<detectorCount;i++) { @@ -215,15 +215,15 @@ namespace DataHandling { continue; } - Geometry::V3D detPos = det->getPos(); - Geometry::V3D shift=truepos[i]-detPos; + Kernel::V3D detPos = det->getPos(); + Kernel::V3D shift=truepos[i]-detPos; double scale; if(detIdLast==detIndex-1 && !det->isMonitor()) { - Geometry::V3D diffI=detPos-detPosLast; - Geometry::V3D diffT=truepos[i]-truPosLast; + Kernel::V3D diffI=detPos-detPosLast; + Kernel::V3D diffT=truepos[i]-truPosLast; scale=diffT.norm()/diffI.norm(); - Geometry::V3D scaleDir=diffT/diffT.norm(); + Kernel::V3D scaleDir=diffT/diffT.norm(); scaleMap[detIndex]=scale; its=scaleMap.find(detIndex-1); if(its==scaleMap.end()) @@ -264,7 +264,7 @@ namespace DataHandling -void SetScalingPSD::movePos(API::MatrixWorkspace_sptr& WS, std::map<int,Geometry::V3D>& posMap, +void SetScalingPSD::movePos(API::MatrixWorkspace_sptr& WS, std::map<int,Kernel::V3D>& posMap, std::map<int,double>& scaleMap) { @@ -274,7 +274,7 @@ void SetScalingPSD::movePos(API::MatrixWorkspace_sptr& WS, std::map<int,Geometry * @param posMap :: A map of integer detector ID and corresponding position shift * @param scaleMap :: A map of integer detectorID and corresponding scaling (in Y) */ - std::map<int,Geometry::V3D>::iterator iter = posMap.begin(); + std::map<int,Kernel::V3D>::iterator iter = posMap.begin(); boost::shared_ptr<IInstrument> inst = WS->getInstrument(); boost::shared_ptr<IComponent> comp; @@ -364,7 +364,7 @@ void SetScalingPSD::findAll(boost::shared_ptr<Geometry::IComponent> comp) * @param detID :: Vector of detector numbers * @param pos :: V3D of detector positions corresponding to detID */ -void SetScalingPSD::getDetPositionsFromRaw(std::string rawfile,std::vector<int>& detID, std::vector<Geometry::V3D>& pos) +void SetScalingPSD::getDetPositionsFromRaw(std::string rawfile,std::vector<int>& detID, std::vector<Kernel::V3D>& pos) { (void) rawfile; // Avoid compiler warning @@ -389,7 +389,7 @@ void SetScalingPSD::getDetPositionsFromRaw(std::string rawfile,std::vector<int>& } detID.reserve(numDetector); pos.reserve(numDetector); - Geometry::V3D point; + Kernel::V3D point; for (int i = 0; i < numDetector; ++i) { point.spherical(r[i], angle[i], phi[i]); diff --git a/Code/Mantid/Framework/DataHandling/src/UpdateInstrumentFromFile.cpp b/Code/Mantid/Framework/DataHandling/src/UpdateInstrumentFromFile.cpp index d5d5006ed95..c7a82911965 100644 --- a/Code/Mantid/Framework/DataHandling/src/UpdateInstrumentFromFile.cpp +++ b/Code/Mantid/Framework/DataHandling/src/UpdateInstrumentFromFile.cpp @@ -30,7 +30,7 @@ namespace Mantid using namespace API; using Geometry::Instrument_sptr; using Geometry::IDetector_sptr; - using Geometry::V3D; + using Kernel::V3D; /// Empty default constructor UpdateInstrumentFromFile::UpdateInstrumentFromFile() @@ -181,7 +181,7 @@ namespace Mantid if( ignoreMonitors && det->isMonitor() ) continue; V3D parentPos; if( det->getParent() ) parentPos = det->getParent()->getPos(); - Geometry::V3D pos; + Kernel::V3D pos; pos.spherical(l2[i], theta[i], phi[i]); // Set new relative position det->setPos(pos-parentPos); diff --git a/Code/Mantid/Framework/DataHandling/test/CreateSampleShapeTest.h b/Code/Mantid/Framework/DataHandling/test/CreateSampleShapeTest.h index 192116ef266..667e509e62b 100644 --- a/Code/Mantid/Framework/DataHandling/test/CreateSampleShapeTest.h +++ b/Code/Mantid/Framework/DataHandling/test/CreateSampleShapeTest.h @@ -75,7 +75,7 @@ public: Mantid::API::MatrixWorkspace_sptr ws = boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve("TestWorkspace")); const Mantid::Geometry::Object& sample = ws->sample().getShape(); - Mantid::Geometry::V3D point(x,y,z); + Mantid::Kernel::V3D point(x,y,z); if( inside ) { diff --git a/Code/Mantid/Framework/DataHandling/test/SetScalingPSDTest.h b/Code/Mantid/Framework/DataHandling/test/SetScalingPSDTest.h index a198f9251cb..e3d95e94f63 100644 --- a/Code/Mantid/Framework/DataHandling/test/SetScalingPSDTest.h +++ b/Code/Mantid/Framework/DataHandling/test/SetScalingPSDTest.h @@ -18,6 +18,7 @@ using Mantid::DataHandling::LoadEmptyInstrument; using Mantid::DataObjects::Workspace2D; using Mantid::DataObjects::Workspace2D_sptr; using Mantid::Kernel::ConfigService; +using Mantid::Kernel::V3D; class SetScalingPSDTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/Peak.h b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/Peak.h index af13147e8c3..146295aaf2e 100644 --- a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/Peak.h +++ b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/Peak.h @@ -3,8 +3,8 @@ #include "MantidAPI/IPeak.h" #include "MantidGeometry/IInstrument.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/PhysicalConstants.h" #include "MantidKernel/System.h" @@ -25,11 +25,11 @@ namespace DataObjects /// Allow PeakColumn class to directly access members. friend class PeakColumn; - Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, Mantid::Geometry::V3D QSampleFrame, double detectorDistance=1.0); - Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, Mantid::Geometry::V3D QSampleFrame, Mantid::Geometry::Matrix<double> goniometer, double detectorDistance=1.0); + Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, Mantid::Kernel::V3D QSampleFrame, double detectorDistance=1.0); + Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, Mantid::Kernel::V3D QSampleFrame, Mantid::Kernel::Matrix<double> goniometer, double detectorDistance=1.0); Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength); - Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Geometry::V3D HKL); - Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Geometry::V3D HKL, Mantid::Geometry::Matrix<double> goniometer); + Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Kernel::V3D HKL); + Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Kernel::V3D HKL, Mantid::Kernel::Matrix<double> goniometer); // Copy constructor is compiler-provided. Peak(const Peak & other); @@ -49,18 +49,18 @@ namespace DataObjects double getH() const; double getK() const; double getL() const; - Mantid::Geometry::V3D getHKL(); + Mantid::Kernel::V3D getHKL(); void setH(double m_H); void setK(double m_K); void setL(double m_L); void setHKL(double H, double K, double L); - void setHKL(Mantid::Geometry::V3D HKL); + void setHKL(Mantid::Kernel::V3D HKL); - Mantid::Geometry::V3D getQLabFrame() const; - Mantid::Geometry::V3D getQSampleFrame() const; + Mantid::Kernel::V3D getQLabFrame() const; + Mantid::Kernel::V3D getQSampleFrame() const; - void setQSampleFrame(Mantid::Geometry::V3D QSampleFrame, double detectorDistance=1.0); - void setQLabFrame(Mantid::Geometry::V3D QLabFrame, double detectorDistance=1.0); + void setQSampleFrame(Mantid::Kernel::V3D QSampleFrame, double detectorDistance=1.0); + void setQLabFrame(Mantid::Kernel::V3D QLabFrame, double detectorDistance=1.0); void setWavelength(double wavelength); double getWavelength() const; @@ -81,14 +81,14 @@ namespace DataObjects double getBinCount() const; void setBinCount(double m_BinCount); - Mantid::Geometry::Matrix<double> getGoniometerMatrix() const; - void setGoniometerMatrix(Mantid::Geometry::Matrix<double> m_GoniometerMatrix); + Mantid::Kernel::Matrix<double> getGoniometerMatrix() const; + void setGoniometerMatrix(Mantid::Kernel::Matrix<double> m_GoniometerMatrix); std::string getBankName() const; int getRow() const; int getCol() const; - Mantid::Geometry::V3D getDetPos() const; + Mantid::Kernel::V3D getDetPos() const; double getL1() const; double getL2() const; @@ -130,10 +130,10 @@ namespace DataObjects double m_FinalEnergy; /// Orientation matrix of the goniometer angles. - Mantid::Geometry::Matrix<double> m_GoniometerMatrix; + Mantid::Kernel::Matrix<double> m_GoniometerMatrix; /// Inverse of the goniometer rotation matrix; used to go from Q in lab frame to Q in sample frame - Mantid::Geometry::Matrix<double> m_InverseGoniometerMatrix; + Mantid::Kernel::Matrix<double> m_InverseGoniometerMatrix; /// Originating run number for this peak int m_RunNumber; @@ -145,11 +145,11 @@ namespace DataObjects int m_Col; /// Cached source position - Mantid::Geometry::V3D sourcePos; + Mantid::Kernel::V3D sourcePos; /// Cached sample position - Mantid::Geometry::V3D samplePos; + Mantid::Kernel::V3D samplePos; /// Cached detector position - Mantid::Geometry::V3D detPos; + Mantid::Kernel::V3D detPos; }; diff --git a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/PeaksWorkspace.h b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/PeaksWorkspace.h index 53e255fd050..00d4cdd5f3c 100644 --- a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/PeaksWorkspace.h +++ b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/PeaksWorkspace.h @@ -10,8 +10,8 @@ #include "MantidDataObjects/TableWorkspace.h" #include "MantidDataObjects/Peak.h" #include "MantidDataObjects/PeakColumn.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/IInstrument.h" #include "MantidKernel/DateAndTime.h" #include "MantidKernel/Exception.h" @@ -137,7 +137,7 @@ namespace DataObjects * @param detectorDistance :: distance between the sample and the detector. * @return a pointer to a new Peak object. */ - IPeak* createPeak(Mantid::Geometry::V3D QLabFrame, double detectorDistance=1.0) + IPeak* createPeak(Mantid::Kernel::V3D QLabFrame, double detectorDistance=1.0) { return new Peak(getInstrument(),QLabFrame,detectorDistance); } @@ -243,8 +243,8 @@ namespace DataObjects /// find method to get the index of cellstd::string value in a table workspace virtual void find(std::string /*value*/,int& /*row*/,const int & /*col*/) { throw Mantid::Kernel::Exception::NotImplementedError("PeaksWorkspace::find() not implemented."); } - /// find method to get the index of Mantid::Geometry::V3D cell value in a table workspace - virtual void find(Mantid::Geometry::V3D /*value*/,int& /*row*/,const int & /*col*/) + /// find method to get the index of Mantid::Kernel::V3D cell value in a table workspace + virtual void find(Mantid::Kernel::V3D /*value*/,int& /*row*/,const int & /*col*/) { throw Mantid::Kernel::Exception::NotImplementedError("PeaksWorkspace::find() not implemented."); } }; diff --git a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/TableColumn.h b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/TableColumn.h index 210fc310110..4caa4364fe8 100644 --- a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/TableColumn.h +++ b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/TableColumn.h @@ -38,7 +38,7 @@ class TableVector; "double" for double "bool" for Boolean "str" for std::string - "V3D" for Mantid::Geometry::V3D + "V3D" for Mantid::Kernel::V3D Boolean is used instead of bool because of bool's non-standard treatmemt in std::vector. diff --git a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/TableWorkspace.h b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/TableWorkspace.h index 27741f7cf7a..6444c64d541 100644 --- a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/TableWorkspace.h +++ b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/TableWorkspace.h @@ -35,7 +35,7 @@ namespace DataObjects - "double" for double - "bool" for bool - "str" for std::string - - "V3D" for Mantid::Geometry::V3D + - "V3D" for Mantid::Kernel::V3D User defined types can be used after declaring them with DECLARE_TABLECOLUMN macro: DECLARE_TABLECOLUMN(typeName, UserDefinedType) @@ -162,12 +162,12 @@ namespace DataObjects { findValue(value,row,col); } - /** This method finds the row and column index of an Mantid::Geometry::V3D cell value in a table workspace + /** This method finds the row and column index of an Mantid::Kernel::V3D cell value in a table workspace * @param value :: -value to search * @param row row number of the value searched * @param col column number of the value searched */ - void find(Mantid::Geometry::V3D value,int& row,const int & col) + void find(Mantid::Kernel::V3D value,int& row,const int & col) { findValue(value,row,col); } @@ -253,12 +253,12 @@ private: { findValue(value,row,col); } - /** This method finds the row and column index of an Mantid::Geometry::V3D cell value in a table workspace + /** This method finds the row and column index of an Mantid::Kernel::V3D cell value in a table workspace * @param value :: -value to search * @param row row number of the value searched * @param col column number of the value searched */ - void find(Mantid::Geometry::V3D value,int& row,int & col) + void find(Mantid::Kernel::V3D value,int& row,int & col) { findValue(value,row,col); } diff --git a/Code/Mantid/Framework/DataObjects/src/Peak.cpp b/Code/Mantid/Framework/DataObjects/src/Peak.cpp index c588a7fbd47..cd8c6612483 100644 --- a/Code/Mantid/Framework/DataObjects/src/Peak.cpp +++ b/Code/Mantid/Framework/DataObjects/src/Peak.cpp @@ -21,7 +21,7 @@ namespace DataObjects * @param detectorDistance :: distance between the sample and the detector. * Used to give a valid TOF. Default 1.0 meters. */ - Peak::Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, Mantid::Geometry::V3D QLabFrame, double detectorDistance) + Peak::Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, Mantid::Kernel::V3D QLabFrame, double detectorDistance) : m_H(0), m_K(0), m_L(0), m_Intensity(0), m_SigmaIntensity(0), m_BinCount(0), m_GoniometerMatrix(3,3,true), @@ -44,8 +44,8 @@ namespace DataObjects * @param detectorDistance :: distance between the sample and the detector. * Used to give a valid TOF. Default 1.0 meters. */ - Peak::Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, Mantid::Geometry::V3D QSampleFrame, - Mantid::Geometry::Matrix<double> goniometer, double detectorDistance) + Peak::Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, Mantid::Kernel::V3D QSampleFrame, + Mantid::Kernel::Matrix<double> goniometer, double detectorDistance) : m_H(0), m_K(0), m_L(0), m_Intensity(0), m_SigmaIntensity(0), m_BinCount(0), m_GoniometerMatrix(goniometer), @@ -89,7 +89,7 @@ namespace DataObjects * @param HKL :: vector with H,K,L position of the peak * @return */ - Peak::Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Geometry::V3D HKL) + Peak::Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Kernel::V3D HKL) : m_H(HKL[0]), m_K(HKL[1]), m_L(HKL[2]), m_Intensity(0), m_SigmaIntensity(0), m_BinCount(0), m_GoniometerMatrix(3,3,true), @@ -111,7 +111,7 @@ namespace DataObjects * @param goniometer :: a 3x3 rotation matrix * @return */ - Peak::Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Geometry::V3D HKL, Mantid::Geometry::Matrix<double> goniometer) : + Peak::Peak(Mantid::Geometry::IInstrument_const_sptr m_inst, int m_DetectorID, double m_Wavelength, Mantid::Kernel::V3D HKL, Mantid::Kernel::Matrix<double> goniometer) : m_H(HKL[0]), m_K(HKL[1]), m_L(HKL[2]), m_Intensity(0), m_SigmaIntensity(0), m_BinCount(0), m_GoniometerMatrix(goniometer), @@ -321,7 +321,7 @@ namespace DataObjects * * Note: There is no 2*pi factor used, so |Q| = 1/wavelength. * */ - Mantid::Geometry::V3D Peak::getQLabFrame() const + Mantid::Kernel::V3D Peak::getQLabFrame() const { // Normalized beam direction V3D beamDir = samplePos - sourcePos; @@ -349,7 +349,7 @@ namespace DataObjects //---------------------------------------------------------------------------------------------- /** Return the Q change (of the lattice, k_i - k_f) for this peak. * The Q is in the Sample frame: the goniometer rotation WAS taken out. */ - Mantid::Geometry::V3D Peak::getQSampleFrame() const + Mantid::Kernel::V3D Peak::getQSampleFrame() const { V3D Qlab = this->getQLabFrame(); // Multiply by the inverse of the goniometer matrix to get the sample frame @@ -368,7 +368,7 @@ namespace DataObjects * @param detectorDistance :: distance between the sample and the detector. * Used to give a valid TOF. Default 1.0 meters. */ - void Peak::setQSampleFrame(Mantid::Geometry::V3D QSampleFrame, double detectorDistance) + void Peak::setQSampleFrame(Mantid::Kernel::V3D QSampleFrame, double detectorDistance) { V3D Qlab = m_GoniometerMatrix * QSampleFrame; this->setQLabFrame(Qlab, detectorDistance); @@ -386,7 +386,7 @@ namespace DataObjects * @param detectorDistance :: distance between the sample and the detector. * Used to give a valid TOF. Default 1.0 meters. */ - void Peak::setQLabFrame(Mantid::Geometry::V3D QLabFrame, double detectorDistance) + void Peak::setQLabFrame(Mantid::Kernel::V3D QLabFrame, double detectorDistance) { // Clear out the detector = we can't know them m_DetectorID = -1; @@ -476,7 +476,7 @@ namespace DataObjects { return m_L; } /** Return the HKL vector */ - Mantid::Geometry::V3D Peak::getHKL() + Mantid::Kernel::V3D Peak::getHKL() { return V3D(m_H, m_K, m_L); } @@ -509,7 +509,7 @@ namespace DataObjects * * @param HKL :: vector with x,y,z -> h,k,l */ - void Peak::setHKL(Mantid::Geometry::V3D HKL) + void Peak::setHKL(Mantid::Kernel::V3D HKL) { m_H = HKL.X(); m_K = HKL.Y(); @@ -557,7 +557,7 @@ namespace DataObjects // ------------------------------------------------------------------------------------- /** Get the goniometer rotation matrix at which this peak was measured. */ - Mantid::Geometry::Matrix<double> Peak::getGoniometerMatrix() const + Mantid::Kernel::Matrix<double> Peak::getGoniometerMatrix() const { return this->m_GoniometerMatrix; } @@ -565,7 +565,7 @@ namespace DataObjects /** Set the goniometer rotation matrix at which this peak was measured. * @param goniometerMatrix :: 3x3 matrix that represents the rotation matrix of the goniometer * @throw std::invalid_argument if matrix is not 3x3*/ - void Peak::setGoniometerMatrix(Mantid::Geometry::Matrix<double> goniometerMatrix) + void Peak::setGoniometerMatrix(Mantid::Kernel::Matrix<double> goniometerMatrix) { if ((goniometerMatrix.numCols() != 3) || (goniometerMatrix.numRows() != 3)) throw std::invalid_argument("Goniometer matrix must be 3x3."); @@ -600,7 +600,7 @@ namespace DataObjects // ------------------------------------------------------------------------------------- /** Return the detector position vector */ - Mantid::Geometry::V3D Peak::getDetPos() const + Mantid::Kernel::V3D Peak::getDetPos() const { return detPos; } diff --git a/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp b/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp index 78d41236fcb..e90366e0764 100644 --- a/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp +++ b/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp @@ -8,8 +8,8 @@ #include "MantidDataObjects/TableColumn.h" #include "MantidDataObjects/TableWorkspace.h" #include "MantidDataObjects/Peak.h" -#include "MantidGeometry/Quat.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Quat.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/DateAndTime.h" #include "MantidKernel/Logger.h" #include "MantidKernel/PhysicalConstants.h" diff --git a/Code/Mantid/Framework/DataObjects/src/TableColumn.cpp b/Code/Mantid/Framework/DataObjects/src/TableColumn.cpp index e372eaa178c..07bf6fa7791 100644 --- a/Code/Mantid/Framework/DataObjects/src/TableColumn.cpp +++ b/Code/Mantid/Framework/DataObjects/src/TableColumn.cpp @@ -1,6 +1,6 @@ #include "MantidDataObjects/TableColumn.h" #include "MantidAPI/ColumnFactory.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" namespace Mantid { @@ -12,7 +12,7 @@ DECLARE_TABLECOLUMN(float,float) DECLARE_TABLECOLUMN(double,double) DECLARE_TABLECOLUMN(API::Boolean,bool) DECLARE_TABLECOLUMN(std::string,str) -DECLARE_TABLECOLUMN(Mantid::Geometry::V3D,V3D) +DECLARE_TABLECOLUMN(Mantid::Kernel::V3D,V3D) DECLARE_TABLECOLUMN(int64_t,long64) diff --git a/Code/Mantid/Framework/DataObjects/test/PeaksWorkspaceTest.h b/Code/Mantid/Framework/DataObjects/test/PeaksWorkspaceTest.h index baefe25d0ca..bcbbc0caede 100644 --- a/Code/Mantid/Framework/DataObjects/test/PeaksWorkspaceTest.h +++ b/Code/Mantid/Framework/DataObjects/test/PeaksWorkspaceTest.h @@ -11,7 +11,7 @@ #include <stdio.h> #include <cmath> #include "MantidDataObjects/PeaksWorkspace.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/Strings.h" #include "MantidKernel/PhysicalConstants.h" #include "MantidTestHelpers/ComponentCreationHelper.h" diff --git a/Code/Mantid/Framework/DataObjects/test/WorkspaceIteratorTest.h b/Code/Mantid/Framework/DataObjects/test/WorkspaceIteratorTest.h index 0ce4c560b5e..2d5166dc1eb 100644 --- a/Code/Mantid/Framework/DataObjects/test/WorkspaceIteratorTest.h +++ b/Code/Mantid/Framework/DataObjects/test/WorkspaceIteratorTest.h @@ -292,15 +292,15 @@ public: int count = 0; for(MatrixWorkspace::const_iterator ti(*workspace,loopCount,LoopOrientation::Vertical); ti != ti.end(); ++ti) { - TS_ASSERT_THROWS_NOTHING - ( - //LocatedDataRef tr = *ti; - //int datablock = count/(size*loopCount); - //int blockindex = count/loopCount; - //TS_ASSERT_EQUALS(tr.X(),workspace->dataX(datablock)[blockindex]); - //TS_ASSERT_EQUALS(tr.Y(),workspace->dataY(datablock)[blockindex]); - //TS_ASSERT_EQUALS(tr.E(),workspace->dataE(datablock)[blockindex]); - ) + //TS_ASSERT_THROWS_NOTHING + //( + // //LocatedDataRef tr = *ti; + // //int datablock = count/(size*loopCount); + // //int blockindex = count/loopCount; + // //TS_ASSERT_EQUALS(tr.X(),workspace->dataX(datablock)[blockindex]); + // //TS_ASSERT_EQUALS(tr.Y(),workspace->dataY(datablock)[blockindex]); + // //TS_ASSERT_EQUALS(tr.E(),workspace->dataE(datablock)[blockindex]); + //) count++; } TS_ASSERT_EQUALS(count,size*histogramCount*loopCount); diff --git a/Code/Mantid/Framework/Geometry/CMakeLists.txt b/Code/Mantid/Framework/Geometry/CMakeLists.txt index 994691c0ebf..845c6e9a6af 100644 --- a/Code/Mantid/Framework/Geometry/CMakeLists.txt +++ b/Code/Mantid/Framework/Geometry/CMakeLists.txt @@ -40,7 +40,6 @@ set ( SRC_FILES src/Math/Acomp.cpp src/Math/Algebra.cpp src/Math/BnId.cpp - src/Math/Matrix.cpp src/Math/PolyBase.cpp src/Math/RotCounter.cpp src/Math/Triple.cpp @@ -52,7 +51,6 @@ set ( SRC_FILES src/Objects/Rules.cpp src/Objects/ShapeFactory.cpp src/Objects/Track.cpp - src/Quat.cpp src/Rendering/BitmapGeometryHandler.cpp src/Rendering/CacheGeometryGenerator.cpp src/Rendering/CacheGeometryHandler.cpp @@ -76,7 +74,6 @@ set ( SRC_FILES src/Surfaces/Surface.cpp src/Surfaces/SurfaceFactory.cpp src/Surfaces/Torus.cpp - src/V3D.cpp ) set ( SRC_UNITY_IGNORE_FILES src/Instrument/CompAssembly.cpp @@ -134,7 +131,6 @@ set ( INC_FILES inc/MantidGeometry/Math/Algebra.h inc/MantidGeometry/Math/BnId.h inc/MantidGeometry/Math/MapSupport.h - inc/MantidGeometry/Math/Matrix.h inc/MantidGeometry/Math/PolyBase.h inc/MantidGeometry/Math/RotCounter.h inc/MantidGeometry/Math/Triple.h @@ -146,7 +142,6 @@ set ( INC_FILES inc/MantidGeometry/Objects/Rules.h inc/MantidGeometry/Objects/ShapeFactory.h inc/MantidGeometry/Objects/Track.h - inc/MantidGeometry/Quat.h inc/MantidGeometry/Rendering/BitmapGeometryHandler.h inc/MantidGeometry/Rendering/CacheGeometryGenerator.h inc/MantidGeometry/Rendering/CacheGeometryHandler.h @@ -163,8 +158,6 @@ set ( INC_FILES inc/MantidGeometry/Rendering/vtkGeometryCacheWriter.h inc/MantidGeometry/ISpectraDetectorMap.h inc/MantidGeometry/Surfaces/BaseVisit.h - inc/MantidGeometry/Tolerance.h - inc/MantidGeometry/V3D.h ) set ( TEST_FILES @@ -199,7 +192,6 @@ set ( TEST_FILES test/MapSupportTest.h test/MaterialTest.h test/MathSupportTest.h - test/MatrixTest.h test/NearestNeighboursTest.h test/ObjCompAssemblyTest.h test/ObjComponentTest.h @@ -214,7 +206,6 @@ set ( TEST_FILES test/ParObjComponentTest.h test/ParametrizedComponentTest.h test/PlaneTest.h - test/QuatTest.h test/RectangularDetectorTest.h test/ReflectionConditionTest.h test/RotCounterTest.h @@ -234,7 +225,6 @@ set ( TEST_FILES test/TripleTest.h test/UnitCellTest.h test/IndexingUtilsTest.h - test/V3DTest.h ) set ( GMOCK_TEST_FILES diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/IndexingUtils.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/IndexingUtils.h index a985b0cddd8..a5ba369fbbf 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/IndexingUtils.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/IndexingUtils.h @@ -6,9 +6,9 @@ //---------------------------------------------------------------------- // Includes //---------------------------------------------------------------------- -#include "MantidKernel/System.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidGeometry/DllConfig.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Matrix.h" namespace Mantid { @@ -53,9 +53,9 @@ class MANTID_GEOMETRY_DLL IndexingUtils public: /// Find the UB matrix that best fits 3 or more indexed peaks - static double BestFit_UB( Matrix<double> & UB, - const std::vector<V3D> & hkl_vectors, - const std::vector<V3D> & q_vectors ); + static double BestFit_UB(Kernel::DblMatrix & UB, + const std::vector<Kernel::V3D> & hkl_vectors, + const std::vector<Kernel::V3D> & q_vectors ); }; } // namespace Geometry diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h index 0150935065e..f652d048554 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h @@ -36,29 +36,29 @@ namespace Geometry { public: // Default constructor. a = b = c = 1, alpha = beta = gamma = 90 degrees - OrientedLattice(DblMatrix Umatrix=DblMatrix(3,3,true)); + OrientedLattice(Kernel::DblMatrix Umatrix=Kernel::DblMatrix(3,3,true)); //Copy constructor OrientedLattice(const OrientedLattice& other); // a,b,c constructor - OrientedLattice(const double _a,const double _b,const double _c,DblMatrix Umatrix=DblMatrix(3,3,true)); + OrientedLattice(const double _a,const double _b,const double _c,Kernel::DblMatrix Umatrix=Kernel::DblMatrix(3,3,true)); //a,b,c,alpha,beta,gamma constructor - OrientedLattice(const double _a,const double _b,const double _c,const double _alpha,const double _beta,const double _gamma,DblMatrix Umatrix=DblMatrix(3,3,true),const int angleunit=angDegrees); + OrientedLattice(const double _a,const double _b,const double _c,const double _alpha,const double _beta,const double _gamma,Kernel::DblMatrix Umatrix=Kernel::DblMatrix(3,3,true),const int angleunit=angDegrees); //UnitCell constructor - OrientedLattice(UnitCell uc ,DblMatrix Umatrix=DblMatrix(3,3,true)); + OrientedLattice(UnitCell uc ,Kernel::DblMatrix Umatrix=Kernel::DblMatrix(3,3,true)); // Destructor virtual ~OrientedLattice(); // Access private variables - const DblMatrix& getU() const; - const DblMatrix& getUB() const; - void setU(DblMatrix& newU); - void setUB(DblMatrix& newUB); + const Kernel::DblMatrix& getU() const; + const Kernel::DblMatrix& getUB() const; + void setU(Kernel::DblMatrix& newU); + void setUB(Kernel::DblMatrix& newUB); - DblMatrix setUFromVectors(const V3D &u, const V3D &v); + Kernel::DblMatrix setUFromVectors(const Kernel::V3D &u, const Kernel::V3D &v); private: - DblMatrix U; - DblMatrix UB; + Kernel::DblMatrix U; + Kernel::DblMatrix UB; }; } // namespace Mantid } // namespace Geometry diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/UnitCell.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/UnitCell.h index 4245e47c6b5..bfeedf2da97 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/UnitCell.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/UnitCell.h @@ -3,9 +3,9 @@ #include "MantidGeometry/DllConfig.h" #include "MantidKernel/PhysicalConstants.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/Quat.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/Quat.h" +#include "MantidKernel/V3D.h" #include <cmath> #include <vector> @@ -111,21 +111,21 @@ namespace Geometry void setgamma(double _gamma,const int angleunit=angDegrees); // Access private variables - const Geometry::DblMatrix& getG() const; - const Geometry::DblMatrix& getGstar() const; - const Geometry::DblMatrix& getB() const; - const Geometry::DblMatrix& getBinv() const; + const Kernel::DblMatrix& getG() const; + const Kernel::DblMatrix& getGstar() const; + const Kernel::DblMatrix& getB() const; + const Kernel::DblMatrix& getBinv() const; // Calculate things about lattice and vectors double d(double h, double k, double l) const; double dstar(double h,double k, double l) const; - double d(const V3D & hkl) const; - double dstar(const V3D & hkl) const; - V3D hklFromQ(V3D Q) const; + double d(const Kernel::V3D & hkl) const; + double dstar(const Kernel::V3D & hkl) const; + Kernel::V3D hklFromQ(Kernel::V3D Q) const; 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; - void recalculateFromGstar(Geometry::Matrix<double>& NewGstar); + void recalculateFromGstar(Kernel::Matrix<double>& NewGstar); private: /// Lattice parameter a,b,c,alpha,beta,gamma (in \f$ \mbox{ \AA } \f$ and radians) @@ -138,25 +138,25 @@ namespace Geometry ab\cos(\gamma) & bb & bc\cos(\alpha) \\ ac\cos(\beta) & bc\cos(\alpha) & cc \end{array} \right) \f] */ - DblMatrix G; + Kernel::DblMatrix G; /** Reciprocal lattice tensor *\f[ \left( \begin{array}{ccc} a^*a^* & a^*b^*\cos(\gamma^*) & a^*c^*\cos(\beta^*) \\ a^*b^*\cos(\gamma^*) & b^*b^* & b^*c^*\cos(\alpha^*) \\ a^*c^*\cos(\beta^*) & b^*c^*\cos(\alpha^*) & c^*c^* \end{array} \right) \f] */ - DblMatrix Gstar; + Kernel::DblMatrix Gstar; /** B matrix for a right-handed coordinate system, in Busing-Levy convention \f[ \left( \begin{array}{ccc} a^* & b^*\cos(\gamma^*) & c^*\cos(\beta^*) \\ 0 & b^*\sin(\gamma^*) & -c^*\sin(\beta^*)\cos(\alpha) \\ 0 & 0 & 1/c \end{array} \right) \f] */ - DblMatrix B; + Kernel::DblMatrix B; /** Inverse of the B matrix. */ - DblMatrix Binv; + Kernel::DblMatrix Binv; // Private functions void recalculate(); diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IComponent.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IComponent.h index 349f10d95c0..4cc9faaa3c0 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IComponent.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IComponent.h @@ -4,8 +4,9 @@ //---------------------------------------------------------------------- // Includes //---------------------------------------------------------------------- -#include "MantidGeometry/V3D.h" #include "MantidGeometry/DllConfig.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include <string> #include <vector> #include <set> @@ -18,8 +19,6 @@ namespace Mantid //--------------------------------------------------------- // Forward declarations //--------------------------------------------------------- - class V3D; - class Quat; class IComponent; class BoundingBox; @@ -37,7 +36,7 @@ namespace Mantid structure and are defined with respect to a parent IComponent. The IComponent position and orientation are relatives, i.e. defined with respect to the parent - IComponent. The orientation is stored as a quaternion. + IComponent. The orientation is stored as a Kernel::Quaternion. Each IComponent has a defined bounding box which at the moment is cuboid. @@ -93,27 +92,27 @@ namespace Mantid /** Set the position of the component * The position is with respect to the parent component */ - virtual void setPos(const V3D&) = 0; - //! Set the orientation quaternion relative to parent (if present) otherwise absolute - virtual void setRot(const Quat&) = 0; + virtual void setPos(const Kernel::V3D&) = 0; + //! Set the orientation Kernel::Quaternion relative to parent (if present) otherwise absolute + virtual void setRot(const Kernel::Quat&) = 0; //! Copy the Rotation from another IComponent //virtual void copyRot(const IComponent&) = 0; //! Translate the IComponent (vector form). This is relative to parent if present. - virtual void translate(const V3D&) = 0; + virtual void translate(const Kernel::V3D&) = 0; //! Translate the IComponent (x,y,z form). This is relative to parent if present. virtual void translate(double, double, double) = 0; //! Rotate the IComponent. This is relative to parent. - virtual void rotate(const Quat&) = 0; + virtual void rotate(const Kernel::Quat&) = 0; //! Rotate the IComponent by an angle in degrees with respect to an axis. - virtual void rotate(double,const V3D&) = 0; + virtual void rotate(double,const Kernel::V3D&) = 0; //! Get the position relative to the parent IComponent (absolute if no parent) - virtual const V3D & getRelativePos() const = 0; + virtual const Kernel::V3D & getRelativePos() const = 0; //! Get the position of the IComponent. Tree structure is traverse through the parent chain - virtual V3D getPos() const = 0; + virtual Kernel::V3D getPos() const = 0; //! Get the relative Orientation - virtual const Quat& getRelativeRot() const = 0; + virtual const Kernel::Quat& getRelativeRot() const = 0; //! Get the absolute orientation of the IComponent - virtual const Quat getRotation() const = 0; + virtual const Kernel::Quat getRotation() const = 0; //! Get the distance to another IComponent virtual double getDistance(const IComponent&) const = 0; /// Get the bounding box for this component and store it in the given argument @@ -122,7 +121,7 @@ namespace Mantid /** Gets the scaling factor of the object for the Object Component. * @return a vector with 1 in all 3 directions. */ - virtual V3D getScaleFactor()const{ return V3D(1.0, 1.0, 1.0);} + virtual Kernel::V3D getScaleFactor()const{ return Kernel::V3D(1.0, 1.0, 1.0);} /** @name ParameterMap access */ //@{ @@ -134,10 +133,10 @@ namespace Mantid // one for each type, luckily there won't be too many /// Get a parameter defined as a double virtual std::vector<double> getNumberParameter(const std::string& pname, bool recursive = true) const = 0; - /// Get a parameter defined as a V3D - virtual std::vector<V3D> getPositionParameter(const std::string& pname, bool recursive = true) const = 0; - /// Get a parameter defined as a Quaternion - virtual std::vector<Quat> getRotationParameter(const std::string& pname, bool recursive = true) const = 0; + /// Get a parameter defined as a Kernel::V3D + virtual std::vector<Kernel::V3D> getPositionParameter(const std::string& pname, bool recursive = true) const = 0; + /// Get a parameter defined as a Kernel::Quaternion + virtual std::vector<Kernel::Quat> getRotationParameter(const std::string& pname, bool recursive = true) const = 0; /// Get a parameter defined as a string virtual std::vector<std::string> getStringParameter(const std::string& pname, bool recursive = true) const = 0; //@} diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IDetector.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IDetector.h index d968fe77c43..0472a4a944d 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IDetector.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IDetector.h @@ -15,14 +15,17 @@ namespace Mantid { - -namespace Geometry +namespace Kernel { - //---------------------------------------------------------------------- // Forward declaration //---------------------------------------------------------------------- - class V3D; + class Kernel::V3D; +} + +namespace Geometry +{ + /** Interface class for detector objects. @@ -77,7 +80,7 @@ public: * @param axis :: The axis to which the required angle is relative * @return The angle in radians */ - virtual double getTwoTheta(const V3D& observer, const V3D& axis) const = 0; + virtual double getTwoTheta(const Kernel::V3D& observer, const Kernel::V3D& axis) const = 0; /// Gives the phi of this detector object in radians virtual double getPhi() const = 0; @@ -93,7 +96,7 @@ public: /// Must return a pointer to itself if derived from IComponent virtual IComponent* getComponent(); /// returns the geometry of detectors, meaningful for groups, rectangular for single; returns the centre of a detector - virtual det_topology getTopology(V3D ¢er)const = 0; + virtual det_topology getTopology(Kernel::V3D ¢er)const = 0; /// (Empty) Constructor diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IInstrument.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IInstrument.h index 11979dacc17..cec56cd8931 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IInstrument.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IInstrument.h @@ -71,7 +71,7 @@ public: virtual Geometry::IObjComponent_sptr getSample() const = 0; /// Returns a unit vector pointing in the direction of the beam - Geometry::V3D getBeamDirection() const; + Kernel::V3D getBeamDirection() const; /// Returns a pointer to the geometrical object for the detector with the given ID virtual Geometry::IDetector_sptr getDetector(const detid_t &detector_id) const = 0; @@ -126,8 +126,8 @@ public: /// Retrieves from which side the instrument to be viewed from when the instrument viewer first starts, possiblities are "Z+, Z-, X+, ..." virtual std::string getDefaultAxis() const=0; - virtual void getInstrumentParameters(double & l1, Geometry::V3D & beamline, - double & beamline_norm, Geometry::V3D & samplePos) const = 0; + virtual void getInstrumentParameters(double & l1, Kernel::V3D & beamline, + double & beamline_norm, Kernel::V3D & samplePos) const = 0; /// @return the date from which the instrument definition begins to be valid. Kernel::DateAndTime getValidFromDate() const diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IObjComponent.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IObjComponent.h index ab44eeece53..bba58aade63 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IObjComponent.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IObjComponent.h @@ -70,19 +70,19 @@ public: virtual IComponent* clone() const = 0; /// Does the point given lie within this object component? - virtual bool isValid(const V3D& point) const = 0; + virtual bool isValid(const Kernel::V3D& point) const = 0; /// Does the point given lie on the surface of this object component? - virtual bool isOnSide(const V3D& point) const = 0; + virtual bool isOnSide(const Kernel::V3D& point) const = 0; ///Checks whether the track given will pass through this Component. virtual int interceptSurface(Track& track) const = 0; /// Finds the approximate solid angle covered by the component when viewed from the point given - virtual double solidAngle(const V3D& observer) const = 0; + virtual double solidAngle(const Kernel::V3D& observer) const = 0; ///Try to find a point that lies within (or on) the object - virtual int getPointInObject(V3D& point) const = 0; + virtual int getPointInObject(Kernel::V3D& point) const = 0; //Rendering member functions ///Draws the objcomponent. diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/CompAssembly.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/CompAssembly.h index e665cec2e99..289ce266cf3 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/CompAssembly.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/CompAssembly.h @@ -80,9 +80,9 @@ public: //! Get a pointer to the ith component in the assembly boost::shared_ptr<IComponent> operator[](int i) const; - V3D getPos() const; + Kernel::V3D getPos() const; - const Quat getRotation() const; + const Kernel::Quat getRotation() const; /// Get the bounding box for this component and store it in the given argument diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Component.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Component.h index c3b976a578c..aa9eef00e54 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Component.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Component.h @@ -13,14 +13,18 @@ namespace Mantid { + namespace Kernel + { + class V3D; + class Quat; + } + namespace Geometry { //---------------------------------------------------------------------- // Forward declarations //---------------------------------------------------------------------- - class V3D; - class Quat; template<typename T> class ComponentPool; /** @class Component Component.h Geometry/Component.h @@ -62,9 +66,9 @@ namespace Mantid //! Create a named component with a parent component (optional) explicit Component(const std::string& name, IComponent* parent=0); //! Create a named component with positioning vector, and parent component (optional) - Component(const std::string& name, const V3D& position, IComponent* parent=0); + Component(const std::string& name, const Kernel::V3D& position, IComponent* parent=0); //! Create a named component with positioning vector, orientation and parent component - Component(const std::string& name, const V3D& position, const Quat& rotation, IComponent* parent=0); + Component(const std::string& name, const Kernel::V3D& position, const Kernel::Quat& rotation, IComponent* parent=0); /// destructor ~Component(); @@ -94,35 +98,35 @@ namespace Mantid //! Set the IComponent position, x, y, z respective to parent (if present) otherwise absolute void setPos(double, double, double); - void setPos(const V3D&); + void setPos(const Kernel::V3D&); - //! Set the orientation quaternion relative to parent (if present) otherwise absolute - void setRot(const Quat&); + //! Set the orientation Kernel::Quaternion relative to parent (if present) otherwise absolute + void setRot(const Kernel::Quat&); //! Translate the IComponent (vector form). This is relative to parent if present. - void translate(const V3D&); + void translate(const Kernel::V3D&); //! Translate the IComponent (x,y,z form). This is relative to parent if present. void translate(double, double, double); //! Rotate the IComponent. This is relative to parent. - void rotate(const Quat&); + void rotate(const Kernel::Quat&); //! Rotate the IComponent by an angle in degrees with respect to an axis. - void rotate(double,const V3D&); + void rotate(double,const Kernel::V3D&); //! Get the position relative to the parent IComponent (absolute if no parent) - const V3D & getRelativePos() const; + const Kernel::V3D & getRelativePos() const; //! Get the position of the IComponent. Tree structure is traverse through the parent chain - virtual V3D getPos() const; + virtual Kernel::V3D getPos() const; //! Get the relative Orientation - const Quat& getRelativeRot() const; + const Kernel::Quat& getRelativeRot() const; //! Get the absolute orientation of the IComponent - virtual const Quat getRotation() const; + virtual const Kernel::Quat getRotation() const; //! Get the distance to another IComponent double getDistance(const IComponent&) const; @@ -151,25 +155,25 @@ namespace Mantid } /** - * Get a parameter defined as a V3D + * Get a parameter defined as a Kernel::V3D * @param pname :: The name of the parameter * @param recursive :: If true the search will walk up through the parent components * @returns A list of values */ - std::vector<V3D> getPositionParameter(const std::string& pname, bool recursive = true) const + std::vector<Kernel::V3D> getPositionParameter(const std::string& pname, bool recursive = true) const { - return getParameter<V3D>(pname, recursive); + return getParameter<Kernel::V3D>(pname, recursive); } /** - * Get a parameter defined as a Quaternion + * Get a parameter defined as a Kernel::Quaternion * @param pname :: The name of the parameter * @param recursive :: If true the search will walk up through the parent components * @returns A list of values */ - std::vector<Quat> getRotationParameter(const std::string& pname, bool recursive = true) const + std::vector<Kernel::Quat> getRotationParameter(const std::string& pname, bool recursive = true) const { - return getParameter<Quat>(pname, recursive); + return getParameter<Kernel::Quat>(pname, recursive); } /** @@ -190,7 +194,7 @@ namespace Mantid const IComponent* base()const { return m_base;} /// Returns the ScaleFactor - virtual V3D getScaleFactor() const; + virtual Kernel::V3D getScaleFactor() const; /** Returns the bare pointer to the IComponent parent */ const IComponent* getBareParent() const { return m_parent; } @@ -209,9 +213,9 @@ namespace Mantid //! Name of the component std::string m_name; //! Position w - V3D m_pos; + Kernel::V3D m_pos; //! Orientation - Quat m_rot; + Kernel::Quat m_rot; /** * Get a parameter from the parameter map diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h index 812d4c4091a..3c4193f05b0 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h @@ -60,7 +60,7 @@ public: detid_t getID() const; std::size_t nDets() const { return 1; } ///< A Detector object represents a single physical detector double getDistance(const IComponent& comp) const; - double getTwoTheta(const V3D& observer, const V3D& axis) const; + double getTwoTheta(const Kernel::V3D& observer, const Kernel::V3D& axis) const; double getPhi() const; bool isMasked() const; bool isMonitor() const; @@ -71,7 +71,7 @@ public: void markAsMonitor(const bool flag = true); /** returns the detector's topology, namely, the meaning of the detector's angular measurements. It is different in cartesian and cylindrical (surrounding the beam) coordinate system */ - det_topology getTopology(V3D ¢er)const; + det_topology getTopology(Kernel::V3D ¢er)const; private: /// The detector id diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h index 7693ae231ef..48b482ccf34 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h @@ -58,19 +58,19 @@ namespace Mantid // IDetector methods detid_t getID() const; std::size_t nDets() const; - V3D getPos() const; + Kernel::V3D getPos() const; double getDistance(const IComponent& comp) const; - double getTwoTheta(const V3D& observer, const V3D& axis) const; + double getTwoTheta(const Kernel::V3D& observer, const Kernel::V3D& axis) const; double getPhi() const; - double solidAngle(const V3D& observer) const; + double solidAngle(const Kernel::V3D& observer) const; bool isParametrized() const; bool isMasked() const; bool isMonitor() const; std::map<detid_t, double> getNeighbours(double radius); - bool isValid(const V3D& point) const; - virtual bool isOnSide(const V3D& point) const; + bool isValid(const Kernel::V3D& point) const; + virtual bool isOnSide(const Kernel::V3D& point) const; ///Try to find a point that lies within (or on) the object - int getPointInObject(V3D& point) const; + int getPointInObject(Kernel::V3D& point) const; /// Get the bounding box for this component and store it in the given argument virtual void getBoundingBox(BoundingBox& boundingBox) const; @@ -95,19 +95,19 @@ namespace Mantid */ std::vector<double> getNumberParameter(const std::string& pname, bool recursive = true) const; /** - * Get a parameter defined as a V3D + * Get a parameter defined as a Kernel::V3D * @param pname :: The name of the parameter * @param recursive :: If true the search will walk up through the parent components * @returns A list of size 0 as this is not a parameterized component */ - std::vector<V3D> getPositionParameter(const std::string& pname, bool recursive = true) const; + std::vector<Kernel::V3D> getPositionParameter(const std::string& pname, bool recursive = true) const; /** - * Get a parameter defined as a Quaternion + * Get a parameter defined as a Kernel::Quaternion * @param pname :: The name of the parameter * @param recursive :: If true the search will walk up through the parent components * @returns A list of size 0 as this is not a parameterized component */ - std::vector<Quat> getRotationParameter(const std::string& pname, bool recursive = true) const; + std::vector<Kernel::Quat> getRotationParameter(const std::string& pname, bool recursive = true) const; /** * Get a parameter defined as a string @@ -118,7 +118,7 @@ namespace Mantid std::vector<std::string> getStringParameter(const std::string& pname, bool recursive = true) const; /** returns the detector's group topology if it has been calculated before or invokes the procedure of calculating such topology if it was not */ - det_topology getTopology(V3D ¢er)const; + det_topology getTopology(Kernel::V3D ¢er)const; protected: /// The ID of this effective detector int m_id; @@ -132,7 +132,7 @@ namespace Mantid * the topology is undefined on construction and caclulated on first request */ mutable det_topology group_topology; /// group centre is the geometrical centre of the detectors group calculated when the calculate group topology is invoked - mutable V3D groupCentre; + mutable Kernel::V3D groupCentre; // functions inherited from IComponent Component* clone() const{ return NULL; } @@ -151,17 +151,17 @@ namespace Mantid void setName(const std::string&){} void setPos(double, double, double){} - void setPos(const V3D&){} - void setRot(const Quat&){} + void setPos(const Kernel::V3D&){} + void setRot(const Kernel::Quat&){} void copyRot(const IComponent&){} int interceptSurface(Track&) const{ return -10; } - void translate(const V3D&){} + void translate(const Kernel::V3D&){} void translate(double, double, double){} - void rotate(const Quat&){} - void rotate(double,const V3D&){} - const V3D& getRelativePos() const { throw std::runtime_error("Cannot call getRelativePos on a DetectorGroup"); } - const Quat& getRelativeRot() const{ throw std::runtime_error("Cannot call getRelativeRot on a DetectorGroup"); } - const Quat getRotation() const{ return Quat(); } + void rotate(const Kernel::Quat&){} + void rotate(double,const Kernel::V3D&){} + const Kernel::V3D& getRelativePos() const { throw std::runtime_error("Cannot call getRelativePos on a DetectorGroup"); } + const Kernel::Quat& getRelativeRot() const{ throw std::runtime_error("Cannot call getRelativeRot on a DetectorGroup"); } + const Kernel::Quat getRotation() const{ return Kernel::Quat(); } void printSelf(std::ostream&) const{} // functions inherited from IObjComponent diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h index a5ddb877479..c4abe463ad1 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h @@ -1,8 +1,8 @@ #ifndef MANTID_GEOMETRY_GONIOMETER_H_ #define MANTID_GEOMETRY_GONIOMETER_H_ -#include <MantidGeometry/Math/Matrix.h> -#include <MantidGeometry/V3D.h> +#include <MantidKernel/Matrix.h> +#include <MantidKernel/V3D.h> #include <MantidGeometry/Crystal/UnitCell.h> //for angle units #include <string> @@ -49,12 +49,12 @@ namespace Geometry struct GoniometerAxis { std::string name; /// GoniometerAxis name - V3D rotationaxis; /// GoniometerAxis direction + 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) /// Constructor - GoniometerAxis(std::string initname,V3D initrotationaxis,double initangle,int initsense,int initangleunit):name(initname),rotationaxis(initrotationaxis),angle(initangle),sense(initsense),angleunit(initangleunit){} + GoniometerAxis(std::string initname, Kernel::V3D initrotationaxis,double initangle,int initsense,int initangleunit):name(initname),rotationaxis(initrotationaxis),angle(initangle),sense(initsense),angleunit(initangleunit){} }; class MANTID_GEOMETRY_DLL Goniometer @@ -65,11 +65,11 @@ namespace Geometry // Copy constructor Goniometer(const Goniometer& other); // Constructor from a rotation matrix - Goniometer(DblMatrix rot); + Goniometer(Kernel::DblMatrix rot); // Default destructor virtual ~Goniometer(); // Return rotation matrix - const Geometry::DblMatrix& getR() const; + const Kernel::DblMatrix& getR() const; // Return information about axes std::string axesInfo(); // Add axis to goniometer @@ -92,7 +92,7 @@ namespace Geometry private: /// Global rotation matrix of the goniometer - DblMatrix R; + Kernel::DblMatrix R; /// Motors vector contains #GoniometerAxis objects, the last one is the closest to the sample std::vector<GoniometerAxis> motors; /// Flag to specify if the goniometer is initialized from a rotation matrix diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Instrument.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Instrument.h index f7052d35758..ec7762a9909 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Instrument.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Instrument.h @@ -148,21 +148,21 @@ namespace Mantid boost::shared_ptr<ParameterMap> getParameterMap() const; // ----- Useful static functions ------ - static double calcConversion(const double l1, const Geometry::V3D &beamline, const double beamline_norm, - const Geometry::V3D &samplePos, const Geometry::IDetector_const_sptr &det, const double offset, + static double calcConversion(const double l1, const Kernel::V3D &beamline, const double beamline_norm, + const Kernel::V3D &samplePos, const Geometry::IDetector_const_sptr &det, const double offset, bool vulcancorrection); static double calcConversion(const double l1, - const Geometry::V3D &beamline, + const Kernel::V3D &beamline, const double beamline_norm, - const Geometry::V3D &samplePos, + const Kernel::V3D &samplePos, const Geometry::IInstrument_const_sptr &instrument, const std::vector<detid_t> &detectors, const std::map<detid_t,double> &offsets, bool vulcancorrection); - void getInstrumentParameters(double & l1, Geometry::V3D & beamline, - double & beamline_norm, Geometry::V3D & samplePos) const; + void getInstrumentParameters(double & l1, Kernel::V3D & beamline, + double & beamline_norm, Kernel::V3D & samplePos) const; private: /// Private copy assignment operator diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/NearestNeighbours.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/NearestNeighbours.h index e545fe909c4..abe3e4ddcdb 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/NearestNeighbours.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/NearestNeighbours.h @@ -12,6 +12,13 @@ namespace Mantid { + namespace Kernel + { + //---------------------------------------------------------------------- + // Forward declaration + //---------------------------------------------------------------------- + class V3D; + } namespace Geometry { //------------------------------------------------------------------------------ @@ -19,7 +26,6 @@ namespace Mantid //------------------------------------------------------------------------------ class IInstrument; class IComponent; - class V3D; class ISpectraDetectorMap; /** @@ -111,7 +117,7 @@ namespace Mantid /// property map holding the edge's related Distance value. boost::property_map<Graph, boost::edge_name_t>::type m_edgeLength; /// V3D for scaling - boost::scoped_ptr<V3D> m_scale; + boost::scoped_ptr<Kernel::V3D> m_scale; }; /// Typedef for shared pointer to the NearestNeighbours class diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h index c7256538da5..f3b59b61fa0 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h @@ -81,8 +81,8 @@ public: void printChildren(std::ostream&) const; void printTree(std::ostream&) const; - const Quat getRotation() const; - V3D getPos() const; + const Kernel::Quat getRotation() const; + Kernel::V3D getPos() const; //! Set the outline of the assembly boost::shared_ptr<Object> createOutline(); diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjComponent.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjComponent.h index 22daa100e5e..e84a11c0725 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjComponent.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjComponent.h @@ -71,10 +71,10 @@ public: */ virtual IComponent* clone() const {return new ObjComponent(*this);} - bool isValid(const V3D& point) const; - bool isOnSide(const V3D& point) const; + bool isValid(const Kernel::V3D& point) const; + bool isOnSide(const Kernel::V3D& point) const; int interceptSurface(Track& track) const; - double solidAngle(const V3D& observer) const; + double solidAngle(const Kernel::V3D& observer) const; ///@todo This should go in favour of just the class related one. void boundingBox(double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) const; /// get bounding box, which may or may not be axis aligned; @@ -86,7 +86,7 @@ public: /// get Depth (Z-dimension) value for component virtual double getDepth() const; - int getPointInObject(V3D& point) const; + int getPointInObject(Kernel::V3D& point) const; //Rendering member functions void draw() const; void drawObject() const; @@ -105,8 +105,8 @@ protected: /// The material this object is made of Material_const_sptr m_material; - const V3D factorOutComponentPosition(const V3D& point) const; - const V3D takeOutRotation(V3D point) const; + const Kernel::V3D factorOutComponentPosition(const Kernel::V3D& point) const; + const Kernel::V3D takeOutRotation(Kernel::V3D point) const; private: /// common part of the two Bounding box functions above; void getRelativeBoundingBox(BoundingBox& RelativeBB) const; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Parameter.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Parameter.h index 12645d8097a..dd3b2c308e7 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Parameter.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Parameter.h @@ -15,8 +15,8 @@ namespace { \ // Includes //---------------------------------------------------------------------- #include "MantidGeometry/DllConfig.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include "MantidKernel/DynamicFactory.h" // For RegistrationHelper #include <boost/shared_ptr.hpp> #include <string> @@ -233,9 +233,9 @@ namespace Mantid /// Parameter of type std::string typedef MANTID_GEOMETRY_DLL ParameterType<std::string> ParameterString; /// Parameter of type V3D - typedef MANTID_GEOMETRY_DLL ParameterType<V3D> ParameterV3D; + typedef MANTID_GEOMETRY_DLL ParameterType<Kernel::V3D> ParameterV3D; /// Parameter of type Quat - typedef MANTID_GEOMETRY_DLL ParameterType<Quat> ParameterQuat; + typedef MANTID_GEOMETRY_DLL ParameterType<Kernel::Quat> ParameterQuat; } // namespace Geometry } // namespace Mantid diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ParameterMap.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ParameterMap.h index 957c1b9c608..406bb3d5f61 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ParameterMap.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ParameterMap.h @@ -147,12 +147,12 @@ namespace Geometry void addBool(const IComponent* comp,const std::string& name, bool value); /// Adds a std::string value to the parameter map. void addString(const IComponent* comp,const std::string& name, const std::string& value); - /// Adds a V3D value to the parameter map. + /// Adds a Kernel::V3D value to the parameter map. void addV3D(const IComponent* comp,const std::string& name, const std::string& value); - /// @param value :: Parameter value as a V3D - void addV3D(const IComponent* comp,const std::string& name, const V3D& value); - /// Adds a Quat value to the parameter map. - void addQuat(const IComponent* comp,const std::string& name, const Quat& value); + /// @param value :: Parameter value as a Kernel::V3D + void addV3D(const IComponent* comp,const std::string& name, const Kernel::V3D& value); + /// Adds a Kernel::Quat value to the parameter map. + void addQuat(const IComponent* comp,const std::string& name, const Kernel::Quat& value); //@} /// Does the named parameter exist for the given component for any type. @@ -212,14 +212,14 @@ namespace Geometry return getType<double>(compName,name); } /** - * Returns a V3D parameter as vector's first element if exists and an empty vector if it doesn't + * Returns a Kernel::V3D parameter as vector's first element if exists and an empty vector if it doesn't * @param compName :: Component name * @param name :: Parameter name - * @return a V3D parameter from component with the requested name + * @return a Kernel::V3D parameter from component with the requested name */ - std::vector<V3D> getV3D(const std::string& compName,const std::string& name)const + std::vector<Kernel::V3D> getV3D(const std::string& compName,const std::string& name)const { - return getType<V3D>(compName,name); + return getType<Kernel::V3D>(compName,name); } /// Returns a set with all parameter names for component @@ -230,13 +230,13 @@ namespace Geometry ///Clears the location and roatation caches void clearCache(); ///Sets a cached location on the location cache - void setCachedLocation(const IComponent* comp, const V3D& location) const; + void setCachedLocation(const IComponent* comp, const Kernel::V3D& location) const; ///Attempts to retreive a location from the location cache - bool getCachedLocation(const IComponent* comp, V3D& location) const; + bool getCachedLocation(const IComponent* comp, Kernel::V3D& location) const; ///Sets a cached rotation on the rotation cache - void setCachedRotation(const IComponent* comp, const Quat& rotation) const; + void setCachedRotation(const IComponent* comp, const Kernel::Quat& rotation) const; ///Attempts to retreive a rotation from the rotation cache - bool getCachedRotation(const IComponent* comp, Quat& rotation) const; + bool getCachedRotation(const IComponent* comp, Kernel::Quat& rotation) const; ///Sets a cached bounding box void setCachedBoundingBox(const IComponent *comp, const BoundingBox & box) const; ///Attempts to retrieve a bounding box from the cache @@ -272,9 +272,9 @@ namespace Geometry /// shared pointer to NearestNeighbours object mutable boost::shared_ptr<NearestNeighbours> m_nearestNeighbours; /// internal cache map instance for cached postition values - mutable Kernel::Cache<const ComponentID,V3D > m_cacheLocMap; + mutable Kernel::Cache<const ComponentID, Kernel::V3D > m_cacheLocMap; /// internal cache map instance for cached rotation values - mutable Kernel::Cache<const ComponentID,Quat > m_cacheRotMap; + mutable Kernel::Cache<const ComponentID, Kernel::Quat > m_cacheRotMap; ///internal cache map for cached bounding boxes mutable Kernel::Cache<const ComponentID,BoundingBox> m_boundingBoxMap; /// Static reference to the logger class diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h index efdb2964a8e..45f4d5c300c 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h @@ -91,7 +91,7 @@ public: ///Size in Y of the detector double ysize() const; - V3D getRelativePosAtXY(int x, int y) const; + Kernel::V3D getRelativePosAtXY(int x, int y) const; void getTextureSize(int & xsize, int & ysize) const; unsigned int getTextureID() const; @@ -110,21 +110,21 @@ public: // ------------ IObjComponent methods ---------------- /// Does the point given lie within this object component? - bool isValid(const V3D& point) const ; + bool isValid(const Kernel::V3D& point) const ; /// Does the point given lie on the surface of this object component? - bool isOnSide(const V3D& point) const ; + bool isOnSide(const Kernel::V3D& point) const ; ///Checks whether the track given will pass through this Component. int interceptSurface(Track& track) const ; /// Finds the approximate solid angle covered by the component when viewed from the point given - double solidAngle(const V3D& observer) const; + double solidAngle(const Kernel::V3D& observer) const; /// Retrieve the cached bounding box void getBoundingBox(BoundingBox & assemblyBox) const; ///Try to find a point that lies within (or on) the object - int getPointInObject(V3D& point) const; + int getPointInObject(Kernel::V3D& point) const; //Rendering member functions ///Draws the objcomponent. diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/IMDDimension.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/IMDDimension.h index 5068afc35b1..fd971c1f3dd 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/IMDDimension.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/IMDDimension.h @@ -4,14 +4,9 @@ #include <vector> #include <stdexcept> #include "MantidGeometry/DllConfig.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <boost/shared_ptr.hpp> - - - - - namespace Mantid { namespace Geometry @@ -107,13 +102,13 @@ namespace Mantid * Orthogonal dimensions always have direction 1, but we set direction of this to 0 (e.g. direction={0,0,0})? questionable, 1 may be better; * while reciprocal dimension can be directed anywhere withing the reciprocal space; Norm of the vector, returned by this function has to be 1 */ - virtual V3D getDirection(void)const + virtual Kernel::V3D getDirection(void)const { throw std::runtime_error("Not Implemented."); } - /** @return direction in the crystallogrpahical sence, e.g. output V3D is normalized in such a way that the size of + /** @return direction in the crystallogrpahical sence, e.g. output Kernel::V3D is normalized in such a way that the size of smallest (by module) non-0 component of the vector is 1; In this case, all vectors representing valid crystallographical axis would have integer values; */ - virtual V3D getDirectionCryst(void)const + virtual Kernel::V3D getDirectionCryst(void)const { throw std::runtime_error("Not Implemented."); } /** @return the function returns the center points of the axis bins; There are nBins of such points diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDBasisDimension.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDBasisDimension.h index 77dcf67253a..2ab39c354a0 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDBasisDimension.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDBasisDimension.h @@ -46,7 +46,7 @@ #include "MantidGeometry/DllConfig.h" #include "MantidKernel/Unit.h" #include "MantidKernel/UnitFactory.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <boost/shared_ptr.hpp> @@ -70,7 +70,7 @@ namespace Mantid * @param UnitID -- the units for this direction. A reciprocal dimension always have a "MomentumTransfer" unit, which overrides the value, specified in * the constructor. An orthogonal dimention can have any unit, known by the unit factory. The default is enerty transfer. */ - explicit MDBasisDimension(std::string id, bool isReciprocal, int columnNumber,const std::string &UnitID="",const V3D &inDirection=V3D()); + explicit MDBasisDimension(std::string id, bool isReciprocal, int columnNumber,const std::string &UnitID="",const Kernel::V3D &inDirection=Kernel::V3D()); bool operator==(const MDBasisDimension &other) const; bool operator!=(const MDBasisDimension &other) const; @@ -79,7 +79,7 @@ namespace Mantid std::string getId() const; bool getIsReciprocal() const; int getColumnNumber() const; - V3D getDirection()const{return direction;} + Kernel::V3D getDirection()const{return direction;} Kernel::Unit & getUnits()const{return *spUnit;} private: std::string m_id; //Equivalent to tag in older definitions. @@ -90,8 +90,8 @@ namespace Mantid boost::shared_ptr<Kernel::Unit> spUnit; /** the direction of the lattice vector. The length of this vector is equal to lattice * parameter for a reciprocal axis in this direction expressed in units above or 0 if this is an orthogonal direction like T or DE - (as orthogonal directions are ortogonal to the 3D space, represented by V3D )*/ - V3D direction; + (as orthogonal directions are ortogonal to the 3D space, represented by Kernel::V3D )*/ + Kernel::V3D direction; }; } diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDDimension.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDDimension.h index 25844c21b12..c7e7bf32a9a 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDDimension.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDDimension.h @@ -91,11 +91,11 @@ namespace Geometry /** virtual: function returns a direction of the dimension in the system of coordinates described by the MDBasis; * Orthogonal dimensions always have direction 1 (e.g. V3D={1,0,0})according to their direction in the coordinate * system. Norm of the vector, returned by this function has to be 1 */ - V3D getDirection(void)const{return direction;} + Kernel::V3D getDirection(void)const{return direction;} /** virtual: Return direction in the crystallogrpahical sence, e.g. output V3D is normalized in such a way that the size of smallest (by module) non-0 component of the vector is 1; In this case, all vectors representing valid crystallographical axis would have integer values; */ - V3D getDirectionCryst(void)const{return direction;} + Kernel::V3D getDirectionCryst(void)const{return direction;} /// get Axis data; std::vector<double> const & getAxis(void)const{return Axis;} @@ -134,7 +134,7 @@ virtual void setRange(double rMin=-1,double rMax=1,size_t nBins=1); // set all non-inter-dimension-dependent values on the dimesion from the dimension description virtual void initialize(const DimensionDescription &descr); //, const std::vector<double> &rotation_mat=std::vector<double>Rot(9) ); // function sets the coordinates of the dimension; An orthogonal dimension does nothing with it; Part of initialisation routine if rotations are present - virtual void setDirection(const V3D &){}; + virtual void setDirection(const Kernel::V3D &){}; //******** SET. -> geometry should set it properly as any set operation here is also rebinning operation on MDImage; /** Set the scale of a particular dimension @@ -164,7 +164,7 @@ virtual void setRange(double rMin=-1,double rMax=1,size_t nBins=1); void ApplySerialization(Poco::XML::Document* pDoc, Poco::XML::Element* pDimensionElement) const; // direction of a vector in the basis system of coordinates; /// the coordinate of a dimension in an WorkspaceGeometry system of coordinates (always 0 here and |1| triplet for reciprocals) - V3D direction; + Kernel::V3D direction; private: /// name of the axis; std::string AxisName; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDDimensionRes.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDDimensionRes.h index 44f2f63fe3e..527bdcbe777 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDDimensionRes.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDDimensionRes.h @@ -57,13 +57,13 @@ public: ///virtual Implementation of toXMLString providing additional fields over parent MDDimension relating to reciprocal nature. std::string toXMLString() const; /// virtual - V3D getDirectionCryst(void)const; + Kernel::V3D getDirectionCryst(void)const; /**Main constructor for a reciprocal dimension Initial direction should be set as in MDGeometryBasis, correspondent direction */ - MDDimensionRes(const std::string &ID,const rec_dim nDim, const V3D *pDir=NULL); + MDDimensionRes(const std::string &ID,const rec_dim nDim, const Kernel::V3D *pDir=NULL); MDDimensionRes(const MDBasisDimension &Dim); protected: // function sets the coordinates of the dimension; - virtual void setDirection(const V3D &theDirection); + virtual void setDirection(const Kernel::V3D &theDirection); private: /// helper method for converting between qtypes as enums to strings. std::string getQTypeAsString() const; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometry.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometry.h index 59d63fbeeee..769840111c0 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometry.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometry.h @@ -87,7 +87,7 @@ namespace Mantid{ size_t getGeometryExtend()const{return nGeometrySize;} /** function returns the rotations matrix, used to transform reciprocal MDDimensions of the MDImage from MDGeometryBasis to whaterver position it currently occupies */ - DblMatrix getRotations()const; + Kernel::DblMatrix getRotations()const; /// return the numbers of dimensions in current geometry; size_t getNumDims()const{return m_basis.getNumDims();} diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryBasis.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryBasis.h index 8ec000e412b..2ce87c61f52 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryBasis.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryBasis.h @@ -87,7 +87,7 @@ namespace Mantid TODO: what to return in 1D mode (powder) (rather how to interpret this mode) */ - std::vector<V3D> get_constRecBasis(void)const; + std::vector<Kernel::V3D> get_constRecBasis(void)const; /// Returns reference to the unit cell, which used in basis; Will throw through dereference of sp if unit cell is not defined; OrientedLattice const & get_constOrientedLattice()const{return *spSample;} diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryDescription.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryDescription.h index cc369edc80b..7b67cf53627 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryDescription.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryDescription.h @@ -3,8 +3,8 @@ #include <deque> #include "MantidGeometry/MDGeometry/MDGeometry.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include <boost/shared_ptr.hpp> /** class describes slicing and rebinning matrix and the geometry of the MD workspace. @@ -96,9 +96,9 @@ public: * into MDImage system of coordinates As there are no info about MDDPoints system of coodinates in this class, the matrix has to be calculated externaly (except when building from geomerty, which provides example of retrieving this matrix */ - void setRotationMatrix(const DblMatrix &rotMatrix){this->Rotations = rotMatrix;} + void setRotationMatrix(const Kernel::DblMatrix &rotMatrix){this->Rotations = rotMatrix;} /// return the rotations, which transform old coordinate system into the new one, set by the projection axis; - DblMatrix const & getRotations()const; + Kernel::DblMatrix const & getRotations()const; /// obtain number of dimensions in the geometry size_t getNumDims(void)const{return nDimensions;} @@ -118,7 +118,7 @@ public: return true; } // Looks like unnesessary here -> we are not setting this for each dimension description any more; - // Geometry::V3D getDirection(size_t i)const; + // Kernel::V3D getDirection(size_t i)const; bool isAxisNamePresent(size_t i)const; @@ -171,7 +171,7 @@ private: size_t nReciprocalDimensions; /** the matrix which would allow to thransform a vector, expressed in MDGeomBasis (MDDPoints) system of coordinates into MDImage system of coordinates. */ - DblMatrix Rotations; + Kernel::DblMatrix Rotations; /** auxiliary function which check if the index requested is allowed. ErrinFuncName allows to add to the error message the name of the calling function*/ diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Acomp.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Acomp.h index 3eab5183b85..db9204feac4 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Acomp.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Acomp.h @@ -13,15 +13,12 @@ namespace Mantid namespace Kernel { class Logger; + template<typename T> class Matrix; } namespace Geometry { - - template<typename T> class Matrix; - - /** \class Acomp \brief Holds a state point in the decision tree. @@ -140,7 +137,7 @@ namespace Mantid std::string displayDepth(int const =0) const; ///< Really pretty print statment of tree void printImplicates(const std::vector<BnId>&, - const Geometry::Matrix<int>&) const; + const Kernel::Matrix<int>&) const; }; std::ostream& operator<<(std::ostream&,const Acomp&); diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Algebra.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Algebra.h index 6fb18b0a596..3750c46761b 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Algebra.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Algebra.h @@ -3,7 +3,7 @@ #include "MantidGeometry/DllConfig.h" #include "MantidKernel/Logger.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidGeometry/Math/BnId.h" #include "MantidGeometry/Math/Acomp.h" diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/mathSupport.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/mathSupport.h index 09f08b7dfd4..b59d877df4c 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/mathSupport.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/mathSupport.h @@ -10,11 +10,6 @@ namespace Mantid { - - /// Create an index of the vector in sorted order. - template<typename T> - MANTID_GEOMETRY_DLL void indexSort(const std::vector<T>&,std::vector<int>&); - /// Solve a Quadratic equation template<typename InputIter> MANTID_GEOMETRY_DLL int solveQuadratic(InputIter, @@ -28,46 +23,6 @@ namespace Mantid namespace mathSupport { - /** - \class PIndex - \author S. Ansell - \date Aug 2005 - \version 1.0 - \brief Class to fill an index with a progressive count - */ - template<typename T> - class PIndex - { - private: - - int count; ///< counter - - public: - - /// Constructor - PIndex() : count(0) { } - - /// functional - std::pair<T,int> operator()(const T& A) { return std::pair<T,int>(A,count++); } - - }; - - /** - \class PSep - \author S. Ansell - \date Aug 2005 - \version 1.0 - \brief Class to access the second object in index pair. - */ - template<typename T> - class PSep - { - public: - - /// Functional to the second object - int operator()(const std::pair<T,int>& A) { return A.second; } - - }; } } diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/BoundingBox.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/BoundingBox.h index 3e14f22b076..8b4b9bb915e 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/BoundingBox.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/BoundingBox.h @@ -1,9 +1,10 @@ #ifndef MANTIDGEOMETRY_BOUNDINGBOX_H_ #define MANTIDGEOMETRY_BOUNDINGBOX_H_ +#include "MantidGeometry/DllConfig.h" #include "MantidKernel/Exception.h" -#include "MantidGeometry/Tolerance.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Tolerance.h" +#include "MantidKernel/V3D.h" #include <boost/shared_ptr.hpp> #include <sstream> @@ -90,13 +91,13 @@ namespace Mantid /// Return the maximum value of Z inline const double & zMax() const { return m_maxPoint.Z(); } /// Returns the min point of the box - inline const V3D & minPoint() const { return m_minPoint; } + inline const Kernel::V3D & minPoint() const { return m_minPoint; } /// Returns the min point of the box - inline const V3D & maxPoint() const { return m_maxPoint; } + inline const Kernel::V3D & maxPoint() const { return m_maxPoint; } /// Returns the centre of the bounding box - inline V3D centrePoint() const { return V3D(0.5*(xMax() + xMin()), 0.5*(yMax() + yMin()), 0.5*(zMax() + zMin())); } + inline Kernel::V3D centrePoint() const { return Kernel::V3D(0.5*(xMax() + xMin()), 0.5*(yMax() + yMin()), 0.5*(zMax() + zMin())); } /// Returns the width of the box - inline V3D width() const { return V3D(m_maxPoint-m_minPoint); } + inline Kernel::V3D width() const { return Kernel::V3D(m_maxPoint-m_minPoint); } //@} /** @name Querying */ @@ -106,23 +107,23 @@ namespace Mantid /// Is the box considered valid. Convenience for !isNull() inline bool isNonNull() const { return !m_null; } /// Is the given point within the bounding box? - bool isPointInside(const V3D & point) const; + bool isPointInside(const Kernel::V3D & point) const; /// Does a specified track intersect the bounding box bool doesLineIntersect(const Track & track) const; /// Does a line intersect the bounding box - bool doesLineIntersect(const V3D & startPoint, const V3D & lineDir) const; + bool doesLineIntersect(const Kernel::V3D & startPoint, const Kernel::V3D & lineDir) const; /// Calculate the angular half width from the given point - double angularWidth(const V3D & observer) const; + double angularWidth(const Kernel::V3D & observer) const; /// Check if it is normal axis aligned bounding box or not. inline bool isAxisAligned()const{return is_axis_aligned;} /// returns the coordinate system to which BB is alighned to; - std::vector<V3D> const & getCoordSystem()const{return coord_system;} + std::vector<Kernel::V3D> const & getCoordSystem()const{return coord_system;} //@} /** returns the expanded box consisting of all 8 box points, * shifted into the coordinate system with the observer centre; */ - void getFullBox(std::vector<V3D> &box,const V3D &observer)const; + void getFullBox(std::vector<Kernel::V3D> &box,const Kernel::V3D &observer)const; /** @name Box mutation functions*/ //@{ /// Return the minimum value of X (non-const) @@ -140,18 +141,18 @@ namespace Mantid /// Grow the bounding box so that it also encompasses the given box void grow(const BoundingBox & other); /// change the BB alighnment - void setBoxAlignment(const V3D &R0,const std::vector<V3D> &orts); + void setBoxAlignment(const Kernel::V3D &R0,const std::vector<Kernel::V3D> &orts); /// set BB in to undefined state with min=FLT_MAX>max=-FLT_MAX void nullify(); /// reallign the BB according to new coordinate system, provided earlier or specified as parameter; - void realign(std::vector<V3D> const* const pCS=NULL); + void realign(std::vector<Kernel::V3D> const* const pCS=NULL); //@} private: /// The minimum point of the axis-aligned box - V3D m_minPoint; + Kernel::V3D m_minPoint; /// The maximum point of the axis-aligned box - V3D m_maxPoint; + Kernel::V3D m_maxPoint; /// Flag marking if we've been initialized using the default constructor, /// with values or default values and user-set points bool m_null; @@ -160,7 +161,7 @@ namespace Mantid /** if the bounding box is not axis aligned, the vector below describes the coordinate system, to which the bounding box is alighned to. The vector has 4 members, with first describing new coordinate system center and three others -- orts of this system */ - std::vector<V3D> coord_system; + std::vector<Kernel::V3D> coord_system; }; /// A shared pointer to a BoundingBox diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/InstrumentRayTracer.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/InstrumentRayTracer.h index 7f04395b3fe..1502d8e6480 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/InstrumentRayTracer.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/InstrumentRayTracer.h @@ -11,6 +11,10 @@ namespace Mantid { + namespace Kernel + { + class Kernel::V3D; + } namespace Geometry { //------------------------------------------------------------- @@ -18,8 +22,6 @@ namespace Mantid //------------------------------------------------------------- struct Link; class Track; - class V3D; - /// Typedef for object intersections typedef Track::LType Links; @@ -58,8 +60,8 @@ namespace Mantid InstrumentRayTracer(IInstrument_sptr instrument); /// Trace a given track from the instrument source in the given direction /// and compile a list of results that this track intersects. - void trace(const V3D & direction) const; - void traceFromSample(const V3D & direction) const; + void trace(const Kernel::V3D & direction) const; + void traceFromSample(const Kernel::V3D & direction) const; /// Get the results of the intersection tests that have been updated /// since the previous call to trace Links getResults() const; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Object.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Object.h index 1ddedcd41ca..4b555e8c888 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Object.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Object.h @@ -5,8 +5,8 @@ // Includes //---------------------------------------------------------------------- #include "MantidGeometry/DllConfig.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include "BoundingBox.h" #include <map> #include <string> @@ -99,10 +99,10 @@ namespace Mantid virtual void print() const; void printTree() const; - bool isValid(const Geometry::V3D&) const; ///< Check if a point is valid + bool isValid(const Kernel::V3D&) const; ///< Check if a point is valid bool isValid(const std::map<int,int>&) const; ///< Check if a set of surfaces are valid. - bool isOnSide(const Geometry::V3D&) const; - int calcValidType(const Geometry::V3D& Pt,const Geometry::V3D& uVec) const; + bool isOnSide(const Kernel::V3D&) const; + int calcValidType(const Kernel::V3D& Pt,const Kernel::V3D& uVec) const; std::vector<int> getSurfaceIndex() const; /// Get the list of surfaces (const version) @@ -120,15 +120,15 @@ namespace Mantid int interceptSurface(Geometry::Track&) const; // Solid angle - uses triangleSolidAngle unless many (>30000) triangles - double solidAngle(const Geometry::V3D& observer) const; + double solidAngle(const Kernel::V3D& observer) const; // Solid angle with a scaling of the object - double solidAngle(const Geometry::V3D& observer, const Geometry::V3D& scaleFactor) const; + double solidAngle(const Kernel::V3D& observer, const Kernel::V3D& scaleFactor) const; // solid angle via triangulation - double triangleSolidAngle(const Geometry::V3D& observer) const; + double triangleSolidAngle(const Kernel::V3D& observer) const; // Solid angle via triangulation with scaling factor for object size - double triangleSolidAngle(const V3D& observer, const V3D& scaleFactor) const; + double triangleSolidAngle(const Kernel::V3D& observer, const Kernel::V3D& scaleFactor) const; // solid angle via ray tracing - double rayTraceSolidAngle(const Geometry::V3D& observer) const; + double rayTraceSolidAngle(const Kernel::V3D& observer) const; /// Calculate (or return cached value of) Axis Aligned Bounding box (DEPRECATED) void getBoundingBox(double& xmax,double& ymax,double& zmax,double& xmin,double& ymin,double& zmin) const; @@ -140,7 +140,7 @@ namespace Mantid /// Set a null bounding box for this object void setNullBoundingBox(); // find internal point to object - int getPointInObject(Geometry::V3D& point) const; + int getPointInObject(Kernel::V3D& point) const; //Rendering member functions void draw() const; @@ -155,7 +155,7 @@ namespace Mantid void setVtkGeometryCacheWriter(boost::shared_ptr<vtkGeometryCacheWriter>); ///set vtkGeometryCache reader void setVtkGeometryCacheReader(boost::shared_ptr<vtkGeometryCacheReader>); - void GetObjectGeom(int& type, std::vector<Geometry::V3D>& vectors, double& myradius, double & myheight) const; + void GetObjectGeom(int& type, std::vector<Kernel::V3D>& vectors, double& myradius, double & myheight) const; private: static Kernel::Logger& PLog; ///< The official logger int ObjName; ///< Creation number @@ -163,7 +163,7 @@ namespace Mantid int procPair(std::string& Ln,std::map<int,Rule*>& Rlist,int& compUnit) const; CompGrp* procComp(Rule*) const; - int checkSurfaceValid(const Geometry::V3D&,const Geometry::V3D&) const; + int checkSurfaceValid(const Kernel::V3D&,const Kernel::V3D&) const; BoundingBox m_boundingBox; ///< Object's bounding box // -- DEPRECATED -- @@ -176,15 +176,15 @@ namespace Mantid mutable bool boolBounded; ///< flag true if a bounding box exists, either by getBoundingBox or defineBoundingBox // -- -- - int searchForObject(Geometry::V3D&) const; - double getTriangleSolidAngle(const V3D& a, const V3D& b, const V3D& c, const V3D& observer) const; - double CuboidSolidAngle(const V3D observer, const std::vector<Geometry::V3D> vectors) const; - double SphereSolidAngle(const V3D observer, const std::vector<Geometry::V3D> vectors, const double radius) const; - double CylinderSolidAngle(const V3D & observer, const Mantid::Geometry::V3D & centre, - const Mantid::Geometry::V3D & axis, + int searchForObject(Kernel::V3D&) const; + double getTriangleSolidAngle(const Kernel::V3D& a, const Kernel::V3D& b, const Kernel::V3D& c, const Kernel::V3D& observer) const; + double CuboidSolidAngle(const Kernel::V3D observer, const std::vector<Kernel::V3D> vectors) const; + double SphereSolidAngle(const Kernel::V3D observer, const std::vector<Kernel::V3D> vectors, const double radius) const; + double CylinderSolidAngle(const Kernel::V3D & observer, const Mantid::Kernel::V3D & centre, + const Mantid::Kernel::V3D & axis, const double radius, const double height) const; - double ConeSolidAngle(const V3D & observer, const Mantid::Geometry::V3D & centre, - const Mantid::Geometry::V3D & axis, + double ConeSolidAngle(const Kernel::V3D & observer, const Mantid::Kernel::V3D & centre, + const Mantid::Kernel::V3D & axis, const double radius, const double height) const; /// Geometry Handle for rendering diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h index 467efa3fce3..6dfaa7553ef 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h @@ -86,7 +86,7 @@ namespace Mantid /// Abstract: The point is within the object - virtual bool isValid(const Geometry::V3D&) const = 0; + virtual bool isValid(const Kernel::V3D&) const = 0; /// Abstract Validity based on surface true/false map virtual bool isValid(const std::map<int,int>&) const = 0; /// Abstract: Can the rule be simplified @@ -148,7 +148,7 @@ namespace Mantid std::string display() const; std::string displayAddress() const; - bool isValid(const Geometry::V3D&) const; + bool isValid(const Kernel::V3D&) const; bool isValid(const std::map<int,int>&) const; int simplify(); ///< apply general intersection simplification void getBoundingBox(double &xmax,double &ymax,double &zmax,double &xmin,double &ymin,double &zmin); ///bounding box @@ -198,7 +198,7 @@ namespace Mantid int type() const { return -1; } ///< effective name - bool isValid(const Geometry::V3D&) const; + bool isValid(const Kernel::V3D&) const; bool isValid(const std::map<int,int>&) const; std::string display() const; std::string displayAddress() const; @@ -247,7 +247,7 @@ namespace Mantid void setKeyN(const int Ky); ///< set keyNumber void setKey(Surface*); - bool isValid(const Geometry::V3D&) const; + bool isValid(const Kernel::V3D&) const; bool isValid(const std::map<int,int>&) const; int getSign() const { return sign; } ///< Get Sign int getKeyN() const { return keyN; } ///< Get Key @@ -299,7 +299,7 @@ namespace Mantid void setObjN(const int Ky); ///< set object Number void setObj(Object*); ///< Set a Object state - bool isValid(const Geometry::V3D&) const; + bool isValid(const Kernel::V3D&) const; bool isValid(const std::map<int,int>&) const; /// Get object number of component int getObjN() const { return objN; } @@ -351,7 +351,7 @@ namespace Mantid int type() const { return 0; } ///< Is it a branched object int isComplementary() const { return 1; } ///< Always returns true (1) - bool isValid(const Geometry::V3D&) const; + bool isValid(const Kernel::V3D&) const; bool isValid(const std::map<int,int>&) const; int simplify(); @@ -398,7 +398,7 @@ namespace Mantid ///< write val into status, if in valid range void setStatus(int val){ if(val==0||val==1||val==-1)status=val;} - bool isValid(const Geometry::V3D&) const; + bool isValid(const Kernel::V3D&) const; bool isValid(const std::map<int,int>&) const; ///< isValue :: Based on a surface status map int simplify(); diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h index d9f5e0c2e61..55f69b20220 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h @@ -5,7 +5,7 @@ // Includes //---------------------------------------------------------------------- #include "MantidGeometry/DllConfig.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <boost/shared_ptr.hpp> #include <map> @@ -88,7 +88,7 @@ namespace Mantid Poco::XML::Element* getShapeElement(Poco::XML::Element* pElem, const std::string& name); double getDoubleAttribute(Poco::XML::Element* pElem, const std::string& name); - V3D parsePosition(Poco::XML::Element* pElem); + Kernel::V3D parsePosition(Poco::XML::Element* pElem); void createGeometryHandler(Poco::XML::Element*,boost::shared_ptr<Object>); /// static reference to the logger class diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Track.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Track.h index b488cc5faf3..ca482c40108 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Track.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Objects/Track.h @@ -5,9 +5,8 @@ // Includes //---------------------------------------------------------------------- #include "MantidGeometry/DllConfig.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Tolerance.h" #include "MantidGeometry/IComponent.h" +#include "MantidKernel/Tolerance.h" #include <list> namespace Mantid @@ -61,12 +60,12 @@ namespace Mantid /** * Constuctor - * @param entry :: V3D point to start - * @param exit :: V3D point to end track + * @param entry :: Kernel::V3D point to start + * @param exit :: Kernel::V3D point to end track * @param totalDistance :: Total distance from start of track * @param compID :: An optional component identifier for the physical object hit. (Default=NULL) */ - inline Link(const V3D& entry,const V3D& exit, const double totalDistance, const ComponentID compID = NULL) : + inline Link(const Kernel::V3D& entry,const Kernel::V3D& exit, const double totalDistance, const ComponentID compID = NULL) : entryPoint(entry),exitPoint(exit),distFromStart(totalDistance), distInsideObject(entryPoint.distance(exitPoint)), componentID(compID) {} @@ -77,8 +76,8 @@ namespace Mantid /** @name Attributes. */ //@{ - V3D entryPoint; ///< Entry point - V3D exitPoint; ///< Exit point + Kernel::V3D entryPoint; ///< Entry point + Kernel::V3D exitPoint; ///< Exit point double distFromStart; ///< Total distance from track beginning double distInsideObject; ///< Total distance covered inside object ComponentID componentID; ///< ComponentID of the intersected component @@ -104,7 +103,7 @@ namespace Mantid * @param distFromStartOfTrack :: Total distance from start of track * @param compID :: An optional unique ID marking the component intersected. (Default=NULL) */ - inline IntersectionPoint(const int flag, const Geometry::V3D& end, + inline IntersectionPoint(const int flag, const Kernel::V3D& end, const double distFromStartOfTrack, const ComponentID compID = NULL) : directionFlag(flag),endPoint(end),distFromStart(distFromStartOfTrack), componentID(compID) {} @@ -120,13 +119,13 @@ namespace Mantid inline bool operator<(const IntersectionPoint& other) const { const double diff = fabs(distFromStart - other.distFromStart); - return (diff > Tolerance) ? distFromStart < other.distFromStart : directionFlag < other.directionFlag; + return (diff > Kernel::Tolerance) ? distFromStart < other.distFromStart : directionFlag < other.directionFlag; } /** @name Attributes. */ //@{ int directionFlag; ///< Directional flag - V3D endPoint; ///< Point + Kernel::V3D endPoint; ///< Point double distFromStart; ///< Total distance from track begin ComponentID componentID; ///< Unique component ID //@} @@ -148,7 +147,7 @@ namespace Mantid /// Default constructor Track(); /// Constructor - Track(const V3D& startPt, const V3D& unitVector); + Track(const Kernel::V3D& startPt, const Kernel::V3D& unitVector); /// Copy constructor Track(const Track&); /// Assignment operator @@ -156,9 +155,9 @@ namespace Mantid /// Destructor ~Track(); /// Adds a point of intersection to the track - void addPoint(const int directionFlag, const V3D& endPoint, const ComponentID compID = NULL); + void addPoint(const int directionFlag, const Kernel::V3D& endPoint, const ComponentID compID = NULL); /// Adds a link to the track - int addLink(const V3D& firstPoint,const V3D& secondPoint, + int addLink(const Kernel::V3D& firstPoint,const Kernel::V3D& secondPoint, const double distanceAlongTrack, const ComponentID compID = NULL); /// Remove touching Links that have identical components void removeCojoins(); @@ -166,13 +165,13 @@ namespace Mantid void buildLink(); /// Set a starting point and direction - void reset(const Geometry::V3D& startPoint,const Geometry::V3D& direction); + void reset(const Kernel::V3D& startPoint,const Kernel::V3D& direction); /// Clear the current set of intersection results void clearIntersectionResults(); /// Returns the starting point - const V3D& startPoint() const { return m_startPoint; } + const Kernel::V3D& startPoint() const { return m_startPoint; } /// Returns the direction as a unit vector - const V3D& direction() const { return m_unitVector; } + const Kernel::V3D& direction() const { return m_unitVector; } /// Returns an interator to the start of the set of links LType::const_iterator begin() const { return m_links.begin(); } /// Returns an interator to one-past-the-end of the set of links @@ -183,8 +182,8 @@ namespace Mantid int nonComplete() const; private: - V3D m_startPoint; ///< Start Point - V3D m_unitVector; ///< unit vector to direction + Kernel::V3D m_startPoint; ///< Start Point + Kernel::V3D m_unitVector; ///< unit vector to direction LType m_links; ///< Track units PType m_surfPoints; ///< Intersection points }; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/BitmapGeometryHandler.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/BitmapGeometryHandler.h index 28c0da69c11..f48bab62b0d 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/BitmapGeometryHandler.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/BitmapGeometryHandler.h @@ -90,7 +90,7 @@ namespace Mantid (void) noPts; (void) noFaces; (void) pts; (void) faces; //Avoid compiler warning }; /// return the actual type and points of one of the "standard" objects, cuboid/cone/cyl/sphere - virtual void GetObjectGeom(int& mytype, std::vector<Geometry::V3D>& vectors, double& myradius, double & myheight) + virtual void GetObjectGeom(int& mytype, std::vector<Kernel::V3D>& vectors, double& myradius, double & myheight) { (void) mytype; (void) vectors; (void) myradius; (void) myheight; //Avoid compiler warning }; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryHandler.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryHandler.h index cf529efe273..241df3d838c 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryHandler.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryHandler.h @@ -7,6 +7,10 @@ namespace Mantid { + namespace Kernel + { + class V3D; + } namespace Geometry { @@ -15,7 +19,7 @@ namespace Mantid class CacheGeometryGenerator; class IObjComponent; class Object; - class V3D; + /** \class CacheGeometryHandler \brief Place holder for geometry triangulation and rendering with caching triangles. diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryRenderer.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryRenderer.h index e863c564722..fdda3d18679 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryRenderer.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryRenderer.h @@ -5,11 +5,13 @@ #include "MantidKernel/Logger.h" namespace Mantid { - + namespace Kernel + { + class V3D; + } namespace Geometry { class IObjComponent; - class V3D; /** \class CacheGeometryRenderer \brief rendering geometry using opengl from the geometry cache. diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h index 96676a99162..ee02b3fa696 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h @@ -3,7 +3,7 @@ #include "MantidGeometry/DllConfig.h" #include "MantidKernel/Logger.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <boost/shared_ptr.hpp> #include <vector> @@ -80,7 +80,7 @@ namespace Mantid UNUSED_ARG(noPts); UNUSED_ARG(noFaces); UNUSED_ARG(pts); UNUSED_ARG(faces); }; /// return the actual type and points of one of the "standard" objects, cuboid/cone/cyl/sphere - virtual void GetObjectGeom(int& mytype, std::vector<Geometry::V3D>& vectors, double& myradius, double & myheight) + virtual void GetObjectGeom(int& mytype, std::vector<Kernel::V3D>& vectors, double& myradius, double & myheight) { UNUSED_ARG(vectors); UNUSED_ARG(myradius); UNUSED_ARG(myheight); // Flag that this is unknown at this point diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryHandler.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryHandler.h index 06ff4d08b2a..3aa25db67af 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryHandler.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryHandler.h @@ -7,14 +7,16 @@ namespace Mantid { - + namespace Kernel + { + class V3D; + } namespace Geometry { class GeometryHandler; class GluGeometryRenderer; class IObjComponent; class Object; - class V3D; /** \class GluGeometryHandler \brief Place holder for geometry triangulation and rendering with special cases of cube, sphere, cone and cylinder. @@ -59,14 +61,14 @@ namespace Mantid static Kernel::Logger& PLog; ///< The official logger GluGeometryRenderer* Renderer; ///< Geometry renderer variable used for rendering Object/ObjComponent - V3D center; ///<Center for sphere,cone and cylinder - V3D Point1; ///<cube coordinates - V3D Point2; ///<cube coordinates - V3D Point3; ///<cube coordinates - V3D Point4; ///<cube coordinates + Kernel::V3D center; ///<Center for sphere,cone and cylinder + Kernel::V3D Point1; ///<cube coordinates + Kernel::V3D Point2; ///<cube coordinates + Kernel::V3D Point3; ///<cube coordinates + Kernel::V3D Point4; ///<cube coordinates double radius; ///<Radius for the sphere, cone and cylinder double height; ///<height for cone and cylinder; - V3D axis; ///< Axis + Kernel::V3D axis; ///< Axis GEOMETRY_TYPE type; ///< the type of the geometry eg CUBOID,CYLINDER,CONE,SPHERE public: GluGeometryHandler(IObjComponent* obj); ///< Constructor @@ -76,19 +78,19 @@ namespace Mantid GeometryHandler* createInstance(IObjComponent *comp); GeometryHandler* createInstance(boost::shared_ptr<Object> obj); ///sets the geometry handler for a cuboid - void setCuboid(V3D,V3D,V3D,V3D); + void setCuboid(Kernel::V3D,Kernel::V3D,Kernel::V3D,Kernel::V3D); ///sets the geometry handler for a cone - void setSphere(V3D,double); + void setSphere(Kernel::V3D,double); ///sets the geometry handler for a cylinder - void setCylinder(V3D,V3D,double,double); + void setCylinder(Kernel::V3D,Kernel::V3D,double,double); ///sets the geometry handler for a cone - void setCone(V3D,V3D,double,double); + void setCone(Kernel::V3D,Kernel::V3D,double,double); ///sets the geometry handler for a segmented cylinder - void setSegmentedCylinder(V3D,V3D,double,double); + void setSegmentedCylinder(Kernel::V3D,Kernel::V3D,double,double); void Triangulate(); void Render(); void Initialize(); - void GetObjectGeom(int& mytype, std::vector<Geometry::V3D>& vectors, double& myradius, double & myheight); + void GetObjectGeom(int& mytype, std::vector<Kernel::V3D>& vectors, double& myradius, double & myheight); }; } // NAMESPACE Geometry diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryRenderer.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryRenderer.h index 29d172f6dfb..e95dc10ec6b 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryRenderer.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryRenderer.h @@ -5,9 +5,13 @@ #include "MantidKernel/Logger.h" namespace Mantid { - + namespace Kernel + { + class V3D; + } namespace Geometry { + class IObjComponent; /** \class GluGeometryRenderer \brief rendering geometry using opengl utility library glu. @@ -36,9 +40,6 @@ namespace Mantid File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid> */ - class IObjComponent; - class V3D; - class MANTID_GEOMETRY_DLL GluGeometryRenderer { private: @@ -53,25 +54,25 @@ namespace Mantid ///Renders an object component void Render(IObjComponent* ObjComp) const; ///Renders a Sphere from the input values - void RenderSphere(const V3D& center,double radius); + void RenderSphere(const Kernel::V3D& center,double radius); ///Renders a Cuboid from the input values - void RenderCube(const V3D& Point1,const V3D& Point2,const V3D& Point3,const V3D& Point4); + void RenderCube(const Kernel::V3D& Point1,const Kernel::V3D& Point2,const Kernel::V3D& Point3,const Kernel::V3D& Point4); ///Renders a Cone from the input values - void RenderCone(const V3D& center,const V3D &axis,double radius,double height); + void RenderCone(const Kernel::V3D& center,const Kernel::V3D &axis,double radius,double height); ///Renders a Cylinder from the input values - void RenderCylinder(const V3D& center,const V3D& axis,double radius,double height); + void RenderCylinder(const Kernel::V3D& center,const Kernel::V3D& axis,double radius,double height); ///Renders a Segmented Cylinder from the input values - void RenderSegmentedCylinder(const V3D& center,const V3D& axis,double radius,double height); + void RenderSegmentedCylinder(const Kernel::V3D& center,const Kernel::V3D& axis,double radius,double height); ///Creates a sphere from the input values - void CreateSphere(const V3D& center,double radius); + void CreateSphere(const Kernel::V3D& center,double radius); ///Creates a cuboid from the input values - void CreateCube(const V3D& Point1,const V3D& Point2,const V3D& Point3,const V3D& Point4); + void CreateCube(const Kernel::V3D& Point1,const Kernel::V3D& Point2,const Kernel::V3D& Point3,const Kernel::V3D& Point4); ///Creates a Cone from the input values - void CreateCone(const V3D& center,const V3D& axis,double radius,double height); + void CreateCone(const Kernel::V3D& center,const Kernel::V3D& axis,double radius,double height); ///Creates a cylinder from the input values - void CreateCylinder(const V3D& center,const V3D& axis,double radius,double height); + void CreateCylinder(const Kernel::V3D& center,const Kernel::V3D& axis,double radius,double height); ///Creates a segmented cylinder from the input values - void CreateSegmentedCylinder(const V3D& center,const V3D& axis,double radius,double height); + void CreateSegmentedCylinder(const Kernel::V3D& center,const Kernel::V3D& axis,double radius,double height); }; } // NAMESPACE Geometry diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Cone.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Cone.h index d43959e6131..bc4596dc996 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Cone.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Cone.h @@ -2,7 +2,7 @@ #define Cone_h #include "MantidGeometry/DllConfig.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/Logger.h" namespace Mantid { @@ -48,13 +48,13 @@ class MANTID_GEOMETRY_DLL Cone : public Quadratic static Kernel::Logger& PLog; ///< The official logger - Geometry::V3D Centre; ///< Geometry::V3D for centre - Geometry::V3D Normal; ///< Normal + Kernel::V3D Centre; ///< Kernel::V3D for centre + Kernel::V3D Normal; ///< Normal double alpha; ///< Angle (degrees) double cangle; ///< Cos(angle) - void rotate(const Geometry::Matrix<double>&); - void displace(const Geometry::V3D&); + void rotate(const Kernel::Matrix<double>&); + void displace(const Kernel::V3D&); public: @@ -69,29 +69,29 @@ class MANTID_GEOMETRY_DLL Cone : public Quadratic ~Cone(); ///Calculate if the point R is within the cone (return -1) or outside (return 1) - int side(const Geometry::V3D& R) const; + int side(const Kernel::V3D& R) const; /// Calculate if the point R is on the cone(1=on the surface, 0=not) - int onSurface(const Geometry::V3D& R) const; + int onSurface(const Kernel::V3D& R) const; /// Accept visitor for line calculation virtual void acceptVisitor(BaseVisit& A) const { A.Accept(*this); } /// Return centre point - Geometry::V3D getCentre() const { return Centre; } + Kernel::V3D getCentre() const { return Centre; } /// Central normal - Geometry::V3D getNormal() const { return Normal; } + Kernel::V3D getNormal() const { return Normal; } /// Edge Angle double getCosAngle() const { return cangle; } ///This method returns the distance of the point from the cone - double distance(const Geometry::V3D&) const; + double distance(const Kernel::V3D&) const; ///This method sets the cone surface using the input string in MCNPx format int setSurface(const std::string&); ///This method sets the centre of the cone - void setCentre(const Geometry::V3D&); + void setCentre(const Kernel::V3D&); ///This method sets the cone normal - void setNorm(const Geometry::V3D&); + void setNorm(const Kernel::V3D&); ///This method sets the angle of the cone void setAngle(double const); ///This method sets the tan angle which will be converted to cos used for MCNPX format diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Cylinder.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Cylinder.h index c2fb152ab62..e3fe3dd76c7 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Cylinder.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Cylinder.h @@ -3,7 +3,7 @@ #include "MantidGeometry/DllConfig.h" #include "MantidGeometry/Surfaces/Quadratic.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" namespace Mantid { @@ -52,13 +52,13 @@ namespace Mantid static Kernel::Logger& PLog; ///< The official logger - Geometry::V3D Centre; ///< Geometry::V3D for centre - Geometry::V3D Normal; ///< Direction of centre line + Kernel::V3D Centre; ///< Kernel::V3D for centre + Kernel::V3D Normal; ///< Direction of centre line int Nvec; ///< Normal vector is x,y or z :: (1-3) (0 if general) double Radius; ///< Radius of cylinder - void rotate(const Geometry::Matrix<double>&); - void displace(const Geometry::V3D&); + void rotate(const Kernel::Matrix<double>&); + void displace(const Kernel::V3D&); void setNvec(); ///< check to obtain orientation public: @@ -76,18 +76,18 @@ namespace Mantid virtual void acceptVisitor(BaseVisit& A) const { A.Accept(*this); } - virtual double lineIntersect(const Geometry::V3D&, - const Geometry::V3D&) const; + virtual double lineIntersect(const Kernel::V3D&, + const Kernel::V3D&) const; - int side(const Geometry::V3D&) const; - int onSurface(const Geometry::V3D&) const; - double distance(const Geometry::V3D&) const; + int side(const Kernel::V3D&) const; + int onSurface(const Kernel::V3D&) const; + double distance(const Kernel::V3D&) const; int setSurface(const std::string&); - void setCentre(const Geometry::V3D&); - void setNorm(const Geometry::V3D&); - Geometry::V3D getCentre() const { return Centre; } ///< Return centre point - Geometry::V3D getNormal() const { return Normal; } ///< Return Central line + void setCentre(const Kernel::V3D&); + void setNorm(const Kernel::V3D&); + Kernel::V3D getCentre() const { return Centre; } ///< Return centre point + Kernel::V3D getNormal() const { return Normal; } ///< Return Central line double getRadius() const { return Radius; } ///< Get Radius /// Set Radius void setRadius(const double& r) { Radius=r; setBaseEqn();} diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Line.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Line.h index ff9bc32df15..9e1251a5556 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Line.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Line.h @@ -1,7 +1,8 @@ #ifndef MANTID_GEOMETRY_LINE_H #define MANTID_GEOMETRY_LINE_H -#include "MantidGeometry/V3D.h" +#include "MantidGeometry/DllConfig.h" +#include "MantidKernel/V3D.h" namespace Mantid { @@ -9,6 +10,7 @@ namespace Mantid namespace Kernel { class Logger; + template<typename T> class Matrix; } namespace Geometry @@ -16,7 +18,6 @@ namespace Mantid //-------------------------------------- // Forward declarations //-------------------------------------- - template<typename T> class Matrix; class Quadratic; class Cylinder; class Plane; @@ -61,38 +62,38 @@ namespace Mantid static Kernel::Logger& PLog; ///< The official logger - Geometry::V3D Origin; ///< Orign point (on plane) - Geometry::V3D Direct; ///< Direction of outer surface (Unit Vector) + Kernel::V3D Origin; ///< Orign point (on plane) + Kernel::V3D Direct; ///< Direction of outer surface (Unit Vector) int lambdaPair(const int ix,const std::pair<std::complex<double>, - std::complex<double> >& SQ,std::vector<Geometry::V3D>& PntOut) const; + std::complex<double> >& SQ,std::vector<Kernel::V3D>& PntOut) const; public: Line(); - Line(const Geometry::V3D&,const Geometry::V3D&); + Line(const Kernel::V3D&,const Kernel::V3D&); Line(const Line&); Line& operator=(const Line&); Line* clone() const; ~Line(); - Geometry::V3D getPoint(const double lambda) const; ///< gets the point O+lam*N - Geometry::V3D getOrigin() const { return Origin; } ///< returns the origin - Geometry::V3D getDirect() const { return Direct; } ///< returns the direction - double distance(const Geometry::V3D&) const; ///< distance from line - int isValid(const Geometry::V3D&) const; ///< Is the point on the line + Kernel::V3D getPoint(const double lambda) const; ///< gets the point O+lam*N + Kernel::V3D getOrigin() const { return Origin; } ///< returns the origin + Kernel::V3D getDirect() const { return Direct; } ///< returns the direction + double distance(const Kernel::V3D&) const; ///< distance from line + int isValid(const Kernel::V3D&) const; ///< Is the point on the line void print() const; - void rotate(const Geometry::Matrix<double>&); - void displace(const Geometry::V3D&); + void rotate(const Kernel::Matrix<double>&); + void displace(const Kernel::V3D&); - int setLine(const Geometry::V3D&,const Geometry::V3D&); ///< input Origin + direction + int setLine(const Kernel::V3D&,const Kernel::V3D&); ///< input Origin + direction - int intersect(std::vector<Geometry::V3D>&,const Quadratic&) const; - int intersect(std::vector<Geometry::V3D>&,const Cylinder&) const; - int intersect(std::vector<Geometry::V3D>&,const Plane&) const; - int intersect(std::vector<Geometry::V3D>&,const Sphere&) const; + int intersect(std::vector<Kernel::V3D>&,const Quadratic&) const; + int intersect(std::vector<Kernel::V3D>&,const Cylinder&) const; + int intersect(std::vector<Kernel::V3D>&,const Plane&) const; + int intersect(std::vector<Kernel::V3D>&,const Sphere&) const; }; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/LineIntersectVisit.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/LineIntersectVisit.h index 73c700fe620..3e525224e56 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/LineIntersectVisit.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/LineIntersectVisit.h @@ -3,7 +3,7 @@ #include "MantidGeometry/Surfaces/BaseVisit.h" #include "MantidGeometry/Surfaces/Line.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <vector> namespace Mantid @@ -58,15 +58,15 @@ namespace Mantid static Kernel::Logger& PLog; ///< The official logger Line ATrack; ///< The line - std::vector<Geometry::V3D> PtOut; ///< The intersection point + std::vector<Kernel::V3D> PtOut; ///< The intersection point std::vector<double> DOut; ///< The distance void procTrack(); public: - LineIntersectVisit(const Geometry::V3D&, - const Geometry::V3D&); + LineIntersectVisit(const Kernel::V3D&, + const Kernel::V3D&); /// Destructor virtual ~LineIntersectVisit() {}; @@ -83,13 +83,13 @@ namespace Mantid const std::vector<double>& getDistance() const { return DOut; } /// Get the intersection points - const std::vector<Geometry::V3D>& getPoints() const + const std::vector<Kernel::V3D>& getPoints() const { return PtOut; } /// Get the number of intersection points unsigned long getNPoints() const { return (unsigned long)PtOut.size(); } /// Re-set the line - void setLine(const Geometry::V3D&,const Geometry::V3D&); + void setLine(const Kernel::V3D&,const Kernel::V3D&); }; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Plane.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Plane.h index 27e12d35bfb..b00d51d2a64 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Plane.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Plane.h @@ -2,7 +2,7 @@ #define PLANE_H #include "MantidGeometry/Surfaces/Quadratic.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <string> namespace Mantid @@ -11,6 +11,7 @@ namespace Mantid namespace Kernel { class Logger; + template <typename T> class Matrix; } namespace Geometry @@ -19,7 +20,6 @@ namespace Mantid // Forward declaration //--------------------------------------------- class BaseVisit; - template <typename T> class Matrix; /** \class Plane @@ -56,7 +56,7 @@ namespace Mantid static Kernel::Logger& PLog; ///< The official logger - Geometry::V3D NormV; ///< Normal vector + Kernel::V3D NormV; ///< Normal vector double Dist; ///< Distance int planeType() const; ///< are we alined on an axis @@ -75,20 +75,20 @@ namespace Mantid virtual void acceptVisitor(BaseVisit& A) const { A.Accept(*this); } - int setPlane(const Geometry::V3D&,const Geometry::V3D&); + int setPlane(const Kernel::V3D&,const Kernel::V3D&); // int setPlane(const std::string&); - int side(const Geometry::V3D&) const; - int onSurface(const Geometry::V3D&) const; + int side(const Kernel::V3D&) const; + int onSurface(const Kernel::V3D&) const; // stuff for finding intersections etc. double dotProd(const Plane&) const; ///< returns normal dot product - Geometry::V3D crossProd(const Plane&) const; ///< returns normal cross product - double distance(const Geometry::V3D&) const; ///< distance from a point + Kernel::V3D crossProd(const Plane&) const; ///< returns normal cross product + double distance(const Kernel::V3D&) const; ///< distance from a point double getDistance() const { return Dist; } ///< Distance from origin - Geometry::V3D getNormal() const { return NormV; } ///< Normal to plane (+ve surface) + Kernel::V3D getNormal() const { return NormV; } ///< Normal to plane (+ve surface) - void rotate(const Geometry::Matrix<double>&); - void displace(const Geometry::V3D&); + void rotate(const Kernel::Matrix<double>&); + void displace(const Kernel::V3D&); int setSurface(const std::string&); void print() const; @@ -96,7 +96,7 @@ namespace Mantid void setBaseEqn() ; ///< set up to be eqn based - int LineIntersectionWithPlane(V3D startpt,V3D endpt,V3D& output); + int LineIntersectionWithPlane(Kernel::V3D startpt,Kernel::V3D endpt,Kernel::V3D& output); void getBoundingBox(double &xmax,double &ymax,double &zmax,double &xmin,double &ymin,double &zmin); }; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Quadratic.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Quadratic.h index f3be97add93..e817ec5dcae 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Quadratic.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Quadratic.h @@ -30,8 +30,8 @@ namespace Mantid static Kernel::Logger& PLog; ///< The official logger - void matrixForm(Geometry::Matrix<double>&, - Geometry::V3D&,double&) const; + void matrixForm(Kernel::Matrix<double>&, + Kernel::V3D&,double&) const; protected: @@ -56,17 +56,17 @@ namespace Mantid const std::vector<double>& copyBaseEqn() const { return BaseEqn; } ///< access BaseEquation vector - virtual int side(const Geometry::V3D&) const; + virtual int side(const Kernel::V3D&) const; virtual void setBaseEqn() =0; ///< Abstract set baseEqn - double eqnValue(const Geometry::V3D&) const; + double eqnValue(const Kernel::V3D&) const; - virtual int onSurface(const Geometry::V3D&) const; ///< is point valid on surface - virtual double distance(const Geometry::V3D&) const; ///< distance between point and surface (approx) - virtual Geometry::V3D surfaceNormal(const Geometry::V3D&) const; ///< Normal at surface + virtual int onSurface(const Kernel::V3D&) const; ///< is point valid on surface + virtual double distance(const Kernel::V3D&) const; ///< distance between point and surface (approx) + virtual Kernel::V3D surfaceNormal(const Kernel::V3D&) const; ///< Normal at surface - virtual void displace(const Geometry::V3D&); - virtual void rotate(const Geometry::Matrix<double>&); + virtual void displace(const Kernel::V3D&); + virtual void rotate(const Kernel::Matrix<double>&); virtual void write(std::ostream&) const; virtual void print() const; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Sphere.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Sphere.h index dba9c03b920..d3c293760ab 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Sphere.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Sphere.h @@ -3,7 +3,7 @@ #include "MantidGeometry/DllConfig.h" #include "MantidGeometry/Surfaces/Quadratic.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <string> namespace Mantid @@ -52,12 +52,12 @@ namespace Mantid private: static Kernel::Logger& PLog; ///< The official logger - V3D Centre; ///< Point for centre + Kernel::V3D Centre; ///< Point for centre double Radius; ///< Radius of sphere - void rotate(const Geometry::Matrix<double>&); - void displace(const Geometry::V3D&); + void rotate(const Kernel::Matrix<double>&); + void displace(const Kernel::V3D&); /// Compute the distance from the centre of the sphere to the given point - double centreToPoint(const V3D & pt) const; + double centreToPoint(const Kernel::V3D & pt) const; public: Sphere(); @@ -73,15 +73,15 @@ namespace Mantid ///Set the sphere defination by input string in MCNP format int setSurface(const std::string&); ///Checks the given input point to be inside, outside or on the surface of sphere - int side(const Geometry::V3D&) const; + int side(const Kernel::V3D&) const; ///Checks whether the give input point is on the surface - int onSurface(const Geometry::V3D&) const; + int onSurface(const Kernel::V3D&) const; ///Gets the distance from the sphere to the input point - double distance(const Geometry::V3D&) const; + double distance(const Kernel::V3D&) const; ///Setter for centre of sphere - void setCentre(const Geometry::V3D&); + void setCentre(const Kernel::V3D&); /// Get Centre - Geometry::V3D getCentre() const { return Centre; } + Kernel::V3D getCentre() const { return Centre; } /// Get Radius double getRadius() const { return Radius; } /// Set Radius diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Surface.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Surface.h index ec24ce7ff53..2f2848c7e42 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Surface.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Surface.h @@ -7,13 +7,16 @@ namespace Mantid { - -namespace Geometry +namespace Kernel { - class V3D; template<class T> class Matrix; +} +namespace Geometry +{ + + /** \class Surface \brief Holds a basic quadratic surface @@ -74,20 +77,20 @@ class MANTID_GEOMETRY_DLL Surface /// Sets the surface based on a string input in MCNPX format virtual int setSurface(const std::string& R) =0; - virtual int side(const V3D&) const; + virtual int side(const Kernel::V3D&) const; /// is point valid on surface - virtual int onSurface(const V3D& R) const =0; + virtual int onSurface(const Kernel::V3D& R) const =0; /// returns the minimum distance to the surface - virtual double distance(const V3D&) const =0; + virtual double distance(const Kernel::V3D&) const =0; /// returns the normal to the closest point on the surface - virtual V3D surfaceNormal(const V3D&) const =0; + virtual Kernel::V3D surfaceNormal(const Kernel::V3D&) const =0; ///translates the surface - virtual void displace(const V3D&) =0; + virtual void displace(const Kernel::V3D&) =0; ///rotates the surface - virtual void rotate(const Matrix<double>&) =0; + virtual void rotate(const Kernel::Matrix<double>&) =0; void writeHeader(std::ostream&) const; virtual void write(std::ostream&) const; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Torus.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Torus.h index c9b2069b0d1..543812d3472 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Torus.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Surfaces/Torus.h @@ -50,14 +50,14 @@ class MANTID_GEOMETRY_DLL Torus : public Surface static Kernel::Logger& PLog; ///< The official logger - Geometry::V3D Centre; ///< Geometry::Vec3D for centre - Geometry::V3D Normal; ///< Normal + Kernel::V3D Centre; ///< Geometry::Vec3D for centre + Kernel::V3D Normal; ///< Normal double Iradius; ///< Inner radius double Dradius; ///< Inner radius double Displacement; ///< Displacement - void rotate(const Geometry::Matrix<double>&); - void displace(const Geometry::V3D&); + void rotate(const Kernel::Matrix<double>&); + void displace(const Kernel::V3D&); public: @@ -76,18 +76,18 @@ class MANTID_GEOMETRY_DLL Torus : public Surface { A.Accept(*this); } int setSurface(const std::string& Pstr); - int side(const Geometry::V3D& R) const; - int onSurface(const Geometry::V3D& R) const; - double distance(const Geometry::V3D& Pt) const; + int side(const Kernel::V3D& R) const; + int onSurface(const Kernel::V3D& R) const; + double distance(const Kernel::V3D& Pt) const; /// Return centre point - Geometry::V3D getCentre() const { return Centre; } + Kernel::V3D getCentre() const { return Centre; } /// Central normal - Geometry::V3D getNormal() const { return Normal; } - Geometry::V3D surfaceNormal(const Geometry::V3D& Pt) const; + Kernel::V3D getNormal() const { return Normal; } + Kernel::V3D surfaceNormal(const Kernel::V3D& Pt) const; - void setCentre(const Geometry::V3D& A); - void setNorm(const Geometry::V3D& A); + void setCentre(const Kernel::V3D& A); + void setNorm(const Kernel::V3D& A); /// Suppose to set the distance from centre of the torus to the centre of tube. ///TODO: diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Tolerance.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Tolerance.h deleted file mode 100644 index e5ce3cb041d..00000000000 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Tolerance.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef MANTID_GEOMETRY_TOLERANCE_H_ -#define MANTID_GEOMETRY_TOLERANCE_H_ - -namespace Mantid -{ -namespace Geometry -{ - - static const double Tolerance = 1.0e-06; ///< Tolerance value used in Geometry classes - -} // namespace Geometry -} // namespace Mantid - -#endif /* MANTID_GEOMETRY_TOLERANCE_H_ */ diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/IndexingUtils.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/IndexingUtils.cpp index 884bc045c5a..b7fcd01fc10 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/IndexingUtils.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/IndexingUtils.cpp @@ -1,9 +1,6 @@ /* File: IndexingUtils.cpp */ #include "MantidGeometry/Crystal/IndexingUtils.h" -#include "MantidKernel/System.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Math/Matrix.h" #include <iostream> #include <stdexcept> @@ -16,8 +13,9 @@ extern "C" #include <gsl/gsl_linalg.h> } -using namespace std; using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::DblMatrix; /** STATIC method BestFit_UB: Calculates the matrix that most nearly maps @@ -45,9 +43,9 @@ using namespace Mantid::Geometry; the UB matrix can't be calculated or if UB is a singular matrix. */ -double IndexingUtils::BestFit_UB( Matrix<double> & UB, - const vector<V3D> & hkl_vectors, - const vector<V3D> & q_vectors ) +double IndexingUtils::BestFit_UB( DblMatrix & UB, + const std::vector<V3D> & hkl_vectors, + const std::vector<V3D> & q_vectors ) { if ( hkl_vectors.size() < 3 ) { diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/OrientedLattice.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/OrientedLattice.cpp index 0ed8dda80b9..2738d68d794 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/OrientedLattice.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/OrientedLattice.cpp @@ -4,6 +4,9 @@ namespace Mantid { namespace Geometry { + using Mantid::Kernel::DblMatrix; + using Mantid::Kernel::V3D; + /** Default constructor @param Umatrix :: orientation matrix U. By default this will be identity matrix */ diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/UnitCell.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/UnitCell.cpp index ab54b417060..ca0bd20d206 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/UnitCell.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/UnitCell.cpp @@ -1,5 +1,5 @@ #include "MantidGeometry/Crystal/UnitCell.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/System.h" #include <stdexcept> #include <cfloat> @@ -8,7 +8,8 @@ namespace Mantid { namespace Geometry { - + using Mantid::Kernel::V3D; + using Mantid::Kernel::DblMatrix; /** Default constructor. \f$ a = b = c = 1 \mbox{\AA, } \alpha = \beta = \gamma = 90^\circ \f$ */ @@ -409,7 +410,7 @@ namespace Geometry /// Get the metric tensor /// @return G :: metric tensor - const Geometry::DblMatrix& UnitCell::getG() const + const Kernel::DblMatrix& UnitCell::getG() const { return G; } @@ -417,21 +418,21 @@ namespace Geometry /// Get the reciprocal metric tensor /// @return Gstar :: metric tensor of the reciprocal lattice - const Geometry::DblMatrix& UnitCell::getGstar() const + const Kernel::DblMatrix& UnitCell::getGstar() const { return Gstar; } /// Get the B-matrix /// @return B :: B matrix in Busing-Levy convention - const Geometry::DblMatrix& UnitCell::getB() const + const Kernel::DblMatrix& UnitCell::getB() const { return B; } /// Get the inverse of the B-matrix /// @return Binv :: inverse of the B matrix in Busing-Levy convention - const Geometry::DblMatrix& UnitCell::getBinv() const + const Kernel::DblMatrix& UnitCell::getBinv() const { return Binv; } diff --git a/Code/Mantid/Framework/Geometry/src/IInstrument.cpp b/Code/Mantid/Framework/Geometry/src/IInstrument.cpp index 770bf2d6d8f..e9d64dedd21 100644 --- a/Code/Mantid/Framework/Geometry/src/IInstrument.cpp +++ b/Code/Mantid/Framework/Geometry/src/IInstrument.cpp @@ -6,15 +6,16 @@ namespace Mantid { + using Kernel::V3D; + namespace Geometry { - /** Gets the beam direction (i.e. source->sample direction). * Not virtual because it relies the getSample() & getPos() virtual functions * @returns A unit vector denoting the direction of the beam */ - Geometry::V3D IInstrument::getBeamDirection() const + Kernel::V3D IInstrument::getBeamDirection() const { V3D retval = getSample()->getPos() - getSource()->getPos(); retval.normalize(); diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp index fc774ed3c42..174ef9dcecf 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp @@ -11,7 +11,10 @@ namespace Mantid namespace Geometry { -/// Void deleter for shared pointers + using Kernel::V3D; + using Kernel::Quat; + + /// Void deleter for shared pointers class NoDeleting { public: @@ -23,7 +26,6 @@ public: }; - /** Empty constructor */ CompAssembly::CompAssembly() : Component(), m_children(), m_cachedBoundingBox(NULL) diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/Component.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/Component.cpp index bdae993ac80..79637c85295 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/Component.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/Component.cpp @@ -8,6 +8,9 @@ namespace Mantid namespace Geometry { + using Kernel::V3D; + using Kernel::Quat; + /** Constructor for a parametrized Component. * @param base :: a Component that is the base (un-parametrized) component * @param map :: a ParameterMap to parameterize the component diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/Detector.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/Detector.cpp index dc649e69503..a2d4e2f9241 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/Detector.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/Detector.cpp @@ -6,6 +6,9 @@ namespace Mantid namespace Geometry { + using Kernel::V3D; + using Kernel::Quat; + // Get a reference to the logger Kernel::Logger& Detector::g_log = Kernel::Logger::get("Detector"); diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/DetectorGroup.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/DetectorGroup.cpp index 300a0ec65e7..7d66ca27563 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/DetectorGroup.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/DetectorGroup.cpp @@ -9,7 +9,9 @@ namespace Mantid { namespace Geometry { - + using Kernel::V3D; + using Kernel::Quat; + // Get a reference to the logger Kernel::Logger& DetectorGroup::g_log = Kernel::Logger::get("DetectorGroup"); diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/Goniometer.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/Goniometer.cpp index 00b95e74fa7..7cf241af856 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/Goniometer.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/Goniometer.cpp @@ -2,7 +2,7 @@ #include <sstream> #include <stdexcept> #include <string> -#include "MantidGeometry/Quat.h" +#include "MantidKernel/Quat.h" #include <vector> #include <boost/algorithm/string.hpp> #include <cstdlib> @@ -11,6 +11,9 @@ namespace Mantid { namespace Geometry { + using Kernel::DblMatrix; + using Kernel::V3D; + using Kernel::Quat; /// Default constructor /// The rotation matrix is initialized to identity @@ -47,7 +50,7 @@ Goniometer::~Goniometer() /// Return global rotation matrix /// @return R :: 3x3 rotation matrix -const Geometry::DblMatrix& Goniometer::getR() const +const Kernel::DblMatrix& Goniometer::getR() const { return R; } diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/Instrument.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/Instrument.cpp index 405c38cd83f..51157fcf93c 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/Instrument.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/Instrument.cpp @@ -1,5 +1,5 @@ #include "MantidGeometry/Instrument/Instrument.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/Exception.h" #include "MantidGeometry/Instrument/ParameterMap.h" #include "MantidGeometry/Instrument/ParComponentFactory.h" @@ -588,9 +588,9 @@ namespace Mantid * @return conversion factor for pixel */ double Instrument::calcConversion(const double l1, - const Geometry::V3D &beamline, + const Kernel::V3D &beamline, const double beamline_norm, - const Geometry::V3D &samplePos, + const Kernel::V3D &samplePos, const Geometry::IDetector_const_sptr &det, const double offset, bool vulcancorrection) @@ -598,7 +598,7 @@ namespace Mantid // Get the sample-detector distance for this detector (in metres) // The scattering angle for this detector (in radians). - Geometry::V3D detPos; + Kernel::V3D detPos; if (vulcancorrection) { detPos = det->getParent()->getPos(); @@ -626,9 +626,9 @@ namespace Mantid * for a LIST of detectors assigned to a single spectrum. */ double Instrument::calcConversion(const double l1, - const Geometry::V3D &beamline, + const Kernel::V3D &beamline, const double beamline_norm, - const Geometry::V3D &samplePos, + const Kernel::V3D &samplePos, const IInstrument_const_sptr &instrument, const std::vector<detid_t> &detectors, const std::map<detid_t,double> &offsets, @@ -663,8 +663,8 @@ namespace Mantid * @param beamline_norm :: 2 * the length of beamline * @param samplePos :: vector of the position of the sample */ - void Instrument::getInstrumentParameters(double & l1, Geometry::V3D & beamline, - double & beamline_norm, Geometry::V3D & samplePos) const + void Instrument::getInstrumentParameters(double & l1, Kernel::V3D & beamline, + double & beamline_norm, Kernel::V3D & samplePos) const { // Get some positions const Geometry::IObjComponent_sptr sourceObj = this->getSource(); @@ -672,7 +672,7 @@ namespace Mantid { throw Exception::InstrumentDefinitionError("Failed to get source component from instrument"); } - const Geometry::V3D sourcePos = sourceObj->getPos(); + const Kernel::V3D sourcePos = sourceObj->getPos(); samplePos = this->getSample()->getPos(); beamline = samplePos-sourcePos; beamline_norm=2.0*beamline.norm(); diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/NearestNeighbours.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/NearestNeighbours.cpp index fd36b0def43..203dad74dc1 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/NearestNeighbours.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/NearestNeighbours.cpp @@ -14,6 +14,7 @@ namespace Mantid namespace Geometry { using Mantid::detid_t; + using Kernel::V3D; /** * Constructor diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp index db9f3e8e5b8..8f3d70bf741 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp @@ -12,6 +12,9 @@ namespace Mantid { namespace Geometry { + using Kernel::V3D; + using Kernel::Quat; + using Kernel::DblMatrix; /// Void deleter for shared pointers class NoDeleting @@ -346,7 +349,7 @@ boost::shared_ptr<Object> ObjCompAssembly::createOutline() // Get information about the shape and size of a detector std::string type; int otype; - std::vector<Geometry::V3D> vectors; + std::vector<Kernel::V3D> vectors; double radius, height; boost::shared_ptr<const Object> obj = group.front()->shape(); if (!obj) @@ -414,7 +417,7 @@ boost::shared_ptr<Object> ObjCompAssembly::createOutline() // Either the detectors are not perfectrly aligned or // vz is parallel to neither of the 3 axis x,y,z // This code is unfinished - Matrix<double> II(3,3),Vec(3,3),D(3,3); + DblMatrix II(3,3),Vec(3,3),D(3,3); II[0][0] = Ixx; II[0][1] = Ixy; II[0][2] = Ixz; diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/ObjComponent.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/ObjComponent.cpp index 03cbcd039f0..63417c0e090 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/ObjComponent.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/ObjComponent.cpp @@ -12,6 +12,8 @@ namespace Mantid { namespace Geometry { + using Kernel::V3D; + using Kernel::Quat; /** Constructor for a parametrized ObjComponent * @param base: the base (un-parametrized) IComponent diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/Parameter.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/Parameter.cpp index 633b334cf1e..32779058eba 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/Parameter.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/Parameter.cpp @@ -37,6 +37,6 @@ DECLARE_PARAMETER(int,int) DECLARE_PARAMETER(double,double) DECLARE_PARAMETER(bool,bool) DECLARE_PARAMETER(string,std::string) -DECLARE_PARAMETER(V3D,Mantid::Geometry::V3D) -DECLARE_PARAMETER(Quat,Mantid::Geometry::Quat) +DECLARE_PARAMETER(V3D,Mantid::Kernel::V3D) +DECLARE_PARAMETER(Quat,Mantid::Kernel::Quat) DECLARE_PARAMETER(fitting,Mantid::Geometry::FitParameter) diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/ParameterMap.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/ParameterMap.cpp index 03b5202aa87..587c47456db 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/ParameterMap.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/ParameterMap.cpp @@ -11,6 +11,9 @@ namespace Mantid { namespace Geometry { + using Kernel::V3D; + using Kernel::Quat; + // Get a reference to the logger Kernel::Logger& ParameterMap::g_log = Kernel::Logger::get("ParameterMap"); diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/RectangularDetector.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/RectangularDetector.cpp index 1a324644231..0f95b0575f1 100644 --- a/Code/Mantid/Framework/Geometry/src/Instrument/RectangularDetector.cpp +++ b/Code/Mantid/Framework/Geometry/src/Instrument/RectangularDetector.cpp @@ -1,6 +1,6 @@ #include "MantidGeometry/Instrument/Detector.h" #include "MantidGeometry/Instrument/RectangularDetector.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidGeometry/Objects/BoundingBox.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/ShapeFactory.h" @@ -15,8 +15,9 @@ namespace Mantid namespace Geometry { - - + using Kernel::V3D; + using Kernel::Quat; + using Kernel::Matrix; /** Empty constructor */ diff --git a/Code/Mantid/Framework/Geometry/src/InstrumentRayTracer.cpp b/Code/Mantid/Framework/Geometry/src/InstrumentRayTracer.cpp index 6f768e6760b..a754b4c5eec 100644 --- a/Code/Mantid/Framework/Geometry/src/InstrumentRayTracer.cpp +++ b/Code/Mantid/Framework/Geometry/src/InstrumentRayTracer.cpp @@ -4,7 +4,7 @@ #include "MantidGeometry/Objects/InstrumentRayTracer.h" #include "MantidGeometry/Objects/BoundingBox.h" #include "MantidGeometry/Objects/Track.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/Exception.h" #include <deque> #include <iterator> @@ -14,6 +14,8 @@ namespace Mantid namespace Geometry { + using Kernel::V3D; + // Initialize logger Kernel::Logger & InstrumentRayTracer::g_log = Kernel::Logger::get("InstrumentRayTracer"); diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDBasisDimension.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDBasisDimension.cpp index 0114a792f42..af97c0cba48 100644 --- a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDBasisDimension.cpp +++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDBasisDimension.cpp @@ -6,6 +6,8 @@ namespace Mantid namespace Geometry { + using Kernel::V3D; + MDBasisDimension::MDBasisDimension(std::string id, bool isReciprocal, int columnNumber,const std::string &UnitID,const V3D &inDirection) : m_id(id), m_isReciprocal(isReciprocal), m_columnNumber(columnNumber), direction(inDirection) diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDDimensionRes.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDDimensionRes.cpp index 07bc714a51e..6e8ea922272 100644 --- a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDDimensionRes.cpp +++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDDimensionRes.cpp @@ -17,6 +17,7 @@ namespace Mantid{ namespace Geometry{ + using Kernel::V3D; MDDimensionRes::MDDimensionRes(const MDBasisDimension &Dim): MDDimension(Dim.getId()), diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDGeometry.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDGeometry.cpp index 8e85ea9e261..f2768e8ed55 100644 --- a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDGeometry.cpp +++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDGeometry.cpp @@ -1,7 +1,7 @@ #include "MantidGeometry/MDGeometry/MDGeometryDescription.h" #include "MantidGeometry/MDGeometry/MDGeometry.h" #include "MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include <MantidGeometry/Crystal/OrientedLattice.h> diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDGeometryDescription.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDGeometryDescription.cpp index ab4c4eb5d92..ab89d348033 100644 --- a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDGeometryDescription.cpp +++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDGeometryDescription.cpp @@ -8,6 +8,8 @@ namespace Mantid{ namespace Geometry{ + using Kernel::DblMatrix; + // get reference to logger for MD workspaces Kernel::Logger& MDGeometryDescription::g_log=Kernel::Logger::get("MDWorkspaces"); diff --git a/Code/Mantid/Framework/Geometry/src/Math/Acomp.cpp b/Code/Mantid/Framework/Geometry/src/Math/Acomp.cpp index 5ee267bb6b1..bd9a8b60549 100644 --- a/Code/Mantid/Framework/Geometry/src/Math/Acomp.cpp +++ b/Code/Mantid/Framework/Geometry/src/Math/Acomp.cpp @@ -2,7 +2,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/Strings.h" #include "MantidKernel/Exception.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidGeometry/Math/RotCounter.h" #include <algorithm> #include <iterator> @@ -13,6 +13,8 @@ namespace Mantid namespace Geometry { + using Kernel::Matrix; + Kernel::Logger& Acomp::PLog( Kernel::Logger::get("Acomp")); // Friend function std::ostream& @@ -1040,7 +1042,7 @@ namespace Mantid std::vector<int> EPIvalue; // Make zeroed matrix. - Geometry::Matrix<int> Grid(PIform.size(),DNFobj.size()); + Kernel::Matrix<int> Grid(PIform.size(),DNFobj.size()); std::vector<int> DNFactive(DNFobj.size()); // DNF that active std::vector<int> PIactive(PIform.size()); // PI that are active std::vector<int> DNFscore(DNFobj.size()); // Number in each channel @@ -1124,7 +1126,7 @@ namespace Mantid // the remaining table. // First Make a new matrix for speed. Useful ??? - Geometry::Matrix<int> Cmat(PIactive.size(),DNFactive.size()); // corrolation matrix + Kernel::Matrix<int> Cmat(PIactive.size(),DNFactive.size()); // corrolation matrix int cm(0); for(px=PIactive.begin();px!=PIactive.end();px++) { @@ -1846,7 +1848,7 @@ namespace Mantid void Acomp::printImplicates(const std::vector<BnId>& PIform, - const Geometry::Matrix<int>& Grid) const + const Kernel::Matrix<int>& Grid) const /** Debug function to print out PI and Grid : diff --git a/Code/Mantid/Framework/Geometry/src/Math/mathSupport.cpp b/Code/Mantid/Framework/Geometry/src/Math/mathSupport.cpp index c5b495bfb97..98849af56d7 100644 --- a/Code/Mantid/Framework/Geometry/src/Math/mathSupport.cpp +++ b/Code/Mantid/Framework/Geometry/src/Math/mathSupport.cpp @@ -10,33 +10,6 @@ namespace Mantid { -template<typename T> -void -indexSort(const std::vector<T>& pVec,std::vector<int>& Index) - /** - Function to take a vector and sort the vector - so as to produce an index. - Leaves the vector unchanged. - */ -{ - Index.resize(pVec.size()); - std::vector<typename std::pair<T,int> > PartList; - PartList.resize(pVec.size()); - - transform(pVec.begin(),pVec.end(),PartList.begin(),mathSupport::PIndex<T>()); - sort(PartList.begin(),PartList.end()); - transform(PartList.begin(),PartList.end(),Index.begin(),mathSupport::PSep<T>()); - - /* - typename std::vector<typename std::pair<T,int> >::const_iterator vc; - - for(vc=PartList.begin();vc!=PartList.end();vc++) - { - std::cout<<"Part == "<<vc->first<<" "<<vc->second<<std::endl; - } - */ - return; -} template<typename InputIter> int diff --git a/Code/Mantid/Framework/Geometry/src/Objects/BoundingBox.cpp b/Code/Mantid/Framework/Geometry/src/Objects/BoundingBox.cpp index bd7ad806fe9..f4d3766a1d4 100644 --- a/Code/Mantid/Framework/Geometry/src/Objects/BoundingBox.cpp +++ b/Code/Mantid/Framework/Geometry/src/Objects/BoundingBox.cpp @@ -9,6 +9,8 @@ namespace Mantid { namespace Geometry { + using Kernel::V3D; + //--------------------------------------------------------- // Public member functions //--------------------------------------------------------- @@ -23,9 +25,9 @@ namespace Mantid throw(Kernel::Exception::NotImplementedError("this function has not been modified properly")); } - if(point.X() <= xMax() + Tolerance && point.X() >= xMin() - Tolerance && - point.Y() <= yMax() + Tolerance && point.Y() >= yMin() - Tolerance && - point.Z() <= zMax() + Tolerance && point.Z() >= zMin() - Tolerance) + if(point.X() <= xMax() + Kernel::Tolerance && point.X() >= xMin() - Kernel::Tolerance && + point.Y() <= yMax() + Kernel::Tolerance && point.Y() >= yMin() - Kernel::Tolerance && + point.Z() <= zMax() + Kernel::Tolerance && point.Z() >= zMin() - Kernel::Tolerance) { return true; } @@ -59,7 +61,7 @@ namespace Mantid } // Method - Loop through planes looking for ones that are visible and check intercept // Assume that orig is outside of BoundingBox. - const double tol = Mantid::Geometry::Tolerance; + const double tol = Mantid::Kernel::Tolerance; double lambda(0.0); if (startPoint.X() > xMax()) { @@ -130,13 +132,13 @@ namespace Mantid * @param observer :: Viewing point * @returns The value of the angular half-width */ - double BoundingBox::angularWidth(const Geometry::V3D& observer) const + double BoundingBox::angularWidth(const Kernel::V3D& observer) const { - Geometry::V3D centre = centrePoint() - observer; - std::vector<Geometry::V3D> pts; + Kernel::V3D centre = centrePoint() - observer; + std::vector<Kernel::V3D> pts; this->getFullBox(pts,observer); - std::vector<Geometry::V3D>::const_iterator ip; + std::vector<Kernel::V3D>::const_iterator ip; double centre_norm_inv = 1.0 / centre.norm(); double thetaMax(-1.0); for (ip = pts.begin(); ip != pts.end(); ip++) @@ -151,14 +153,14 @@ namespace Mantid void BoundingBox::getFullBox(std::vector<V3D> &box,const V3D &observer)const { box.resize(8); - box[0] = Geometry::V3D(xMin(), yMin(), zMin())-observer; - box[1] = Geometry::V3D(xMax(), yMin(), zMin())-observer; - box[2] = Geometry::V3D(xMax(), yMax(), zMin())-observer; - box[3] = Geometry::V3D(xMin(), yMax(), zMin())-observer; - box[4] = Geometry::V3D(xMin(), yMax(), zMax())-observer; - box[5] = Geometry::V3D(xMin(), yMin(), zMax())-observer; - box[6] = Geometry::V3D(xMax(), yMin(), zMax())-observer; - box[7] = Geometry::V3D(xMax(), yMax(), zMax())-observer; + box[0] = Kernel::V3D(xMin(), yMin(), zMin())-observer; + box[1] = Kernel::V3D(xMax(), yMin(), zMin())-observer; + box[2] = Kernel::V3D(xMax(), yMax(), zMin())-observer; + box[3] = Kernel::V3D(xMin(), yMax(), zMin())-observer; + box[4] = Kernel::V3D(xMin(), yMax(), zMax())-observer; + box[5] = Kernel::V3D(xMin(), yMin(), zMax())-observer; + box[6] = Kernel::V3D(xMax(), yMin(), zMax())-observer; + box[7] = Kernel::V3D(xMax(), yMax(), zMax())-observer; } void BoundingBox::setBoxAlignment(const V3D &R0,const std::vector<V3D> &orts) diff --git a/Code/Mantid/Framework/Geometry/src/Objects/Object.cpp b/Code/Mantid/Framework/Geometry/src/Objects/Object.cpp index 8a8e7885690..9e251b1a39f 100644 --- a/Code/Mantid/Framework/Geometry/src/Objects/Object.cpp +++ b/Code/Mantid/Framework/Geometry/src/Objects/Object.cpp @@ -16,7 +16,7 @@ #include "MantidGeometry/Rendering/vtkGeometryCacheReader.h" #include "MantidGeometry/Rendering/vtkGeometryCacheWriter.h" #include "MantidKernel/RegexStrings.h" -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include <deque> #include <stack> @@ -25,6 +25,9 @@ namespace Mantid namespace Geometry { + using Kernel::V3D; + using Kernel::Quat; + Kernel::Logger& Object::PLog(Kernel::Logger::get("Object")); /** @@ -408,9 +411,9 @@ namespace Mantid * @param Pt :: Point to check * @returns 1 if the point is on the surface */ - bool Object::isOnSide(const Geometry::V3D& Pt) const + bool Object::isOnSide(const Kernel::V3D& Pt) const { - std::list<Geometry::V3D> Snorms; // Normals from the constact surface. + std::list<Kernel::V3D> Snorms; // Normals from the constact surface. std::vector<const Surface*>::const_iterator vc; for (vc = SurList.begin(); vc != SurList.end(); vc++) @@ -424,8 +427,8 @@ namespace Mantid return true; } } - std::list<Geometry::V3D>::const_iterator xs, ys; - Geometry::V3D NormPair; + std::list<Kernel::V3D>::const_iterator xs, ys; + Kernel::V3D NormPair; for (xs = Snorms.begin(); xs != Snorms.end(); xs++) for (ys = xs, ys++; ys != Snorms.end(); ys++) { @@ -448,12 +451,12 @@ namespace Mantid * @retval -1 :: Point included (e.g at convex intersection) * @retval 0 :: success */ - int Object::checkSurfaceValid(const Geometry::V3D& C, const Geometry::V3D& Nm) const + int Object::checkSurfaceValid(const Kernel::V3D& C, const Kernel::V3D& Nm) const { int status(0); - Geometry::V3D tmp = C + Nm * (Tolerance * 5.0); + Kernel::V3D tmp = C + Nm * (Kernel::Tolerance * 5.0); status = (!isValid(tmp)) ? 1 : -1; - tmp -= Nm * (Tolerance * 10.0); + tmp -= Nm * (Kernel::Tolerance * 10.0); status += (!isValid(tmp)) ? 1 : -1; return status / 2; } @@ -463,7 +466,7 @@ namespace Mantid * @param Pt :: Point to be tested * @returns 1 if true and 0 if false */ - bool Object::isValid(const Geometry::V3D& Pt) const + bool Object::isValid(const Kernel::V3D& Pt) const { if (!TopRule) return false; @@ -792,7 +795,7 @@ namespace Mantid { (*vc)->acceptVisitor(LI); } - const std::vector<Geometry::V3D>& IPts(LI.getPoints()); + const std::vector<Kernel::V3D>& IPts(LI.getPoints()); const std::vector<double>& dPts(LI.getDistance()); for (unsigned int i = 0; i < IPts.size(); i++) @@ -817,11 +820,11 @@ namespace Mantid * @retval 1 :: Entry point * @retval -1 :: Exit Point */ - int Object::calcValidType(const Geometry::V3D& Pt, const Geometry::V3D& uVec) const + int Object::calcValidType(const Kernel::V3D& Pt, const Kernel::V3D& uVec) const { - const Geometry::V3D shift(uVec * Tolerance * 25.0); - const Geometry::V3D testA(Pt - shift); - const Geometry::V3D testB(Pt + shift); + const Kernel::V3D shift(uVec * Kernel::Tolerance * 25.0); + const Kernel::V3D testA(Pt - shift); + const Kernel::V3D testB(Pt + shift); const int flagA = isValid(testA); const int flagB = isValid(testB); if (!(flagA ^ flagB)) @@ -836,7 +839,7 @@ namespace Mantid * @param observer :: point to measure solid angle from * @return :: estimate of solid angle of object. Accuracy depends on object shape. */ - double Object::solidAngle(const Geometry::V3D& observer) const + double Object::solidAngle(const Kernel::V3D& observer) const { if (this->NumberOfTriangles() > 30000) return rayTraceSolidAngle(observer); @@ -849,7 +852,7 @@ namespace Mantid * @param scaleFactor :: V3D giving scaling of the object * @return :: estimate of solid angle of object. Accuracy depends on triangulation quality. */ - double Object::solidAngle(const Geometry::V3D& observer, const Geometry::V3D& scaleFactor) const + double Object::solidAngle(const Kernel::V3D& observer, const Kernel::V3D& scaleFactor) const { return triangleSolidAngle(observer, scaleFactor); @@ -860,7 +863,7 @@ namespace Mantid * @param observer :: position of the observer (V3D) * @return Solid angle in steradians (+/- 1% if accurate bounding box available) */ - double Object::rayTraceSolidAngle(const Geometry::V3D& observer) const + double Object::rayTraceSolidAngle(const Kernel::V3D& observer) const { // Calculation of solid angle as numerical double integral over all // angles. This could be optimised further e.g. by @@ -882,7 +885,7 @@ namespace Mantid const BoundingBox & boundingBox = getBoundingBox(); double thetaMax = M_PI; bool useBB = false, usePt = false; - Geometry::V3D ptInObject, axis; + Kernel::V3D ptInObject, axis; Quat zToPt; // Is the bounding box a reasonable one? @@ -903,10 +906,10 @@ namespace Mantid // found point in object, now get rotation that maps z axis to this direction from observer ptInObject -= observer; double theta0 = -180.0 / M_PI * acos(ptInObject.Z() / ptInObject.norm()); - Geometry::V3D zDir(0.0, 0.0, 1.0); + Kernel::V3D zDir(0.0, 0.0, 1.0); axis = ptInObject.cross_prod(zDir); if (axis.nullVector()) - axis = Geometry::V3D(1.0, 0.0, 0.0); + axis = Kernel::V3D(1.0, 0.0, 0.0); zToPt(theta0, axis); } dtheta = thetaMax / res; @@ -925,7 +928,7 @@ namespace Mantid { // integrate phi from 0 to 2*PI phi = 2.0 * M_PI * (jphi - 0.5) / resPhi; - Geometry::V3D dir(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)); + Kernel::V3D dir(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)); if (usePt) zToPt.rotate(dir); if (!useBB || boundingBox.doesLineIntersect(observer, dir)) @@ -961,7 +964,7 @@ namespace Mantid for (jphi = 1; jphi <= resPhi; jphi++) { phi = 2.0 * M_PI * (jphi - 0.5) / resPhi; - Geometry::V3D dir(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)); + Kernel::V3D dir(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)); if (usePt) zToPt.rotate(dir); Track tr(observer, dir); @@ -1037,7 +1040,7 @@ namespace Mantid // If the object is a simple shape use the special methods double height(0.0), radius(0.0); int type(0); - std::vector<Mantid::Geometry::V3D> geometry_vectors; + std::vector<Mantid::Kernel::V3D> geometry_vectors; // Maximum of 4 vectors depending on the type geometry_vectors.reserve(4); this->GetObjectGeom(type, geometry_vectors, radius, height); @@ -1119,7 +1122,7 @@ namespace Mantid { double height = 0.0, radius(0.0); int type; - std::vector<Geometry::V3D> vectors; + std::vector<Kernel::V3D> vectors; this->GetObjectGeom(type, vectors, radius, height); if (type == 1) { @@ -1160,11 +1163,11 @@ namespace Mantid * @param radius :: sphere radius * @return :: solid angle of sphere */ - double Object::SphereSolidAngle(const V3D observer, const std::vector<Geometry::V3D> vectors, + double Object::SphereSolidAngle(const V3D observer, const std::vector<Kernel::V3D> vectors, const double radius) const { const double distance = (observer - vectors[0]).norm(); - const double tol = Tolerance; + const double tol = Kernel::Tolerance; if (distance > radius + tol) { const double sa = 2.0 * M_PI * (1.0 - cos(asin(radius / distance))); @@ -1183,7 +1186,7 @@ namespace Mantid * @param vectors :: vector of V3D - the values are the 4 points used to defined the cuboid * @return :: solid angle of cuboid - good accuracy */ - double Object::CuboidSolidAngle(const V3D observer, const std::vector<Geometry::V3D> vectors) const + double Object::CuboidSolidAngle(const V3D observer, const std::vector<Kernel::V3D> vectors) const { // Build bounding points, then set up map of 12 bounding // triangles defining the 6 surfaces of the bounding box. Using a consistent @@ -1191,8 +1194,8 @@ namespace Mantid // solid angle and hence are ignored. std::vector<V3D> pts; pts.reserve(8); - Geometry::V3D dx = vectors[1] - vectors[0]; - Geometry::V3D dz = vectors[3] - vectors[0]; + Kernel::V3D dx = vectors[1] - vectors[0]; + Kernel::V3D dz = vectors[3] - vectors[0]; pts.push_back(vectors[2]); pts.push_back(vectors[2] + dx); pts.push_back(vectors[1]); @@ -1260,8 +1263,8 @@ namespace Mantid * @param height :: The height * @returns The solid angle value */ - double Object::CylinderSolidAngle(const V3D & observer, const Mantid::Geometry::V3D & centre, - const Mantid::Geometry::V3D & axis, const double radius, const double height) const + double Object::CylinderSolidAngle(const V3D & observer, const Mantid::Kernel::V3D & centre, + const Mantid::Kernel::V3D & axis, const double radius, const double height) const { // The cylinder is triangulated along its axis EXCLUDING the end caps so that stacked cylinders // give the correct value of solid angle (i.e shadowing is losely taken into account by this @@ -1270,12 +1273,12 @@ namespace Mantid //angle and is excluded // For simplicity the triangulation points are constructed such that the cone axis // points up the +Z axis and then rotated into their final position - Geometry::V3D axis_direction = axis; + Kernel::V3D axis_direction = axis; axis_direction.normalize(); // Required rotation - Geometry::V3D initial_axis = Geometry::V3D(0., 0., 1.0); - Geometry::V3D final_axis = axis_direction; - Geometry::Quat transform(initial_axis, final_axis); + Kernel::V3D initial_axis = Kernel::V3D(0., 0., 1.0); + Kernel::V3D final_axis = axis_direction; + Kernel::Quat transform(initial_axis, final_axis); // Do the base cap which is a point at the centre and nslices points around it const int nslices(Mantid::Geometry::Cylinder::g_nslices); @@ -1295,13 +1298,13 @@ namespace Mantid { double x = radius * std::cos(angle_step * sl); double y = radius * std::sin(angle_step * sl); - Geometry::V3D pt1 = Geometry::V3D(x,y,z0); - Geometry::V3D pt2 = Geometry::V3D(x,y,z1); + Kernel::V3D pt1 = Kernel::V3D(x,y,z0); + Kernel::V3D pt2 = Kernel::V3D(x,y,z1); int vertex = (sl+1) % nslices; x = radius * std::cos(angle_step * vertex); y = radius * std::sin(angle_step * vertex); - Geometry::V3D pt3 = Geometry::V3D(x,y,z0); - Geometry::V3D pt4 = Geometry::V3D(x,y,z1); + Kernel::V3D pt3 = Kernel::V3D(x,y,z0); + Kernel::V3D pt4 = Kernel::V3D(x,y,z1); // Rotations transform.rotate(pt1); transform.rotate(pt3); @@ -1341,20 +1344,20 @@ namespace Mantid * @param height :: The height * @returns The solid angle value */ - double Object::ConeSolidAngle(const V3D & observer, const Mantid::Geometry::V3D & centre, - const Mantid::Geometry::V3D & axis, const double radius, const double height) const + double Object::ConeSolidAngle(const V3D & observer, const Mantid::Kernel::V3D & centre, + const Mantid::Kernel::V3D & axis, const double radius, const double height) const { // The cone is broken down into three pieces and then in turn broken down into triangles. Any triangle // that has a normal facing away from the observer gives a negative solid angle and is excluded // For simplicity the triangulation points are constructed such that the cone axis points up the +Z axis // and then rotated into their final position - Geometry::V3D axis_direction = axis; + Kernel::V3D axis_direction = axis; axis_direction.normalize(); // Required rotation - Geometry::V3D initial_axis = Geometry::V3D(0., 0., 1.0); - Geometry::V3D final_axis = axis_direction; - Geometry::Quat transform(initial_axis, final_axis); + Kernel::V3D initial_axis = Kernel::V3D(0., 0., 1.0); + Kernel::V3D final_axis = axis_direction; + Kernel::Quat transform(initial_axis, final_axis); // Do the base cap which is a point at the centre and nslices points around it const int nslices(Mantid::Geometry::Cone::g_nslices); @@ -1369,7 +1372,7 @@ namespace Mantid int vertex = sl; cos_table[vertex] = std::cos(angle_step * vertex); sin_table[vertex] = std::sin(angle_step * vertex); - Geometry::V3D pt2 = Geometry::V3D(radius * cos_table[vertex], radius * sin_table[vertex], 0.0); + Kernel::V3D pt2 = Kernel::V3D(radius * cos_table[vertex], radius * sin_table[vertex], 0.0); if (sl < nslices - 1) { @@ -1380,7 +1383,7 @@ namespace Mantid else vertex = 0; - Geometry::V3D pt3 = Geometry::V3D(radius * cos_table[vertex], radius * sin_table[vertex], 0.0); + Kernel::V3D pt3 = Kernel::V3D(radius * cos_table[vertex], radius * sin_table[vertex], 0.0); transform.rotate(pt2); transform.rotate(pt3); @@ -1409,20 +1412,20 @@ namespace Mantid for (int sl = 0; sl < nslices; ++sl) { int vertex = sl; - Geometry::V3D pt1 = Geometry::V3D(r0 * cos_table[vertex], r0 * sin_table[vertex], z0); + Kernel::V3D pt1 = Kernel::V3D(r0 * cos_table[vertex], r0 * sin_table[vertex], z0); if (sl < nslices - 1) vertex = sl + 1; else vertex = 0; - Geometry::V3D pt3 = Geometry::V3D(r0 * cos_table[vertex], r0 * sin_table[vertex], z0); + Kernel::V3D pt3 = Kernel::V3D(r0 * cos_table[vertex], r0 * sin_table[vertex], z0); vertex = sl; - Geometry::V3D pt2 = Geometry::V3D(r1 * cos_table[vertex], r1 * sin_table[vertex], z1); + Kernel::V3D pt2 = Kernel::V3D(r1 * cos_table[vertex], r1 * sin_table[vertex], z1); if (sl < nslices - 1) vertex = sl + 1; else vertex = 0; - Geometry::V3D pt4 = Geometry::V3D(r1 * cos_table[vertex], r1 * sin_table[vertex], z1); + Kernel::V3D pt4 = Kernel::V3D(r1 * cos_table[vertex], r1 * sin_table[vertex], z1); // Rotations transform.rotate(pt1); transform.rotate(pt3); @@ -1452,20 +1455,20 @@ namespace Mantid } // Top section - Geometry::V3D top_centre = Geometry::V3D(0.0, 0.0, height) + centre; + Kernel::V3D top_centre = Kernel::V3D(0.0, 0.0, height) + centre; transform.rotate(top_centre); top_centre += centre; for (int sl = 0; sl < nslices; ++sl) { int vertex = sl; - Geometry::V3D pt2 = Geometry::V3D(r0 * cos_table[vertex], r0 * sin_table[vertex], height); + Kernel::V3D pt2 = Kernel::V3D(r0 * cos_table[vertex], r0 * sin_table[vertex], height); if (sl < nslices - 1) vertex = sl + 1; else vertex = 0; - Geometry::V3D pt3 = Geometry::V3D(r0 * cos_table[vertex], r0 * sin_table[vertex], height); + Kernel::V3D pt3 = Kernel::V3D(r0 * cos_table[vertex], r0 * sin_table[vertex], height); // Rotate them to the correct axis orientation transform.rotate(pt2); @@ -1606,13 +1609,13 @@ namespace Mantid @param[out] point :: on exit set to the point value, if found @return 1 if point found, 0 otherwise */ - int Object::getPointInObject(Geometry::V3D& point) const + int Object::getPointInObject(Kernel::V3D& point) const { // // Simple method - check if origin in object, if not search directions along // axes. If that fails, try centre of boundingBox, and paths about there // - Geometry::V3D testPt(0, 0, 0); + Kernel::V3D testPt(0, 0, 0); if (searchForObject(testPt)) { point = testPt; @@ -1638,24 +1641,24 @@ namespace Mantid * @param point :: on entry the seed point, on exit point in object, if found * @return 1 if point found, 0 otherwise */ - int Object::searchForObject(Geometry::V3D& point) const + int Object::searchForObject(Kernel::V3D& point) const { // // Method - check if point in object, if not search directions along // principle axes using interceptSurface // - Geometry::V3D testPt; + Kernel::V3D testPt; if (isValid(point)) return 1; - std::vector<Geometry::V3D> axes; + std::vector<Kernel::V3D> axes; axes.reserve(6); - axes.push_back(Geometry::V3D(1, 0, 0)); - axes.push_back(Geometry::V3D(-1, 0, 0)); - axes.push_back(Geometry::V3D(0, 1, 0)); - axes.push_back(Geometry::V3D(0, -1, 0)); - axes.push_back(Geometry::V3D(0, 0, 1)); - axes.push_back(Geometry::V3D(0, 0, -1)); - std::vector<Geometry::V3D>::const_iterator dir; + axes.push_back(Kernel::V3D(1, 0, 0)); + axes.push_back(Kernel::V3D(-1, 0, 0)); + axes.push_back(Kernel::V3D(0, 1, 0)); + axes.push_back(Kernel::V3D(0, -1, 0)); + axes.push_back(Kernel::V3D(0, 0, 1)); + axes.push_back(Kernel::V3D(0, 0, -1)); + std::vector<Kernel::V3D>::const_iterator dir; for (dir = axes.begin(); dir != axes.end(); dir++) { Geometry::Track tr(point, (*dir)); @@ -1800,7 +1803,7 @@ namespace Mantid /** * get info on standard shapes */ - void Object::GetObjectGeom(int& type, std::vector<Geometry::V3D>& vectors, double& myradius, + void Object::GetObjectGeom(int& type, std::vector<Kernel::V3D>& vectors, double& myradius, double & myheight) const { type = 0; diff --git a/Code/Mantid/Framework/Geometry/src/Objects/RuleItems.cpp b/Code/Mantid/Framework/Geometry/src/Objects/RuleItems.cpp index e279abcf93a..56983bdfcbc 100644 --- a/Code/Mantid/Framework/Geometry/src/Objects/RuleItems.cpp +++ b/Code/Mantid/Framework/Geometry/src/Objects/RuleItems.cpp @@ -17,8 +17,8 @@ #include "MantidKernel/Exception.h" #include "MantidGeometry/Math/Triple.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Line.h" #include "MantidGeometry/Surfaces/BaseVisit.h" #include "MantidGeometry/Surfaces/Surface.h" @@ -30,6 +30,7 @@ namespace Mantid namespace Geometry { + using Kernel::V3D; Kernel::Logger& Intersection::PLog(Kernel::Logger::get("Intersection")); @@ -286,7 +287,7 @@ Intersection::displayAddress() const } bool -Intersection::isValid(const Geometry::V3D& Vec) const +Intersection::isValid(const Kernel::V3D& Vec) const /** Calculates if Vec is within the object @param Vec :: Point to test @@ -591,7 +592,7 @@ Union::simplify() } bool -Union::isValid(const Geometry::V3D& Vec) const +Union::isValid(const Kernel::V3D& Vec) const /** Calculates if Vec is within the object @param Vec :: Point to test @@ -844,7 +845,7 @@ SurfPoint::simplify() } bool -SurfPoint::isValid(const Geometry::V3D& Pt) const +SurfPoint::isValid(const Kernel::V3D& Pt) const /** Determines if a point is valid. @param Pt :: Point to test @@ -1089,7 +1090,7 @@ CompObj::findLeaf(const Rule* A) const } bool -CompObj::isValid(const Geometry::V3D& Pt) const +CompObj::isValid(const Kernel::V3D& Pt) const /** Determines if a point is valid. Checks to see if the point is valid in the object @@ -1295,7 +1296,7 @@ BoolValue::findLeaf(const Rule* A) const } bool -BoolValue::isValid(const Geometry::V3D& pt) const +BoolValue::isValid(const Kernel::V3D& pt) const /** Determines if a point is valid. @param pt :: Point to test @@ -1517,7 +1518,7 @@ CompGrp::findLeaf(const Rule* R) const } bool -CompGrp::isValid(const Geometry::V3D& Pt) const +CompGrp::isValid(const Kernel::V3D& Pt) const /** Determines if a point is valid. Checks to see if the point is valid in the object diff --git a/Code/Mantid/Framework/Geometry/src/Objects/Rules.cpp b/Code/Mantid/Framework/Geometry/src/Objects/Rules.cpp index c5b3aaeaacb..8d277a3b1f7 100644 --- a/Code/Mantid/Framework/Geometry/src/Objects/Rules.cpp +++ b/Code/Mantid/Framework/Geometry/src/Objects/Rules.cpp @@ -15,8 +15,8 @@ #include "MantidKernel/Logger.h" #include "MantidGeometry/Math/Triple.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/BaseVisit.h" #include "MantidGeometry/Surfaces/Surface.h" #include "MantidGeometry/Objects/Rules.h" diff --git a/Code/Mantid/Framework/Geometry/src/Objects/Track.cpp b/Code/Mantid/Framework/Geometry/src/Objects/Track.cpp index 7f9e4f80826..8c316df4057 100644 --- a/Code/Mantid/Framework/Geometry/src/Objects/Track.cpp +++ b/Code/Mantid/Framework/Geometry/src/Objects/Track.cpp @@ -1,7 +1,7 @@ #include "MantidGeometry/Objects/Track.h" -#include "MantidGeometry/Tolerance.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Tolerance.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Surface.h" #include <cmath> @@ -12,6 +12,9 @@ namespace Mantid { namespace Geometry { + using Kernel::V3D; + using Kernel::Tolerance; + /** * Default constructor */ diff --git a/Code/Mantid/Framework/Geometry/src/Rendering/BitmapGeometryHandler.cpp b/Code/Mantid/Framework/Geometry/src/Rendering/BitmapGeometryHandler.cpp index d25cd160db8..8fd8504abc0 100644 --- a/Code/Mantid/Framework/Geometry/src/Rendering/BitmapGeometryHandler.cpp +++ b/Code/Mantid/Framework/Geometry/src/Rendering/BitmapGeometryHandler.cpp @@ -7,7 +7,7 @@ namespace Mantid { namespace Geometry { - + using Kernel::V3D; BitmapGeometryHandler::BitmapGeometryHandler(RectangularDetector *comp) : GeometryHandler(dynamic_cast<IObjComponent*>(comp)) diff --git a/Code/Mantid/Framework/Geometry/src/Rendering/CacheGeometryGenerator.cpp b/Code/Mantid/Framework/Geometry/src/Rendering/CacheGeometryGenerator.cpp index 5b1843b484b..48e40a97306 100644 --- a/Code/Mantid/Framework/Geometry/src/Rendering/CacheGeometryGenerator.cpp +++ b/Code/Mantid/Framework/Geometry/src/Rendering/CacheGeometryGenerator.cpp @@ -1,8 +1,8 @@ #include "MantidKernel/Logger.h" #include <vector> #include <cmath> -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Matrix.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Rendering/CacheGeometryGenerator.h" #include "MantidGeometry/Rendering/GeometryHandler.h" diff --git a/Code/Mantid/Framework/Geometry/src/Rendering/CacheGeometryRenderer.cpp b/Code/Mantid/Framework/Geometry/src/Rendering/CacheGeometryRenderer.cpp index b88e48b8b0c..d0af2030ca7 100644 --- a/Code/Mantid/Framework/Geometry/src/Rendering/CacheGeometryRenderer.cpp +++ b/Code/Mantid/Framework/Geometry/src/Rendering/CacheGeometryRenderer.cpp @@ -1,13 +1,15 @@ #include "MantidGeometry/Rendering/CacheGeometryRenderer.h" #include "MantidGeometry/Rendering/OpenGL_Headers.h" #include "MantidGeometry/Instrument/ObjComponent.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/Quat.h" #include <climits> namespace Mantid { namespace Geometry { + using Kernel::V3D; + using Kernel::Quat; Kernel::Logger& CacheGeometryRenderer::PLog(Kernel::Logger::get("CacheGeometryRenderer")); diff --git a/Code/Mantid/Framework/Geometry/src/Rendering/GluGeometryHandler.cpp b/Code/Mantid/Framework/Geometry/src/Rendering/GluGeometryHandler.cpp index 65b71d61645..2ef9dc65398 100644 --- a/Code/Mantid/Framework/Geometry/src/Rendering/GluGeometryHandler.cpp +++ b/Code/Mantid/Framework/Geometry/src/Rendering/GluGeometryHandler.cpp @@ -8,6 +8,8 @@ namespace Mantid { namespace Geometry { + using Kernel::V3D; + GluGeometryHandler::GluGeometryHandler(IObjComponent *comp):GeometryHandler(comp) { Renderer = new GluGeometryRenderer(); @@ -69,7 +71,7 @@ namespace Mantid } } - void GluGeometryHandler::GetObjectGeom(int& mytype, std::vector<Geometry::V3D>& vectors, double& myradius, double & myheight) + void GluGeometryHandler::GetObjectGeom(int& mytype, std::vector<Kernel::V3D>& vectors, double& myradius, double & myheight) { mytype=0; if(Obj!=NULL) diff --git a/Code/Mantid/Framework/Geometry/src/Rendering/GluGeometryRenderer.cpp b/Code/Mantid/Framework/Geometry/src/Rendering/GluGeometryRenderer.cpp index e8d1f4b3c6f..5c8f0521d53 100644 --- a/Code/Mantid/Framework/Geometry/src/Rendering/GluGeometryRenderer.cpp +++ b/Code/Mantid/Framework/Geometry/src/Rendering/GluGeometryRenderer.cpp @@ -1,7 +1,7 @@ #include "MantidGeometry/Rendering/GluGeometryRenderer.h" #include "MantidGeometry/Rendering/OpenGL_Headers.h" #include "MantidGeometry/Instrument/ObjComponent.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/Quat.h" #include "MantidGeometry/Surfaces/Cylinder.h" #include "MantidGeometry/Surfaces/Cone.h" #include "MantidGeometry/Surfaces/Sphere.h" @@ -11,6 +11,8 @@ namespace Mantid { namespace Geometry { + using Kernel::V3D; + using Kernel::Quat; Kernel::Logger& GluGeometryRenderer::PLog(Kernel::Logger::get("GluGeometryRenderer")); diff --git a/Code/Mantid/Framework/Geometry/src/Rendering/OCGeometryGenerator.cpp b/Code/Mantid/Framework/Geometry/src/Rendering/OCGeometryGenerator.cpp index 2172e31609f..b366f0468a9 100644 --- a/Code/Mantid/Framework/Geometry/src/Rendering/OCGeometryGenerator.cpp +++ b/Code/Mantid/Framework/Geometry/src/Rendering/OCGeometryGenerator.cpp @@ -3,8 +3,8 @@ #include <vector> #include <cmath> #include <climits> // Needed for g++4.4 on Mac with OpenCASCADE 6.3.0 -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Matrix.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/Sphere.h" @@ -51,6 +51,8 @@ namespace Mantid { + using Kernel::V3D; + using Kernel::Quat; namespace Geometry { diff --git a/Code/Mantid/Framework/Geometry/src/Rendering/OCGeometryRenderer.cpp b/Code/Mantid/Framework/Geometry/src/Rendering/OCGeometryRenderer.cpp index 4a6a06ae98e..cdaf612726d 100644 --- a/Code/Mantid/Framework/Geometry/src/Rendering/OCGeometryRenderer.cpp +++ b/Code/Mantid/Framework/Geometry/src/Rendering/OCGeometryRenderer.cpp @@ -1,8 +1,8 @@ #include "MantidGeometry/Rendering/OCGeometryRenderer.h" #include "MantidGeometry/Rendering/OpenGL_Headers.h" #include "MantidGeometry/IObjComponent.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include <climits> // Squash a warning coming out of an OpenCascade header @@ -29,6 +29,8 @@ namespace Mantid { namespace Geometry { + using Kernel::V3D; + using Kernel::Quat; /** * Constructor diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/Cone.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/Cone.cpp index 6b0a3182691..291f98e4afd 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/Cone.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/Cone.cpp @@ -14,9 +14,9 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/Strings.h" -#include "MantidGeometry/Tolerance.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Tolerance.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Line.h" #include "MantidGeometry/Surfaces/BaseVisit.h" #include "MantidGeometry/Surfaces/Surface.h" @@ -28,7 +28,8 @@ namespace Mantid namespace Geometry { - + using Kernel::Tolerance; + using Kernel::V3D; Kernel::Logger& Cone::PLog(Kernel::Logger::get("Cone")); @@ -137,8 +138,8 @@ namespace Mantid if (!Mantid::Kernel::Strings::section(Line,tanAng)) return -5; - Centre=Geometry::V3D(cent); - Normal=Geometry::V3D(norm); + Centre=Kernel::V3D(cent); + Normal=Kernel::V3D(norm); setTanAngle(sqrt(tanAng)); setBaseEqn(); return 0; @@ -188,7 +189,7 @@ namespace Mantid } void - Cone::rotate(const Geometry::Matrix<double>& R) + Cone::rotate(const Kernel::Matrix<double>& R) /** Rotate both the centre and the normal direction @param R :: Matrix for rotation. @@ -201,11 +202,11 @@ namespace Mantid } void - Cone::displace(const Geometry::V3D& A) + Cone::displace(const Kernel::V3D& A) /** Displace the centre Only need to update the centre position - @param A :: Geometry::V3D to add + @param A :: Kernel::V3D to add */ { Centre+=A; @@ -214,7 +215,7 @@ namespace Mantid } void - Cone::setCentre(const Geometry::V3D& A) + Cone::setCentre(const Kernel::V3D& A) /** Sets the central point and the Base Equation @param A :: New Centre point @@ -226,7 +227,7 @@ namespace Mantid } void - Cone::setNorm(const Geometry::V3D& A) + Cone::setNorm(const Kernel::V3D& A) /** Sets the Normal and the Base Equation @param A :: New Normal direction @@ -270,7 +271,7 @@ namespace Mantid } double - Cone::distance(const Geometry::V3D& Pt) const + Cone::distance(const Kernel::V3D& Pt) const /** Calculates the distance from the point to the Cone does not calculate the point on the cone that is closest @@ -282,7 +283,7 @@ namespace Mantid @return distance to Pt */ { - const Geometry::V3D Px=Pt-Centre; + const Kernel::V3D Px=Pt-Centre; // test is the centre to point distance is zero if(Px.norm()<Tolerance) return Px.norm(); @@ -306,10 +307,10 @@ namespace Mantid @param R :: Point to determine if in/out of cone @return Side of R */ - int Cone::side(const Geometry::V3D& R) const + int Cone::side(const Kernel::V3D& R) const { - const Geometry::V3D cR = R-Centre; + const Kernel::V3D cR = R-Centre; double rptAngle=cR.scalar_prod(Normal); rptAngle*=rptAngle/cR.scalar_prod(cR); const double eqn(sqrt(rptAngle)); @@ -326,10 +327,10 @@ namespace Mantid @param R :: Point to check @return 1 if on surface and 0 if not not on surface */ - int Cone::onSurface(const Geometry::V3D& R) const + int Cone::onSurface(const Kernel::V3D& R) const { - const Geometry::V3D cR = R-Centre; + const Kernel::V3D cR = R-Centre; double rptAngle=cR.scalar_prod(Normal); rptAngle*=rptAngle/cR.scalar_prod(cR); const double eqn(sqrt(rptAngle)); diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/Cylinder.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/Cylinder.cpp index 43c93d7d44b..b0f1d1541d9 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/Cylinder.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/Cylinder.cpp @@ -1,8 +1,8 @@ #include "MantidGeometry/Surfaces/Cylinder.h" #include "MantidKernel/Logger.h" #include "MantidKernel/Strings.h" -#include "MantidGeometry/Tolerance.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Tolerance.h" +#include "MantidKernel/Matrix.h" #include <cfloat> namespace Mantid @@ -11,6 +11,9 @@ namespace Mantid namespace Geometry { + using Kernel::Tolerance; + using Kernel::V3D; + Kernel::Logger& Cylinder::PLog(Kernel::Logger::get("Cylinder")); // The number of slices to use to approximate a cylinder @@ -123,8 +126,8 @@ Cylinder::setSurface(const std::string& Pstr) if (!Mantid::Kernel::Strings::section(Line,R) || R<=0.0) return errRadius; - Centre=Geometry::V3D(cent); - Normal=Geometry::V3D(norm); + Centre=Kernel::V3D(cent); + Normal=Kernel::V3D(norm); Nvec=ptype+1; Radius=R; setBaseEqn(); @@ -132,7 +135,7 @@ Cylinder::setSurface(const std::string& Pstr) } int -Cylinder::side(const Geometry::V3D& Pt) const +Cylinder::side(const Kernel::V3D& Pt) const /** Calculate if the point PT within the middle of the cylinder @@ -164,10 +167,10 @@ Cylinder::side(const Geometry::V3D& Pt) const } int -Cylinder::onSurface(const Geometry::V3D& Pt) const +Cylinder::onSurface(const Kernel::V3D& Pt) const /** Calculate if the point PT on the cylinder - @param Pt :: Geometry::V3D to test + @param Pt :: Kernel::V3D to test @retval 1 :: on the surface @retval 0 :: not on the surface */ @@ -204,7 +207,7 @@ Cylinder::setNvec() } void -Cylinder::rotate(const Geometry::Matrix<double>& MA) +Cylinder::rotate(const Kernel::Matrix<double>& MA) /** Apply a rotation to the cylinder and re-check the status of the main axis. @@ -220,7 +223,7 @@ Cylinder::rotate(const Geometry::Matrix<double>& MA) } void -Cylinder::displace(const Geometry::V3D& Pt) +Cylinder::displace(const Kernel::V3D& Pt) /** Apply a displacement Pt @param Pt :: Displacement to add to the centre @@ -238,9 +241,9 @@ Cylinder::displace(const Geometry::V3D& Pt) } void -Cylinder::setCentre(const Geometry::V3D& A) +Cylinder::setCentre(const Kernel::V3D& A) /** - Sets the centre Geometry::V3D + Sets the centre Kernel::V3D @param A :: centre point */ { @@ -250,7 +253,7 @@ Cylinder::setCentre(const Geometry::V3D& A) } void -Cylinder::setNorm(const Geometry::V3D& A) +Cylinder::setNorm(const Kernel::V3D& A) /** Sets the centre line unit vector A does not need to be a unit vector @@ -286,7 +289,7 @@ Cylinder::setBaseEqn() } double -Cylinder::distance(const Geometry::V3D& A) const +Cylinder::distance(const Kernel::V3D& A) const /** Calculates the distance of point A from the surface of the cylinder. @@ -298,9 +301,9 @@ Cylinder::distance(const Geometry::V3D& A) const */ { // First find the normal going to the point - const Geometry::V3D Amov=A-Centre; + const Kernel::V3D Amov=A-Centre; double lambda=Amov.scalar_prod(Normal); - const Geometry::V3D Ccut= Normal*lambda; + const Kernel::V3D Ccut= Normal*lambda; // The distance is from the centre line to the return fabs(Ccut.distance(Amov)-Radius); } @@ -355,8 +358,8 @@ Cylinder::write(std::ostream& OX) const } double -Cylinder::lineIntersect(const Geometry::V3D& Pt, - const Geometry::V3D& uVec) const +Cylinder::lineIntersect(const Kernel::V3D& Pt, + const Kernel::V3D& uVec) const /** Given a track starting from Pt and traveling along uVec determine the intersection point (distance) diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/General.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/General.cpp index 1c724a770f4..39dd5092054 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/General.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/General.cpp @@ -1,7 +1,7 @@ #include "MantidGeometry/Surfaces/General.h" #include "MantidKernel/Logger.h" #include "MantidKernel/Strings.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" namespace Mantid { diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/Line.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/Line.cpp index 098c81066c2..64d4f0f5eb2 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/Line.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/Line.cpp @@ -2,18 +2,20 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/Strings.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/Cylinder.h" #include "MantidGeometry/Surfaces/Plane.h" #include "MantidGeometry/Surfaces/Sphere.h" -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" namespace Mantid { namespace Geometry { + using Kernel::Tolerance; + using Kernel::V3D; Kernel::Logger& Line::PLog(Kernel::Logger::get("Line")); @@ -23,7 +25,7 @@ namespace Mantid */ {} - Line::Line(const Geometry::V3D& O,const Geometry::V3D& D) + Line::Line(const Kernel::V3D& O,const Kernel::V3D& D) : Origin(O),Direct(D) /** Constructor @@ -72,7 +74,7 @@ namespace Mantid */ {} - Geometry::V3D + Kernel::V3D Line::getPoint(const double lambda) const /** Return the point on the line given lambda*direction @@ -84,7 +86,7 @@ namespace Mantid } double - Line::distance(const Geometry::V3D& A) const + Line::distance(const Kernel::V3D& A) const /** Distance of a point from the line @param A :: test Point @@ -92,13 +94,13 @@ namespace Mantid */ { const double lambda=Direct.scalar_prod(A-Origin); - Geometry::V3D L=getPoint(lambda); + Kernel::V3D L=getPoint(lambda); L-=A; return L.norm(); } int - Line::isValid(const Geometry::V3D& A) const + Line::isValid(const Kernel::V3D& A) const /** Calculate is point is on line by using distance to determine if the point is within Tolerance of the line @@ -111,7 +113,7 @@ namespace Mantid } void - Line::rotate(const Geometry::Matrix<double>& MA) + Line::rotate(const Kernel::Matrix<double>& MA) /** Applies the rotation matrix to the object. @@ -125,7 +127,7 @@ namespace Mantid } void - Line::displace(const Geometry::V3D& Pt) + Line::displace(const Kernel::V3D& Pt) /** Apply a displacement Pt @param Pt :: Point value of the displacement @@ -138,7 +140,7 @@ namespace Mantid int Line::lambdaPair(const int ix,const std::pair< std::complex<double>,std::complex<double> >& SQ, - std::vector<Geometry::V3D>& PntOut) const + std::vector<Kernel::V3D>& PntOut) const /** Helper function to decide which roots to take. The assumption is that lambda has been solved by quadratic @@ -160,11 +162,11 @@ namespace Mantid int nCnt(0); // number of good points - Geometry::V3D Ans; + Kernel::V3D Ans; if (SQ.first.imag()==0.0 && SQ.first.real()>=0.0) // +ve roots only { const double lambda=SQ.first.real(); - Geometry::V3D Ans=getPoint(lambda); + Kernel::V3D Ans=getPoint(lambda); PntOut.push_back(Ans); if (ix<2) // only one unique root. return 1; @@ -178,7 +180,7 @@ namespace Mantid PntOut.push_back(getPoint(lambda)); return 1; } - Geometry::V3D Ans2=getPoint(lambda); + Kernel::V3D Ans2=getPoint(lambda); // If points too close return only 1 item. if (Ans.distance(Ans2)<Tolerance) return 1; @@ -190,7 +192,7 @@ namespace Mantid } int - Line::intersect(std::vector<Geometry::V3D>& VecOut, + Line::intersect(std::vector<Kernel::V3D>& VecOut, const Quadratic& Sur) const /** For the line that intersects the surfaces @@ -220,7 +222,7 @@ namespace Mantid } int - Line::intersect(std::vector<Geometry::V3D>& PntOut ,const Plane& Pln) const + Line::intersect(std::vector<Kernel::V3D>& PntOut ,const Plane& Pln) const /** For the line that intersects the cylinder generate add the point to the VecOut, return number of points @@ -244,7 +246,7 @@ namespace Mantid } int - Line::intersect(std::vector<Geometry::V3D>& PntOut ,const Cylinder& Cyl) const + Line::intersect(std::vector<Kernel::V3D>& PntOut ,const Cylinder& Cyl) const /** For the line that intersects the cylinder generate add the point to the VecOut, return number of points @@ -255,9 +257,9 @@ namespace Mantid @return Number of points found by intersection */ { - const Geometry::V3D Cent=Cyl.getCentre(); - const Geometry::V3D Ax=Origin-Cent; - const Geometry::V3D N= Cyl.getNormal(); + const Kernel::V3D Cent=Cyl.getCentre(); + const Kernel::V3D Ax=Origin-Cent; + const Kernel::V3D N= Cyl.getNormal(); const double R=Cyl.getRadius(); const double vDn = N.scalar_prod(Direct); const double vDA = N.scalar_prod(Ax); @@ -273,7 +275,7 @@ namespace Mantid } int - Line::intersect(std::vector<Geometry::V3D>& PntOut ,const Sphere& Sph) const + Line::intersect(std::vector<Kernel::V3D>& PntOut ,const Sphere& Sph) const /** For the line that intersects the cylinder generate add the point to the VecOut, return number of points @@ -285,7 +287,7 @@ namespace Mantid */ { // Nasty stripping of useful stuff from sphere - const Geometry::V3D Ax=Origin-Sph.getCentre(); + const Kernel::V3D Ax=Origin-Sph.getCentre(); const double R=Sph.getRadius(); // First solve the equation of intersection double C[3]; @@ -300,7 +302,7 @@ namespace Mantid //SETING int - Line::setLine(const Geometry::V3D& O,const Geometry::V3D& D) + Line::setLine(const Kernel::V3D& O,const Kernel::V3D& D) /** sets the line given the Origne and direction @param O :: origin diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/LineIntersectVisit.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/LineIntersectVisit.cpp index 1768ff627a2..e5c9c258310 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/LineIntersectVisit.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/LineIntersectVisit.cpp @@ -21,7 +21,7 @@ namespace Geometry Kernel::Logger& LineIntersectVisit::PLog(Kernel::Logger::get("LineIntersectVisit")); LineIntersectVisit::LineIntersectVisit - (const Geometry::V3D& Pt,const Geometry::V3D& uVec) : + (const Kernel::V3D& Pt,const Kernel::V3D& uVec) : ATrack(Pt,uVec) /** Constructor @@ -122,7 +122,7 @@ LineIntersectVisit::procTrack() // Calculate the distances to the points DOut.resize(PtOut.size()); std::transform(PtOut.begin(),PtOut.end(),DOut.begin(), - boost::bind(&Geometry::V3D::distance,ATrack.getOrigin(),_1)); + boost::bind(&Kernel::V3D::distance,ATrack.getOrigin(),_1)); return; } diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/Plane.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/Plane.cpp index 0018830e8f5..0e26bff70c8 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/Plane.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/Plane.cpp @@ -1,7 +1,7 @@ #include "MantidGeometry/Surfaces/Plane.h" #include "MantidKernel/Logger.h" #include "MantidKernel/Strings.h" -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include <cfloat> namespace Mantid @@ -10,6 +10,9 @@ namespace Mantid namespace Geometry { + using Kernel::Tolerance; + using Kernel::V3D; + Kernel::Logger& Plane::PLog(Kernel::Logger::get("Plane")); /// Numerical tolerance, now set by Surface::Tolerance @@ -95,9 +98,9 @@ Plane::setSurface(const std::string& Pstr) return -3; if (cnt==9) // V3D type { - Geometry::V3D A=Geometry::V3D(surf[0],surf[1],surf[2]); - Geometry::V3D B=Geometry::V3D(surf[3],surf[4],surf[5]); - Geometry::V3D C=Geometry::V3D(surf[6],surf[7],surf[8]); + Kernel::V3D A=Kernel::V3D(surf[0],surf[1],surf[2]); + Kernel::V3D B=Kernel::V3D(surf[3],surf[4],surf[5]); + Kernel::V3D C=Kernel::V3D(surf[6],surf[7],surf[8]); B-=A; C-=A; NormV = B*C; @@ -106,7 +109,7 @@ Plane::setSurface(const std::string& Pstr) } else // Norm Equation: { - NormV=Geometry::V3D(surf[0],surf[1],surf[2]); + NormV=Kernel::V3D(surf[0],surf[1],surf[2]); const double ll=NormV.normalize(); if (ll<Tolerance) // avoid return -4; @@ -121,7 +124,7 @@ Plane::setSurface(const std::string& Pstr) surf[ptype]=1.0; if (!Mantid::Kernel::Strings::convert(Line,Dist)) return -6; //Too short or no number - NormV=Geometry::V3D(surf[0],surf[1],surf[2]); + NormV=Kernel::V3D(surf[0],surf[1],surf[2]); } else return -3; // WRONG NAME @@ -131,7 +134,7 @@ Plane::setSurface(const std::string& Pstr) } int -Plane::setPlane(const Geometry::V3D& P,const Geometry::V3D& N) +Plane::setPlane(const Kernel::V3D& P,const Kernel::V3D& N) /** Given a point and a normal direction set the plane @param P :: Point for plane to pass thought @@ -147,7 +150,7 @@ Plane::setPlane(const Geometry::V3D& P,const Geometry::V3D& N) } void -Plane::rotate(const Geometry::Matrix<double>& MA) +Plane::rotate(const Kernel::Matrix<double>& MA) /** Rotate the plane about the origin by MA @param MA :: direct rotation matrix (3x3) @@ -160,7 +163,7 @@ Plane::rotate(const Geometry::Matrix<double>& MA) } void -Plane::displace(const Geometry::V3D& Sp) +Plane::displace(const Kernel::V3D& Sp) /** Displace the plane by Point Sp. i.e. r+sp now on the plane @@ -173,7 +176,7 @@ Plane::displace(const Geometry::V3D& Sp) } double -Plane::distance(const Geometry::V3D& A) const +Plane::distance(const Kernel::V3D& A) const /** Determine the distance of point A from the plane returns a value relative to the normal @@ -194,7 +197,7 @@ Plane::dotProd(const Plane& A) const return NormV.scalar_prod(A.NormV); } -Geometry::V3D +Kernel::V3D Plane::crossProd(const Plane& A) const /** Take the cross produce of the normals @@ -208,7 +211,7 @@ Plane::crossProd(const Plane& A) const int -Plane::side(const Geometry::V3D& A) const +Plane::side(const Kernel::V3D& A) const /** Calcualates the side that the point is on @param A :: test point @@ -225,7 +228,7 @@ Plane::side(const Geometry::V3D& A) const } int -Plane::onSurface(const Geometry::V3D& A) const +Plane::onSurface(const Kernel::V3D& A) const /** Calcuate the side that the point is on and returns success if it is on the surface. diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/Quadratic.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/Quadratic.cpp index 568e5dfcfd9..a5b250a5501 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/Quadratic.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/Quadratic.cpp @@ -14,10 +14,10 @@ #include <boost/multi_array.hpp> #include <gsl/gsl_poly.h> -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Math/PolyBase.h" #include "MantidGeometry/Surfaces/BaseVisit.h" #include "MantidGeometry/Surfaces/Surface.h" @@ -31,11 +31,11 @@ namespace Mantid namespace Geometry { + using Kernel::Tolerance; + using Kernel::V3D; Kernel::Logger& Quadratic::PLog(Kernel::Logger::get("Quadratic")); -/// Numerical tolerance -//const double QTolerance(1e-6); Quadratic::Quadratic() : Surface(), BaseEqn(10) @@ -77,7 +77,7 @@ Quadratic::~Quadratic() double -Quadratic::eqnValue(const Geometry::V3D& Pt) const +Quadratic::eqnValue(const Kernel::V3D& Pt) const /** Helper function to calcuate the value of the equation at a fixed point @@ -101,7 +101,7 @@ Quadratic::eqnValue(const Geometry::V3D& Pt) const } int -Quadratic::side(const Geometry::V3D& Pt) const +Quadratic::side(const Kernel::V3D& Pt) const /** Determine if the the Point is true to the surface or on the other side @@ -118,8 +118,8 @@ Quadratic::side(const Geometry::V3D& Pt) const } -Geometry::V3D -Quadratic::surfaceNormal(const Geometry::V3D& Pt) const +Kernel::V3D +Quadratic::surfaceNormal(const Kernel::V3D& Pt) const /** Given a point on the surface Calculate the normal at the point @@ -129,7 +129,7 @@ Quadratic::surfaceNormal(const Geometry::V3D& Pt) const @return normal unit vector */ { - Geometry::V3D N(2*BaseEqn[0]*Pt[0]+BaseEqn[3]*Pt[1]+BaseEqn[4]*Pt[2]+BaseEqn[6], + Kernel::V3D N(2*BaseEqn[0]*Pt[0]+BaseEqn[3]*Pt[1]+BaseEqn[4]*Pt[2]+BaseEqn[6], 2*BaseEqn[1]*Pt[1]+BaseEqn[3]*Pt[0]+BaseEqn[5]*Pt[2]+BaseEqn[7], 2*BaseEqn[2]*Pt[2]+BaseEqn[4]*Pt[0]+BaseEqn[5]*Pt[1]+BaseEqn[8]); N.normalize(); @@ -137,8 +137,8 @@ Quadratic::surfaceNormal(const Geometry::V3D& Pt) const } void -Quadratic::matrixForm(Geometry::Matrix<double>& A, - Geometry::V3D& B,double& C) const +Quadratic::matrixForm(Kernel::Matrix<double>& A, + Kernel::V3D& B,double& C) const /** Converts the baseEqn into the matrix form such that \f[ x^T A x + B^T x + C =0 \f] @@ -162,7 +162,7 @@ Quadratic::matrixForm(Geometry::Matrix<double>& A, } double -Quadratic::distance(const Geometry::V3D& Pt) const +Quadratic::distance(const Kernel::V3D& Pt) const /** Proper calcuation of a point to a general surface @param Pt :: Point to calculate distance from surace @@ -170,22 +170,22 @@ Quadratic::distance(const Geometry::V3D& Pt) const */ { // Job 1 :: Create matrix and vector representation - Geometry::Matrix<double> A(3,3); - Geometry::V3D B; + Kernel::Matrix<double> A(3,3); + Kernel::V3D B; double cc; matrixForm(A,B,cc); //Job 2 :: calculate the diagonal matrix - Geometry::Matrix<double> D(3,3); - Geometry::Matrix<double> R(3,3); + Kernel::Matrix<double> D(3,3); + Kernel::Matrix<double> R(3,3); if (!A.Diagonalise(R,D)) { std::cerr<<"Problem with matrix :: distance now guessed at"<<std::endl; return distance(Pt); } - Geometry::V3D alpha=R.Tprime()*Pt; - Geometry::V3D beta=R.Tprime()*B; + Kernel::V3D alpha=R.Tprime()*Pt; + Kernel::V3D beta=R.Tprime()*B; // Calculate fundermental equation: const double aa(alpha[0]); const double aa2(aa*aa); @@ -258,7 +258,7 @@ Quadratic::distance(const Geometry::V3D& Pt) const return -1.0; double Out= -1; - Geometry::V3D xvec; + Kernel::V3D xvec; std::vector<double>::const_iterator vc; for(vc=TRange.begin();vc!=TRange.end();vc++) { @@ -267,7 +267,7 @@ Quadratic::distance(const Geometry::V3D& Pt) const const double dcI=1.0+2* (*vc) *dc; if ((daI*daI)>Tolerance || ((dbI*dbI)>Tolerance && (dcI*dcI)<Tolerance) ) { - Geometry::Matrix<double> DI(3,3); + Kernel::Matrix<double> DI(3,3); DI[0][0]=1.0/daI; DI[1][1]=1.0/dbI; DI[2][2]=1.0/dcI; @@ -281,7 +281,7 @@ Quadratic::distance(const Geometry::V3D& Pt) const } int -Quadratic::onSurface(const Geometry::V3D& Pt) const +Quadratic::onSurface(const Kernel::V3D& Pt) const /** Test to see if a point is on the surface @param Pt :: Point to test @@ -294,7 +294,7 @@ Quadratic::onSurface(const Geometry::V3D& Pt) const void -Quadratic::displace(const Geometry::V3D& Pt) +Quadratic::displace(const Kernel::V3D& Pt) /** Apply a general displacement to the surface @param Pt :: Point to add to surface coordinate @@ -313,13 +313,13 @@ Quadratic::displace(const Geometry::V3D& Pt) } void -Quadratic::rotate(const Geometry::Matrix<double>& MX) +Quadratic::rotate(const Kernel::Matrix<double>& MX) /** Rotate the surface by matrix MX @param MX :: Matrix for rotation (not inverted like MCNPX) */ { - Geometry::Matrix<double> MA=MX; + Kernel::Matrix<double> MA=MX; MA.Invert(); const double a(MA[0][0]),b(MA[0][1]),c(MA[0][2]); const double d(MA[1][0]),e(MA[1][1]),f(MA[1][2]); diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/Sphere.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/Sphere.cpp index b6dcc3ec3d8..f1818ce6b0c 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/Sphere.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/Sphere.cpp @@ -1,13 +1,15 @@ #include "MantidGeometry/Surfaces/Sphere.h" #include "MantidKernel/Logger.h" #include "MantidKernel/Strings.h" -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" namespace Mantid { namespace Geometry { + using Kernel::Tolerance; + using Kernel::V3D; Kernel::Logger& Sphere::PLog(Kernel::Logger::get("Sphere")); @@ -112,7 +114,7 @@ namespace Mantid if (!Mantid::Kernel::Strings::section(Line,R)) return -7; - Centre=Geometry::V3D(cent); + Centre=Kernel::V3D(cent); Radius=R; setBaseEqn(); return 0; @@ -120,7 +122,7 @@ namespace Mantid int - Sphere::side(const Geometry::V3D& Pt) const + Sphere::side(const Kernel::V3D& Pt) const /** Calculate where the point Pt is relative to the sphere. @@ -141,7 +143,7 @@ namespace Mantid } int - Sphere::onSurface(const Geometry::V3D& Pt) const + Sphere::onSurface(const Kernel::V3D& Pt) const /** Calculate if the point Pt on the surface of the sphere (within tolerance CTolerance) @@ -157,7 +159,7 @@ namespace Mantid } double - Sphere::distance(const Geometry::V3D& Pt) const + Sphere::distance(const Kernel::V3D& Pt) const /** Determine the shortest distance from the Surface to the Point. @@ -165,13 +167,13 @@ namespace Mantid @return distance (Positive only) */ { - const Geometry::V3D disp_vec = Pt - Centre; + const Kernel::V3D disp_vec = Pt - Centre; return std::abs(disp_vec.norm() - Radius); } void - Sphere::displace(const Geometry::V3D& Pt) + Sphere::displace(const Kernel::V3D& Pt) /** Apply a shift of the centre @param Pt :: distance to add to the centre @@ -183,7 +185,7 @@ namespace Mantid } void - Sphere::rotate(const Geometry::Matrix<double>& MA) + Sphere::rotate(const Kernel::Matrix<double>& MA) /** Apply a Rotation matrix @param MA :: matrix to rotate by @@ -200,12 +202,12 @@ namespace Mantid Compute the distance between the given point and the centre of the sphere @param pt :: The chosen point */ - const Geometry::V3D displace_vec = pt - Centre; + const Kernel::V3D displace_vec = pt - Centre; return displace_vec.norm(); } void - Sphere::setCentre(const Geometry::V3D& A) + Sphere::setCentre(const Kernel::V3D& A) /** Set the centre point @param A :: New Centre Point @@ -248,7 +250,7 @@ namespace Mantid std::ostringstream cx; Quadratic::writeHeader(cx); cx.precision(Surface::Nprecision); - if (Centre.distance(Geometry::V3D(0,0,0))<Tolerance) + if (Centre.distance(Kernel::V3D(0,0,0))<Tolerance) { cx<<"so "<<Radius; } diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/Surface.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/Surface.cpp index 22dc23edc6b..3a22e9264b9 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/Surface.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/Surface.cpp @@ -16,8 +16,8 @@ #include "MantidKernel/Strings.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Math/PolyBase.h" #include "MantidGeometry/Surfaces/BaseVisit.h" #include "MantidGeometry/Surfaces/Surface.h" @@ -68,7 +68,7 @@ Surface::~Surface() {} int -Surface::side(const Geometry::V3D&) const +Surface::side(const Kernel::V3D&) const /// Surface side : throw AbsObjMethod { throw Kernel::Exception::AbsObjMethod("Surface::side"); diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/SurfaceFactory.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/SurfaceFactory.cpp index ff77e114955..5c1a6362b12 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/SurfaceFactory.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/SurfaceFactory.cpp @@ -13,8 +13,8 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/Exception.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/Strings.h" #include "MantidGeometry/Surfaces/BaseVisit.h" #include "MantidGeometry/Surfaces/Surface.h" diff --git a/Code/Mantid/Framework/Geometry/src/Surfaces/Torus.cpp b/Code/Mantid/Framework/Geometry/src/Surfaces/Torus.cpp index 191efc5dbf1..616386f2828 100644 --- a/Code/Mantid/Framework/Geometry/src/Surfaces/Torus.cpp +++ b/Code/Mantid/Framework/Geometry/src/Surfaces/Torus.cpp @@ -13,9 +13,9 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/Strings.h" #include "MantidKernel/Exception.h" -#include "MantidGeometry/Tolerance.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Tolerance.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/BaseVisit.h" #include "MantidGeometry/Surfaces/Surface.h" #include "MantidGeometry/Surfaces/Torus.h" @@ -25,8 +25,10 @@ namespace Mantid namespace Geometry { + using Kernel::Tolerance; + using Kernel::V3D; -Kernel::Logger& Torus::PLog( Kernel::Logger::get("Torus")); + Kernel::Logger& Torus::PLog( Kernel::Logger::get("Torus")); Torus::Torus() : Surface(), Centre(), Normal(1,0,0), @@ -121,11 +123,11 @@ Torus::operator==(const Torus& A) const @param A :: string for input and output. @return 1 on success 0 on failure */ -int sectionV3D(std::string& A,Mantid::Geometry::V3D& out) +int sectionV3D(std::string& A,Mantid::Kernel::V3D& out) { if (A.empty()) return 0; std::istringstream cx; - Mantid::Geometry::V3D retval; + Mantid::Kernel::V3D retval; cx.str(A); cx.clear(); cx>>retval; @@ -167,9 +169,9 @@ Torus::setSurface(const std::string& Pstr) if (ptype<0 || ptype>=3) return errAxis; - Geometry::V3D Norm; - Geometry::V3D Cent; - Geometry::V3D PtVec; + Kernel::V3D Norm; + Kernel::V3D Cent; + Kernel::V3D PtVec; Norm[ptype]=1.0; // Torus on X/Y/Z axis @@ -186,7 +188,7 @@ Torus::setSurface(const std::string& Pstr) } void -Torus::rotate(const Geometry::Matrix<double>& R) +Torus::rotate(const Kernel::Matrix<double>& R) /** Rotate both the centre and the normal direction @param R :: Matrix for rotation. @@ -198,7 +200,7 @@ Torus::rotate(const Geometry::Matrix<double>& R) } void -Torus::displace(const Geometry::V3D& A) +Torus::displace(const Kernel::V3D& A) /** Displace the centre Only need to update the centre position @@ -210,7 +212,7 @@ Torus::displace(const Geometry::V3D& A) } void -Torus::setCentre(const Geometry::V3D& A) +Torus::setCentre(const Kernel::V3D& A) /** Sets the central point and the Base Equation @param A :: New Centre point @@ -221,7 +223,7 @@ Torus::setCentre(const Geometry::V3D& A) } void -Torus::setNorm(const Geometry::V3D& A) +Torus::setNorm(const Kernel::V3D& A) /** Sets the Normal and the Base Equation @param A :: New Normal direction @@ -235,8 +237,8 @@ Torus::setNorm(const Geometry::V3D& A) return; } -Geometry::V3D -Torus::surfaceNormal(const Geometry::V3D& Pt) const +Kernel::V3D +Torus::surfaceNormal(const Kernel::V3D& Pt) const /** Get the normal at a point @param Pt :: The Point of interest @@ -250,7 +252,7 @@ Torus::surfaceNormal(const Geometry::V3D& Pt) const double -Torus::distance(const Geometry::V3D& Pt) const +Torus::distance(const Kernel::V3D& Pt) const /** Calculates the distance from the point to the Torus does not calculate the point on the Torusthat is closest @@ -262,7 +264,7 @@ Torus::distance(const Geometry::V3D& Pt) const @return distance to Pt */ { - const Geometry::V3D Px=Pt-Centre; + const Kernel::V3D Px=Pt-Centre; // test is the centre to point distance is zero if(Px.norm()<Tolerance) return Px.norm(); @@ -270,7 +272,7 @@ Torus::distance(const Geometry::V3D& Pt) const } int -Torus::side(const Geometry::V3D& R) const +Torus::side(const Kernel::V3D& R) const /** Calculate if the point R is within @@ -288,7 +290,7 @@ Torus::side(const Geometry::V3D& R) const } int -Torus::onSurface(const Geometry::V3D& R) const +Torus::onSurface(const Kernel::V3D& R) const { /** Calculate if the point R is on diff --git a/Code/Mantid/Framework/Geometry/test/AcompTest.h b/Code/Mantid/Framework/Geometry/test/AcompTest.h index b2cb7f4bd32..b5dc44c2169 100644 --- a/Code/Mantid/Framework/Geometry/test/AcompTest.h +++ b/Code/Mantid/Framework/Geometry/test/AcompTest.h @@ -3,7 +3,7 @@ #include <cxxtest/TestSuite.h> #include <cmath> #include <vector> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Math/Acomp.h" using namespace Mantid; diff --git a/Code/Mantid/Framework/Geometry/test/AlgebraTest.h b/Code/Mantid/Framework/Geometry/test/AlgebraTest.h index 43f191216fd..01e5a6a38fd 100644 --- a/Code/Mantid/Framework/Geometry/test/AlgebraTest.h +++ b/Code/Mantid/Framework/Geometry/test/AlgebraTest.h @@ -7,7 +7,7 @@ #include <vector> #include <algorithm> -//#include "MantidGeometry/Math/Matrix.h" +//#include "MantidKernel/Matrix.h" #include "MantidGeometry/Math/Algebra.h" using namespace Mantid::Geometry; diff --git a/Code/Mantid/Framework/Geometry/test/BnIdTest.h b/Code/Mantid/Framework/Geometry/test/BnIdTest.h index 3a817e6e883..689ea4b1beb 100644 --- a/Code/Mantid/Framework/Geometry/test/BnIdTest.h +++ b/Code/Mantid/Framework/Geometry/test/BnIdTest.h @@ -3,7 +3,7 @@ #include <cxxtest/TestSuite.h> #include <cmath> #include <vector> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Math/BnId.h" using namespace Mantid; diff --git a/Code/Mantid/Framework/Geometry/test/BoundingBoxTest.h b/Code/Mantid/Framework/Geometry/test/BoundingBoxTest.h index 52c2d50bdce..6c138da176d 100644 --- a/Code/Mantid/Framework/Geometry/test/BoundingBoxTest.h +++ b/Code/Mantid/Framework/Geometry/test/BoundingBoxTest.h @@ -9,6 +9,7 @@ using namespace Mantid; using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; /** * BoundingBox Unit test @@ -275,7 +276,7 @@ private: // Origin TS_ASSERT_EQUALS(bbox.isPointInside(V3D(0.0,0.0,0.0)), true); - const double tol = Mantid::Geometry::Tolerance; + const double tol = Mantid::Kernel::Tolerance; /// The test is a strictly less-than test so when outside we need slighly more than the tolerance to be truely outside double singleDimValue = insideTest ? unit-tol : unit+tol+0.01*tol; // Near, but inside, +X-edge diff --git a/Code/Mantid/Framework/Geometry/test/CompAssemblyTest.h b/Code/Mantid/Framework/Geometry/test/CompAssemblyTest.h index b0d40c9a857..c39e0183269 100644 --- a/Code/Mantid/Framework/Geometry/test/CompAssemblyTest.h +++ b/Code/Mantid/Framework/Geometry/test/CompAssemblyTest.h @@ -6,12 +6,14 @@ #include <iostream> #include <string> #include "MantidGeometry/Instrument/CompAssembly.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include "MantidTestHelpers/ComponentCreationHelper.h" using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; class CompAssemblyTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/ComponentTest.h b/Code/Mantid/Framework/Geometry/test/ComponentTest.h index 0b6cd4d8c1d..5188293604a 100644 --- a/Code/Mantid/Framework/Geometry/test/ComponentTest.h +++ b/Code/Mantid/Framework/Geometry/test/ComponentTest.h @@ -6,11 +6,13 @@ #include <iostream> #include <string> #include "MantidGeometry/Instrument/Component.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include "MantidKernel/Exception.h" using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; class ComponentTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/ConeTest.h b/Code/Mantid/Framework/Geometry/test/ConeTest.h index 5d87e0156a7..2753b953a51 100644 --- a/Code/Mantid/Framework/Geometry/test/ConeTest.h +++ b/Code/Mantid/Framework/Geometry/test/ConeTest.h @@ -3,13 +3,13 @@ #include <cxxtest/TestSuite.h> #include <cmath> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/Cone.h" using namespace Mantid; using namespace Geometry; - +using Mantid::Kernel::V3D; class ConeTest: public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/CylinderTest.h b/Code/Mantid/Framework/Geometry/test/CylinderTest.h index 82762101f42..dc020c2be24 100644 --- a/Code/Mantid/Framework/Geometry/test/CylinderTest.h +++ b/Code/Mantid/Framework/Geometry/test/CylinderTest.h @@ -7,11 +7,12 @@ #include <algorithm> #include <sstream> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Cylinder.h" using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; class CylinderTest: public CxxTest::TestSuite { @@ -188,7 +189,7 @@ public: std::vector<std::string> CylStr; CylStr.push_back("cx 1"); // Cylinder origin CylStr.push_back("c/x 1.0 1.0 1.0"); // also cylinder at ?origin? - Geometry::V3D P(0,-1.2,0); + Kernel::V3D P(0,-1.2,0); double results[]={ 1.2-1, 1.41661 }; std::vector<std::string>::const_iterator vc; diff --git a/Code/Mantid/Framework/Geometry/test/DetectorGroupTest.h b/Code/Mantid/Framework/Geometry/test/DetectorGroupTest.h index 3422bf372b1..b5ae831ae69 100644 --- a/Code/Mantid/Framework/Geometry/test/DetectorGroupTest.h +++ b/Code/Mantid/Framework/Geometry/test/DetectorGroupTest.h @@ -9,6 +9,8 @@ using namespace Mantid::Geometry; using namespace Mantid; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; class DetectorGroupTest : public CxxTest::TestSuite { @@ -55,17 +57,17 @@ public: } void testIdentRectShape(){ - Geometry::V3D center; + Kernel::V3D center; boost::shared_ptr<Mantid::Geometry::DetectorGroup> rectGroup = ComponentCreationHelper::createDetectorGroupWith5CylindricalDetectors(); TSM_ASSERT_EQUALS("should be rectangular shape",rect,rectGroup->getTopology(center)); } void testIdentRectShapeWithGaps(){ - Geometry::V3D center; + Kernel::V3D center; boost::shared_ptr<Mantid::Geometry::DetectorGroup> rectGroup = ComponentCreationHelper::createDetectorGroupWithNCylindricalDetectorsWithGaps(4,0.0); TSM_ASSERT_EQUALS("should be rectangular shape",rect,rectGroup->getTopology(center)); } void testIdentRingShape(){ - Geometry::V3D center; + Kernel::V3D center; boost::shared_ptr<Mantid::Geometry::DetectorGroup> rectGroup = ComponentCreationHelper::createRingOfCylindricalDetectors(); TSM_ASSERT_EQUALS("should be ring shape",cyl,rectGroup->getTopology(center)); } diff --git a/Code/Mantid/Framework/Geometry/test/DetectorTest.h b/Code/Mantid/Framework/Geometry/test/DetectorTest.h index 5e60b0d1a01..9a706b3c8a4 100644 --- a/Code/Mantid/Framework/Geometry/test/DetectorTest.h +++ b/Code/Mantid/Framework/Geometry/test/DetectorTest.h @@ -7,6 +7,8 @@ #include "MantidGeometry/Instrument/Component.h" using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; class DetectorTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/GeneralTest.h b/Code/Mantid/Framework/Geometry/test/GeneralTest.h index ad86d298a6c..8e72560376b 100644 --- a/Code/Mantid/Framework/Geometry/test/GeneralTest.h +++ b/Code/Mantid/Framework/Geometry/test/GeneralTest.h @@ -3,7 +3,7 @@ #include <cxxtest/TestSuite.h> #include <cmath> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/General.h" diff --git a/Code/Mantid/Framework/Geometry/test/GoniometerTest.h b/Code/Mantid/Framework/Geometry/test/GoniometerTest.h index 30e35b0978c..5d52211dbf9 100644 --- a/Code/Mantid/Framework/Geometry/test/GoniometerTest.h +++ b/Code/Mantid/Framework/Geometry/test/GoniometerTest.h @@ -6,8 +6,11 @@ #include <iostream> #include <stdexcept> #include <string> -#include "MantidGeometry/Quat.h" +#include "MantidKernel/Quat.h" using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; +using Mantid::Kernel::DblMatrix; class GoniometerTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/IndexingUtilsTest.h b/Code/Mantid/Framework/Geometry/test/IndexingUtilsTest.h index bc7e3581e93..84fa18a62fc 100644 --- a/Code/Mantid/Framework/Geometry/test/IndexingUtilsTest.h +++ b/Code/Mantid/Framework/Geometry/test/IndexingUtilsTest.h @@ -6,12 +6,14 @@ #include <MantidKernel/System.h> #include <iostream> #include <iomanip> -#include <MantidGeometry/V3D.h> -#include <MantidGeometry/Math/Matrix.h> +#include <MantidKernel/V3D.h> +#include <MantidKernel/Matrix.h> #include <MantidGeometry/Crystal/IndexingUtils.h> using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Matrix; class IndexingUtilsTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/InstrumentRayTracerTest.h b/Code/Mantid/Framework/Geometry/test/InstrumentRayTracerTest.h index dac5a566166..da7486ef4cf 100644 --- a/Code/Mantid/Framework/Geometry/test/InstrumentRayTracerTest.h +++ b/Code/Mantid/Framework/Geometry/test/InstrumentRayTracerTest.h @@ -5,7 +5,7 @@ #include "MantidDataObjects/Workspace2D.h" #include "MantidGeometry/Instrument/RectangularDetector.h" #include "MantidGeometry/Objects/InstrumentRayTracer.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/ConfigService.h" #include "MantidTestHelpers/AlgorithmHelper.h" #include "MantidTestHelpers/ComponentCreationHelper.h" @@ -16,6 +16,7 @@ using namespace Mantid::Geometry; using Mantid::DataObjects::Workspace2D_sptr; using Mantid::API::AnalysisDataService; +using Mantid::Kernel::V3D; //------------------------------------------------------------- // Test suite diff --git a/Code/Mantid/Framework/Geometry/test/LineIntersectVisitTest.h b/Code/Mantid/Framework/Geometry/test/LineIntersectVisitTest.h index 659a8c812df..448aafecbc6 100644 --- a/Code/Mantid/Framework/Geometry/test/LineIntersectVisitTest.h +++ b/Code/Mantid/Framework/Geometry/test/LineIntersectVisitTest.h @@ -2,7 +2,7 @@ #define MANTID_LINEINTERSECTVISITTEST__ #include <cxxtest/TestSuite.h> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/Line.h" #include "MantidGeometry/Surfaces/LineIntersectVisit.h" @@ -13,13 +13,14 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; class LineIntersectVisitTest: public CxxTest::TestSuite{ public: void testConstructor(){ LineIntersectVisit A(V3D(-1.0,-1.0,-1.0),V3D(1.0,0.0,0.0)); TS_ASSERT_EQUALS(A.getNPoints(),0); - TS_ASSERT_EQUALS(A.getPoints(),std::vector<Geometry::V3D>()); + TS_ASSERT_EQUALS(A.getPoints(),std::vector<Kernel::V3D>()); TS_ASSERT_EQUALS(A.getDistance(),std::vector<double>()); } @@ -30,7 +31,7 @@ public: TS_ASSERT_EQUALS(extractString(B),"-1 px 0\n"); A.Accept(B); TS_ASSERT_EQUALS(A.getNPoints(),1); - std::vector<Geometry::V3D> Pnts; + std::vector<Kernel::V3D> Pnts; Pnts.push_back(V3D(0.0,-1.0,-1.0)); TS_ASSERT_EQUALS(A.getPoints(),Pnts); std::vector<double> Dist; diff --git a/Code/Mantid/Framework/Geometry/test/LineTest.h b/Code/Mantid/Framework/Geometry/test/LineTest.h index 72a18c5ee6d..b0a2f59dc0f 100644 --- a/Code/Mantid/Framework/Geometry/test/LineTest.h +++ b/Code/Mantid/Framework/Geometry/test/LineTest.h @@ -3,7 +3,7 @@ #include <cxxtest/TestSuite.h> #include <cmath> #include <vector> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/Line.h" #include "MantidGeometry/Surfaces/Cylinder.h" @@ -12,6 +12,8 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Matrix; class LineTest: public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/Geometry/test/MDDimensionTest.h b/Code/Mantid/Framework/Geometry/test/MDDimensionTest.h index c9d9f04d988..ae900f33869 100644 --- a/Code/Mantid/Framework/Geometry/test/MDDimensionTest.h +++ b/Code/Mantid/Framework/Geometry/test/MDDimensionTest.h @@ -8,6 +8,8 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; + // test class for dimension; The dimensions are internal classes for MD geometry; class tDimension: public MDDimension { diff --git a/Code/Mantid/Framework/Geometry/test/MDGeometryBasisTest.h b/Code/Mantid/Framework/Geometry/test/MDGeometryBasisTest.h index 22d604260c3..9996bb7d558 100644 --- a/Code/Mantid/Framework/Geometry/test/MDGeometryBasisTest.h +++ b/Code/Mantid/Framework/Geometry/test/MDGeometryBasisTest.h @@ -10,7 +10,7 @@ using namespace Mantid; using namespace Geometry; - +using Mantid::Kernel::V3D; class MDGeometryBasisTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/MDGeometryDescriptionTest.h b/Code/Mantid/Framework/Geometry/test/MDGeometryDescriptionTest.h index 67fffdb85b7..e6aed7b79b5 100644 --- a/Code/Mantid/Framework/Geometry/test/MDGeometryDescriptionTest.h +++ b/Code/Mantid/Framework/Geometry/test/MDGeometryDescriptionTest.h @@ -6,6 +6,8 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::DblMatrix; + class MDGeometryDescriptionTest: public CxxTest::TestSuite { MDGeometryDescription *pSlice; diff --git a/Code/Mantid/Framework/Geometry/test/MDGeometryTest.h b/Code/Mantid/Framework/Geometry/test/MDGeometryTest.h index 846abe2edfe..ce93edfb985 100644 --- a/Code/Mantid/Framework/Geometry/test/MDGeometryTest.h +++ b/Code/Mantid/Framework/Geometry/test/MDGeometryTest.h @@ -16,8 +16,10 @@ #include <Poco/Path.h> #include <cfloat> - +using Mantid::Kernel::V3D; +using Mantid::Kernel::DblMatrix; using namespace Mantid::Geometry; + class testMDGeometry: public MDGeometry { public: diff --git a/Code/Mantid/Framework/Geometry/test/MDPointTest.h b/Code/Mantid/Framework/Geometry/test/MDPointTest.h index 57a0345a3ce..e1f9f714b15 100644 --- a/Code/Mantid/Framework/Geometry/test/MDPointTest.h +++ b/Code/Mantid/Framework/Geometry/test/MDPointTest.h @@ -6,7 +6,7 @@ #include "MantidGeometry/Instrument/Detector.h" #include "MantidGeometry/Instrument/Instrument.h" #include "MantidGeometry/IComponent.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <boost/scoped_ptr.hpp> class MDPointTest : public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/Geometry/test/MapSupportTest.h b/Code/Mantid/Framework/Geometry/test/MapSupportTest.h index ce3532d210b..7c9b230dc7c 100644 --- a/Code/Mantid/Framework/Geometry/test/MapSupportTest.h +++ b/Code/Mantid/Framework/Geometry/test/MapSupportTest.h @@ -3,7 +3,7 @@ #include <cxxtest/TestSuite.h> #include <cmath> #include <vector> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Math/MapSupport.h" #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" diff --git a/Code/Mantid/Framework/Geometry/test/MathSupportTest.h b/Code/Mantid/Framework/Geometry/test/MathSupportTest.h index fbf89c4948d..2ee12665bd9 100644 --- a/Code/Mantid/Framework/Geometry/test/MathSupportTest.h +++ b/Code/Mantid/Framework/Geometry/test/MathSupportTest.h @@ -18,44 +18,6 @@ using namespace mathSupport; class MathSupportTest: public CxxTest::TestSuite { public: - void testIndexSort(){ - //Test double - std::vector<double> udArray; - std::vector<int> sdArray,cdArray; - udArray.push_back(3.3); - udArray.push_back(4.4); - udArray.push_back(2.2); - udArray.push_back(5.5); - udArray.push_back(1.1); - udArray.push_back(5.4999999999999999999); - indexSort(udArray,sdArray); - cdArray.push_back(4); - cdArray.push_back(2); - cdArray.push_back(0); - cdArray.push_back(1); - cdArray.push_back(3); - cdArray.push_back(5); - TS_ASSERT_EQUALS(sdArray,cdArray); - - std::vector<int> uiArray; - std::vector<int> siArray,ciArray; - uiArray.push_back(3); - uiArray.push_back(4); - uiArray.push_back(2); - uiArray.push_back(5); - uiArray.push_back(1); - indexSort(uiArray,siArray); - ciArray.push_back(4); - ciArray.push_back(2); - ciArray.push_back(0); - ciArray.push_back(1); - ciArray.push_back(3); - TS_ASSERT_EQUALS(siArray,ciArray); - - std::vector<int> uzArray,szArray; - indexSort(uzArray,szArray); - TS_ASSERT_EQUALS(uzArray,szArray); - } void testSolveQuadratic(){ //Test quadratic solution double xp1w2[3]={1,2,1}; //(x+1)^2 one solution diff --git a/Code/Mantid/Framework/Geometry/test/NearestNeighboursTest.h b/Code/Mantid/Framework/Geometry/test/NearestNeighboursTest.h index 3b3055dda54..4eae1c9c1c5 100644 --- a/Code/Mantid/Framework/Geometry/test/NearestNeighboursTest.h +++ b/Code/Mantid/Framework/Geometry/test/NearestNeighboursTest.h @@ -16,6 +16,7 @@ using namespace Mantid; using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; /** * Everything must be in one test or the instrument/detector list goes AWOL. diff --git a/Code/Mantid/Framework/Geometry/test/ObjCompAssemblyTest.h b/Code/Mantid/Framework/Geometry/test/ObjCompAssemblyTest.h index 9194ce9a202..7a077e90d23 100644 --- a/Code/Mantid/Framework/Geometry/test/ObjCompAssemblyTest.h +++ b/Code/Mantid/Framework/Geometry/test/ObjCompAssemblyTest.h @@ -6,14 +6,16 @@ #include <iostream> #include <string> #include "MantidGeometry/Instrument/ObjCompAssembly.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include "MantidGeometry/Objects/ShapeFactory.h" #include "MantidGeometry/Objects/Object.h" #include "MantidKernel/Exception.h" using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; class ObjCompAssemblyTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/ObjectTest.h b/Code/Mantid/Framework/Geometry/test/ObjectTest.h index cd40a2281f7..91783e1a9dd 100644 --- a/Code/Mantid/Framework/Geometry/test/ObjectTest.h +++ b/Code/Mantid/Framework/Geometry/test/ObjectTest.h @@ -11,7 +11,7 @@ #include <boost/shared_ptr.hpp> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Surfaces/Cylinder.h" #include "MantidGeometry/Surfaces/Sphere.h" @@ -24,6 +24,7 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; class ObjectTest: public CxxTest::TestSuite { @@ -345,8 +346,8 @@ public: object2.setObject(4,ObjB); object2.populate(SMap); - Track TL(Geometry::V3D(-5,0,0), - Geometry::V3D(1,0,0)); + Track TL(Kernel::V3D(-5,0,0), + Kernel::V3D(1,0,0)); // CARE: This CANNOT be called twice TS_ASSERT(object1.interceptSurface(TL)!=0); @@ -377,7 +378,7 @@ public: object2.setObject(4,ObjB); object2.populate(SMap); - Track TL(Geometry::V3D(-5,0,0), Geometry::V3D(1,0,0)); + Track TL(Kernel::V3D(-5,0,0), Kernel::V3D(1,0,0)); // CARE: This CANNOT be called twice TS_ASSERT(object1.interceptSurface(TL)!=0); @@ -409,8 +410,8 @@ public: object2.setObject(4,ObjB); object2.populate(SMap); - Track TL(Geometry::V3D(-5,0,0), - Geometry::V3D(1,0,0)); + Track TL(Kernel::V3D(-5,0,0), + Kernel::V3D(1,0,0)); // CARE: This CANNOT be called twice TS_ASSERT(object1.interceptSurface(TL)!=0); @@ -441,7 +442,7 @@ public: object2.setObject(4,ObjB); object2.populate(SMap); - Track TL(Geometry::V3D(-5,0,0), Geometry::V3D(1,0,0)); + Track TL(Kernel::V3D(-5,0,0), Kernel::V3D(1,0,0)); // CARE: This CANNOT be called twice @@ -473,8 +474,8 @@ public: object2.setObject(4,ObjB); object2.populate(SMap); - Track TL(Geometry::V3D(-5,0,0), - Geometry::V3D(0,1,0)); + Track TL(Kernel::V3D(-5,0,0), + Kernel::V3D(0,1,0)); // CARE: This CANNOT be called twice @@ -492,7 +493,7 @@ public: { Object_sptr geom_obj = createUnitCube(); // initial guess in object - Geometry::V3D pt; + Kernel::V3D pt; TS_ASSERT_EQUALS(geom_obj->getPointInObject(pt),1); TS_ASSERT_EQUALS(pt,V3D(0,0,0)); // initial guess not in object, but on x-axis diff --git a/Code/Mantid/Framework/Geometry/test/OrientedLatticeTest.h b/Code/Mantid/Framework/Geometry/test/OrientedLatticeTest.h index 6aeb8e27758..6449f83e2b5 100644 --- a/Code/Mantid/Framework/Geometry/test/OrientedLatticeTest.h +++ b/Code/Mantid/Framework/Geometry/test/OrientedLatticeTest.h @@ -4,10 +4,13 @@ #include <cxxtest/TestSuite.h> #include <iostream> #include <iomanip> -#include <MantidGeometry/Math/Matrix.h> +#include <MantidKernel/Matrix.h> #include <MantidGeometry/Crystal/OrientedLattice.h> using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::DblMatrix; +using Mantid::Kernel::Matrix; class OrientedLatticeTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/ParCompAssemblyTest.h b/Code/Mantid/Framework/Geometry/test/ParCompAssemblyTest.h index 0fadea9093a..e62dcfc0e3e 100644 --- a/Code/Mantid/Framework/Geometry/test/ParCompAssemblyTest.h +++ b/Code/Mantid/Framework/Geometry/test/ParCompAssemblyTest.h @@ -7,10 +7,12 @@ #include <string> #include "MantidGeometry/Instrument/CompAssembly.h" #include "MantidGeometry/Instrument/CompAssembly.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; class ParCompAssemblyTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/ParDetectorTest.h b/Code/Mantid/Framework/Geometry/test/ParDetectorTest.h index b77493a5807..48bacda4926 100644 --- a/Code/Mantid/Framework/Geometry/test/ParDetectorTest.h +++ b/Code/Mantid/Framework/Geometry/test/ParDetectorTest.h @@ -106,11 +106,11 @@ public: Detector det("det",0,0); ParameterMap_sptr pmap( new ParameterMap() ); - pmap->add("V3D", &det, "testparam", Mantid::Geometry::V3D(0.5, 1.0, 1.5)); + pmap->add("V3D", &det, "testparam", Mantid::Kernel::V3D(0.5, 1.0, 1.5)); Detector pdet(&det,pmap.get()); IDetector *idet = static_cast<IDetector*>(&pdet); - std::vector<Mantid::Geometry::V3D> pos = idet->getPositionParameter("testparam"); + std::vector<Mantid::Kernel::V3D> pos = idet->getPositionParameter("testparam"); TS_ASSERT_EQUALS(pos.size(), 1); TS_ASSERT_DELTA(pos[0].X(), 0.5, 1e-08); @@ -124,11 +124,11 @@ public: Detector det("det",0,0); ParameterMap_sptr pmap( new ParameterMap() ); - pmap->add("Quat", &det, "testparam", Mantid::Geometry::Quat(1.0, 0.25, 0.5, 0.75)); + pmap->add("Quat", &det, "testparam", Mantid::Kernel::Quat(1.0, 0.25, 0.5, 0.75)); Detector pdet(&det,pmap.get()); IDetector *idet = static_cast<IDetector*>(&pdet); - std::vector<Mantid::Geometry::Quat> rot = idet->getRotationParameter("testparam"); + std::vector<Mantid::Kernel::Quat> rot = idet->getRotationParameter("testparam"); TS_ASSERT_EQUALS(rot.size(), 1); TS_ASSERT_DELTA(rot[0].real(), 1.0, 1e-08); diff --git a/Code/Mantid/Framework/Geometry/test/ParObjCompAssemblyTest.h b/Code/Mantid/Framework/Geometry/test/ParObjCompAssemblyTest.h index 0690b8f8717..59a1778e5a7 100644 --- a/Code/Mantid/Framework/Geometry/test/ParObjCompAssemblyTest.h +++ b/Code/Mantid/Framework/Geometry/test/ParObjCompAssemblyTest.h @@ -9,10 +9,12 @@ #include "MantidGeometry/Instrument/ObjCompAssembly.h" #include "MantidGeometry/Objects/ShapeFactory.h" #include "MantidGeometry/Objects/Object.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; class ParObjCompAssemblyTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/ParametrizedComponentTest.h b/Code/Mantid/Framework/Geometry/test/ParametrizedComponentTest.h index 3c53b0b9def..5658e2ca7f9 100644 --- a/Code/Mantid/Framework/Geometry/test/ParametrizedComponentTest.h +++ b/Code/Mantid/Framework/Geometry/test/ParametrizedComponentTest.h @@ -7,12 +7,14 @@ #include <string> #include "MantidGeometry/Instrument/Component.h" #include "MantidGeometry/IComponent.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include "MantidKernel/Exception.h" using namespace Mantid; using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; /** This test used to refer to ParametrizedComponent, a * class that has (as of Nov 2010) been folded back into diff --git a/Code/Mantid/Framework/Geometry/test/PlaneTest.h b/Code/Mantid/Framework/Geometry/test/PlaneTest.h index 6c6284358dc..d1de354bf22 100644 --- a/Code/Mantid/Framework/Geometry/test/PlaneTest.h +++ b/Code/Mantid/Framework/Geometry/test/PlaneTest.h @@ -2,12 +2,14 @@ #define MANTID_PLANETEST__ #include <cxxtest/TestSuite.h> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/Plane.h" using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Matrix; class PlaneTest: public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/PolyTest.h b/Code/Mantid/Framework/Geometry/test/PolyTest.h index 6b84763afe6..290e2a42bc5 100644 --- a/Code/Mantid/Framework/Geometry/test/PolyTest.h +++ b/Code/Mantid/Framework/Geometry/test/PolyTest.h @@ -9,7 +9,7 @@ #include <sstream> #include "MantidGeometry/Math/PolyVar.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" using namespace Mantid; using namespace Geometry; diff --git a/Code/Mantid/Framework/Geometry/test/RectangularDetectorTest.h b/Code/Mantid/Framework/Geometry/test/RectangularDetectorTest.h index 8eb8f376fb2..45e068d090b 100644 --- a/Code/Mantid/Framework/Geometry/test/RectangularDetectorTest.h +++ b/Code/Mantid/Framework/Geometry/test/RectangularDetectorTest.h @@ -6,15 +6,17 @@ #include <iostream> #include <string> #include "MantidGeometry/Instrument/RectangularDetector.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Objects/BoundingBox.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/Quat.h" #include "MantidTestHelpers/ComponentCreationHelper.h" #include "MantidGeometry/Objects/ShapeFactory.h" using namespace Mantid; using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; class RectangularDetectorTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/RotCounterTest.h b/Code/Mantid/Framework/Geometry/test/RotCounterTest.h index 0455336ae9e..7ff34f7287c 100644 --- a/Code/Mantid/Framework/Geometry/test/RotCounterTest.h +++ b/Code/Mantid/Framework/Geometry/test/RotCounterTest.h @@ -3,7 +3,7 @@ #include <cxxtest/TestSuite.h> #include <cmath> #include <vector> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Math/RotCounter.h" using namespace Mantid; diff --git a/Code/Mantid/Framework/Geometry/test/RulesBoolValueTest.h b/Code/Mantid/Framework/Geometry/test/RulesBoolValueTest.h index 9a147712252..6cec6930d3e 100644 --- a/Code/Mantid/Framework/Geometry/test/RulesBoolValueTest.h +++ b/Code/Mantid/Framework/Geometry/test/RulesBoolValueTest.h @@ -6,7 +6,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" #include <cfloat> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/Rules.h" @@ -17,6 +17,7 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; //---------------------------------End of CompGrp---------------------------------------- class RulesBoolValueTest: public CxxTest::TestSuite{ diff --git a/Code/Mantid/Framework/Geometry/test/RulesCompGrpTest.h b/Code/Mantid/Framework/Geometry/test/RulesCompGrpTest.h index 6526f17a9b6..fa5e50c17dd 100644 --- a/Code/Mantid/Framework/Geometry/test/RulesCompGrpTest.h +++ b/Code/Mantid/Framework/Geometry/test/RulesCompGrpTest.h @@ -6,7 +6,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" #include <cfloat> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/Rules.h" @@ -17,6 +17,7 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; class RulesCompGrpTest: public CxxTest::TestSuite{ public: diff --git a/Code/Mantid/Framework/Geometry/test/RulesCompObjTest.h b/Code/Mantid/Framework/Geometry/test/RulesCompObjTest.h index 7e50df2e390..d90588aa669 100644 --- a/Code/Mantid/Framework/Geometry/test/RulesCompObjTest.h +++ b/Code/Mantid/Framework/Geometry/test/RulesCompObjTest.h @@ -6,7 +6,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" #include <cfloat> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/Rules.h" @@ -17,6 +17,7 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; class RulesCompObjTest: public CxxTest::TestSuite{ public: diff --git a/Code/Mantid/Framework/Geometry/test/RulesIntersectionTest.h b/Code/Mantid/Framework/Geometry/test/RulesIntersectionTest.h index 27c7e87d5c6..a09aaa9684a 100644 --- a/Code/Mantid/Framework/Geometry/test/RulesIntersectionTest.h +++ b/Code/Mantid/Framework/Geometry/test/RulesIntersectionTest.h @@ -6,7 +6,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" #include <cfloat> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/Rules.h" @@ -17,6 +17,7 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; class RulesIntersectionTest: public CxxTest::TestSuite{ public: diff --git a/Code/Mantid/Framework/Geometry/test/RulesSurfPointTest.h b/Code/Mantid/Framework/Geometry/test/RulesSurfPointTest.h index 5e9cf331309..bc370bea7a1 100644 --- a/Code/Mantid/Framework/Geometry/test/RulesSurfPointTest.h +++ b/Code/Mantid/Framework/Geometry/test/RulesSurfPointTest.h @@ -6,7 +6,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" #include <cfloat> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/Rules.h" @@ -17,6 +17,7 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; class RulesSurfPointTest: public CxxTest::TestSuite{ public: diff --git a/Code/Mantid/Framework/Geometry/test/RulesTest.h b/Code/Mantid/Framework/Geometry/test/RulesTest.h index 4af13ab002d..73b4d5f771a 100644 --- a/Code/Mantid/Framework/Geometry/test/RulesTest.h +++ b/Code/Mantid/Framework/Geometry/test/RulesTest.h @@ -6,7 +6,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" #include <cfloat> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/Rules.h" diff --git a/Code/Mantid/Framework/Geometry/test/RulesUnionTest.h b/Code/Mantid/Framework/Geometry/test/RulesUnionTest.h index e4b4dd514d7..1911396b5c4 100644 --- a/Code/Mantid/Framework/Geometry/test/RulesUnionTest.h +++ b/Code/Mantid/Framework/Geometry/test/RulesUnionTest.h @@ -6,7 +6,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" #include <cfloat> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/Rules.h" @@ -17,6 +17,7 @@ using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; class RulesUnionTest:public CxxTest::TestSuite{ public: diff --git a/Code/Mantid/Framework/Geometry/test/SphereTest.h b/Code/Mantid/Framework/Geometry/test/SphereTest.h index c2f254aeec8..ef80663fa1a 100644 --- a/Code/Mantid/Framework/Geometry/test/SphereTest.h +++ b/Code/Mantid/Framework/Geometry/test/SphereTest.h @@ -9,12 +9,13 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/Sphere.h" using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; class SphereTest: public CxxTest::TestSuite { @@ -221,8 +222,8 @@ public: std::vector<std::string> SphStr; SphStr.push_back("so 1"); // sphere origin SphStr.push_back("s 1.5 -2.5 1.8 1"); // sphere - Geometry::V3D P(3,7,4); - Geometry::V3D Q(0,0,4); + Kernel::V3D P(3,7,4); + Kernel::V3D Q(0,0,4); std::vector<std::string>::const_iterator vc; Sphere A; diff --git a/Code/Mantid/Framework/Geometry/test/SurfaceFactoryTest.h b/Code/Mantid/Framework/Geometry/test/SurfaceFactoryTest.h index 855c7c05791..fe8585b75fc 100644 --- a/Code/Mantid/Framework/Geometry/test/SurfaceFactoryTest.h +++ b/Code/Mantid/Framework/Geometry/test/SurfaceFactoryTest.h @@ -11,7 +11,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/Plane.h" #include "MantidGeometry/Surfaces/Sphere.h" diff --git a/Code/Mantid/Framework/Geometry/test/SurfaceTest.h b/Code/Mantid/Framework/Geometry/test/SurfaceTest.h index 0782e505c70..55d654c568c 100644 --- a/Code/Mantid/Framework/Geometry/test/SurfaceTest.h +++ b/Code/Mantid/Framework/Geometry/test/SurfaceTest.h @@ -11,7 +11,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/Sphere.h" #include "MantidGeometry/Surfaces/Cone.h" @@ -35,7 +35,7 @@ public: std::vector<std::string> ConeStr; ConeStr.push_back("kx 0 1"); // cone at origin ConeStr.push_back("k/x 0 0 0 1"); // also cone at origin - Geometry::V3D P(-1,-1.2,0); + Kernel::V3D P(-1,-1.2,0); const double results[]={sin(atan(1.2)-M_PI/4)*sqrt(2.44), sin(atan(1.2)-M_PI/4)*sqrt(2.44)}; diff --git a/Code/Mantid/Framework/Geometry/test/TorusTest.h b/Code/Mantid/Framework/Geometry/test/TorusTest.h index eecabab6776..ea79c804454 100644 --- a/Code/Mantid/Framework/Geometry/test/TorusTest.h +++ b/Code/Mantid/Framework/Geometry/test/TorusTest.h @@ -6,7 +6,7 @@ #include "MantidKernel/Logger.h" #include "MantidKernel/System.h" #include "MantidKernel/Exception.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Surfaces/Quadratic.h" #include "MantidGeometry/Surfaces/Torus.h" diff --git a/Code/Mantid/Framework/Geometry/test/TrackTest.h b/Code/Mantid/Framework/Geometry/test/TrackTest.h index e0f130bdff3..0e1ad153792 100644 --- a/Code/Mantid/Framework/Geometry/test/TrackTest.h +++ b/Code/Mantid/Framework/Geometry/test/TrackTest.h @@ -6,10 +6,12 @@ #include "MantidKernel/System.h" #include "MantidGeometry/Instrument/Component.h" #include "MantidGeometry/Objects/Track.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; + class TrackTest : public CxxTest::TestSuite { public: diff --git a/Code/Mantid/Framework/Geometry/test/UnitCellTest.h b/Code/Mantid/Framework/Geometry/test/UnitCellTest.h index 1aaa855107c..0a167f6a1c8 100644 --- a/Code/Mantid/Framework/Geometry/test/UnitCellTest.h +++ b/Code/Mantid/Framework/Geometry/test/UnitCellTest.h @@ -6,11 +6,15 @@ #include <MantidKernel/System.h> #include <iostream> #include <iomanip> -#include <MantidGeometry/Math/Matrix.h> +#include <MantidKernel/Matrix.h> #include <MantidGeometry/Crystal/UnitCell.h> using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::DblMatrix; +using Mantid::Kernel::Matrix; + class UnitCellTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Kernel/CMakeLists.txt b/Code/Mantid/Framework/Kernel/CMakeLists.txt index cac013dfaa2..06a814de921 100644 --- a/Code/Mantid/Framework/Kernel/CMakeLists.txt +++ b/Code/Mantid/Framework/Kernel/CMakeLists.txt @@ -30,6 +30,7 @@ set ( SRC_FILES src/MandatoryValidator.cpp src/MantidVersion.cpp src/MaskedProperty.cpp + src/Matrix.cpp src/Memory.cpp src/MersenneTwister.cpp src/NeutronAtom.cpp @@ -40,6 +41,7 @@ set ( SRC_FILES src/PropertyManager.cpp src/PropertyManagerOwner.cpp src/PropertyWithValue.cpp + src/Quat.cpp src/RebinParamsValidator.cpp src/RegexStrings.cpp src/SignalChannel.cpp @@ -57,6 +59,7 @@ set ( SRC_FILES src/UnitFactory.cpp src/UserStringParser.cpp src/Utils.cpp + src/V3D.cpp src/VectorHelper.cpp ) @@ -84,6 +87,7 @@ set ( INC_FILES inc/MantidKernel/CPUTimer.h inc/MantidKernel/Cache.h inc/MantidKernel/ConfigService.h + inc/MantidKernel/cow_ptr.h inc/MantidKernel/DataService.h inc/MantidKernel/DateAndTime.h inc/MantidKernel/DateValidator.h @@ -116,6 +120,7 @@ set ( INC_FILES inc/MantidKernel/MandatoryValidator.h inc/MantidKernel/MantidVersion.h inc/MantidKernel/MaskedProperty.h + inc/MantidKernel/Matrix.h inc/MantidKernel/Memory.h inc/MantidKernel/MersenneTwister.h inc/MantidKernel/MultiThreaded.h @@ -129,6 +134,7 @@ set ( INC_FILES inc/MantidKernel/PropertyManager.h inc/MantidKernel/PropertyManagerOwner.h inc/MantidKernel/PropertyWithValue.h + inc/MantidKernel/Quat.h inc/MantidKernel/RandomNumberGenerator.h inc/MantidKernel/RebinParamsValidator.h inc/MantidKernel/RegexStrings.h @@ -145,12 +151,13 @@ set ( INC_FILES inc/MantidKernel/TimeSeriesProperty.h inc/MantidKernel/TimeSplitter.h inc/MantidKernel/Timer.h + inc/MantidKernel/Tolerance.h inc/MantidKernel/Unit.h inc/MantidKernel/UnitFactory.h inc/MantidKernel/UserStringParser.h inc/MantidKernel/Utils.h + inc/MantidKernel/V3D.h inc/MantidKernel/VectorHelper.h - inc/MantidKernel/cow_ptr.h ) set ( TEST_FILES @@ -181,6 +188,7 @@ set ( TEST_FILES test/MagneticIonTest.h test/MandatoryValidatorTest.h test/MaskedPropertyTest.h + test/MatrixTest.h test/MemoryTest.h test/MersenneTwisterTest.h test/NeutronAtomTest.h @@ -191,6 +199,7 @@ set ( TEST_FILES test/PropertyManagerTest.h test/PropertyTest.h test/PropertyWithValueTest.h + test/QuatTest.h test/RandomNumberGeneratorTest.h test/RebinHistogramTest.h test/RebinParamsValidatorTest.h @@ -210,6 +219,7 @@ set ( TEST_FILES test/UnitTest.h test/UserStringParserTest.h test/UtilsTest.h + test/V3DTest.h ) if(UNITY_BUILD) diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Matrix.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Matrix.h similarity index 88% rename from Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Matrix.h rename to Code/Mantid/Framework/Kernel/inc/MantidKernel/Matrix.h index 9c82e3ceb98..fde223e04b0 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Math/Matrix.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Matrix.h @@ -1,7 +1,7 @@ -#ifndef MANTID_GEOMETRY_MATRIX_H_ -#define MANTID_GEOMETRY_MATRIX_H_ +#ifndef MANTID_KERNEL_MATRIX_H_ +#define MANTID_KERNEL_MATRIX_H_ -#include "MantidGeometry/DllConfig.h" +#include "MantidKernel/DllConfig.h" #include <vector> #include <cfloat> #include <ostream> @@ -9,7 +9,7 @@ namespace Mantid { - namespace Geometry + namespace Kernel { //------------------------------------------------------------------------- // Forward declarations @@ -153,19 +153,26 @@ namespace Mantid // Transform to a rotation matrix std::vector<T> toRotation(); private: - template<typename TYPE> friend std::ostream& operator<<(std::ostream&,const Geometry::Matrix<TYPE>&); - template<typename TYPE> friend std::istream& operator>>(std::istream&, Geometry::Matrix<TYPE>&); + template<typename TYPE> friend std::ostream& operator<<(std::ostream&,const Kernel::Matrix<TYPE>&); + template<typename TYPE> friend std::istream& operator>>(std::istream&, Kernel::Matrix<TYPE>&); }; + //------------------------------------------------------------------------- + // Typedefs + //------------------------------------------------------------------------- + /// A matrix of doubles + typedef Mantid::Kernel::Matrix<double> DblMatrix; + /// A matrix of ints + typedef Mantid::Kernel::Matrix<int> IntMatrix; + + //------------------------------------------------------------------------- + // Utility methods + //------------------------------------------------------------------------- template<typename T> - DLLExport std::ostream& operator<<(std::ostream&,const Geometry::Matrix<T>&); + DLLExport std::ostream& operator<<(std::ostream&,const Kernel::Matrix<T>&); template<typename T> - DLLExport std::istream& operator>>(std::istream&, Geometry::Matrix<T>&); + DLLExport std::istream& operator>>(std::istream&, Kernel::Matrix<T>&); - /// A matrix of doubles - typedef Mantid::Geometry::Matrix<double> DblMatrix; - /// A matrix of ints - typedef Mantid::Geometry::Matrix<int> IntMatrix; } } -#endif //MANTID_GEOMETRY_MATRIX_H_ +#endif //MANTID_KERNEL_MATRIX_H_ diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Quat.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Quat.h similarity index 81% rename from Code/Mantid/Framework/Geometry/inc/MantidGeometry/Quat.h rename to Code/Mantid/Framework/Kernel/inc/MantidKernel/Quat.h index 959c3d9486e..4e8823374a6 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Quat.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Quat.h @@ -1,19 +1,18 @@ -#ifndef MANTID_QUAT_H_ -#define MANTID_QUAT_H_ +#ifndef MANTID_KERNEL_QUAT_H_ +#define MANTID_KERNEL_QUAT_H_ +#include "MantidKernel/DllConfig.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/Logger.h" #include <iostream> #include <vector> -#include "MantidGeometry/DllConfig.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidKernel/Logger.h" namespace Mantid { - namespace Geometry + namespace Kernel { //Forward declarations class V3D; - class M33; /** @class Quat Quat.h Geometry/Quat.h @brief Class for quaternions @@ -54,7 +53,7 @@ namespace Mantid File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid> */ - class MANTID_GEOMETRY_DLL Quat + class MANTID_KERNEL_DLL Quat { public: @@ -69,20 +68,17 @@ namespace Mantid Quat& operator=(const Quat&); //! Set quaternion form an angle in degrees and an axis Quat(const double _deg, const V3D& _axis); - // set a quaternion from a rotational matrix; - Quat(const Geometry::DblMatrix &RotMat); + // set a quaternion from a rotational matrix; + Quat(const DblMatrix &RotMat); ~Quat(); void operator()(const Quat&); void operator()(const double ww, const double aa, const double bb, const double cc); void operator()(const double angle, const V3D&); void operator()(const V3D& rX, const V3D& rY, const V3D& rZ); - // Set quaternion from a 3x3 matrix - //void operator()(const M33&); void set(const double ww, const double aa, const double bb, const double cc); void setAngleAxis(const double _deg, const V3D& _axis); void getAngleAxis(double& _deg,double& _axis1,double& _axis2,double& axis3) const; - //void setRotMatrix(const M33&); //! Norm of a quaternion /// Set the rotation (both don't change rotation axis) void setRotation(const double deg); @@ -103,13 +99,13 @@ namespace Mantid //! stored as an linear array of 16 double //! The function glRotated must be called void GLMatrix(double* glmat) const; - //! returns the rotation matrix defined by this quaternion as an 9-point vector representing M33 matrix - //! (m33 is not used at the moment), if check_normalisation selected, verify if the mod(quat) is indeed == 1 and throws otherwise. - std::vector<double> getRotation(bool check_normalisation=false,bool throw_on_errors=false)const; + //! returns the rotation matrix defined by this quaternion as an 9-point vector representing M33 matrix + //! (m33 is not used at the moment), if check_normalisation selected, verify if the mod(quat) is indeed == 1 and throws otherwise. + std::vector<double> getRotation(bool check_normalisation=false,bool throw_on_errors=false)const; //! Convert GL Matrix into Quat void setQuat(double[16]); - //! Convert usual 3D rotation matrix into quat; Will throw if matirix is not rotational; - void setQuat(const Geometry::DblMatrix &RotMat); + //! Convert usual 3D rotation matrix into quat; Will throw if matirix is not rotational; + void setQuat(const DblMatrix &RotMat); //! Rotate a vector void rotate(V3D&) const; @@ -154,16 +150,16 @@ namespace Mantid /// Internal value double c; - // - static Kernel::Logger& quatG_log; + // Logger + static Kernel::Logger& quat_log; }; - MANTID_GEOMETRY_DLL std::ostream& operator<<(std::ostream&, const Quat&); - MANTID_GEOMETRY_DLL std::istream& operator>>(std::istream&,Quat& q); + MANTID_KERNEL_DLL std::ostream& operator<<(std::ostream&, const Quat&); + MANTID_KERNEL_DLL std::istream& operator>>(std::istream&,Quat& q); } // Namespace Mantid -} // Namespace Geometry +} // Namespace Kernel -#endif /*MANTID_QUAT_H_*/ +#endif /*MANTID_KERNEL_QUAT_H_*/ diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/Tolerance.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Tolerance.h new file mode 100644 index 00000000000..17bc73b0368 --- /dev/null +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Tolerance.h @@ -0,0 +1,14 @@ +#ifndef MANTID_KERNEL_TOLERANCE_H_ +#define MANTID_KERNEL_TOLERANCE_H_ + +namespace Mantid +{ +namespace Kernel +{ + /// Standard tolerance value + static const double Tolerance = 1.0e-06; + +} // namespace Kernel +} // namespace Mantid + +#endif /* MANTID_KERNEL_TOLERANCE_H_ */ diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/V3D.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/V3D.h similarity index 88% rename from Code/Mantid/Framework/Geometry/inc/MantidGeometry/V3D.h rename to Code/Mantid/Framework/Kernel/inc/MantidKernel/V3D.h index a43a4103618..2844619566c 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/V3D.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/V3D.h @@ -1,18 +1,18 @@ -#ifndef MANTIDGEOMETRY_V3D_H_ -#define MANTIDGEOMETRY_V3D_H_ +#ifndef MANTID_KERNEL_V3D_H_ +#define MANTID_KERNEL_V3D_H_ #include <cmath> #include <cfloat> #include <complex> #include <vector> -#include "MantidGeometry/DllConfig.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/DllConfig.h" +#include "MantidKernel/Matrix.h" namespace Mantid { - namespace Geometry + namespace Kernel { - /** @class V3D V3D.h Geometry\V3D.h + /** @class V3D V3D.h Kernel\V3D.h Class for 3D vectors. @@ -39,7 +39,7 @@ namespace Mantid File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>. Code Documentation is available at: <http://doxygen.mantidproject.org> */ - class MANTID_GEOMETRY_DLL V3D + class MANTID_KERNEL_DLL V3D { public: @@ -54,8 +54,8 @@ namespace Mantid V3D operator+(const V3D& v) const; V3D& operator+=(const V3D& v); - // explicit conversion into vector - operator std::vector<double>()const{std::vector<double> tmp(3); tmp[0]=x;tmp[1]=y; tmp[2]=z;return tmp;} + // explicit conversion into vector + operator std::vector<double>()const{std::vector<double> tmp(3); tmp[0]=x;tmp[1]=y; tmp[2]=z;return tmp;} V3D operator-(const V3D& v) const; V3D& operator-=(const V3D& v); @@ -134,10 +134,10 @@ namespace Mantid }; // Overload operator << - MANTID_GEOMETRY_DLL std::ostream& operator<<(std::ostream&, const V3D&); - MANTID_GEOMETRY_DLL std::istream& operator>>(std::istream&,V3D&); + MANTID_KERNEL_DLL std::ostream& operator<<(std::ostream&, const V3D&); + MANTID_KERNEL_DLL std::istream& operator>>(std::istream&,V3D&); - } // Namespace Geometry + } // Namespace Kernel } // Namespace Mantid -#endif /*MANTIDGEOMETRY_V3D_H_*/ +#endif /*MANTID_KERNEL_V3D_H_*/ diff --git a/Code/Mantid/Framework/Geometry/src/Math/Matrix.cpp b/Code/Mantid/Framework/Kernel/src/Matrix.cpp similarity index 93% rename from Code/Mantid/Framework/Geometry/src/Math/Matrix.cpp rename to Code/Mantid/Framework/Kernel/src/Matrix.cpp index 2b72d05f4d2..6896d6cfbe2 100644 --- a/Code/Mantid/Framework/Geometry/src/Math/Matrix.cpp +++ b/Code/Mantid/Framework/Kernel/src/Matrix.cpp @@ -1,26 +1,81 @@ -#include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/Exception.h" #include "MantidKernel/TimeSeriesProperty.h" #include <iomanip> #include <iostream> -#include <boost/algorithm/string/trim.hpp> -#include <boost/algorithm/string/split.hpp> -#include <boost/algorithm/string/regex.hpp> - using Mantid::Kernel::TimeSeriesProperty; namespace Mantid { -namespace Geometry +namespace Kernel { // #define fabs(x) std::fabs((x)*1.0) + namespace + { + //------------------------------------------------------------------------- + // Utility methods and function objects in anonymous namespace + //------------------------------------------------------------------------- + /** + \class PIndex + \author S. Ansell + \date Aug 2005 + \version 1.0 + \brief Class to fill an index with a progressive count + */ + template<typename T> + struct PIndex + { + private: + int count; ///< counter + public: + /// Constructor + PIndex() : count(0) { } + /// functional + std::pair<T,int> operator()(const T& A) { return std::pair<T,int>(A,count++); } + }; + + /** + \class PSep + \author S. Ansell + \date Aug 2005 + \version 1.0 + \brief Class to access the second object in index pair. + */ + template<typename T> + struct PSep + { + /// Functional to the second object + int operator()(const std::pair<T,int>& A) { return A.second; } + }; + + /** + * Function to take a vector and sort the vector + * so as to produce an index. Leaves the vector unchanged. + * @param pVec :: Input vector + * @param Index :: Output vector + */ + template<typename T> + void + indexSort(const std::vector<T>& pVec,std::vector<int>& Index) + { + Index.resize(pVec.size()); + std::vector<typename std::pair<T,int> > PartList; + PartList.resize(pVec.size()); + + transform(pVec.begin(),pVec.end(),PartList.begin(),PIndex<T>()); + sort(PartList.begin(),PartList.end()); + transform(PartList.begin(),PartList.end(),Index.begin(),PSep<T>()); + return; + } + + } + /** * Write an object to a stream. Format should be Matrix(nrows,ncols)x_00,x_01...,x_10,x_11 * @param os :: output stream @@ -50,7 +105,7 @@ std::ostream& operator<<(std::ostream& os,const Matrix<T>& matrix) * @returns A reference to the stream */ template<typename T> -std::istream& operator>>(std::istream& is, Geometry::Matrix<T>& in) +std::istream& operator>>(std::istream& is, Kernel::Matrix<T>& in) { // Stream should start with Matrix( char dump; @@ -955,7 +1010,7 @@ Matrix<T>::Transpose() template<> int -Matrix<int>::GaussJordan(Geometry::Matrix<int>&) +Matrix<int>::GaussJordan(Kernel::Matrix<int>&) /** Not valid for Integer @return zero @@ -1748,18 +1803,18 @@ Matrix<T>::str() const ///\cond TEMPLATE // Symbol definitions for common types -template class MANTID_GEOMETRY_DLL Matrix<double>; -template class MANTID_GEOMETRY_DLL Matrix<int>; -template class MANTID_GEOMETRY_DLL Matrix<float>; - -template MANTID_GEOMETRY_DLL std::ostream& operator<<(std::ostream&, const DblMatrix&); -template MANTID_GEOMETRY_DLL std::istream& operator>>(std::istream&, DblMatrix&); -template MANTID_GEOMETRY_DLL std::ostream& operator<<(std::ostream&, const Matrix<float>&); -template MANTID_GEOMETRY_DLL std::istream& operator>>(std::istream&, Matrix<float>&); -template MANTID_GEOMETRY_DLL std::ostream& operator<<(std::ostream&, const IntMatrix&); -template MANTID_GEOMETRY_DLL std::istream& operator>>(std::istream&, IntMatrix&); - +template class MANTID_KERNEL_DLL Matrix<double>; +template class MANTID_KERNEL_DLL Matrix<int>; +template class MANTID_KERNEL_DLL Matrix<float>; + +template MANTID_KERNEL_DLL std::ostream& operator<<(std::ostream&, const DblMatrix&); +template MANTID_KERNEL_DLL std::istream& operator>>(std::istream&, DblMatrix&); +template MANTID_KERNEL_DLL std::ostream& operator<<(std::ostream&, const Matrix<float>&); +template MANTID_KERNEL_DLL std::istream& operator>>(std::istream&, Matrix<float>&); +template MANTID_KERNEL_DLL std::ostream& operator<<(std::ostream&, const IntMatrix&); +template MANTID_KERNEL_DLL std::istream& operator>>(std::istream&, IntMatrix&); ///\endcond TEMPLATE -} // namespace Geometry + +} // namespace Kernel } // namespace diff --git a/Code/Mantid/Framework/Geometry/src/Quat.cpp b/Code/Mantid/Framework/Kernel/src/Quat.cpp similarity index 96% rename from Code/Mantid/Framework/Geometry/src/Quat.cpp rename to Code/Mantid/Framework/Kernel/src/Quat.cpp index b468257c0c5..ce68b080f59 100644 --- a/Code/Mantid/Framework/Geometry/src/Quat.cpp +++ b/Code/Mantid/Framework/Kernel/src/Quat.cpp @@ -1,6 +1,6 @@ -#include "MantidGeometry/Quat.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Tolerance.h" #include <cmath> #include <stdexcept> #include <cstdlib> @@ -9,10 +9,11 @@ namespace Mantid { -namespace Geometry +namespace Kernel { - Kernel::Logger& Quat::quatG_log = Kernel::Logger::get("Geometry:Quat"); + Kernel::Logger& Quat::quat_log = Kernel::Logger::get("Kernel:Quat"); + /** Null Constructor * Initialize the quaternion with the identity q=1.0+0i+0j+0k; */ @@ -62,7 +63,7 @@ Quat::Quat(const V3D& src,const V3D& des) } } } -Quat::Quat(const Geometry::DblMatrix &RotMat) +Quat::Quat(const Kernel::DblMatrix &RotMat) { this->setQuat(RotMat); } @@ -541,10 +542,10 @@ Quat::getRotation(bool check_normalisation,bool throw_on_errors)const double normSq=aa+bb+cc+w*w; if(fabs(normSq-1)>FLT_EPSILON){ if(throw_on_errors){ - quatG_log.error()<<" A non-unit quaternion used to obtain a rotation matrix; need to notmalize it first\n"; + quat_log.error()<<" A non-unit quaternion used to obtain a rotation matrix; need to notmalize it first\n"; throw(std::invalid_argument("Attempt to use non-normalized quaternion to define rotation matrix; need to notmalize it first")); }else{ - quatG_log.information()<<" Warning; a non-unit quaternion used to obtain the rotation matrix; using normalized quat\n"; + quat_log.information()<<" Warning; a non-unit quaternion used to obtain the rotation matrix; using normalized quat\n"; aa/=normSq; ab/=normSq; ac/=normSq; @@ -610,7 +611,7 @@ void Quat::setQuat(double mat[16]) } /// Using the convention at http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation void -Quat::setQuat(const Geometry::DblMatrix &rMat) +Quat::setQuat(const Kernel::DblMatrix &rMat) { int i=0,j,k; if (rMat[1][1]>rMat[0][0]) i=1; @@ -736,7 +737,7 @@ void Quat::rotateBB(double& xmin, double& ymin, double& zmin, double& xmax, doub if (ymin>ymax) std::swap(ymin,ymax); if (zmin>zmax) std::swap(zmin,zmax); // Get the min and max of the cube, and remove centring offset - Mantid::Geometry::V3D minT(xmin,ymin,zmin), maxT(xmax,ymax,zmax); + Mantid::Kernel::V3D minT(xmin,ymin,zmin), maxT(xmax,ymax,zmax); // Get the rotation matrix double rotMatr[16]; GLMatrix(&rotMatr[0]); @@ -744,7 +745,7 @@ void Quat::rotateBB(double& xmin, double& ymin, double& zmin, double& xmax, doub // Much faster than creating 8 points and rotate them. The new min (max) // can only be obtained by summing the smallest (largest) components // - Mantid::Geometry::V3D minV, maxV; + Mantid::Kernel::V3D minV, maxV; // Looping on rows of matrix int index; for (int i=0;i<3;i++) @@ -763,6 +764,6 @@ void Quat::rotateBB(double& xmin, double& ymin, double& zmin, double& xmax, doub return; } -} // Namespace Geometry +} // Namespace Kernel } // Namespce Mantid diff --git a/Code/Mantid/Framework/Geometry/src/V3D.cpp b/Code/Mantid/Framework/Kernel/src/V3D.cpp similarity index 98% rename from Code/Mantid/Framework/Geometry/src/V3D.cpp rename to Code/Mantid/Framework/Kernel/src/V3D.cpp index 82edbfb031a..8035a3f3b3d 100644 --- a/Code/Mantid/Framework/Geometry/src/V3D.cpp +++ b/Code/Mantid/Framework/Kernel/src/V3D.cpp @@ -4,13 +4,13 @@ #include <vector> #include <cstdlib> -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Tolerance.h" #include "MantidKernel/Exception.h" namespace Mantid { -namespace Geometry +namespace Kernel { /// Constructor [Null] @@ -555,7 +555,7 @@ V3D::reBase(const V3D& A,const V3D&B,const V3D& C) } void -V3D::rotate(const Geometry::Matrix<double>& A) +V3D::rotate(const Kernel::Matrix<double>& A) /** Rotate a point by a matrix @param A :: Rotation matrix (needs to be >3x3) @@ -731,5 +731,5 @@ operator>>(std::istream& IX,V3D& A) return IX; } -} // Namespace Geometry +} // Namespace Kernel } // Namespace Mantid diff --git a/Code/Mantid/Framework/Geometry/test/MatrixTest.h b/Code/Mantid/Framework/Kernel/test/MatrixTest.h similarity index 98% rename from Code/Mantid/Framework/Geometry/test/MatrixTest.h rename to Code/Mantid/Framework/Kernel/test/MatrixTest.h index 6ea5149c169..14bf579147b 100644 --- a/Code/Mantid/Framework/Geometry/test/MatrixTest.h +++ b/Code/Mantid/Framework/Kernel/test/MatrixTest.h @@ -7,13 +7,14 @@ #include <vector> #include <algorithm> -#include "MantidGeometry/Math/Matrix.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/Matrix.h" +#include "MantidKernel/V3D.h" #include <boost/lexical_cast.hpp> -using namespace Mantid; -using namespace Geometry; +using Mantid::Kernel::Matrix; +using Mantid::Kernel::DblMatrix; +using Mantid::Kernel::V3D; class MatrixTest: public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/Geometry/test/QuatTest.h b/Code/Mantid/Framework/Kernel/test/QuatTest.h similarity index 95% rename from Code/Mantid/Framework/Geometry/test/QuatTest.h rename to Code/Mantid/Framework/Kernel/test/QuatTest.h index 14a95d4b108..0435d490802 100644 --- a/Code/Mantid/Framework/Geometry/test/QuatTest.h +++ b/Code/Mantid/Framework/Kernel/test/QuatTest.h @@ -5,17 +5,17 @@ #include <cmath> #include <ostream> #include <float.h> -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" +#include "MantidKernel/Matrix.h" -using namespace Mantid::Geometry; +using namespace Mantid::Kernel; class QuatTest : public CxxTest::TestSuite { private: - Mantid::Geometry::Quat q,p; + Mantid::Kernel::Quat q,p; public: void testoperatorbracket() @@ -40,7 +40,7 @@ public: void testValueConstructor() { - Mantid::Geometry::Quat q1(1,2,3,4); + Mantid::Kernel::Quat q1(1,2,3,4); TS_ASSERT_EQUALS(q1[0],1.0); TS_ASSERT_EQUALS(q1[1],2.0); TS_ASSERT_EQUALS(q1[2],3.0); @@ -49,10 +49,10 @@ public: void testAngleAxisConstructor() { - Mantid::Geometry::V3D v(1,1,1); + Mantid::Kernel::V3D v(1,1,1); // Construct quaternion to represent rotation // of 45 degrees around the 111 axis. - Mantid::Geometry::Quat q1(90.0,v); + Mantid::Kernel::Quat q1(90.0,v); double c=1.0/sqrt(2.0); double s=c/sqrt(3.0); TS_ASSERT_DELTA(q1[0],c,0.000001); @@ -72,7 +72,7 @@ public: void testoperatorassignmentfromangleaxis() { - Mantid::Geometry::V3D v(1,1,1); + Mantid::Kernel::V3D v(1,1,1); q(90.0,v); double c=1.0/sqrt(2.0); double s=c/sqrt(3.0); @@ -147,7 +147,7 @@ public: void testinversemethod() { q(2,3,4,5); - Mantid::Geometry::Quat qinv(q); + Mantid::Kernel::Quat qinv(q); qinv.inverse(); q*=qinv; TS_ASSERT_DELTA(q[0],1,0.000001); @@ -160,7 +160,7 @@ public: { q(1,1,1,1); p(-1,2,1,3); - Mantid::Geometry::Quat res; + Mantid::Kernel::Quat res; res=p+q; TS_ASSERT_EQUALS(res[0],0); TS_ASSERT_EQUALS(res[1],3); @@ -172,7 +172,7 @@ public: { q(1,1,1,1); p(-1,2,1,3); - Mantid::Geometry::Quat res; + Mantid::Kernel::Quat res; res=p-q; TS_ASSERT_EQUALS(res[0],-2); TS_ASSERT_EQUALS(res[1],1); @@ -184,7 +184,7 @@ public: { q(1,1,1,1); p(-1,2,1,3); - Mantid::Geometry::Quat res; + Mantid::Kernel::Quat res; res=p*q; TS_ASSERT_EQUALS(res[0],-7); TS_ASSERT_EQUALS(res[1],-1); @@ -379,9 +379,9 @@ public: void testSetFromDirectionCosineMatrix_trival() { - Mantid::Geometry::V3D rX(1,0,0); - Mantid::Geometry::V3D rY(0,1,0); - Mantid::Geometry::V3D rZ(0,0,1); + Mantid::Kernel::V3D rX(1,0,0); + Mantid::Kernel::V3D rY(0,1,0); + Mantid::Kernel::V3D rZ(0,0,1); q(rX,rY,rZ); p(1,0,0,0); //Identity quaternion TS_ASSERT(p==q); //Trivial rotation diff --git a/Code/Mantid/Framework/Geometry/test/V3DTest.h b/Code/Mantid/Framework/Kernel/test/V3DTest.h similarity index 96% rename from Code/Mantid/Framework/Geometry/test/V3DTest.h rename to Code/Mantid/Framework/Kernel/test/V3DTest.h index c9f425e8871..0d6e90b9d33 100644 --- a/Code/Mantid/Framework/Geometry/test/V3DTest.h +++ b/Code/Mantid/Framework/Kernel/test/V3DTest.h @@ -6,15 +6,15 @@ #include <ostream> #include <vector> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" -using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; class V3DTest : public CxxTest::TestSuite { private: - Mantid::Geometry::V3D a,b,c,d; + Mantid::Kernel::V3D a,b,c,d; public: void testEmptyConstructor() @@ -26,7 +26,7 @@ public: } void testDefaultConstructor() { - Mantid::Geometry::V3D d(1.0,2.0,3.0); + Mantid::Kernel::V3D d(1.0,2.0,3.0); TS_ASSERT_EQUALS(d.X(),1.0); TS_ASSERT_EQUALS(d.Y(),2.0); TS_ASSERT_EQUALS(d.Z(),3.0); @@ -41,7 +41,7 @@ public: void testcopyConstructor() { a(2.0,2.0,2.0); - Mantid::Geometry::V3D d(a); + Mantid::Kernel::V3D d(a); TS_ASSERT_EQUALS(d.X(),2.0); TS_ASSERT_EQUALS(d.Y(),2.0); TS_ASSERT_EQUALS(d.Z(),2.0); @@ -58,7 +58,7 @@ public: { double* t=new double[3]; t[0]=1.0;t[1]=2.0;t[2]=3.0; - Mantid::Geometry::V3D d(t); + Mantid::Kernel::V3D d(t); TS_ASSERT_EQUALS(d.X(),1.0); TS_ASSERT_EQUALS(d.Y(),2.0); TS_ASSERT_EQUALS(d.Z(),3.0); @@ -220,7 +220,7 @@ public: } void testOperatorBracketConst() { - const Mantid::Geometry::V3D d(1.0,2.0,3.0); + const Mantid::Kernel::V3D d(1.0,2.0,3.0); TS_ASSERT_EQUALS(d[0],1.0); TS_ASSERT_EQUALS(d[1],2.0); TS_ASSERT_EQUALS(d[2],3.0); @@ -232,7 +232,7 @@ public: } void testOperatorBracketConstThrows() { - const Mantid::Geometry::V3D d(1.0,2.0,3.0); + const Mantid::Kernel::V3D d(1.0,2.0,3.0); TS_ASSERT_THROWS(d[-1],std::runtime_error&); TS_ASSERT_THROWS(d[3],std::runtime_error&); } diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CobaltSpinWaveDSHO.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CobaltSpinWaveDSHO.h index bb0b709c9b0..9fea2d6a38e 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CobaltSpinWaveDSHO.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CobaltSpinWaveDSHO.h @@ -60,7 +60,7 @@ namespace Mantid std::string name()const{return "CobaltSpinWaveDSHO";} /// sqwBroad returns the expected scattering weight for the given Q,w point virtual double sqwBroad(const std::vector<double> & point, const std::vector<double> & fgParams, - const double temp, const Geometry::Matrix<double> & ubinv) const; + const double temp, const Kernel::Matrix<double> & ubinv) const; protected: /// load parameter values into local memory diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PlaneImplicitFunction.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PlaneImplicitFunction.h index dd5e54a0916..19636be22bd 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PlaneImplicitFunction.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PlaneImplicitFunction.h @@ -8,7 +8,7 @@ #include <gsl/gsl_blas.h> #include "MantidKernel/System.h" #include "MantidAPI/ImplicitFunction.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidMDAlgorithms/OriginParameter.h" #include "MantidMDAlgorithms/NormalParameter.h" #include "MantidMDAlgorithms/WidthParameter.h" @@ -80,7 +80,7 @@ namespace Mantid WidthParameter m_width; /// Calculate the width applied to the normal direction resolved into the specified axis. - inline double calculateNormContributionAlongAxisComponent(const Mantid::Geometry::V3D& axis) const; + inline double calculateNormContributionAlongAxisComponent(const Mantid::Kernel::V3D& axis) const; /// Determine whether the point is bounded by the plane described by the parameters. inline bool isBoundedByPlane(const OriginParameter& origin, const NormalParameter& normal, const Mantid::API::Point3D* pPoint) const; /// Get the effective normal vector to use in calculation. diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/RunParam.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/RunParam.h index e7889ae8b76..4ba9f07fb30 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/RunParam.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/RunParam.h @@ -7,9 +7,9 @@ //---------------------------------------------------------------------- #include "MantidAPI/IMDWorkspace.h" -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" namespace Mantid { diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SimulateMDD.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SimulateMDD.h index 3aa022f0077..544809f1190 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SimulateMDD.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SimulateMDD.h @@ -10,9 +10,9 @@ #include "MantidGeometry/MDGeometry/MDCell.h" #include "MantidKernel/RandomNumberGenerator.h" -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" namespace Mantid { diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SimulateResolution.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SimulateResolution.h index 9b849eb3b1f..10b1844996c 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SimulateResolution.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SimulateResolution.h @@ -60,7 +60,7 @@ namespace Mantid virtual double function(Mantid::API::IMDIterator& r) const; /// This will be over ridden by the user's SQW function TODO argument list is not general enough virtual double sqwBroad(const std::vector<double> & point, const std::vector<double> & fgParams, - const double temp, const Geometry::Matrix<double> & ubinv) const=0; + const double temp, const Kernel::DblMatrix & ubinv) const=0; /// This will be over ridden by the user's getParam function virtual void getParams() const = 0; /// Perform convolution on one MDPoint @@ -81,7 +81,7 @@ namespace Mantid Kernel::RandomNumberGenerator *m_randGen; /// Sample S(Q,eps) function from tobyfit double sqwBroad601(const std::vector<double> &, const std::vector<double> & , - const double, const Geometry::Matrix<double> & ); + const double, const Kernel::Matrix<double> & ); /// function to evaluate y/(1-exp(-y)) including y=0 and large -ve y double pop(const double) const; /// function to bose factor @@ -98,11 +98,11 @@ namespace Mantid /// function to build bmatrix void bMatrix(const double, const double, const double, const double, const double, const double, const double, const double, - const Geometry::Matrix<double> & , const Geometry::Matrix<double> & , - Geometry::Matrix<double> & ); + const Kernel::Matrix<double> & , const Kernel::Matrix<double> & , + Kernel::Matrix<double> & ); /// function to build matrices dMat and dinvMat - void dMatrix(const double , const double , Geometry::Matrix<double> & , - Geometry::Matrix<double> & ); + void dMatrix(const double , const double , Kernel::Matrix<double> & , + Kernel::Matrix<double> & ); /// Energy resoultion function for moderator and chopper from TF double enResModChop(const double , const double , const double , const double , const double , const double , const double ); @@ -112,7 +112,7 @@ namespace Mantid /// get transform matrices, vectors for reciprocal space int rlatt(const std::vector<double> & a, const std::vector<double> & ang, std::vector<double> & arlu, std::vector<double> & angrlu, - Geometry::Matrix<double> & dMat ); + Kernel::Matrix<double> & dMat ); private: /// The default seed for MT random numbers int m_randSeed; diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/TobyFitSimulate.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/TobyFitSimulate.h index 233677ff2ff..79795065941 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/TobyFitSimulate.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/TobyFitSimulate.h @@ -10,9 +10,9 @@ #include "MantidKernel/RandomNumberGenerator.h" #include "MantidMDAlgorithms/RunParam.h" -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" namespace Mantid { @@ -78,7 +78,7 @@ namespace Mantid Kernel::RandomNumberGenerator *m_randGen; /// Sample S(Q,eps) function from tobyfit double sqwBroad601(const std::vector<double> &, const std::vector<double> & , - const double, const Geometry::Matrix<double> & ); + const double, const Kernel::Matrix<double> & ); /// function to evaluate y/(1-exp(-y)) including y=0 and large -ve y double pop(double); /// function to bose factor @@ -95,11 +95,11 @@ namespace Mantid /// function to build bmatrix void bMatrix(const double, const double, const double, const double, const double, const double, const double, const double, - const Geometry::Matrix<double> & , const Geometry::Matrix<double> & , - Geometry::Matrix<double> & ); + const Kernel::Matrix<double> & , const Kernel::Matrix<double> & , + Kernel::Matrix<double> & ); /// function to build matrices dMat and dinvMat - void dMatrix(const double , const double , Geometry::Matrix<double> & , - Geometry::Matrix<double> & ); + void dMatrix(const double , const double , Kernel::Matrix<double> & , + Kernel::Matrix<double> & ); /// Energy resoultion function for moderator and chopper from TF double enResModChop(const double , const double , const double , const double , const double , const double , const double ); @@ -109,7 +109,7 @@ namespace Mantid /// get transform matrices, vectors for reciprocal space int rlatt(const std::vector<double> & a, const std::vector<double> & ang, std::vector<double> & arlu, std::vector<double> & angrlu, - Geometry::Matrix<double> & dMat ); + Kernel::Matrix<double> & dMat ); /// The default seed for MT random numbers int m_randSeed; /// Flag for random number method - may change to enum to allow for several methods diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/VectorMathematics.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/VectorMathematics.h index 855280e5fde..101f95209b4 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/VectorMathematics.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/VectorMathematics.h @@ -6,7 +6,7 @@ //---------------------------------------------------------------------- #include <vector> #include <cmath> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" namespace Mantid { @@ -44,13 +44,13 @@ namespace MDAlgorithms //TODO: consider replacing with something more Mantid generic. -DLLExport double dotProduct(Mantid::Geometry::V3D a, Mantid::Geometry::V3D b); +DLLExport double dotProduct(Mantid::Kernel::V3D a, Mantid::Kernel::V3D b); DLLExport double dotProduct(double a1, double a2, double a3, double b1, double b2, double b3); -DLLExport Mantid::Geometry::V3D crossProduct(Mantid::Geometry::V3D a, Mantid::Geometry::V3D b); +DLLExport Mantid::Kernel::V3D crossProduct(Mantid::Kernel::V3D a, Mantid::Kernel::V3D b); -DLLExport Mantid::Geometry::V3D crossProduct(double a1, double a2, double a3, double b1, double b2, +DLLExport Mantid::Kernel::V3D crossProduct(double a1, double a2, double a3, double b1, double b2, double b3); DLLExport double absolute(double a1, double a2, double a3); diff --git a/Code/Mantid/Framework/MDAlgorithms/src/CobaltSpinWaveDSHO.cpp b/Code/Mantid/Framework/MDAlgorithms/src/CobaltSpinWaveDSHO.cpp index 3df1dccf4fa..5dafbdd4ee6 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/CobaltSpinWaveDSHO.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/CobaltSpinWaveDSHO.cpp @@ -4,9 +4,9 @@ #include "MantidMDAlgorithms/CobaltSpinWaveDSHO.h" #include <math.h> -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" namespace Mantid { @@ -32,7 +32,7 @@ namespace Mantid * sqw_broad model 601 from tobyfit */ double CobaltSpinWaveDSHO::sqwBroad(const std::vector<double> & point, const std::vector<double> & fgParams, - const double temp, const Geometry::Matrix<double> & ubinv) const + const double temp, const Kernel::Matrix<double> & ubinv) const { double qx = point[0]; double qy = point[1]; double qz = point[2]; double eps = point[3]; double qsqr = qx*qx+qy*qy+qz*qz; diff --git a/Code/Mantid/Framework/MDAlgorithms/src/PlaneImplicitFunction.cpp b/Code/Mantid/Framework/MDAlgorithms/src/PlaneImplicitFunction.cpp index 10b4f16cdd6..064c487faf6 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/PlaneImplicitFunction.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/PlaneImplicitFunction.cpp @@ -1,6 +1,6 @@ #include "MantidMDAlgorithms/PlaneImplicitFunction.h" #include "MantidAPI/Point3D.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <cmath> #include <vector> #include <boost/algorithm/string.hpp> @@ -20,9 +20,9 @@ PlaneImplicitFunction::PlaneImplicitFunction(NormalParameter& normal, OriginPara } -inline double PlaneImplicitFunction::calculateNormContributionAlongAxisComponent(const Mantid::Geometry::V3D& axis) const +inline double PlaneImplicitFunction::calculateNormContributionAlongAxisComponent(const Mantid::Kernel::V3D& axis) const { - using Mantid::Geometry::V3D; + using Mantid::Kernel::V3D; NormalParameter normalUnit =m_normal.asUnitVector(); const V3D normal(normalUnit.getX(), normalUnit.getY(), normalUnit.getZ()); @@ -58,7 +58,7 @@ inline bool PlaneImplicitFunction::isBoundedByPlane(const OriginParameter& origi bool PlaneImplicitFunction::evaluate(const Mantid::API::Point3D* pPoint) const { - using Mantid::Geometry::V3D; + using Mantid::Kernel::V3D; //TODO: consider caching calculation parameters that share lifetime with object. //Create virtual planes separated by (absolute) width from from actual origin. Origins are key. diff --git a/Code/Mantid/Framework/MDAlgorithms/src/QuadEnBackground.cpp b/Code/Mantid/Framework/MDAlgorithms/src/QuadEnBackground.cpp index 5f58a82617f..becc540079a 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/QuadEnBackground.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/QuadEnBackground.cpp @@ -4,9 +4,9 @@ #include "MantidMDAlgorithms/QuadEnBackground.h" #include <math.h> -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" namespace Mantid { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/RunParam.cpp b/Code/Mantid/Framework/MDAlgorithms/src/RunParam.cpp index 251f08a8d7e..9eda8bb4bc3 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/RunParam.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/RunParam.cpp @@ -4,9 +4,9 @@ #include "MantidMDAlgorithms/RunParam.h" #include "MantidAPI/IMDWorkspace.h" -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" namespace Mantid { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/SimulateMDD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/SimulateMDD.cpp index 01af4da843a..6fa64df4b67 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/SimulateMDD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/SimulateMDD.cpp @@ -10,9 +10,9 @@ #include <gsl/gsl_roots.h> #include <algorithm> -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" using namespace Mantid::API; using namespace Mantid::Kernel; diff --git a/Code/Mantid/Framework/MDAlgorithms/src/SimulateResolution.cpp b/Code/Mantid/Framework/MDAlgorithms/src/SimulateResolution.cpp index dd355cd5e91..8bf1b4a7290 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/SimulateResolution.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/SimulateResolution.cpp @@ -11,9 +11,9 @@ #include <gsl/gsl_math.h> #include <gsl/gsl_roots.h> -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" using namespace Mantid::API; using namespace Mantid::Kernel; @@ -191,8 +191,8 @@ namespace Mantid */ void SimulateResolution::bMatrix(const double wi, const double wf, const double x0, const double xa, const double x1, const double x2, const double thetam, const double angvel, - const Geometry::Matrix<double> & sMat, const Geometry::Matrix<double> & dMat, - Geometry::Matrix<double> & bMat) + const Kernel::Matrix<double> & sMat, const Kernel::Matrix<double> & dMat, + Kernel::Matrix<double> & bMat) { //double precision wi, wf, x0, xa, x1, x2, thetam, angvel, sMat(3,3), dMat(3,3), bMat(6,11) /* @@ -324,8 +324,8 @@ namespace Mantid * d_matrix function from tobyfit */ - void SimulateResolution::dMatrix(const double phi, const double beta, Geometry::Matrix<double> & dMat, - Geometry::Matrix<double> & dinvMat) + void SimulateResolution::dMatrix(const double phi, const double beta, Kernel::Matrix<double> & dMat, + Kernel::Matrix<double> & dinvMat) { /* @@ -602,7 +602,7 @@ namespace Mantid */ int SimulateResolution::rlatt(const std::vector<double> & a, const std::vector<double> & ang, std::vector<double> & arlu, std::vector<double> & angrlu, - Geometry::Matrix<double> & dMat ) + Kernel::Matrix<double> & dMat ) { UNUSED_ARG(ang); UNUSED_ARG(arlu); diff --git a/Code/Mantid/Framework/MDAlgorithms/src/TobyFitSimulate.cpp b/Code/Mantid/Framework/MDAlgorithms/src/TobyFitSimulate.cpp index a84b7bd420f..a40fa3669f4 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/TobyFitSimulate.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/TobyFitSimulate.cpp @@ -11,9 +11,9 @@ #include <gsl/gsl_math.h> #include <gsl/gsl_roots.h> -#include "MantidGeometry/Tolerance.h" +#include "MantidKernel/Tolerance.h" #include "MantidGeometry/Math/mathSupport.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" using namespace Mantid::API; using namespace Mantid::Kernel; @@ -115,7 +115,7 @@ namespace Mantid * sqw_broad model 601 from tobyfit */ double TobyFitSimulate::sqwBroad601(const std::vector<double> & point, const std::vector<double> & fgParams, - const double temp, const Geometry::Matrix<double> & ubinv) + const double temp, const Kernel::Matrix<double> & ubinv) { double qx = point[0]; double qy = point[1]; double qz = point[2]; double eps = point[3]; double qsqr = qx*qx+qy*qy+qz*qz; @@ -220,8 +220,8 @@ namespace Mantid */ void TobyFitSimulate::bMatrix(const double wi, const double wf, const double x0, const double xa, const double x1, const double x2, const double thetam, const double angvel, - const Geometry::Matrix<double> & sMat, const Geometry::Matrix<double> & dMat, - Geometry::Matrix<double> & bMat) + const Kernel::Matrix<double> & sMat, const Kernel::Matrix<double> & dMat, + Kernel::Matrix<double> & bMat) { //double precision wi, wf, x0, xa, x1, x2, thetam, angvel, sMat(3,3), dMat(3,3), bMat(6,11) /* @@ -353,8 +353,8 @@ namespace Mantid * d_matrix function from tobyfit */ - void TobyFitSimulate::dMatrix(const double phi, const double beta, Geometry::Matrix<double> & dMat, - Geometry::Matrix<double> & dinvMat) + void TobyFitSimulate::dMatrix(const double phi, const double beta, Kernel::Matrix<double> & dMat, + Kernel::Matrix<double> & dinvMat) { /* @@ -631,7 +631,7 @@ namespace Mantid */ int TobyFitSimulate::rlatt(const std::vector<double> & a, const std::vector<double> & ang, std::vector<double> & arlu, std::vector<double> & angrlu, - Geometry::Matrix<double> & dMat ) + Kernel::Matrix<double> & dMat ) { UNUSED_ARG(ang); UNUSED_ARG(arlu); diff --git a/Code/Mantid/Framework/MDAlgorithms/src/VectorMathematics.cpp b/Code/Mantid/Framework/MDAlgorithms/src/VectorMathematics.cpp index ce097e6a4fa..fe1cd078ec6 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/VectorMathematics.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/VectorMathematics.cpp @@ -4,30 +4,30 @@ namespace Mantid namespace MDAlgorithms { -double dotProduct(Mantid::Geometry::V3D a, Mantid::Geometry::V3D b) +double dotProduct(Mantid::Kernel::V3D a, Mantid::Kernel::V3D b) { - using Mantid::Geometry::V3D; + using Mantid::Kernel::V3D; return a.scalar_prod(b); } double dotProduct(double a1, double a2, double a3, double b1, double b2, double b3) { - using Mantid::Geometry::V3D; + using Mantid::Kernel::V3D; V3D a(a1, a2, a3); V3D b(b1, b2, b3); return a.scalar_prod(b); } -Mantid::Geometry::V3D crossProduct(Mantid::Geometry::V3D a, Mantid::Geometry::V3D b) +Mantid::Kernel::V3D crossProduct(Mantid::Kernel::V3D a, Mantid::Kernel::V3D b) { - using Mantid::Geometry::V3D; + using Mantid::Kernel::V3D; return a.cross_prod(b); } -Mantid::Geometry::V3D crossProduct(double a1, double a2, double a3, double b1, double b2, +Mantid::Kernel::V3D crossProduct(double a1, double a2, double a3, double b1, double b2, double b3) { - using Mantid::Geometry::V3D; + using Mantid::Kernel::V3D; V3D a(a1, a2, a3); V3D b(b1, b2, b3); return a.cross_prod(b); diff --git a/Code/Mantid/Framework/MDAlgorithms/test/CP3DxN_RebinningTest.h b/Code/Mantid/Framework/MDAlgorithms/test/CP3DxN_RebinningTest.h index 85d9ed97334..f08b693a8cb 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/CP3DxN_RebinningTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/CP3DxN_RebinningTest.h @@ -124,7 +124,7 @@ class CP3DxN_RebinningTest : public CxxTest::TestSuite pSlicing->pDimDescription("en")->cut_max = 50; // and set a rotation Geometry::OrientedLattice rotator(1,1,1); - Geometry::DblMatrix Rot = rotator.setUFromVectors(Geometry::V3D(1,1,1),Geometry::V3D(1,-1,-1)); + Kernel::DblMatrix Rot = rotator.setUFromVectors(Kernel::V3D(1,1,1),Kernel::V3D(1,-1,-1)); pSlicing->setRotationMatrix(Rot); /* pSlicing->pDimDescription("qx")->nBins = 200; @@ -161,7 +161,7 @@ class CP3DxN_RebinningTest : public CxxTest::TestSuite pSlicing->pDimDescription("en")->nBins = 0;*/ // and set a rotation Geometry::OrientedLattice rotator(1,1,1); - Geometry::DblMatrix Rot = rotator.setUFromVectors(Geometry::V3D(0,1,1),Geometry::V3D(1,-1,-1)); + Kernel::DblMatrix Rot = rotator.setUFromVectors(Kernel::V3D(0,1,1),Kernel::V3D(1,-1,-1)); pSlicing->setRotationMatrix(Rot); diff --git a/Code/Mantid/Framework/MDAlgorithms/test/CPRebinKeepPixTest.h b/Code/Mantid/Framework/MDAlgorithms/test/CPRebinKeepPixTest.h index 9ef9524002d..22d8f16c7db 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/CPRebinKeepPixTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/CPRebinKeepPixTest.h @@ -78,7 +78,7 @@ class CPRebinKeepPixTest : public CxxTest::TestSuite pSlicing->pDimDescription("qyt")->nBins = 1; // and set a rotation //Geometry::UnitCell rotator(1,1,1); - //Geometry::DblMatrix Rot = rotator.getUmatrix(Geometry::V3D(1,1,0),Geometry::V3D(1,-1,0)); + //Kernel::DblMatrix Rot = rotator.getUmatrix(Kernel::V3D(1,1,0),Kernel::V3D(1,-1,0)); //pSlicing->setRotationMatrix(Rot); diff --git a/Code/Mantid/Framework/MDAlgorithms/test/PlaneImplicitFunctionTest.h b/Code/Mantid/Framework/MDAlgorithms/test/PlaneImplicitFunctionTest.h index ec4194fd019..a6a39d75498 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/PlaneImplicitFunctionTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/PlaneImplicitFunctionTest.h @@ -6,7 +6,7 @@ #include <gmock/gmock.h> #include <gtest/gtest.h> #include <vector> -#include <MantidGeometry/Math/Matrix.h> +#include <MantidKernel/Matrix.h> #include "MantidMDAlgorithms/PlaneImplicitFunction.h" class PlaneImplicitFunctionTest: public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/MDAlgorithms/test/PlaneInterpreterTest.h b/Code/Mantid/Framework/MDAlgorithms/test/PlaneInterpreterTest.h index 0637b7f2c54..393173d5f1e 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/PlaneInterpreterTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/PlaneInterpreterTest.h @@ -5,7 +5,7 @@ #include <gtest/gtest.h> #include <cxxtest/TestSuite.h> #include <boost/shared_ptr.hpp> -#include <MantidGeometry/Math/Matrix.h> +#include <MantidKernel/Matrix.h> #include <MantidMDAlgorithms/NormalParameter.h> #include <MantidMDAlgorithms/OriginParameter.h> #include <MantidMDAlgorithms/PlaneInterpreter.h> @@ -15,7 +15,7 @@ using namespace Mantid::MDAlgorithms; using namespace Mantid::MDDataObjects; -using namespace Mantid::Geometry; +using Mantid::Kernel::V3D; class PlaneInterpreterTest: public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/MDAlgorithms/test/VectorMathematicsTest.h b/Code/Mantid/Framework/MDAlgorithms/test/VectorMathematicsTest.h index 606d4726948..a246829a484 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/VectorMathematicsTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/VectorMathematicsTest.h @@ -1,7 +1,7 @@ #ifndef VECTOR_MATHEMATICS_TEST_H_ #define VECTOR_MATHEMATICS_TEST_H_ -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidMDAlgorithms/VectorMathematics.h" using namespace Mantid::MDAlgorithms; @@ -39,7 +39,7 @@ public: void testCrossProductOrthogonal(void) { - using Mantid::Geometry::V3D; + using Mantid::Kernel::V3D; double a1 = 1; double a2 = 0; double a3 = 0; @@ -54,7 +54,7 @@ public: void testCrossProductParallel(void) { - using Mantid::Geometry::V3D; + using Mantid::Kernel::V3D; double a1 = 1; double a2 = 0; double a3 = 0; diff --git a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransform.h b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransform.h index d79402104fe..61beea13bfa 100644 --- a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransform.h +++ b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransform.h @@ -3,7 +3,7 @@ #include "MantidKernel/System.h" #include "MantidGeometry/MDGeometry/IMDDimension.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidGeometry/MDGeometry/MDTypes.h" namespace Mantid @@ -30,8 +30,8 @@ namespace MDEvents virtual ~CoordTransform(); void addTranslation(const coord_t * translationVector); - Mantid::Geometry::Matrix<coord_t> getMatrix() const; - void setMatrix(const Mantid::Geometry::Matrix<coord_t> newMatrix); + Mantid::Kernel::Matrix<coord_t> getMatrix() const; + void setMatrix(const Mantid::Kernel::Matrix<coord_t> newMatrix); //---------------------------------------------------------------------------------------------- /** Apply the coordinate transformation @@ -71,7 +71,7 @@ namespace MDEvents * By using an affine, translations and rotations (or other linear transforms) can be * combined by simply multiplying the matrices. */ - Mantid::Geometry::Matrix<coord_t> affineMatrix; + Mantid::Kernel::Matrix<coord_t> affineMatrix; /// Raw pointer to the same underlying matrix as affineMatrix. coord_t ** rawMatrix; diff --git a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformDistance.h b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformDistance.h index a921b995899..8d25420c5cd 100644 --- a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformDistance.h +++ b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformDistance.h @@ -3,7 +3,7 @@ #include "MantidKernel/System.h" #include "MantidGeometry/MDGeometry/IMDDimension.h" -#include "MantidGeometry/Math/Matrix.h" +#include "MantidKernel/Matrix.h" #include "MantidMDEvents/CoordTransform.h" diff --git a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MakeDiffractionMDEventWorkspace.h b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MakeDiffractionMDEventWorkspace.h index cf3092495ea..5b309db8e18 100644 --- a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MakeDiffractionMDEventWorkspace.h +++ b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MakeDiffractionMDEventWorkspace.h @@ -3,7 +3,7 @@ #include "MantidKernel/System.h" #include "MantidAPI/Algorithm.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidAPI/IMDEventWorkspace.h" #include "MantidDataObjects/EventWorkspace.h" #include "MantidKernel/System.h" @@ -61,17 +61,17 @@ namespace MDEvents /// Primary flight path (source to sample) double l1; /// Beam direction and length - Geometry::V3D beamline; + Kernel::V3D beamline; /// Path length between source and sample double beamline_norm; /// Beam direction (unit vector) - Geometry::V3D beamDir; + Kernel::V3D beamDir; /// Sample position - Geometry::V3D samplePos; + Kernel::V3D samplePos; /// Progress reporter (shared) Kernel::ProgressBase * prog; /// Matrix. Multiply this by the lab frame Qx, Qy, Qz to get the desired Q or HKL. - Geometry::Matrix<double> mat; + Kernel::Matrix<double> mat; }; diff --git a/Code/Mantid/Framework/MDEvents/src/CoordTransform.cpp b/Code/Mantid/Framework/MDEvents/src/CoordTransform.cpp index bcb29741ad4..64256f45477 100644 --- a/Code/Mantid/Framework/MDEvents/src/CoordTransform.cpp +++ b/Code/Mantid/Framework/MDEvents/src/CoordTransform.cpp @@ -72,7 +72,7 @@ namespace MDEvents * @param newMatrix :: (outD+1 * inD+1) matrix to set. * @throw runtime_error if the matrix dimensions are incompatible. */ - void CoordTransform::setMatrix(const Mantid::Geometry::Matrix<coord_t> newMatrix) + void CoordTransform::setMatrix(const Mantid::Kernel::Matrix<coord_t> newMatrix) { if (newMatrix.numRows() != outD+1) throw std::runtime_error("setMatrix(): Number of rows must match!"); @@ -87,7 +87,7 @@ namespace MDEvents //---------------------------------------------------------------------------------------------- /** Return the affine matrix in the transform. */ - Mantid::Geometry::Matrix<coord_t> CoordTransform::getMatrix() const + Mantid::Kernel::Matrix<coord_t> CoordTransform::getMatrix() const { return affineMatrix; } diff --git a/Code/Mantid/Framework/MDEvents/src/MakeDiffractionMDEventWorkspace.cpp b/Code/Mantid/Framework/MDEvents/src/MakeDiffractionMDEventWorkspace.cpp index 966465c98c4..f757546fd68 100644 --- a/Code/Mantid/Framework/MDEvents/src/MakeDiffractionMDEventWorkspace.cpp +++ b/Code/Mantid/Framework/MDEvents/src/MakeDiffractionMDEventWorkspace.cpp @@ -255,7 +255,7 @@ namespace MDEvents ws = boost::dynamic_pointer_cast<MDEventWorkspace3>( i_out ); // Initalize the matrix to 3x3 identity - mat = Geometry::Matrix<double>(3,3, true); + mat = Kernel::Matrix<double>(3,3, true); // ----------------- Handle the type of output ------------------------------------- @@ -271,8 +271,8 @@ namespace MDEvents else if (OutputDimensions == "HKL") { // Set the matrix based on UB etc. - Geometry::Matrix<double> ub = in_ws->mutableSample().getOrientedLattice().getUB(); - Geometry::Matrix<double> gon = in_ws->mutableRun().getGoniometerMatrix(); + Kernel::Matrix<double> ub = in_ws->mutableSample().getOrientedLattice().getUB(); + Kernel::Matrix<double> gon = in_ws->mutableRun().getGoniometerMatrix(); // As per Busing and Levy 1967, HKL = Goniometer * UB * q_lab_frame mat = gon * ub; dimensionNames[0] = "H"; diff --git a/Code/Mantid/Framework/MDEvents/test/MDCentroidPeaksTest.h b/Code/Mantid/Framework/MDEvents/test/MDCentroidPeaksTest.h index 8655a146517..4955f8d4fd4 100644 --- a/Code/Mantid/Framework/MDEvents/test/MDCentroidPeaksTest.h +++ b/Code/Mantid/Framework/MDEvents/test/MDCentroidPeaksTest.h @@ -31,6 +31,7 @@ using namespace Mantid::API; using namespace Mantid::DataObjects; using namespace Mantid::Geometry; using namespace Mantid::MDEvents; +using Mantid::Kernel::V3D; class MDCentroidPeaksTest : public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/MDEvents/test/MDEWPeakIntegrationTest.h b/Code/Mantid/Framework/MDEvents/test/MDEWPeakIntegrationTest.h index 070de5cc26e..276601b28e6 100644 --- a/Code/Mantid/Framework/MDEvents/test/MDEWPeakIntegrationTest.h +++ b/Code/Mantid/Framework/MDEvents/test/MDEWPeakIntegrationTest.h @@ -30,6 +30,7 @@ using namespace Mantid::API; using namespace Mantid::DataObjects; using namespace Mantid::Geometry; using namespace Mantid::MDEvents; +using Mantid::Kernel::V3D; class MDEWPeakIntegrationTest : public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp b/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp index 15e243ef899..7009343351d 100644 --- a/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp +++ b/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp @@ -1337,14 +1337,14 @@ using namespace DataObjects; Mantid::Geometry::IObjComponent_const_sptr sample = localWorkspace->getInstrument()->getSample(); if (sample) { - Mantid::Geometry::V3D sample_pos = sample->getPos(); + Mantid::Kernel::V3D sample_pos = sample->getPos(); for(int i=0;i<ndet;i++) { double R,Theta,Phi; try { boost::shared_ptr<Mantid::Geometry::IDetector> det = localWorkspace->getInstrument()->getDetector(detector_list[i]); - Mantid::Geometry::V3D pos = det->getPos() - sample_pos; + Mantid::Kernel::V3D pos = det->getPos() - sample_pos; pos.getSpherical(R,Theta,Phi); R = det->getDistance(*sample); Theta = localWorkspace->detectorTwoTheta(det)*180.0/M_PI; diff --git a/Code/Mantid/Framework/PythonAPI/inc/MantidPythonAPI/MantidVecHelper.h b/Code/Mantid/Framework/PythonAPI/inc/MantidPythonAPI/MantidVecHelper.h index 096e15f5a8b..f7903f83114 100644 --- a/Code/Mantid/Framework/PythonAPI/inc/MantidPythonAPI/MantidVecHelper.h +++ b/Code/Mantid/Framework/PythonAPI/inc/MantidPythonAPI/MantidVecHelper.h @@ -6,7 +6,7 @@ //----------------------------------- #include "MantidAPI/MatrixWorkspace.h" // For MantidVec typedef #include "MantidPythonAPI/BoostPython_Silent.h" -#include <MantidGeometry/Math/Matrix.h>// For Matrix +#include "MantidKernel/Matrix.h" namespace Mantid { @@ -58,11 +58,11 @@ namespace Mantid /// Flag if the init routine has been called already static bool g_isInitialized; /// Choose an appropriate wrapping for a Matrix - static PyObject * createPythonWrapper(const Geometry::DblMatrix & values, bool readonly); + static PyObject * createPythonWrapper(const Kernel::DblMatrix & values, bool readonly); /// Create a numpy array using the already allocated data for Matrix - static PyObject * createNumPyArray(const Geometry::DblMatrix & values, bool readonly); + static PyObject * createNumPyArray(const Kernel::DblMatrix & values, bool readonly); /// Import a Matrix from a 2D numpy array - static Geometry::DblMatrix getMatrixFromArray(PyObject *p); + static Kernel::DblMatrix getMatrixFromArray(PyObject *p); }; } } diff --git a/Code/Mantid/Framework/PythonAPI/src/MantidVecHelper.cpp b/Code/Mantid/Framework/PythonAPI/src/MantidVecHelper.cpp index c5f9af60226..81dfaa0bee1 100644 --- a/Code/Mantid/Framework/PythonAPI/src/MantidVecHelper.cpp +++ b/Code/Mantid/Framework/PythonAPI/src/MantidVecHelper.cpp @@ -101,7 +101,7 @@ namespace Mantid * @param readonly :: If true the array is flagged as read only (only used for numpy arrays) * @returns A pointer to a PyObject that contains the data */ - PyObject * MantidVecHelper::createPythonWrapper(const Geometry::DblMatrix & values, bool readonly) + PyObject * MantidVecHelper::createPythonWrapper(const Kernel::DblMatrix & values, bool readonly) { if( g_useNumPy ) { @@ -118,7 +118,7 @@ namespace Mantid * @param readonly :: If true the array is flagged as read only * @returns A numpy wrapped array C-array */ - PyObject * MantidVecHelper::createNumPyArray(const Geometry::DblMatrix & values, bool readonly) + PyObject * MantidVecHelper::createNumPyArray(const Kernel::DblMatrix & values, bool readonly) { npy_intp dims[2] = {values.size().first,values.size().second} ; PyArrayObject * ndarray = @@ -130,7 +130,7 @@ namespace Mantid return (PyObject*)ndarray; } // - Geometry::DblMatrix MantidVecHelper::getMatrixFromArray(PyObject *p) + Kernel::DblMatrix MantidVecHelper::getMatrixFromArray(PyObject *p) { _import_array(); if(PyArray_Check(p)==1) @@ -142,7 +142,7 @@ namespace Mantid size_t nx,ny,i,j; nx=(size_t)(boost::python::extract< unsigned >( shape[0] )); ny=(size_t)(boost::python::extract< unsigned >( shape[1] )); - Geometry::Matrix<double> m(nx,ny); + Kernel::Matrix<double> m(nx,ny); for( i = 0; i < nx; i++ ) { for( j = 0; j < ny; j++ ) diff --git a/Code/Mantid/Framework/PythonAPI/src/geometry_exports.cpp b/Code/Mantid/Framework/PythonAPI/src/geometry_exports.cpp index bb5ab177841..a4b4f5dda79 100644 --- a/Code/Mantid/Framework/PythonAPI/src/geometry_exports.cpp +++ b/Code/Mantid/Framework/PythonAPI/src/geometry_exports.cpp @@ -15,8 +15,6 @@ #include "MantidPythonAPI/BoostPython_Silent.h" //Geometry -#include <MantidGeometry/V3D.h> -#include <MantidGeometry/Quat.h> #include <MantidGeometry/Crystal/UnitCell.h> #include <MantidGeometry/Crystal/OrientedLattice.h> #include <MantidGeometry/Instrument/ObjComponent.h> @@ -33,63 +31,6 @@ namespace Mantid { using namespace boost::python; - - void export_utils() - { - //V3D class - class_< Geometry::V3D >("V3D",init<>("Construct a V3D at 0,0,0")) - .def(init<double, double, double>("Construct a V3D with X,Y,Z coordinates")) - .def("getX", &Geometry::V3D::X, return_value_policy< copy_const_reference >()) - .def("getY", &Geometry::V3D::Y, return_value_policy< copy_const_reference >()) - .def("getZ", &Geometry::V3D::Z, return_value_policy< copy_const_reference >()) - .def("distance", &Geometry::V3D::distance) - .def("angle", &Geometry::V3D::angle) - .def("zenith", &Geometry::V3D::zenith) - .def("scalar_prod", &Geometry::V3D::scalar_prod) - .def("cross_prod", &Geometry::V3D::cross_prod) - .def("norm", &Geometry::V3D::norm) - .def("norm2", &Geometry::V3D::norm2) - .def(self + self) - .def(self += self) - .def(self - self) - .def(self -= self) - .def(self * self) - .def(self *= self) - .def(self / self) - .def(self /= self) - .def(self * int()) - .def(self *= int()) - .def(self * double()) - .def(self *= double()) - .def(self < self) - .def(self == self) - .def(self_ns::str(self)) - ; - - //Quat class - class_< Geometry::Quat >("Quat", init<>("Construct a default Quat that will perform no transformation.")) - .def(init<double, double, double, double>("Constructor with values")) - .def(init<V3D, V3D>("Construct a Quat between two vectors")) - .def(init<V3D, V3D, V3D>("Construct a Quaternion that performs a reference frame rotation.\nThe initial X,Y,Z vectors are aligned as expected: X=(1,0,0), Y=(0,1,0), Z=(0,0,1)")) - .def(init<double,V3D>("Constructor from an angle(degrees) and an axis.")) - .def("rotate", &Geometry::Quat::rotate) - .def("real", &Geometry::Quat::real) - .def("imagI", &Geometry::Quat::imagI) - .def("imagJ", &Geometry::Quat::imagJ) - .def("imagK", &Geometry::Quat::imagK) - .def(self + self) - .def(self += self) - .def(self - self) - .def(self -= self) - .def(self * self) - .def(self *= self) - .def(self == self) - .def(self != self) - .def(self_ns::str(self)) - ; - } - - // Default parameter function overloads BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParameterNames,Geometry::Component::getParameterNames,0,1); BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_hasParameter,Geometry::Component::hasParameter,1,2); @@ -331,7 +272,6 @@ namespace Mantid } void export_geometry_namespace() { - export_utils(); export_components(); export_instrument(); export_unit_cell(); diff --git a/Code/Mantid/Framework/PythonAPI/src/geometryhelper.cpp b/Code/Mantid/Framework/PythonAPI/src/geometryhelper.cpp index 36fd81eb691..e126198a3ac 100644 --- a/Code/Mantid/Framework/PythonAPI/src/geometryhelper.cpp +++ b/Code/Mantid/Framework/PythonAPI/src/geometryhelper.cpp @@ -32,7 +32,7 @@ PyObject* UnitCellWrapper::getB(UnitCell& self) void UnitCellWrapper::recalculateFromGstar(UnitCell& self,PyObject* p) { - Geometry::Matrix<double> m=MantidVecHelper::getMatrixFromArray(p); + Kernel::DblMatrix m=MantidVecHelper::getMatrixFromArray(p); if ((m.numRows()!=3) || (m.numCols()!=3)) throw std::invalid_argument("Not 3x3 matrix"); self.recalculateFromGstar(m); } @@ -83,7 +83,7 @@ PyObject* OrientedLatticeWrapper::getUB(OrientedLattice& self) void OrientedLatticeWrapper::recalculateFromGstar(OrientedLattice& self,PyObject* p) { - Geometry::Matrix<double> m=MantidVecHelper::getMatrixFromArray(p),unity(3,3,true); + Kernel::DblMatrix m=MantidVecHelper::getMatrixFromArray(p),unity(3,3,true); if ((m.numRows()!=3) || (m.numCols()!=3)) throw std::invalid_argument("Not 3x3 matrix"); self.recalculateFromGstar(m); self.setU(unity); @@ -91,14 +91,14 @@ void OrientedLatticeWrapper::recalculateFromGstar(OrientedLattice& self,PyObject void OrientedLatticeWrapper::setU(OrientedLattice& self,PyObject* p) { - Geometry::Matrix<double> m=MantidVecHelper::getMatrixFromArray(p); + Kernel::DblMatrix m=MantidVecHelper::getMatrixFromArray(p); if ((m.numRows()!=3) || (m.numCols()!=3)) throw std::invalid_argument("Not 3x3 matrix"); self.setU(m); } void OrientedLatticeWrapper::setUB(OrientedLattice& self,PyObject* p) { - Geometry::Matrix<double> m=MantidVecHelper::getMatrixFromArray(p); + Kernel::DblMatrix m=MantidVecHelper::getMatrixFromArray(p); if ((m.numRows()!=3) || (m.numCols()!=3)) throw std::invalid_argument("Not 3x3 matrix"); self.setUB(m); } diff --git a/Code/Mantid/Framework/PythonAPI/src/kernel_exports.cpp b/Code/Mantid/Framework/PythonAPI/src/kernel_exports.cpp index 7eeec393497..5d2d507c77f 100644 --- a/Code/Mantid/Framework/PythonAPI/src/kernel_exports.cpp +++ b/Code/Mantid/Framework/PythonAPI/src/kernel_exports.cpp @@ -17,8 +17,10 @@ #include "MantidKernel/Unit.h" #include "MantidKernel/PropertyWithValue.h" #include "MantidKernel/TimeSeriesProperty.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" -#include <MantidPythonAPI/stl_proxies.h> +#include "MantidPythonAPI/stl_proxies.h" namespace Mantid { @@ -28,6 +30,62 @@ namespace PythonAPI using namespace Mantid::Kernel; //@cond + void export_utils() + { + //V3D class + class_< V3D >("V3D",init<>("Construct a V3D at 0,0,0")) + .def(init<double, double, double>("Construct a V3D with X,Y,Z coordinates")) + .def("getX", &V3D::X, return_value_policy< copy_const_reference >()) + .def("getY", &V3D::Y, return_value_policy< copy_const_reference >()) + .def("getZ", &V3D::Z, return_value_policy< copy_const_reference >()) + .def("distance", &V3D::distance) + .def("angle", &V3D::angle) + .def("zenith", &V3D::zenith) + .def("scalar_prod", &V3D::scalar_prod) + .def("cross_prod", &V3D::cross_prod) + .def("norm", &V3D::norm) + .def("norm2", &V3D::norm2) + .def(self + self) + .def(self += self) + .def(self - self) + .def(self -= self) + .def(self * self) + .def(self *= self) + .def(self / self) + .def(self /= self) + .def(self * int()) + .def(self *= int()) + .def(self * double()) + .def(self *= double()) + .def(self < self) + .def(self == self) + .def(self_ns::str(self)) + ; + + //Quat class + class_< Quat >("Quat", init<>("Construct a default Quat that will perform no transformation.")) + .def(init<double, double, double, double>("Constructor with values")) + .def(init<V3D, V3D>("Construct a Quat between two vectors")) + .def(init<V3D, V3D, V3D>("Construct a Quaternion that performs a reference frame rotation.\nThe initial X,Y,Z vectors are aligned as expected: X=(1,0,0), Y=(0,1,0), Z=(0,0,1)")) + .def(init<double,V3D>("Constructor from an angle(degrees) and an axis.")) + .def("rotate", &Quat::rotate) + .def("real", &Quat::real) + .def("imagI", &Quat::imagI) + .def("imagJ", &Quat::imagJ) + .def("imagK", &Quat::imagK) + .def(self + self) + .def(self += self) + .def(self - self) + .def(self -= self) + .def(self * self) + .def(self *= self) + .def(self == self) + .def(self != self) + .def(self_ns::str(self)) + ; + } + + void export_property() { //Pointer @@ -238,6 +296,7 @@ namespace PythonAPI void export_kernel_namespace() { + export_utils(); export_property(); export_validators(); export_logger(); diff --git a/Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/ComponentCreationHelper.h b/Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/ComponentCreationHelper.h index 46b90c6f88e..3b6969dd0b3 100644 --- a/Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/ComponentCreationHelper.h +++ b/Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/ComponentCreationHelper.h @@ -3,7 +3,7 @@ #include "MantidTestHelpers/DLLExport.h" #include "MantidGeometry/Objects/Object.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Instrument/Instrument.h" #include "MantidGeometry/ISpectraDetectorMap.h" #include "MantidDataObjects/Workspace2D.h" @@ -53,16 +53,16 @@ namespace ComponentCreationHelper * Create a capped cylinder object */ DLL_TESTHELPERS Mantid::Geometry::Object_sptr - createCappedCylinder(double radius, double height, const Mantid::Geometry::V3D & baseCentre, - const Mantid::Geometry::V3D & axis, const std::string & id); + createCappedCylinder(double radius, double height, const Mantid::Kernel::V3D & baseCentre, + const Mantid::Kernel::V3D & axis, const std::string & id); /** * Return the XML for a sphere. */ - DLL_TESTHELPERS std::string sphereXML(double radius, const Mantid::Geometry::V3D & centre, const std::string & id); + DLL_TESTHELPERS std::string sphereXML(double radius, const Mantid::Kernel::V3D & centre, const std::string & id); /** * Create a sphere object */ - DLL_TESTHELPERS Mantid::Geometry::Object_sptr createSphere(double radius, const Mantid::Geometry::V3D & centre, const std::string & id); + DLL_TESTHELPERS Mantid::Geometry::Object_sptr createSphere(double radius, const Mantid::Kernel::V3D & centre, const std::string & id); /** Create a cuboid shape for your pixels */ DLL_TESTHELPERS Mantid::Geometry::Object_sptr createCuboid(double x_side_length, double y_side_length = -1.0, double z_side_length = -1.0); @@ -78,7 +78,7 @@ namespace ComponentCreationHelper * Create a hollow shell, i.e. the intersection of two spheres or radius r1 and r2 */ DLL_TESTHELPERS Mantid::Geometry::Object_sptr createHollowShell(double innerRadius, double outerRadius, - const Mantid::Geometry::V3D & centre = Mantid::Geometry::V3D()); + const Mantid::Kernel::V3D & centre = Mantid::Kernel::V3D()); /** * Create a detector group containing 5 detectors */ diff --git a/Code/Mantid/Framework/TestHelpers/src/ComponentCreationHelper.cpp b/Code/Mantid/Framework/TestHelpers/src/ComponentCreationHelper.cpp index eff160c37b0..bb3b0821e12 100644 --- a/Code/Mantid/Framework/TestHelpers/src/ComponentCreationHelper.cpp +++ b/Code/Mantid/Framework/TestHelpers/src/ComponentCreationHelper.cpp @@ -28,6 +28,8 @@ using namespace Mantid::API; using namespace Mantid::DataObjects; using Mantid::detid_t; using Mantid::specid_t; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; namespace ComponentCreationHelper { diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/CompAssemblyActor.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/CompAssemblyActor.cpp index 41e1d6a0cc0..d85c6833518 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/CompAssemblyActor.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/CompAssemblyActor.cpp @@ -5,7 +5,7 @@ #include "OpenGLError.h" #include "MantidGeometry/IInstrument.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/ICompAssembly.h" #include "MantidGeometry/Instrument/ObjCompAssembly.h" @@ -52,8 +52,8 @@ CompAssemblyActor::CompAssemblyActor(const InstrumentActor& instrActor,const Man boost::shared_ptr<const IComponent> CompPtr = getComponent(); //bounding box of the overall instrument - Mantid::Geometry::V3D minBound; - Mantid::Geometry::V3D maxBound; + Mantid::Kernel::V3D minBound; + Mantid::Kernel::V3D maxBound; //Iterate through CompAssembly children boost::shared_ptr<const ICompAssembly> CompAssemPtr=boost::dynamic_pointer_cast<const ICompAssembly>(CompPtr); if(CompAssemPtr!=boost::shared_ptr<ICompAssembly>()) @@ -168,7 +168,7 @@ void CompAssemblyActor::draw(bool picking)const * @param minBound :: min point of the bounding box * @param maxBound :: max point of the bounding box */ -void CompAssemblyActor::AppendBoundingBox(const Mantid::Geometry::V3D& minBound,const Mantid::Geometry::V3D& maxBound) +void CompAssemblyActor::AppendBoundingBox(const Mantid::Kernel::V3D& minBound,const Mantid::Kernel::V3D& maxBound) { if(minBoundBox[0]>minBound[0]) minBoundBox[0]=minBound[0]; if(minBoundBox[1]>minBound[1]) minBoundBox[1]=minBound[1]; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/CompAssemblyActor.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/CompAssemblyActor.h index 4639f88a6ad..b60b3e36541 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/CompAssemblyActor.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/CompAssemblyActor.h @@ -5,7 +5,7 @@ #include "GLActor.h" #include "MantidGeometry/IComponent.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" /** \class CompAssemblyActor \brief This class wraps the ICompAssembly into Actor. @@ -37,13 +37,15 @@ */ namespace Mantid { - +namespace Kernel +{ + class V3D; +} namespace Geometry { class IInstrument; class ICompAssembly; class Object; - class V3D; } } @@ -63,7 +65,7 @@ protected: mutable std::vector<ObjComponentActor*> mChildObjCompActors; ///< List of ObjComponent Actors mutable std::vector<ICompAssemblyActor*> mChildCompAssemActors; ///< List of CompAssembly Actors private: - void AppendBoundingBox(const Mantid::Geometry::V3D& minBound,const Mantid::Geometry::V3D& maxBound); + void AppendBoundingBox(const Mantid::Kernel::V3D& minBound,const Mantid::Kernel::V3D& maxBound); }; #endif /*GLTRIANGLE_H_*/ diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActor.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActor.h index bbfb8ff5008..00bda592ffc 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActor.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActor.h @@ -12,7 +12,7 @@ */ #ifndef GLACTOR_H_ #define GLACTOR_H_ -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "GLObject.h" #include "GLColor.h" #include <boost/shared_ptr.hpp> @@ -69,7 +69,7 @@ public: void setVisibility(bool); bool getVisibility(); virtual void draw(bool picking = false)const = 0; - virtual void getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const = 0; + virtual void getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const = 0; static GLColor makePickColor(size_t pickID); static size_t decodePickColor(const GLColor& c); static size_t decodePickColor(unsigned char r,unsigned char g,unsigned char b); diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActorCollection.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActorCollection.cpp index 1caacd78fb9..c414e4279a2 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActorCollection.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActorCollection.cpp @@ -88,8 +88,8 @@ void GLActorCollection::addActor(GLActor* a) return; } mActorsList.push_back(a); - Mantid::Geometry::V3D minBound; - Mantid::Geometry::V3D maxBound; + Mantid::Kernel::V3D minBound; + Mantid::Kernel::V3D maxBound; a->getBoundingBox(minBound,maxBound); if(m_minBound[0]>minBound[0]) m_minBound[0]=minBound[0]; if(m_minBound[1]>minBound[1]) m_minBound[1]=minBound[1]; @@ -128,7 +128,7 @@ GLActor* GLActorCollection::getActor(int index) return mActorsList.at(index); } -void GLActorCollection::getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const +void GLActorCollection::getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const { minBound = m_minBound; maxBound = m_maxBound; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActorCollection.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActorCollection.h index db5db174feb..f0a749f1cb9 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActorCollection.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLActorCollection.h @@ -2,7 +2,7 @@ #define GLACTORCOLLECTION_H_ #include "GLActor.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <vector> @@ -51,7 +51,7 @@ public: GLActorCollection(); ///< Default Constructor virtual ~GLActorCollection(); ///< Destructor void draw(bool picking = false)const; - void getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const; + void getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const; void addActor(GLActor*); void removeActor(GLActor*); @@ -61,8 +61,8 @@ public: private: void drawGL(bool picking = false)const; mutable std::vector<GLActor*> mActorsList; ///< Vector of GLActors for fast access. - Mantid::Geometry::V3D m_minBound; - Mantid::Geometry::V3D m_maxBound; + Mantid::Kernel::V3D m_minBound; + Mantid::Kernel::V3D m_maxBound; mutable GLuint m_displayListId; mutable bool m_useDisplayList; }; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLTrackball.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLTrackball.cpp index 59ae7bc8800..53d6e7deb9a 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLTrackball.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLTrackball.cpp @@ -12,7 +12,7 @@ GLTrackball::GLTrackball(GLViewport* parent):_viewport(parent) // on the sceen. The factor 180/M_PI is simply rad to deg conversion. THis // prevent recalculation of this factor every time a generateRotationTo call is issued. _rotationspeed=180/M_PI; - _modelCenter=Mantid::Geometry::V3D(0.0,0.0,0.0); + _modelCenter=Mantid::Kernel::V3D(0.0,0.0,0.0); hasOffset=false; } GLTrackball::~GLTrackball() @@ -24,16 +24,16 @@ void GLTrackball::initRotationFrom(int a,int b) } void GLTrackball::generateRotationTo(int a,int b) { - Mantid::Geometry::V3D _newpoint; + Mantid::Kernel::V3D _newpoint; projectOnSphere(a,b,_newpoint); - Mantid::Geometry::V3D diff(_lastpoint); + Mantid::Kernel::V3D diff(_lastpoint); // Difference between old point and new point diff-=_newpoint; // Angle is given in degrees as the dot product of the two vectors double angle=_rotationspeed*_newpoint.angle(_lastpoint); diff=_lastpoint.cross_prod(_newpoint); // Create a quaternion from the angle and vector direction - Mantid::Geometry::Quat temp(angle,diff); + Mantid::Kernel::Quat temp(angle,diff); // Left multiply temp*=_quaternion; // Assignment of _quaternion @@ -50,7 +50,7 @@ void GLTrackball::initTranslateFrom(int a,int b) void GLTrackball::generateTranslationTo(int a, int b) { - Mantid::Geometry::V3D _newpoint; + Mantid::Kernel::V3D _newpoint; generateTranslationPoint(a,b,_newpoint); // This is now the difference _newpoint-=_lastpoint; @@ -108,7 +108,7 @@ void GLTrackball::IssueRotation() const return; } -void GLTrackball::setModelCenter(const Mantid::Geometry::V3D& center) +void GLTrackball::setModelCenter(const Mantid::Kernel::V3D& center) { _modelCenter=center; if (_modelCenter.nullVector()) @@ -117,12 +117,12 @@ void GLTrackball::setModelCenter(const Mantid::Geometry::V3D& center) hasOffset=true; } -Mantid::Geometry::V3D GLTrackball::getModelCenter() const +Mantid::Kernel::V3D GLTrackball::getModelCenter() const { return _modelCenter; } -void GLTrackball::projectOnSphere(int a,int b,Mantid::Geometry::V3D& point) +void GLTrackball::projectOnSphere(int a,int b,Mantid::Kernel::V3D& point) { // z initiaised to zero if out of the sphere double x,y,z=0; @@ -143,7 +143,7 @@ void GLTrackball::projectOnSphere(int a,int b,Mantid::Geometry::V3D& point) point(x,y,z); } -void GLTrackball::generateTranslationPoint(int a,int b,Mantid::Geometry::V3D& point) +void GLTrackball::generateTranslationPoint(int a,int b,Mantid::Kernel::V3D& point) { double x,y,z=0.0; int _viewport_w, _viewport_h; @@ -181,7 +181,7 @@ void GLTrackball::reset() void GLTrackball::setViewToXPositive() { reset(); - Mantid::Geometry::Quat tempy(Mantid::Geometry::V3D(0.0,0.0,1.0),Mantid::Geometry::V3D(1.0,0.0,0.0)); + Mantid::Kernel::Quat tempy(Mantid::Kernel::V3D(0.0,0.0,1.0),Mantid::Kernel::V3D(1.0,0.0,0.0)); _quaternion=tempy; _quaternion.GLMatrix(&_rotationmatrix[0]); } @@ -189,7 +189,7 @@ void GLTrackball::setViewToXPositive() void GLTrackball::setViewToYPositive() { reset(); - Mantid::Geometry::Quat tempy(Mantid::Geometry::V3D(0.0,0.0,1.0),Mantid::Geometry::V3D(0.0,1.0,0.0)); + Mantid::Kernel::Quat tempy(Mantid::Kernel::V3D(0.0,0.0,1.0),Mantid::Kernel::V3D(0.0,1.0,0.0)); _quaternion=tempy; _quaternion.GLMatrix(&_rotationmatrix[0]); } @@ -204,7 +204,7 @@ void GLTrackball::setViewToZPositive() void GLTrackball::setViewToXNegative() { reset(); - Mantid::Geometry::Quat tempy(Mantid::Geometry::V3D(0.0,0.0,1.0),Mantid::Geometry::V3D(-1.0,0.0,0.0)); + Mantid::Kernel::Quat tempy(Mantid::Kernel::V3D(0.0,0.0,1.0),Mantid::Kernel::V3D(-1.0,0.0,0.0)); _quaternion=tempy; _quaternion.GLMatrix(&_rotationmatrix[0]); } @@ -212,7 +212,7 @@ void GLTrackball::setViewToXNegative() void GLTrackball::setViewToYNegative() { reset(); - Mantid::Geometry::Quat tempy(Mantid::Geometry::V3D(0.0,0.0,1.0),Mantid::Geometry::V3D(0.0,-1.0,0.0)); + Mantid::Kernel::Quat tempy(Mantid::Kernel::V3D(0.0,0.0,1.0),Mantid::Kernel::V3D(0.0,-1.0,0.0)); _quaternion=tempy; _quaternion.GLMatrix(&_rotationmatrix[0]); } @@ -220,7 +220,7 @@ void GLTrackball::setViewToYNegative() void GLTrackball::setViewToZNegative() { reset(); - Mantid::Geometry::Quat tempy(180.0,Mantid::Geometry::V3D(0.0,1.0,0.0)); + Mantid::Kernel::Quat tempy(180.0,Mantid::Kernel::V3D(0.0,1.0,0.0)); _quaternion=tempy; _quaternion.GLMatrix(&_rotationmatrix[0]); } @@ -238,7 +238,7 @@ void GLTrackball::rotateBoundingBox(double& xmin,double& xmax,double& ymin,doubl return; } -void GLTrackball::setRotation(const Mantid::Geometry::Quat& quat) +void GLTrackball::setRotation(const Mantid::Kernel::Quat& quat) { _quaternion=quat; _quaternion.GLMatrix(&_rotationmatrix[0]); diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLTrackball.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLTrackball.h index 97e0febca30..6a189d3879a 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLTrackball.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLTrackball.h @@ -1,8 +1,8 @@ #ifndef GLTRACKBALL_H_ #define GLTRACKBALL_H_ #include "MantidKernel/System.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" /** \class GLTrackball @@ -73,33 +73,33 @@ public: //! Call to set the View to Z- direction void setViewToZNegative(); //! Set Rotation - void setRotation(const Mantid::Geometry::Quat& quat); + void setRotation(const Mantid::Kernel::Quat& quat); //! Set Model center - void setModelCenter(const Mantid::Geometry::V3D& center); + void setModelCenter(const Mantid::Kernel::V3D& center); //! Get Model center - Mantid::Geometry::V3D getModelCenter() const; + Mantid::Kernel::V3D getModelCenter() const; //! Reset Trackball void reset(); //! Rotates a bounding box void rotateBoundingBox(double& xmin,double& xmax,double& ymin,double& ymax,double& zmin,double& zmax); - Mantid::Geometry::Quat getRotation() const {return _quaternion;} + Mantid::Kernel::Quat getRotation() const {return _quaternion;} private: //! Pointer to the viewport to which the trackball is attached GLViewport* _viewport; //! Project a point on the trackball sphere from viewport coordinates x,y - void projectOnSphere(int x,int y, Mantid::Geometry::V3D& p); + void projectOnSphere(int x,int y, Mantid::Kernel::V3D& p); //! Generate a 3D point coordinates from coordinates on the viewport. - void generateTranslationPoint(int x,int y, Mantid::Geometry::V3D& p); + void generateTranslationPoint(int x,int y, Mantid::Kernel::V3D& p); //! Previous point selected on sphere - Mantid::Geometry::V3D _lastpoint; + Mantid::Kernel::V3D _lastpoint; //! Rotation matrix stored as a quaternion - Mantid::Geometry::Quat _quaternion; + Mantid::Kernel::Quat _quaternion; //! Rotation matrix (4x4 stored as linear array) used in OpenGL double _rotationmatrix[16]; //! Rotation speed of the trackball double _rotationspeed; //! Center of rotation - Mantid::Geometry::V3D _modelCenter; + Mantid::Kernel::V3D _modelCenter; //! Is the centre of rotation offcentered bool hasOffset; }; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLViewport.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLViewport.cpp index d3725dbcc27..5ff487f288e 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLViewport.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/GLViewport.cpp @@ -2,7 +2,7 @@ #include <math.h> #include <iostream> #include "MantidGeometry/Rendering/OpenGL_Headers.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "OpenGLError.h" GLViewport::GLViewport(int w, int h):mWidth(w),mHeight(h) @@ -105,9 +105,9 @@ void GLViewport::getProjection(double& xmin,double& xmax,double& ymin,double& ym void GLViewport::getInstantProjection(double& xmin,double& xmax,double& ymin,double& ymax,double& zmin,double& zmax)const { - Mantid::Geometry::V3D center((mRight+mLeft)/2.0,(mTop+mBottom)/2.0,(mNear+mFar)/2.0); + Mantid::Kernel::V3D center((mRight+mLeft)/2.0,(mTop+mBottom)/2.0,(mNear+mFar)/2.0); - Mantid::Geometry::V3D distance(mRight-mLeft,mTop-mBottom,mNear-mFar); + Mantid::Kernel::V3D distance(mRight-mLeft,mTop-mBottom,mNear-mFar); //Window Aspect ratio GLdouble windowAspect= mHeight > 0 ? (GLdouble)mWidth/(GLdouble)mHeight : 1.0; //Adjust width and height to show the dimensions correct @@ -185,9 +185,9 @@ void GLViewport::getTranslation(double& xval,double& yval) /** Issue the OpenGL commands that define the viewport and projection. */ void GLViewport::issueGL() const { - //Mantid::Geometry::V3D center((mRight+mLeft)/2.0,(mTop+mBottom)/2.0,(mNear+mFar)/2.0); + //Mantid::Kernel::V3D center((mRight+mLeft)/2.0,(mTop+mBottom)/2.0,(mNear+mFar)/2.0); - //Mantid::Geometry::V3D distance(mRight-mLeft,mTop-mBottom,mNear-mFar); + //Mantid::Kernel::V3D distance(mRight-mLeft,mTop-mBottom,mNear-mFar); ////Window Aspect ratio //GLdouble windowAspect= mHeight > 0 ? (GLdouble)mWidth/(GLdouble)mHeight : 1.0; ////Adjust width and height to show the dimensions correct diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ICompAssemblyActor.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ICompAssemblyActor.cpp index b1beb3ae3e7..dae45e9ca99 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ICompAssemblyActor.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ICompAssemblyActor.cpp @@ -1,5 +1,5 @@ #include "MantidGeometry/IInstrument.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/ICompAssembly.h" #include "MantidGeometry/IObjComponent.h" @@ -30,7 +30,7 @@ ICompAssemblyActor::ICompAssemblyActor(const InstrumentActor& instrActor,const M * @param minBound :: min point of the bounding box * @param maxBound :: max point of the bounding box */ -void ICompAssemblyActor::getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const +void ICompAssemblyActor::getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const { minBound=minBoundBox; maxBound=maxBoundBox; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ICompAssemblyActor.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ICompAssemblyActor.h index a60e0889b8c..ff01a25e182 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ICompAssemblyActor.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ICompAssemblyActor.h @@ -2,7 +2,7 @@ #define ICOMPASSEMBLY_ACTOR__H_ #include "ComponentActor.h" #include "MantidGeometry/IComponent.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include <boost/shared_ptr.hpp> @@ -38,12 +38,15 @@ */ namespace Mantid { +namespace Kernel +{ + class V3D; +} namespace Geometry { class ICompAssembly; class Object; - class V3D; class IInstrument; } @@ -55,15 +58,15 @@ class ICompAssemblyActor : public ComponentActor { public: ICompAssemblyActor(const InstrumentActor& instrActor,const Mantid::Geometry::ComponentID& compID); ///< Constructor - void getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const; + void getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const; virtual std::string type()const {return "ICompAssemblyActor";} ///< Type of the GL object int getNumberOfDetectors() const { return mNumberOfDetectors;} protected: int mNumberOfDetectors; - Mantid::Geometry::V3D minBoundBox; - Mantid::Geometry::V3D maxBoundBox; + Mantid::Kernel::V3D minBoundBox; + Mantid::Kernel::V3D maxBoundBox; }; #endif /*GLTRIANGLE_H_*/ diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.cpp index 86f20153d50..dfc4141236d 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.cpp @@ -1,7 +1,7 @@ #include "InstrumentActor.h" #include "CompAssemblyActor.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/ICompAssembly.h" #include "MantidGeometry/IObjComponent.h" @@ -278,13 +278,13 @@ bool InstrumentActor::wholeRange()const * @param R :: The output rotation as a quaternion * @param out :: Debug printout flag */ -void InstrumentActor::BasisRotation(const Mantid::Geometry::V3D& Xfrom, - const Mantid::Geometry::V3D& Yfrom, - const Mantid::Geometry::V3D& Zfrom, - const Mantid::Geometry::V3D& Xto, - const Mantid::Geometry::V3D& Yto, - const Mantid::Geometry::V3D& Zto, - Mantid::Geometry::Quat& R, +void InstrumentActor::BasisRotation(const Mantid::Kernel::V3D& Xfrom, + const Mantid::Kernel::V3D& Yfrom, + const Mantid::Kernel::V3D& Zfrom, + const Mantid::Kernel::V3D& Xto, + const Mantid::Kernel::V3D& Yto, + const Mantid::Kernel::V3D& Zto, + Mantid::Kernel::Quat& R, bool out ) { @@ -301,37 +301,37 @@ void InstrumentActor::BasisRotation(const Mantid::Geometry::V3D& Xfrom, double sX = Xfrom.scalar_prod(Xto); if (fabs(sX - 1) < m_tolerance) { - R = Mantid::Geometry::Quat(); + R = Mantid::Kernel::Quat(); } else if (fabs(sX + 1) < m_tolerance) { - R = Mantid::Geometry::Quat(180,Zfrom); + R = Mantid::Kernel::Quat(180,Zfrom); } else { - R = Mantid::Geometry::Quat(Xfrom,Xto); + R = Mantid::Kernel::Quat(Xfrom,Xto); } } else if(fabs(sZ + 1) < m_tolerance) // rotated by 180 degrees { if (fabs(Xfrom.scalar_prod(Xto)-1) < m_tolerance) { - R = Mantid::Geometry::Quat(180.,Xfrom); + R = Mantid::Kernel::Quat(180.,Xfrom); } else if (fabs(Yfrom.scalar_prod(Yto)-1) < m_tolerance) { - R = Mantid::Geometry::Quat(180.,Yfrom); + R = Mantid::Kernel::Quat(180.,Yfrom); } else { - R = Mantid::Geometry::Quat(180.,Xto)*Mantid::Geometry::Quat(Xfrom,Xto); + R = Mantid::Kernel::Quat(180.,Xto)*Mantid::Kernel::Quat(Xfrom,Xto); } } else { // Rotation R1 of system (X,Y,Z) around Z by alpha - Mantid::Geometry::V3D X1; - Mantid::Geometry::Quat R1; + Mantid::Kernel::V3D X1; + Mantid::Kernel::Quat R1; X1 = Zfrom.cross_prod(Zto); X1.normalize(); @@ -339,45 +339,45 @@ void InstrumentActor::BasisRotation(const Mantid::Geometry::V3D& Xfrom, double sX = Xfrom.scalar_prod(Xto); if (fabs(sX - 1) < m_tolerance) { - R = Mantid::Geometry::Quat(Zfrom,Zto); + R = Mantid::Kernel::Quat(Zfrom,Zto); return; } sX = Xfrom.scalar_prod(X1); if (fabs(sX - 1) < m_tolerance) { - R1 = Mantid::Geometry::Quat(); + R1 = Mantid::Kernel::Quat(); } else if (fabs(sX + 1) < m_tolerance) // 180 degree rotation { - R1 = Mantid::Geometry::Quat(180.,Zfrom); + R1 = Mantid::Kernel::Quat(180.,Zfrom); } else { - R1 = Mantid::Geometry::Quat(Xfrom,X1); + R1 = Mantid::Kernel::Quat(Xfrom,X1); } if (out) std::cerr<<"R1="<<R1<<'\n'; // Rotation R2 around X1 by beta - Mantid::Geometry::Quat R2(Zfrom,Zto); // vectors are different + Mantid::Kernel::Quat R2(Zfrom,Zto); // vectors are different if (out) std::cerr<<"R2="<<R2<<'\n'; // Rotation R3 around ZZ by gamma - Mantid::Geometry::Quat R3; + Mantid::Kernel::Quat R3; sX = Xto.scalar_prod(X1); if (fabs(sX - 1) < m_tolerance) { - R3 = Mantid::Geometry::Quat(); + R3 = Mantid::Kernel::Quat(); } else if (fabs(sX + 1) < m_tolerance) // 180 degree rotation { - R3 = Mantid::Geometry::Quat(180.,Zto); + R3 = Mantid::Kernel::Quat(180.,Zto); } else { - R3 = Mantid::Geometry::Quat(X1,Xto); + R3 = Mantid::Kernel::Quat(X1,Xto); } if (out) std::cerr<<"R3="<<R3<<'\n'; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.h index e74cace3966..dd256a02dfe 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.h @@ -87,7 +87,7 @@ public: double maxBinValue()const{return m_BinMaxValue;} bool wholeRange()const; void draw(bool picking = false)const; - void getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const{m_scene.getBoundingBox(minBound,maxBound);} + void getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const{m_scene.getBoundingBox(minBound,maxBound);} size_t ndetectors()const{return m_detIDs.size();} boost::shared_ptr<Mantid::Geometry::IDetector> getDetector(size_t pickID)const; Mantid::detid_t getDetID(size_t pickID)const{return m_detIDs.at(pickID);} @@ -96,13 +96,13 @@ public: size_t getWorkspaceIndex(Mantid::detid_t id)const{return (*m_id2wi_map)[id];} void invalidateDisplayLists()const{m_scene.invalidateDisplayList();} QString getCurrentColorMap()const{return m_currentColorMap;} - static void BasisRotation(const Mantid::Geometry::V3D& Xfrom, - const Mantid::Geometry::V3D& Yfrom, - const Mantid::Geometry::V3D& Zfrom, - const Mantid::Geometry::V3D& Xto, - const Mantid::Geometry::V3D& Yto, - const Mantid::Geometry::V3D& Zto, - Mantid::Geometry::Quat& R, + static void BasisRotation(const Mantid::Kernel::V3D& Xfrom, + const Mantid::Kernel::V3D& Yfrom, + const Mantid::Kernel::V3D& Zfrom, + const Mantid::Kernel::V3D& Xto, + const Mantid::Kernel::V3D& Yto, + const Mantid::Kernel::V3D& Zto, + Mantid::Kernel::Quat& R, bool out = false ); signals: diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp index 0aa5648c5c8..e4515348ec3 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp @@ -70,13 +70,13 @@ void InstrumentTreeWidget::getSelectedBoundingBox(const QModelIndex& index,doubl } } -Mantid::Geometry::V3D InstrumentTreeWidget::getSamplePos()const +Mantid::Kernel::V3D InstrumentTreeWidget::getSamplePos()const { boost::shared_ptr<const Mantid::Geometry::IComponent> sample = mInstrument->getSample(); if(sample!=NULL) return sample->getPos(); else - return Mantid::Geometry::V3D(0.0,0.0,0.0); + return Mantid::Kernel::V3D(0.0,0.0,0.0); } QModelIndex InstrumentTreeWidget::findComponentByName(const QString & name) const diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.h index 4c0a7b42c55..2a652ea031a 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.h @@ -19,7 +19,7 @@ public: InstrumentTreeWidget(QWidget *w); void setInstrument(boost::shared_ptr<const Mantid::Geometry::IInstrument>); void getSelectedBoundingBox(const QModelIndex& index,double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin); - Mantid::Geometry::V3D getSamplePos()const; + Mantid::Kernel::V3D getSamplePos()const; QModelIndex findComponentByName(const QString & name) const; protected slots: void sendComponentSelectedSignal(const QModelIndex); diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp index f2a64ca00ab..fefaa65609c 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp @@ -170,19 +170,19 @@ void InstrumentWindow::setSurfaceType(int type) if (!m_instrumentActor) return; boost::shared_ptr<Mantid::Geometry::IInstrument> instr = m_workspace->getInstrument(); Mantid::Geometry::IObjComponent_sptr sample = instr->getSample(); - Mantid::Geometry::V3D sample_pos = sample->getPos(); - Mantid::Geometry::V3D axis; + Mantid::Kernel::V3D sample_pos = sample->getPos(); + Mantid::Kernel::V3D axis; if (m_surfaceType == SPHERICAL_Y || m_surfaceType == CYLINDRICAL_Y) { - axis = Mantid::Geometry::V3D(0,1,0); + axis = Mantid::Kernel::V3D(0,1,0); } else if (m_surfaceType == SPHERICAL_Z || m_surfaceType == CYLINDRICAL_Z) { - axis = Mantid::Geometry::V3D(0,0,1); + axis = Mantid::Kernel::V3D(0,0,1); } else // SPHERICAL_X || CYLINDRICAL_X { - axis = Mantid::Geometry::V3D(1,0,0); + axis = Mantid::Kernel::V3D(1,0,0); } ProjectionSurface* surface; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowPickTab.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowPickTab.cpp index aafdc704fcf..7d11f91c7a4 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowPickTab.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowPickTab.cpp @@ -160,7 +160,7 @@ void InstrumentWindowPickTab::updateSelectionInfo(int detid) QString text = "Selected detector: " + QString::fromStdString(det->getName()) + "\n"; text += "Detector ID: " + QString::number(detid) + '\n'; text += "Workspace index: " + QString::number(wi) + '\n'; - Mantid::Geometry::V3D pos = det->getPos(); + Mantid::Kernel::V3D pos = det->getPos(); text += "xyz: " + QString::number(pos.X()) + "," + QString::number(pos.Y()) + "," + QString::number(pos.Z()) + '\n'; double r,t,p; pos.getSpherical(r,t,p); @@ -426,8 +426,8 @@ void InstrumentWindowPickTab::addPeak(double x,double y) return; } } - const Mantid::Geometry::V3D samplePos = sample->getPos(); - const Mantid::Geometry::V3D beamLine = samplePos - source->getPos(); + const Mantid::Kernel::V3D samplePos = sample->getPos(); + const Mantid::Kernel::V3D beamLine = samplePos - source->getPos(); double theta2 = det->getTwoTheta(samplePos,beamLine); double phi = det->getPhi(); @@ -441,7 +441,7 @@ void InstrumentWindowPickTab::addPeak(double x,double y) Qy *= knorm; Qz *= knorm; - Mantid::API::IPeak* peak = tw->createPeak(Mantid::Geometry::V3D(Qx,Qy,Qz),l2); + Mantid::API::IPeak* peak = tw->createPeak(Mantid::Kernel::V3D(Qx,Qy,Qz),l2); peak->setDetectorID(m_currentDetID); tw->addPeak(*peak); delete peak; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjCompAssemblyActor.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjCompAssemblyActor.cpp index f83d314b1c1..1a088c270b5 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjCompAssemblyActor.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjCompAssemblyActor.cpp @@ -4,7 +4,7 @@ #include "OpenGLError.h" #include "MantidGeometry/IInstrument.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/ICompAssembly.h" #include "MantidGeometry/IObjComponent.h" diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjCompAssemblyActor.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjCompAssemblyActor.h index 8f687b0bc8d..9ae51ad209b 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjCompAssemblyActor.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjCompAssemblyActor.h @@ -4,7 +4,7 @@ #include "MantidGeometry/IComponent.h" #include "MantidGeometry/IDetector.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" class TexObject; namespace Mantid{ @@ -50,7 +50,7 @@ public: virtual ~ObjCompAssemblyActor(); ///< Destructor virtual std::string type()const {return "ObjCompAssemblyActor";} ///< Type of the GL object virtual void draw(bool picking = false)const; ///< Method that defines ObjComponent geometry. Calls ObjComponent draw method - //virtual void getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const; + //virtual void getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const; virtual void setColors(); private: void setDetectorColor(unsigned char* data, size_t i,GLColor c); ///< set colour to a detector diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjComponentActor.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjComponentActor.cpp index fff39b1a44a..60e5b5c877c 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjComponentActor.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjComponentActor.cpp @@ -2,8 +2,8 @@ #include "InstrumentActor.h" #include "OpenGLError.h" -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include "MantidGeometry/IObjComponent.h" #include "MantidKernel/Exception.h" #include "MantidGeometry/IDetector.h" @@ -78,7 +78,7 @@ void ObjComponentActor::setColors() * @param minBound :: min point of the bounding box * @param maxBound :: max point of the bounding box */ -void ObjComponentActor::getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const +void ObjComponentActor::getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const { Mantid::Geometry::BoundingBox boundBox; getComponent()->getBoundingBox(boundBox); diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjComponentActor.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjComponentActor.h index fc5b1276dc2..1fda67d582d 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjComponentActor.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ObjComponentActor.h @@ -31,9 +31,14 @@ File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid> */ namespace Mantid{ - namespace Geometry{ +namespace Kernel +{ + class V3D; +} + + namespace Geometry{ class IObjComponent; - class V3D; + } } class InstrumentActor; @@ -45,7 +50,7 @@ public: ~ObjComponentActor(); ///< Destructor virtual std::string type()const {return "ObjComponentActor";} ///< Type of the GL object virtual void draw(bool picking = false)const; ///< Method that defines ObjComponent geometry. Calls ObjComponent draw method - virtual void getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const; + virtual void getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const; virtual void setColors(); void setColor(const GLColor& c){m_dataColor = c;} diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.cpp index b7337565fd8..389f5edfc2d 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.cpp @@ -35,7 +35,7 @@ using namespace Mantid::Kernel; using namespace Mantid::Geometry; Projection3D::Projection3D(const InstrumentActor* rootActor,int winWidth,int winHeight) - :ProjectionSurface(rootActor,Mantid::Geometry::V3D(),Mantid::Geometry::V3D(0,0,1)), + :ProjectionSurface(rootActor,Mantid::Kernel::V3D(),Mantid::Kernel::V3D(0,0,1)), //m_instrActor(*rootActor), m_viewport(new GLViewport), m_drawAxes(true), diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.h index 35181518ed5..96ac137ef37 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/Projection3D.h @@ -11,7 +11,7 @@ //#include "DetSelector.h" #include "MantidGeometry/IComponent.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidAPI/MatrixWorkspace.h" #include "MantidGeometry/IDetector.h" diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ProjectionSurface.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ProjectionSurface.cpp index d6461e3b7b0..8471122f095 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ProjectionSurface.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ProjectionSurface.cpp @@ -23,7 +23,7 @@ * @param origin :: Defines the origin of the projection reference system (if applicable) * @param axis :: */ -ProjectionSurface::ProjectionSurface(const InstrumentActor* rootActor,const Mantid::Geometry::V3D& origin,const Mantid::Geometry::V3D& axis): +ProjectionSurface::ProjectionSurface(const InstrumentActor* rootActor,const Mantid::Kernel::V3D& origin,const Mantid::Kernel::V3D& axis): m_instrActor(rootActor), m_pos(origin), m_zaxis(axis), diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ProjectionSurface.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ProjectionSurface.h index d0dc138f17d..ce002731611 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ProjectionSurface.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/ProjectionSurface.h @@ -1,8 +1,8 @@ #ifndef PROJECTIONSURFACE_H #define PROJECTIONSURFACE_H -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include "MantidGeometry/IComponent.h" #include "InstrumentActor.h" #include <boost/shared_ptr.hpp> @@ -41,7 +41,7 @@ class ProjectionSurface: public QObject public: enum InteractionMode {MoveMode = 0, PickMode = 1}; ///< Move around or select things - ProjectionSurface(const InstrumentActor* rootActor,const Mantid::Geometry::V3D& origin,const Mantid::Geometry::V3D& axis); + ProjectionSurface(const InstrumentActor* rootActor,const Mantid::Kernel::V3D& origin,const Mantid::Kernel::V3D& axis); virtual ~ProjectionSurface(); /// draw the surface onto a GL widget virtual void draw(MantidGLWidget* widget)const; @@ -117,10 +117,10 @@ protected: QString getPickInfoText()const; const InstrumentActor* m_instrActor; - const Mantid::Geometry::V3D m_pos; ///< Origin (sample position) - const Mantid::Geometry::V3D m_zaxis; ///< The z axis of the surface specific coord system - Mantid::Geometry::V3D m_xaxis; ///< The x axis - Mantid::Geometry::V3D m_yaxis; ///< The y axis + const Mantid::Kernel::V3D m_pos; ///< Origin (sample position) + const Mantid::Kernel::V3D m_zaxis; ///< The z axis of the surface specific coord system + Mantid::Kernel::V3D m_xaxis; ///< The x axis + Mantid::Kernel::V3D m_yaxis; ///< The y axis mutable QImage* m_viewImage; ///< storage for view image mutable QImage* m_pickImage; ///< storage for picking image mutable bool m_viewChanged; ///< set when the image must be redrawn diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/RectangularDetectorActor.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/RectangularDetectorActor.cpp index f709aa26e3a..e5fba39c4b8 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/RectangularDetectorActor.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/RectangularDetectorActor.cpp @@ -4,7 +4,7 @@ #include "InstrumentActor.h" #include "MantidGeometry/IInstrument.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/BoundingBox.h" #include "MantidGeometry/ICompAssembly.h" @@ -15,6 +15,8 @@ #include <cfloat> using namespace Mantid; using namespace Geometry; +using Mantid::Kernel::V3D; +using Mantid::Kernel::Quat; static const bool VERBOSE = false; @@ -242,7 +244,7 @@ void RectangularDetectorActor::uploadTexture(char * & image_data)const * @param minBound :: min point of the bounding box * @param maxBound :: max point of the bounding box */ -void RectangularDetectorActor::getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const +void RectangularDetectorActor::getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const { minBound=minBoundBox; maxBound=maxBoundBox; @@ -254,7 +256,7 @@ void RectangularDetectorActor::getBoundingBox(Mantid::Geometry::V3D& minBound,Ma * @param minBound :: min point of the bounding box * @param maxBound :: max point of the bounding box */ -void RectangularDetectorActor::AppendBoundingBox(const Mantid::Geometry::V3D& minBound,const Mantid::Geometry::V3D& maxBound) +void RectangularDetectorActor::AppendBoundingBox(const Mantid::Kernel::V3D& minBound,const Mantid::Kernel::V3D& maxBound) { if(minBoundBox[0]>minBound[0]) minBoundBox[0]=minBound[0]; if(minBoundBox[1]>minBound[1]) minBoundBox[1]=minBound[1]; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/RectangularDetectorActor.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/RectangularDetectorActor.h index 4c5395143a8..301635d962b 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/RectangularDetectorActor.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/RectangularDetectorActor.h @@ -5,7 +5,7 @@ #include "ICompAssemblyActor.h" #include "MantidGeometry/IComponent.h" #include "MantidGeometry/Instrument/RectangularDetector.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" /** \class RectangularDetectorActor \brief This class wraps a RectangularDetector into Actor. @@ -36,12 +36,14 @@ */ namespace Mantid { - +namespace Kernel +{ + class V3D; +} namespace Geometry { class ICompAssembly; class Object; - class V3D; } namespace API { @@ -61,7 +63,7 @@ public: virtual ~RectangularDetectorActor(); private: - void AppendBoundingBox(const Mantid::Geometry::V3D& minBound,const Mantid::Geometry::V3D& maxBound); + void AppendBoundingBox(const Mantid::Kernel::V3D& minBound,const Mantid::Kernel::V3D& maxBound); protected: /// The rectangular detector @@ -76,7 +78,7 @@ public: virtual std::string type()const {return "RectangularDetectorActor";} ///< Type of the GL object void draw(bool picking = false)const; ///< Method that defines ObjComponent geometry. Calls ObjComponent draw method - void getBoundingBox(Mantid::Geometry::V3D& minBound,Mantid::Geometry::V3D& maxBound)const; + void getBoundingBox(Mantid::Kernel::V3D& minBound,Mantid::Kernel::V3D& maxBound)const; virtual void setColors(); int genTexture(char * & image_data, std::vector<GLColor>& list, bool useDetectorIDs); diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedCylinder.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedCylinder.cpp index 4a471a020bf..92c74bcbd14 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedCylinder.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedCylinder.cpp @@ -2,7 +2,7 @@ #include "MantidGeometry/IDetector.h" -UnwrappedCylinder::UnwrappedCylinder(const InstrumentActor* rootActor, const Mantid::Geometry::V3D &origin, const Mantid::Geometry::V3D &axis): +UnwrappedCylinder::UnwrappedCylinder(const InstrumentActor* rootActor, const Mantid::Kernel::V3D &origin, const Mantid::Kernel::V3D &axis): UnwrappedSurface(rootActor,origin,axis) { init(); @@ -11,7 +11,7 @@ UnwrappedCylinder::UnwrappedCylinder(const InstrumentActor* rootActor, const Man void UnwrappedCylinder::calcUV(UnwrappedDetector& udet) { //static const double pi2 = 2*acos(-1.); - Mantid::Geometry::V3D pos = udet.detector->getPos() - m_pos; + Mantid::Kernel::V3D pos = udet.detector->getPos() - m_pos; // projection to cylinder axis udet.v = pos.scalar_prod(m_zaxis); @@ -22,20 +22,20 @@ void UnwrappedCylinder::calcUV(UnwrappedDetector& udet) udet.uscale = 1./sqrt(x*x+y*y); udet.vscale = 1.; - calcSize(udet,Mantid::Geometry::V3D(-1,0,0),Mantid::Geometry::V3D(0,1,0)); + calcSize(udet,Mantid::Kernel::V3D(-1,0,0),Mantid::Kernel::V3D(0,1,0)); } -void UnwrappedCylinder::calcRot(const UnwrappedDetector& udet, Mantid::Geometry::Quat& R)const +void UnwrappedCylinder::calcRot(const UnwrappedDetector& udet, Mantid::Kernel::Quat& R)const { // Basis vectors for a detector image on the screen - const Mantid::Geometry::V3D X(-1,0,0); - const Mantid::Geometry::V3D Y(0,1,0); - const Mantid::Geometry::V3D Z(0,0,-1); + const Mantid::Kernel::V3D X(-1,0,0); + const Mantid::Kernel::V3D Y(0,1,0); + const Mantid::Kernel::V3D Z(0,0,-1); // Find basis with x axis pointing to the detector from the sample, // z axis is coplanar with x and m_zaxis, and y making the basis right handed - Mantid::Geometry::V3D x,y,z; + Mantid::Kernel::V3D x,y,z; z = udet.detector->getPos() - m_pos; y = m_zaxis; y.normalize(); @@ -43,7 +43,7 @@ void UnwrappedCylinder::calcRot(const UnwrappedDetector& udet, Mantid::Geometry: x.normalize(); z = z - y * z.scalar_prod(y); z.normalize(); - Mantid::Geometry::Quat R1; + Mantid::Kernel::Quat R1; InstrumentActor::BasisRotation(x,y,z,X,Y,Z,R1); R = R1 * udet.detector->getRotation(); diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedCylinder.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedCylinder.h index b556c4b2db6..9b479b689f9 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedCylinder.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedCylinder.h @@ -9,10 +9,10 @@ class UnwrappedCylinder: public UnwrappedSurface { public: - UnwrappedCylinder(const InstrumentActor* rootActor,const Mantid::Geometry::V3D& origin,const Mantid::Geometry::V3D& axis); + UnwrappedCylinder(const InstrumentActor* rootActor,const Mantid::Kernel::V3D& origin,const Mantid::Kernel::V3D& axis); protected: void calcUV(UnwrappedDetector& udet); - void calcRot(const UnwrappedDetector& udet, Mantid::Geometry::Quat& R)const; + void calcRot(const UnwrappedDetector& udet, Mantid::Kernel::Quat& R)const; double uPeriod()const; }; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSphere.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSphere.cpp index 976bf3c3f3f..7eac1dc9d42 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSphere.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSphere.cpp @@ -2,7 +2,7 @@ #include "MantidGeometry/IDetector.h" #include <cmath> -UnwrappedSphere::UnwrappedSphere(const InstrumentActor* rootActor, const Mantid::Geometry::V3D &origin, const Mantid::Geometry::V3D &axis): +UnwrappedSphere::UnwrappedSphere(const InstrumentActor* rootActor, const Mantid::Kernel::V3D &origin, const Mantid::Kernel::V3D &axis): UnwrappedSurface(rootActor,origin,axis) { init(); @@ -11,7 +11,7 @@ UnwrappedSphere::UnwrappedSphere(const InstrumentActor* rootActor, const Mantid: void UnwrappedSphere::calcUV(UnwrappedDetector& udet) { //static const double pi2 = 2*acos(-1.); - Mantid::Geometry::V3D pos = udet.detector->getPos() - m_pos; + Mantid::Kernel::V3D pos = udet.detector->getPos() - m_pos; // projection to cylinder axis udet.v = pos.scalar_prod(m_zaxis); @@ -25,20 +25,20 @@ void UnwrappedSphere::calcUV(UnwrappedDetector& udet) udet.u = -atan2(y,x); udet.v = -acos(udet.v/r); - calcSize(udet,Mantid::Geometry::V3D(-1,0,0),Mantid::Geometry::V3D(0,1,0)); + calcSize(udet,Mantid::Kernel::V3D(-1,0,0),Mantid::Kernel::V3D(0,1,0)); } -void UnwrappedSphere::calcRot(const UnwrappedDetector& udet, Mantid::Geometry::Quat& R)const +void UnwrappedSphere::calcRot(const UnwrappedDetector& udet, Mantid::Kernel::Quat& R)const { // Basis vectors for a detector image on the screen - const Mantid::Geometry::V3D X(-1,0,0); - const Mantid::Geometry::V3D Y(0,1,0); - const Mantid::Geometry::V3D Z(0,0,-1); + const Mantid::Kernel::V3D X(-1,0,0); + const Mantid::Kernel::V3D Y(0,1,0); + const Mantid::Kernel::V3D Z(0,0,-1); // Find basis with x axis pointing to the detector from the sample, // z axis is coplanar with x and m_zaxis, and y making the basis right handed - Mantid::Geometry::V3D x,y,z; + Mantid::Kernel::V3D x,y,z; z = udet.detector->getPos() - m_pos; z.normalize(); y = m_zaxis; @@ -49,7 +49,7 @@ void UnwrappedSphere::calcRot(const UnwrappedDetector& udet, Mantid::Geometry::Q } x.normalize(); y = z.cross_prod(x); - Mantid::Geometry::Quat R1; + Mantid::Kernel::Quat R1; InstrumentActor::BasisRotation(x,y,z,X,Y,Z,R1); R = R1 * udet.detector->getRotation(); diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSphere.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSphere.h index bd4e3b4b62b..f2202719486 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSphere.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSphere.h @@ -9,10 +9,10 @@ class UnwrappedSphere: public UnwrappedSurface { public: - UnwrappedSphere(const InstrumentActor* rootActor,const Mantid::Geometry::V3D& origin,const Mantid::Geometry::V3D& axis); + UnwrappedSphere(const InstrumentActor* rootActor,const Mantid::Kernel::V3D& origin,const Mantid::Kernel::V3D& axis); protected: void calcUV(UnwrappedDetector& udet); - void calcRot(const UnwrappedDetector& udet, Mantid::Geometry::Quat& R)const; + void calcRot(const UnwrappedDetector& udet, Mantid::Kernel::Quat& R)const; double uPeriod()const; }; diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSurface.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSurface.cpp index 1c4398f4858..072aec5e117 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSurface.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSurface.cpp @@ -27,7 +27,7 @@ detector(det) } -UnwrappedSurface::UnwrappedSurface(const InstrumentActor* rootActor,const Mantid::Geometry::V3D& origin,const Mantid::Geometry::V3D& axis): +UnwrappedSurface::UnwrappedSurface(const InstrumentActor* rootActor,const Mantid::Kernel::V3D& origin,const Mantid::Kernel::V3D& axis): ProjectionSurface(rootActor,origin,axis), m_instrActor(rootActor), m_u_min(DBL_MAX), @@ -66,7 +66,7 @@ void UnwrappedSurface::init() // first detector defines the surface's x axis if (m_xaxis.nullVector()) { - Mantid::Geometry::V3D pos = det->getPos() - m_pos; + Mantid::Kernel::V3D pos = det->getPos() - m_pos; double z = pos.scalar_prod(m_zaxis); m_xaxis = pos - m_zaxis * z; m_xaxis.normalize(); @@ -209,13 +209,13 @@ void UnwrappedSurface::drawSurface(MantidGLWidget *widget,bool picking)const glTranslated(udet.u,udet.v,0.); glScaled(udet.uscale,udet.vscale,1); - Mantid::Geometry::Quat rot; + Mantid::Kernel::Quat rot; this->calcRot(udet,rot); double deg,ax0,ax1,ax2; rot.getAngleAxis(deg,ax0,ax1,ax2); glRotated(deg,ax0,ax1,ax2); - Mantid::Geometry::V3D scaleFactor = udet.detector->getScaleFactor(); + Mantid::Kernel::V3D scaleFactor = udet.detector->getScaleFactor(); glScaled(scaleFactor[0],scaleFactor[1],scaleFactor[2]); udet.detector->shape()->draw(); @@ -237,23 +237,23 @@ void UnwrappedSurface::drawSurface(MantidGLWidget *widget,bool picking)const } -void UnwrappedSurface::calcSize(UnwrappedDetector& udet,const Mantid::Geometry::V3D& X, - const Mantid::Geometry::V3D& Y) +void UnwrappedSurface::calcSize(UnwrappedDetector& udet,const Mantid::Kernel::V3D& X, + const Mantid::Kernel::V3D& Y) { - Mantid::Geometry::Quat R; + Mantid::Kernel::Quat R; this->calcRot(udet,R); Mantid::Geometry::BoundingBox bbox = udet.detector->shape()->getBoundingBox(); - Mantid::Geometry::V3D scale = udet.detector->getScaleFactor(); + Mantid::Kernel::V3D scale = udet.detector->getScaleFactor(); // udet.minPoint = bbox.minPoint(); // udet.maxPoint = bbox.maxPoint(); - Mantid::Geometry::V3D size = bbox.maxPoint() - bbox.minPoint(); + Mantid::Kernel::V3D size = bbox.maxPoint() - bbox.minPoint(); size *= scale; - Mantid::Geometry::V3D s1(size); - Mantid::Geometry::V3D s2 = size + Mantid::Geometry::V3D(-size.X(),0,0) - Mantid::Geometry::V3D(size.X(),0,0); - Mantid::Geometry::V3D s3 = size + Mantid::Geometry::V3D(0,-size.Y(),0) - Mantid::Geometry::V3D(0,size.Y(),0); + Mantid::Kernel::V3D s1(size); + Mantid::Kernel::V3D s2 = size + Mantid::Kernel::V3D(-size.X(),0,0) - Mantid::Kernel::V3D(size.X(),0,0); + Mantid::Kernel::V3D s3 = size + Mantid::Kernel::V3D(0,-size.Y(),0) - Mantid::Kernel::V3D(0,size.Y(),0); R.rotate(s1); R.rotate(s2); R.rotate(s3); diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSurface.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSurface.h index 50939f8a798..cd24caa2aa9 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSurface.h +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/UnwrappedSurface.h @@ -1,8 +1,8 @@ #ifndef UNWRAPPEDSURFACE_H #define UNWRAPPEDSURFACE_H -#include "MantidGeometry/V3D.h" -#include "MantidGeometry/Quat.h" +#include "MantidKernel/V3D.h" +#include "MantidKernel/Quat.h" #include "MantidGeometry/IComponent.h" #include "InstrumentActor.h" #include "ProjectionSurface.h" @@ -47,7 +47,7 @@ public: double uscale; ///< scaling factor in u direction double vscale; ///< scaling factor in v direction boost::shared_ptr<const Mantid::Geometry::IDetector> detector; -// Mantid::Geometry::V3D minPoint,maxPoint; +// Mantid::Kernel::V3D minPoint,maxPoint; }; /** @@ -62,7 +62,7 @@ class UnwrappedSurface: /*public DetectorCallback,*/ public ProjectionSurface { //Q_OBJECT public: - UnwrappedSurface(const InstrumentActor* rootActor,const Mantid::Geometry::V3D& origin,const Mantid::Geometry::V3D& axis); + UnwrappedSurface(const InstrumentActor* rootActor,const Mantid::Kernel::V3D& origin,const Mantid::Kernel::V3D& axis); ~UnwrappedSurface(); void componentSelected(Mantid::Geometry::ComponentID = NULL); void getSelectedDetectors(QList<int>& dets); @@ -80,12 +80,12 @@ protected: /// calculate and assign udet.u and udet.v virtual void calcUV(UnwrappedDetector& udet) = 0; /// calculate rotation R for a udet - virtual void calcRot(const UnwrappedDetector& udet, Mantid::Geometry::Quat& R)const = 0; + virtual void calcRot(const UnwrappedDetector& udet, Mantid::Kernel::Quat& R)const = 0; virtual double uPeriod()const{return 0.0;} void init(); - void calcSize(UnwrappedDetector& udet,const Mantid::Geometry::V3D& X, - const Mantid::Geometry::V3D& Y); + void calcSize(UnwrappedDetector& udet,const Mantid::Kernel::V3D& X, + const Mantid::Kernel::V3D& Y); //void callback(boost::shared_ptr<const Mantid::Geometry::IDetector> det,const DetectorCallbackData& data); void setColor(int index,bool picking)const; void showPickedDetector(); diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp index 68210f29847..7db9e7083d0 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp @@ -715,7 +715,7 @@ Table* MantidUI::createDetectorTable(const QString & wsName, const std::vector<i boost::shared_ptr<Mantid::Geometry::IDetector> det = ws->getDetector(ws_index); detID = det->getID(); // We want the position of the detector relative to the sample - Mantid::Geometry::V3D pos = det->getPos() - sample->getPos(); + Mantid::Kernel::V3D pos = det->getPos() - sample->getPos(); pos.getSpherical(R,Theta,Phi); // Need to get R & Theta through these methods to be correct for grouped detectors R = det->getDistance(*sample); @@ -2853,8 +2853,8 @@ void MantidUI::test() if (first) { static int i = 0; - Mantid::Geometry::V3D u = i++ ? Mantid::Geometry::V3D(1,0,0) : Mantid::Geometry::V3D(0,1,0); - Mantid::Geometry::Quat q(30,u); + Mantid::Kernel::V3D u = i++ ? Mantid::Kernel::V3D(1,0,0) : Mantid::Kernel::V3D(0,1,0); + Mantid::Kernel::Quat q(30,u); first->rotate(q); return; } diff --git a/Code/Mantid/MantidPlot/src/origin/OPJFile.cpp b/Code/Mantid/MantidPlot/src/origin/OPJFile.cpp index e7c3ed7fa93..99052d869ac 100644 --- a/Code/Mantid/MantidPlot/src/origin/OPJFile.cpp +++ b/Code/Mantid/MantidPlot/src/origin/OPJFile.cpp @@ -46,7 +46,6 @@ #pragma warning disable 181 #endif -#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <iostream> #include <stdlib.h> diff --git a/Code/Mantid/MantidPlot/src/zlib123/minigzip.c b/Code/Mantid/MantidPlot/src/zlib123/minigzip.c index a76ec6e7b0e..54f62f5b7c4 100644 --- a/Code/Mantid/MantidPlot/src/zlib123/minigzip.c +++ b/Code/Mantid/MantidPlot/src/zlib123/minigzip.c @@ -15,8 +15,6 @@ /* @(#) $Id$ */ -#define _CRT_SECURE_NO_WARNINGS - #include <stdio.h> #include "zlib.h" diff --git a/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/MantidGLWidget.h b/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/MantidGLWidget.h index c916d967eb7..5170581d0b5 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/MantidGLWidget.h +++ b/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/MantidGLWidget.h @@ -7,7 +7,7 @@ #include <QGLWidget> #include <boost/shared_ptr.hpp> -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" //----------------------------------------- // Forward Declarations diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/MantidGLWidget.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/MantidGLWidget.cpp index cc3b7fd4e1a..c36d6f92073 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/MantidGLWidget.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/MantidGLWidget.cpp @@ -3,8 +3,6 @@ //----------------------------------------- #include "MantidQtCustomDialogs/MantidGLWidget.h" #include "MantidGeometry/Objects/Object.h" -//#include "MantidGeometry/V3D.h" -//#include "MantidGeometry/Quat.h" #include <QtOpenGL> #include <QMessageBox> diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp index 2b412c6e3bf..ea33e7bba56 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp @@ -20,7 +20,7 @@ #include "MantidGeometry/IInstrument.h" #include "MantidGeometry/IComponent.h" #include "MantidGeometry/IDetector.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/Exception.h" #include "MantidGeometry/Instrument/XMLlogfile.h" #include "MantidGeometry/Instrument/DetectorGroup.h" diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp index f4407c8769a..15e5ce7d378 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp @@ -16,7 +16,7 @@ #include "MantidAPI/SpectraDetectorMap.h" #include "MantidGeometry/IInstrument.h" #include "MantidGeometry/IComponent.h" -#include "MantidGeometry/V3D.h" +#include "MantidKernel/V3D.h" #include "MantidKernel/Exception.h" #include <QLineEdit> -- GitLab