diff --git a/Code/Mantid/Framework/Algorithms/src/AbsorptionCorrection.cpp b/Code/Mantid/Framework/Algorithms/src/AbsorptionCorrection.cpp index 16f14ddca8e208d6541faa7291550d2e79f8e84b..a1c0fc0d075ac678fea4a05eb66fbf4eff7321d5 100644 --- a/Code/Mantid/Framework/Algorithms/src/AbsorptionCorrection.cpp +++ b/Code/Mantid/Framework/Algorithms/src/AbsorptionCorrection.cpp @@ -155,7 +155,7 @@ void AbsorptionCorrection::exec() if (m_emode==2) { try { - Parameter_sptr par = pmap.get(det->getComponent(),"Efixed"); + Parameter_sptr par = pmap.get(det.get(),"Efixed"); if (par) { Unit_const_sptr energy = UnitFactory::Instance().create("Energy"); diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertUnits.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertUnits.cpp index eed191647346d89ebe0b097167773f7c96c78dd2..69c211cdd63eb27ae14fff401aed7ec21b4f177a 100644 --- a/Code/Mantid/Framework/Algorithms/src/ConvertUnits.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ConvertUnits.cpp @@ -434,7 +434,7 @@ void ConvertUnits::convertViaTOF(Kernel::Unit_const_sptr fromUnit, API::MatrixWo { try { - Parameter_sptr par = pmap.getRecursive(det->getComponent(),"Efixed"); + Parameter_sptr par = pmap.getRecursive(det.get(),"Efixed"); if (par) { efixed = par->value<double>(); diff --git a/Code/Mantid/Framework/Algorithms/src/SofQW.cpp b/Code/Mantid/Framework/Algorithms/src/SofQW.cpp index 4bb4c47e8a76b0a5a44b5b1411db4c2a7402bd45..56db4eb07c0d21c79bcb4c714edf174996d51659 100644 --- a/Code/Mantid/Framework/Algorithms/src/SofQW.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SofQW.cpp @@ -117,7 +117,7 @@ void SofQW::exec() if (emode==2) { try { - Parameter_sptr par = pmap.get(spectrumDet->getComponent(),"Efixed"); + Parameter_sptr par = pmap.get(spectrumDet.get(),"Efixed"); if (par) { efixed = par->value<double>(); diff --git a/Code/Mantid/Framework/DataHandling/src/LoadDetectorInfo.cpp b/Code/Mantid/Framework/DataHandling/src/LoadDetectorInfo.cpp index 96b88c62b246c7fd3875d7742b2234ce9bfb746d..8930b4b354e6bf63779ce4aae608e72a6feb214a 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadDetectorInfo.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadDetectorInfo.cpp @@ -417,11 +417,10 @@ void LoadDetectorInfo::setDetectorParams(const detectorInfo ¶ms, detectorInf } Geometry::ParameterMap &pmap = m_workspace->instrumentParameters(); - const IComponent* comp = det->getComponent(); // Set the detectors pressure. - pmap.addDouble(comp, "3He(atm)", params.pressure); + pmap.addDouble(det.get(), "3He(atm)", params.pressure); // Set the wall thickness - pmap.addDouble(comp, "wallT(m)", params.wallThick); + pmap.addDouble(det.get(), "wallT(m)", params.wallThick); // If we have a l2, theta and phi. Update the postion if required if( m_moveDets && diff --git a/Code/Mantid/Framework/DataHandling/test/LoadDetectorInfoTest.h b/Code/Mantid/Framework/DataHandling/test/LoadDetectorInfoTest.h index 2ef969d8b08945520bb34ac4bee181bd2e43d4cc..972aa20c8a98fd7b98f104775c02451d7f213bd9 100644 --- a/Code/Mantid/Framework/DataHandling/test/LoadDetectorInfoTest.h +++ b/Code/Mantid/Framework/DataHandling/test/LoadDetectorInfoTest.h @@ -81,7 +81,7 @@ public: boost::shared_ptr<const IComponent> comp = boost::dynamic_pointer_cast<const IComponent>(detector); - const IComponent* baseComp = detector->getComponent(); + const IComponent* baseComp = detector->getComponentID(); Parameter_sptr par = pmap.get(baseComp,"3He(atm)"); // this is only for PSD detectors, code 3 @@ -221,14 +221,13 @@ public: for ( int i = 0; i < NUMRANDOM; ++i) { int detID = DETECTS[i]; - boost::shared_ptr<const IDetector> detector =WS->getInstrument()->getDetector(detID); + IDetector_const_sptr detector =WS->getInstrument()->getDetector(detID); - const IComponent* baseComp = detector->getComponent(); - Parameter_sptr par = pmap.get(baseComp,"3He(atm)"); + Parameter_sptr par = pmap.get(detector.get(),"3He(atm)"); TS_ASSERT(par); TS_ASSERT_EQUALS(par->asString(), castaround("10.0")); - par = pmap.get(baseComp,"wallT(m)"); + par = pmap.get(detector.get(),"wallT(m)"); TS_ASSERT(par); TS_ASSERT_EQUALS(par->asString(), castaround("0.0008").substr(0,6)); diff --git a/Code/Mantid/Framework/Geometry/CMakeLists.txt b/Code/Mantid/Framework/Geometry/CMakeLists.txt index 40323c9d85e6e9077636f64630d4853e8c5d05b0..369c2b50668e0701db87668accfbf2e53437f70a 100644 --- a/Code/Mantid/Framework/Geometry/CMakeLists.txt +++ b/Code/Mantid/Framework/Geometry/CMakeLists.txt @@ -3,7 +3,6 @@ set ( SRC_FILES src/Crystal/OrientedLattice.cpp src/Crystal/ReflectionCondition.cpp src/Crystal/UnitCell.cpp - src/IDetector.cpp src/Instrument.cpp src/IObjComponent.cpp src/Instrument/CompAssembly.cpp diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IDetector.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IDetector.h index 82fbffb255548853a943de4615b140cefcd1f0a9..c37c4883364e00ed4a11592c82d757c00a82db2f 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IDetector.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/IDetector.h @@ -25,7 +25,14 @@ namespace Kernel namespace Geometry { - + /** Describes the topology of a detectors group used to calculate angular position and angular + * measures for detectors. The topology defines the meaning of angular measurements for a detector + */ + enum det_topology{ + rect, //< rectangular geometry + cyl, //< cylindrical geometry + undef //< the geometry is yet undefined, if you need to know the geometry, a method to identify it must be deployed + }; /** Interface class for detector objects. @@ -52,14 +59,6 @@ namespace Geometry File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>. Code Documentation is available at: <http://doxygen.mantidproject.org> */ -/** enum describes the toplogy of a detectors group used to calculate angular position and angular - * measures for detecors. The topology defines the meaning of angular measurements for a detector -*/ -enum det_topology{ - rect, //< rectangular geometry - cyl, //< cylindrical geometry - undef //< the geometry is yet undefined, if you need to know the geometry, a method to identify it must be deployed -}; class MANTID_GEOMETRY_DLL IDetector : public virtual IObjComponent { public: @@ -90,8 +89,6 @@ public: /// Indicates whether this is a monitor detector virtual bool isMonitor() const = 0; - /// Must return a pointer to itself if derived from IComponent - virtual const IComponent* getComponent() const; /// returns the geometry of detectors, meaningful for groups, rectangular for single; returns the centre of a detector virtual det_topology getTopology(Kernel::V3D ¢er)const = 0; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h index 248bb8ec23c28f7c9c5f02e780703b18b0ee9674..4c1a965ba177b999d7bcedaec8cd77444965ab26 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h @@ -64,8 +64,6 @@ public: double getPhi() const; bool isMasked() const; bool isMonitor() const; - /// Returns a reference to itself - const IComponent* getComponent() const {return static_cast<const IComponent*>(this);} // end IDetector methods void markAsMonitor(const bool flag = true); /** returns the detector's topology, namely, the meaning of the detector's angular measurements. diff --git a/Code/Mantid/Framework/Geometry/src/IDetector.cpp b/Code/Mantid/Framework/Geometry/src/IDetector.cpp deleted file mode 100644 index 1d17c1b13f3783c8ddb9a27a48a9f7b54f6df78a..0000000000000000000000000000000000000000 --- a/Code/Mantid/Framework/Geometry/src/IDetector.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "MantidGeometry/IDetector.h" - -using namespace Mantid::Geometry; - -/// Must return a pointer to itself if derived from IComponent -const IComponent* IDetector::getComponent() const -{ - throw std::runtime_error("This detector class does not inherit from IComponent."); -} -