From 9dafb37a828f93c3476f4bc4d0f0fe25968825d7 Mon Sep 17 00:00:00 2001
From: Karl Palmen <karl.palmen@stfc.ac.uk>
Date: Fri, 1 Dec 2017 15:35:56 +0000
Subject: [PATCH] Remove Populate method from IObject & Container re #12827

Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
---
 Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h   | 2 +-
 Framework/DataHandling/src/LoadNXSPE.cpp                    | 6 +++---
 .../Geometry/inc/MantidGeometry/Instrument/Container.h      | 3 ---
 Framework/Geometry/inc/MantidGeometry/Objects/CSGObject.h   | 2 +-
 Framework/Geometry/inc/MantidGeometry/Objects/IObject.h     | 1 -
 5 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h b/Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h
index 592775ca63c..aa37bcefa4d 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h
@@ -69,7 +69,7 @@ private:
   /// Run the algorithm
   void exec() override;
   /// Function to return a cuboid shape, with widths dx,dy,dz
-  Geometry::IObject_sptr createCuboid(double dx, double dy, double dz);
+  boost::shared_ptr<Geometry::CSGObject> createCuboid(double dx, double dy, double dz);
 };
 
 } // namespace DataHandling
diff --git a/Framework/DataHandling/src/LoadNXSPE.cpp b/Framework/DataHandling/src/LoadNXSPE.cpp
index fc0ae603059..d651872df8f 100644
--- a/Framework/DataHandling/src/LoadNXSPE.cpp
+++ b/Framework/DataHandling/src/LoadNXSPE.cpp
@@ -275,7 +275,7 @@ void LoadNXSPE::exec() {
   instrument->add(sample);
   instrument->markAsSamplePos(sample);
 
-  Geometry::IObject_const_sptr cuboid(
+  boost::shared_ptr<const Geometry::CSGObject> cuboid(
       createCuboid(0.1, 0.1, 0.1)); // FIXME: memory hog on rendering. Also,
                                     // make each detector separate size
   for (std::size_t i = 0; i < numSpectra; ++i) {
@@ -342,7 +342,7 @@ void LoadNXSPE::exec() {
   setProperty("OutputWorkspace", outputWS);
 }
 
-Geometry::IObject_sptr LoadNXSPE::createCuboid(double dx, double dy,
+boost::shared_ptr<Geometry::CSGObject>  LoadNXSPE::createCuboid(double dx, double dy,
                                                double dz) {
 
   dx = 0.5 * std::fabs(dx);
@@ -404,7 +404,7 @@ Geometry::IObject_sptr LoadNXSPE::createCuboid(double dx, double dy,
 
   // A sphere
   std::string ObjSphere = "-41";
-  Geometry::IObject_sptr retVal = boost::make_shared<Geometry::CSGObject>();
+  boost::shared_ptr<Geometry::CSGObject> retVal = boost::make_shared<Geometry::CSGObject>();
   retVal->setObject(41, ObjSphere);
   retVal->populate(SphSurMap);
 
diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/Container.h b/Framework/Geometry/inc/MantidGeometry/Instrument/Container.h
index 6718c552f1f..5cc42ac8904 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument/Container.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument/Container.h
@@ -65,9 +65,6 @@ public:
   int setObject(const int ON, const std::string &Ln) override {
     return m_shape->setObject(ON, Ln);
   }
-  int populate(const std::map<int, boost::shared_ptr<Surface>> &m) override {
-    return m_shape->populate(m);
-  }
   IObject *clone() const override { return new Container(*this); }
 
   int getName() const override { return m_shape->getName(); }
diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/CSGObject.h b/Framework/Geometry/inc/MantidGeometry/Objects/CSGObject.h
index 23152457325..9011b3196b0 100644
--- a/Framework/Geometry/inc/MantidGeometry/Objects/CSGObject.h
+++ b/Framework/Geometry/inc/MantidGeometry/Objects/CSGObject.h
@@ -96,7 +96,7 @@ public:
                           std::string &Ln); ///< Process a complementary object
   int hasComplement() const;
 
-  int populate(const std::map<int, boost::shared_ptr<Surface>> &) override;
+  int populate(const std::map<int, boost::shared_ptr<Surface>> &);
   int createSurfaceList(const int outFlag = 0); ///< create Surface list
   int addSurfString(const std::string &);       ///< Not implemented
   int removeSurface(const int SurfN);
diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/IObject.h b/Framework/Geometry/inc/MantidGeometry/Objects/IObject.h
index c8a6c425e23..93f33338a2f 100644
--- a/Framework/Geometry/inc/MantidGeometry/Objects/IObject.h
+++ b/Framework/Geometry/inc/MantidGeometry/Objects/IObject.h
@@ -60,7 +60,6 @@ public:
                             const Kernel::V3D &uVec) const = 0;
   virtual bool hasValidShape() const = 0;
   virtual int setObject(const int ON, const std::string &Ln) = 0;
-  virtual int populate(const std::map<int, boost::shared_ptr<Surface>> &) = 0;
   virtual IObject *clone() const = 0;
 
   virtual int getName() const = 0;
-- 
GitLab