diff --git a/Framework/API/inc/MantidAPI/Sample.h b/Framework/API/inc/MantidAPI/Sample.h index ba80b57499ee010f1bb5857e6001ee51991a5201..44eb568df07fae1e407e3543349e5fff47d2a908 100644 --- a/Framework/API/inc/MantidAPI/Sample.h +++ b/Framework/API/inc/MantidAPI/Sample.h @@ -69,9 +69,9 @@ public: /// Set the name of the sample void setName(const std::string &name); /// Return the sample shape - const Geometry::Object &getShape() const; + const Geometry::CSGObject &getShape() const; /// Update the shape of the object - void setShape(const Geometry::Object &shape); + void setShape(const Geometry::CSGObject &shape); /** @name Material properties.*/ //@{ @@ -138,7 +138,7 @@ private: /// The sample name std::string m_name; /// The sample shape object - Geometry::Object m_shape; + Geometry::CSGObject m_shape; /// An owned pointer to the SampleEnvironment object boost::shared_ptr<Geometry::SampleEnvironment> m_environment; /// Pointer to the OrientedLattice of the sample, NULL if not set. diff --git a/Framework/API/src/Sample.cpp b/Framework/API/src/Sample.cpp index 4578f18482a805f761419fb651fa7254387b78d2..f5fa5eeb52ca66f3e6eb5167db00c252e13a61c6 100644 --- a/Framework/API/src/Sample.cpp +++ b/Framework/API/src/Sample.cpp @@ -16,7 +16,7 @@ namespace Mantid { namespace API { using namespace Mantid::Kernel; -using Geometry::Object; +using Geometry::CSGObject; using Geometry::OrientedLattice; using Geometry::SampleEnvironment; using Geometry::ShapeFactory; @@ -101,13 +101,13 @@ void Sample::setName(const std::string &name) { m_name = name; } * its own coordinate system with its centre at [0,0,0] * @return A reference to the object describing the shape */ -const Object &Sample::getShape() const { return m_shape; } +const CSGObject &Sample::getShape() const { return m_shape; } /** Set the object that describes the sample shape. The object is defined within * its own coordinate system * @param shape :: The object describing the shape */ -void Sample::setShape(const Object &shape) { m_shape = shape; } +void Sample::setShape(const CSGObject &shape) { m_shape = shape; } /** Return the material. * @return A reference to the material the sample is composed of diff --git a/Framework/API/test/SampleTest.h b/Framework/API/test/SampleTest.h index 79a8baac246ba7101e3a769dd9eb7697e8c8b3ad..c3ee8e4043a90ce1c5c480620d5bb04fb4558f1a 100644 --- a/Framework/API/test/SampleTest.h +++ b/Framework/API/test/SampleTest.h @@ -34,13 +34,13 @@ public: 0.0127, 1.0, V3D(), V3D(0.0, 1.0, 0.0), "cyl"); Sample sample; TS_ASSERT_THROWS_NOTHING(sample.setShape(*shape_sptr)) - const Object &sampleShape = sample.getShape(); + const CSGObject &sampleShape = sample.getShape(); TS_ASSERT_EQUALS(shape_sptr->getName(), sampleShape.getName()); } void test_Setting_Default_Shape_Is_Accepted() { Sample sample; - Object object; + CSGObject object; TS_ASSERT_EQUALS(object.hasValidShape(), false); TS_ASSERT_THROWS_NOTHING(sample.setShape(object)); } @@ -56,7 +56,7 @@ public: const std::string envName("TestKit"); SampleEnvironment *kit = new SampleEnvironment(envName, boost::make_shared<const Container>("")); - kit->add(boost::make_shared<const Object>()); + kit->add(boost::make_shared<const CSGObject>()); TS_ASSERT_THROWS_NOTHING(sample.setEnvironment(kit)); @@ -259,7 +259,7 @@ public: Material vanBlock("vanBlock", Mantid::PhysicalConstants::getNeutronAtom(23, 0), 0.072); Sample sample; - Object shape; + CSGObject shape; shape.setMaterial(vanBlock); sample.setShape(shape); diff --git a/Framework/Algorithms/inc/MantidAlgorithms/AbsorptionCorrection.h b/Framework/Algorithms/inc/MantidAlgorithms/AbsorptionCorrection.h index 3eb9de0fbd63cf746aec02bd319b28adaecc2721..fc128bc347b55f50e2619ca68acab3edc73e9072 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/AbsorptionCorrection.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/AbsorptionCorrection.h @@ -13,7 +13,7 @@ class Sample; } namespace Geometry { class IDetector; -class Object; +class CSGObject; } namespace Algorithms { @@ -114,7 +114,7 @@ protected: virtual void initialiseCachedDistances() = 0; API::MatrixWorkspace_sptr m_inputWS; ///< A pointer to the input workspace - const Geometry::Object *m_sampleObject; ///< Local cache of sample object. + const Geometry::CSGObject *m_sampleObject; ///< Local cache of sample object. Kernel::V3D m_beamDirection; ///< The direction of the beam. std::vector<double> m_L1s, ///< Cached L1 distances m_elementVolumes; ///< Cached element volumes diff --git a/Framework/Algorithms/inc/MantidAlgorithms/AnnularRingAbsorption.h b/Framework/Algorithms/inc/MantidAlgorithms/AnnularRingAbsorption.h index ad6915a6a4a0fb4c4c03d3323a06b391c7ee934e..d84d6448bf9cbea9ccad4226ff8a811bed67448e 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/AnnularRingAbsorption.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/AnnularRingAbsorption.h @@ -12,7 +12,7 @@ class Material; class V3D; } namespace Geometry { -class Object; +class CSGObject; } namespace Algorithms { diff --git a/Framework/Algorithms/inc/MantidAlgorithms/AnyShapeAbsorption.h b/Framework/Algorithms/inc/MantidAlgorithms/AnyShapeAbsorption.h index a6dba2958346772d71ab2923a9efb12923acc70f..c480718d627110cd8beb94870b5ff36ef3745c4d 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/AnyShapeAbsorption.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/AnyShapeAbsorption.h @@ -106,7 +106,7 @@ private: std::string sampleXML() override; void initialiseCachedDistances() override; /// Create the gague volume for the correction - Geometry::Object constructGaugeVolume(); + Geometry::CSGObject constructGaugeVolume(); double m_cubeSide; ///< The length of the side of an element cube in m }; diff --git a/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h b/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h index 32fb36d812ffc806954ba4d06ac00c50c264fcb1..7a49e3679ba64fa4e2da993aa2f8ad0d1659cfaa 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h @@ -114,7 +114,7 @@ private: Kernel::V3D &detAxis); /// Computes the distance to the given shape from a starting point double distToSurface(const Kernel::V3D &start, - const Geometry::Object *shape) const; + const Geometry::CSGObject *shape) const; /// Computes the detector efficiency for a given paramater double detectorEfficiency(const double alpha) const; /// Computes an approximate expansion of a Chebysev polynomial @@ -138,7 +138,7 @@ private: /// 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, Kernel::V3D>> + std::map<const Geometry::CSGObject *, std::pair<double, Kernel::V3D>> m_shapeCache; /// Sample position Kernel::V3D m_samplePos; diff --git a/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h b/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h index 7e9ba5dd978e243ec82472306669b8f44d09a01f..dffc19efaad917198e7d99873bc5628d9aeda810 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h @@ -11,7 +11,7 @@ namespace Mantid { // forward declarations namespace Geometry { class IDetector; -class Object; +class CSGObject; class ParameterMap; } @@ -92,7 +92,7 @@ private: Kernel::V3D &detAxis); /// Computes the distance to the given shape from a starting point double distToSurface(const Kernel::V3D start, - const Geometry::Object *shape) const; + const Geometry::CSGObject *shape) const; /// Calculate the detector efficiency double detectorEfficiency(const double alpha, const double scale_factor = 1.0) const; @@ -115,7 +115,7 @@ private: 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, Kernel::V3D>> shapeCache; + std::map<const Geometry::CSGObject *, std::pair<double, Kernel::V3D>> shapeCache; /// Sample position Kernel::V3D samplePos; /// The spectra numbers that were skipped diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SampleCorrections/MCInteractionVolume.h b/Framework/Algorithms/inc/MantidAlgorithms/SampleCorrections/MCInteractionVolume.h index 651398733d9ff5b81e2065fda92c6551d91ee72b..3a5c0bf45ef800d832eb512d95e00bff0b8053f0 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/SampleCorrections/MCInteractionVolume.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/SampleCorrections/MCInteractionVolume.h @@ -9,7 +9,7 @@ namespace API { class Sample; } namespace Geometry { -class Object; +class CSGObject; class SampleEnvironment; } namespace Kernel { @@ -62,7 +62,7 @@ public: double lambdaAfter) const; private: - const Geometry::Object &m_sample; + const Geometry::CSGObject &m_sample; const Geometry::SampleEnvironment *m_env; const Geometry::BoundingBox m_activeRegion; const size_t m_maxScatterAttempts; diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SphericalAbsorption.h b/Framework/Algorithms/inc/MantidAlgorithms/SphericalAbsorption.h index ad07918a5e0f4d879664e3d270050a33fba276df..375776ce16f245b11686e7e53af14aee94ac942b 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/SphericalAbsorption.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/SphericalAbsorption.h @@ -19,7 +19,7 @@ class V3D; } namespace Geometry { -class Object; +class CSGObject; } namespace Algorithms { @@ -99,7 +99,7 @@ public: protected: API::MatrixWorkspace_sptr m_inputWS; ///< A pointer to the input workspace - const Geometry::Object *m_sampleObject; ///< Local cache of sample object. + const Geometry::CSGObject *m_sampleObject; ///< Local cache of sample object. Kernel::V3D m_beamDirection; ///< The direction of the beam. std::vector<double> m_L1s, ///< Cached L1 distances m_elementVolumes; ///< Cached element volumes diff --git a/Framework/Algorithms/src/AbsorptionCorrection.cpp b/Framework/Algorithms/src/AbsorptionCorrection.cpp index c34f897cc0e7acf326e42eabb3cf6ccb3f920cac..b593e66168086b65617bf78845653b7767f0bb95 100644 --- a/Framework/Algorithms/src/AbsorptionCorrection.cpp +++ b/Framework/Algorithms/src/AbsorptionCorrection.cpp @@ -244,7 +244,7 @@ void AbsorptionCorrection::retrieveBaseProperties() { static_cast<uint16_t>(0), 0.0, 0.0, sigma_s, 0.0, sigma_s, sigma_atten); - Object shape = m_inputWS->sample().getShape(); // copy + CSGObject shape = m_inputWS->sample().getShape(); // copy shape.setMaterial(Material("SetInAbsorptionCorrection", neutron, rho)); m_inputWS->mutableSample().setShape(shape); } @@ -296,7 +296,7 @@ void AbsorptionCorrection::constructSample(API::Sample &sample) { throw std::invalid_argument(mess); } } else { - boost::shared_ptr<Object> shape = ShapeFactory().createShape(xmlstring); + boost::shared_ptr<CSGObject> shape = ShapeFactory().createShape(xmlstring); sample.setShape(*shape); m_sampleObject = &sample.getShape(); diff --git a/Framework/Algorithms/src/AnyShapeAbsorption.cpp b/Framework/Algorithms/src/AnyShapeAbsorption.cpp index 337a58ad4b662a98f70f06053a613c0fc89cf1e4..011e91fd6d7129b136aa830dce8b9ae5c85df342 100644 --- a/Framework/Algorithms/src/AnyShapeAbsorption.cpp +++ b/Framework/Algorithms/src/AnyShapeAbsorption.cpp @@ -43,7 +43,7 @@ std::string AnyShapeAbsorption::sampleXML() { void AnyShapeAbsorption::initialiseCachedDistances() { // First, check if a 'gauge volume' has been defined. If not, it's the same as // the sample. - Object integrationVolume = *m_sampleObject; + CSGObject integrationVolume = *m_sampleObject; if (m_inputWS->run().hasProperty("GaugeVolume")) { integrationVolume = constructGaugeVolume(); } @@ -120,12 +120,12 @@ void AnyShapeAbsorption::initialiseCachedDistances() { YSliceThickness * ZSliceThickness; } -Geometry::Object AnyShapeAbsorption::constructGaugeVolume() { +Geometry::CSGObject AnyShapeAbsorption::constructGaugeVolume() { g_log.information("Calculating scattering within the gauge volume defined on " "the input workspace"); // Retrieve and create the gauge volume shape - boost::shared_ptr<const Geometry::Object> volume = ShapeFactory().createShape( + boost::shared_ptr<const Geometry::CSGObject> volume = ShapeFactory().createShape( m_inputWS->run().getProperty("GaugeVolume")->value()); // Although DefineGaugeVolume algorithm will have checked validity of XML, do // so again here diff --git a/Framework/Algorithms/src/CreateSampleWorkspace.cpp b/Framework/Algorithms/src/CreateSampleWorkspace.cpp index f51024dd014465d125b4ba47282b876839e6e3da..381b6a2f28db195e88ae6e2a147658d58cbb39e1 100644 --- a/Framework/Algorithms/src/CreateSampleWorkspace.cpp +++ b/Framework/Algorithms/src/CreateSampleWorkspace.cpp @@ -565,14 +565,14 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular( // Define a source component ObjComponent *source = - new ObjComponent("moderator", Object_sptr(new Object), testInst.get()); + new ObjComponent("moderator", Object_sptr(new CSGObject), testInst.get()); source->setPos(V3D(0.0, 0.0, -sourceSampleDistance)); testInst->add(source); testInst->markAsSource(source); // Add chopper ObjComponent *chopper = new ObjComponent( - "chopper-position", Object_sptr(new Object), testInst.get()); + "chopper-position", Object_sptr(new CSGObject), testInst.get()); chopper->setPos(V3D(0.0, 0.0, -0.25 * sourceSampleDistance)); testInst->add(chopper); diff --git a/Framework/Algorithms/src/DetectorEfficiencyCor.cpp b/Framework/Algorithms/src/DetectorEfficiencyCor.cpp index d8478bc56666036f5cc9b74cfb5bb8a02da6b16e..b32d139ca99d91a40d8cfc6ba8778e8ea6166088 100644 --- a/Framework/Algorithms/src/DetectorEfficiencyCor.cpp +++ b/Framework/Algorithms/src/DetectorEfficiencyCor.cpp @@ -304,12 +304,12 @@ double DetectorEfficiencyCor::calculateOneOverK(double loBinBound, void DetectorEfficiencyCor::getDetectorGeometry(const Geometry::IDetector &det, double &detRadius, V3D &detAxis) { - boost::shared_ptr<const Object> shape_sptr = det.shape(); + boost::shared_ptr<const CSGObject> shape_sptr = det.shape(); if (!shape_sptr->hasValidShape()) { throw Exception::NotFoundError("Shape", "Detector has no shape"); } - std::map<const Geometry::Object *, + std::map<const Geometry::CSGObject *, std::pair<double, Kernel::V3D>>::const_iterator it = m_shapeCache.find(shape_sptr.get()); if (it == m_shapeCache.end()) { @@ -369,7 +369,7 @@ void DetectorEfficiencyCor::getDetectorGeometry(const Geometry::IDetector &det, * @returns The distance to the surface in meters */ double DetectorEfficiencyCor::distToSurface(const V3D &start, - const Object *shape) const { + const CSGObject *shape) const { // get a vector from the point that was passed to the origin V3D direction = V3D(0.0, 0.0, 0.0) - start; // it needs to be a unit vector diff --git a/Framework/Algorithms/src/HRPDSlabCanAbsorption.cpp b/Framework/Algorithms/src/HRPDSlabCanAbsorption.cpp index 373a6c697e362952fcb950b8e494e0c7e6a2e532..553bc8bacc0dad9e63c8cf93c375346dd728e179 100644 --- a/Framework/Algorithms/src/HRPDSlabCanAbsorption.cpp +++ b/Framework/Algorithms/src/HRPDSlabCanAbsorption.cpp @@ -167,7 +167,7 @@ API::MatrixWorkspace_sptr HRPDSlabCanAbsorption::runFlatPlateAbsorption() { NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), static_cast<uint16_t>(0), 0.0, 0.0, sigma_s, 0.0, sigma_s, sigma_atten); - Object shape = m_inputWS->sample().getShape(); // copy + CSGObject shape = m_inputWS->sample().getShape(); // copy shape.setMaterial(Material("SetInSphericalAbsorption", neutron, rho)); m_inputWS->mutableSample().setShape(shape); } diff --git a/Framework/Algorithms/src/He3TubeEfficiency.cpp b/Framework/Algorithms/src/He3TubeEfficiency.cpp index 7f7be044328501c2e4cfe4c1ced8ef907ff8c4b3..7e4abd9d27625fad6bbded7d5012db22750d1fc7 100644 --- a/Framework/Algorithms/src/He3TubeEfficiency.cpp +++ b/Framework/Algorithms/src/He3TubeEfficiency.cpp @@ -258,7 +258,7 @@ He3TubeEfficiency::calculateExponential(std::size_t spectraIndex, void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, double &detRadius, Kernel::V3D &detAxis) { - boost::shared_ptr<const Geometry::Object> shape_sptr = det.shape(); + boost::shared_ptr<const Geometry::CSGObject> shape_sptr = det.shape(); if (!shape_sptr) { throw std::runtime_error( "Detector geometry error: detector with id: " + @@ -267,7 +267,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, "The algorithm works for instruments with one-to-one " "spectra-to-detector maps only!"); } - std::map<const Geometry::Object *, + std::map<const Geometry::CSGObject *, std::pair<double, Kernel::V3D>>::const_iterator it = this->shapeCache.find(shape_sptr.get()); if (it == this->shapeCache.end()) { @@ -281,7 +281,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, // 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, Kernel::V3D>>( + std::pair<const Geometry::CSGObject *, std::pair<double, Kernel::V3D>>( shape_sptr.get(), std::pair<double, Kernel::V3D>(detRadius, detAxis))); } @@ -296,7 +296,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, // and the axis is perpendicular, in the x direction PARALLEL_CRITICAL(deteff_shapecacheb) { this->shapeCache.insert( - std::pair<const Geometry::Object *, std::pair<double, Kernel::V3D>>( + std::pair<const Geometry::CSGObject *, std::pair<double, Kernel::V3D>>( shape_sptr.get(), std::pair<double, Kernel::V3D>(detRadius, detAxis))); } @@ -308,7 +308,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, detAxis = Kernel::V3D(0, 0, 1); PARALLEL_CRITICAL(deteff_shapecachec) { this->shapeCache.insert( - std::pair<const Geometry::Object *, std::pair<double, Kernel::V3D>>( + std::pair<const Geometry::CSGObject *, std::pair<double, Kernel::V3D>>( shape_sptr.get(), std::pair<double, Kernel::V3D>(detRadius, detAxis))); } @@ -333,7 +333,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, * @returns The distance to the surface in metres */ double He3TubeEfficiency::distToSurface(const Kernel::V3D start, - const Geometry::Object *shape) const { + const Geometry::CSGObject *shape) const { // get a vector from the point that was passed to the origin Kernel::V3D direction = Kernel::V3D(0.0, 0.0, 0.0) - start; // it needs to be a unit vector diff --git a/Framework/Algorithms/src/MultipleScatteringCylinderAbsorption.cpp b/Framework/Algorithms/src/MultipleScatteringCylinderAbsorption.cpp index 12494bd1bfebb63f6ce58e4c728dfd22b75874d6..095b2c0ea0a59f51f238a0bd981c80f05c014b9e 100644 --- a/Framework/Algorithms/src/MultipleScatteringCylinderAbsorption.cpp +++ b/Framework/Algorithms/src/MultipleScatteringCylinderAbsorption.cpp @@ -140,7 +140,7 @@ void MultipleScatteringCylinderAbsorption::exec() { NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), static_cast<uint16_t>(0), 0.0, 0.0, coeff3, 0.0, coeff3, coeff1); - Object shape = in_WS->sample().getShape(); // copy + CSGObject shape = in_WS->sample().getShape(); // copy shape.setMaterial(Material("SetInMultipleScattering", neutron, coeff2)); in_WS->mutableSample().setShape(shape); } diff --git a/Framework/Algorithms/src/SofQWNormalisedPolygon.cpp b/Framework/Algorithms/src/SofQWNormalisedPolygon.cpp index fcb3b55fb15fd25e088fee3cb2308ceaa1791546..0dcdc3545dc0fb8135575cfea4bfb2103ace5b1a 100644 --- a/Framework/Algorithms/src/SofQWNormalisedPolygon.cpp +++ b/Framework/Algorithms/src/SofQWNormalisedPolygon.cpp @@ -287,7 +287,7 @@ void SofQWNormalisedPolygon::initAngularCachesNonPSD( * The angular width is computed using the l2 distance from the sample */ Kernel::V3D pos; - boost::shared_ptr<const Object> + boost::shared_ptr<const CSGObject> shape; // Defined in its own reference frame with centre at 0,0,0 Kernel::Quat rot; diff --git a/Framework/Algorithms/src/SphericalAbsorption.cpp b/Framework/Algorithms/src/SphericalAbsorption.cpp index b2856de2b9e0b9b823738becce409c0661cb6acf..1b6a35c5aee2ff6610422dc677f995ffd8fe7048 100644 --- a/Framework/Algorithms/src/SphericalAbsorption.cpp +++ b/Framework/Algorithms/src/SphericalAbsorption.cpp @@ -124,7 +124,7 @@ void SphericalAbsorption::retrieveBaseProperties() { NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), static_cast<uint16_t>(0), 0.0, 0.0, sigma_s, 0.0, sigma_s, sigma_atten); - Object shape = m_inputWS->sample().getShape(); // copy + CSGObject shape = m_inputWS->sample().getShape(); // copy shape.setMaterial(Material("SetInSphericalAbsorption", neutron, rho)); m_inputWS->mutableSample().setShape(shape); } diff --git a/Framework/Algorithms/test/DetectorEfficiencyCorTest.h b/Framework/Algorithms/test/DetectorEfficiencyCorTest.h index 3eb8a4a71f46e5ede9439b799a4bc107a2b746df..b987f1a499402ef240efba90b86643f4459f6651 100644 --- a/Framework/Algorithms/test/DetectorEfficiencyCorTest.h +++ b/Framework/Algorithms/test/DetectorEfficiencyCorTest.h @@ -121,7 +121,7 @@ private: // convert into a Geometry object bool addTypeTag = true; - boost::shared_ptr<Object> shape = + boost::shared_ptr<CSGObject> shape = ShapeFactory().createShape(xmlShape, addTypeTag); boost::shared_ptr<Instrument> instrument = boost::make_shared<Instrument>(); diff --git a/Framework/Algorithms/test/MayersSampleCorrectionTest.h b/Framework/Algorithms/test/MayersSampleCorrectionTest.h index 96f70e5f3ef25038a780e8e1515519e3dd3c16f6..526727f8bab1a2e9d316cc53b04386096b671ea1 100644 --- a/Framework/Algorithms/test/MayersSampleCorrectionTest.h +++ b/Framework/Algorithms/test/MayersSampleCorrectionTest.h @@ -107,7 +107,7 @@ private: using ComponentCreationHelper::createCappedCylinder; using ComponentCreationHelper::createTestInstrumentCylindrical; using Mantid::Geometry::ObjComponent; - using Mantid::Geometry::Object; + using Mantid::Geometry::CSGObject; using Mantid::Kernel::Material; using Mantid::Kernel::V3D; using Mantid::PhysicalConstants::getNeutronAtom; @@ -156,7 +156,7 @@ private: MatrixWorkspace_sptr createTestWorkspaceWithNoSampleShape() { using ComponentCreationHelper::createTestInstrumentCylindrical; using Mantid::Geometry::ObjComponent; - using Mantid::Geometry::Object; + using Mantid::Geometry::CSGObject; using Mantid::Kernel::V3D; using WorkspaceCreationHelper::create2DWorkspaceBinned; diff --git a/Framework/Crystal/src/AnvredCorrection.cpp b/Framework/Crystal/src/AnvredCorrection.cpp index 23da65b6c574d5f767f5ab2c940d612af6a2e0a6..a625d9fc26f0b492fefea2ed5e46b119fb9d1ae0 100644 --- a/Framework/Crystal/src/AnvredCorrection.cpp +++ b/Framework/Crystal/src/AnvredCorrection.cpp @@ -359,7 +359,7 @@ void AnvredCorrection::retrieveBaseProperties() { NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), static_cast<uint16_t>(0), 0.0, 0.0, m_smu, 0.0, m_smu, m_amu); - Object shape = m_inputWS->sample().getShape(); // copy + CSGObject shape = m_inputWS->sample().getShape(); // copy shape.setMaterial(Material("SetInAnvredCorrection", neutron, 1.0)); m_inputWS->mutableSample().setShape(shape); } diff --git a/Framework/Crystal/src/LoadHKL.cpp b/Framework/Crystal/src/LoadHKL.cpp index 59ad3ad990c0a10ace1e7e6d0ddcc5d5cf189bde..93c96b020bba71d4dd9871c385236f4676ebfaf2 100644 --- a/Framework/Crystal/src/LoadHKL.cpp +++ b/Framework/Crystal/src/LoadHKL.cpp @@ -168,7 +168,7 @@ void LoadHKL::exec() { mrun.addProperty<double>("Radius", radius, true); NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), static_cast<uint16_t>(0), 0.0, 0.0, smu, 0.0, smu, amu); - Object shape = ws->sample().getShape(); // copy + CSGObject shape = ws->sample().getShape(); // copy shape.setMaterial(Material("SetInLoadHKL", neutron, 1.0)); ws->mutableSample().setShape(shape); diff --git a/Framework/Crystal/src/SaveHKL.cpp b/Framework/Crystal/src/SaveHKL.cpp index dc392f08a5ffa6e468d2bacea6307b813823062b..f615050766337be8133e1e94eb76feb6a70a04bd 100644 --- a/Framework/Crystal/src/SaveHKL.cpp +++ b/Framework/Crystal/src/SaveHKL.cpp @@ -258,7 +258,7 @@ void SaveHKL::exec() { NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), static_cast<uint16_t>(0), 0.0, 0.0, m_smu, 0.0, m_smu, m_amu); - Object shape = peaksW->sample().getShape(); // copy + CSGObject shape = peaksW->sample().getShape(); // copy shape.setMaterial(Material("SetInSaveHKL", neutron, 1.0)); peaksW->mutableSample().setShape(shape); } diff --git a/Framework/Crystal/test/LoadHKLTest.h b/Framework/Crystal/test/LoadHKLTest.h index 84395d8e9f99ec125bc7522def6d4f7363746590..ff02593e5c2bcaa90c8cfc321b0732175b61af57 100644 --- a/Framework/Crystal/test/LoadHKLTest.h +++ b/Framework/Crystal/test/LoadHKLTest.h @@ -42,7 +42,7 @@ public: double amu = 0.011; NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), static_cast<uint16_t>(0), 0.0, 0.0, smu, 0.0, smu, amu); - Object sampleShape; + CSGObject sampleShape; sampleShape.setMaterial(Material("SetInAnvredCorrection", neutron, 1.0)); ws->mutableSample().setShape(sampleShape); diff --git a/Framework/Crystal/test/SaveHKLTest.h b/Framework/Crystal/test/SaveHKLTest.h index d430b398fe5fad29f70590373d6ff841a8ed9c23..4029b5c7073b8709df0b75b4faac24e874094d69 100644 --- a/Framework/Crystal/test/SaveHKLTest.h +++ b/Framework/Crystal/test/SaveHKLTest.h @@ -40,7 +40,7 @@ public: double amu = 0.011; NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), static_cast<uint16_t>(0), 0.0, 0.0, smu, 0.0, smu, amu); - Object sampleShape; + CSGObject sampleShape; sampleShape.setMaterial(Material("SetInSaveHKLTest", neutron, 1.0)); ws->mutableSample().setShape(sampleShape); diff --git a/Framework/Crystal/test/SortHKLTest.h b/Framework/Crystal/test/SortHKLTest.h index b16f1f18e2c9e430ea855216a368ca80362f50f4..12c151a76dbadb42eabe6ed8c8872ca72fad7d43 100644 --- a/Framework/Crystal/test/SortHKLTest.h +++ b/Framework/Crystal/test/SortHKLTest.h @@ -49,7 +49,7 @@ public: double amu = 0.011; NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), static_cast<uint16_t>(0), 0.0, 0.0, smu, 0.0, smu, amu); - Object sampleShape; + CSGObject sampleShape; sampleShape.setMaterial(Material("SetInSaveHKLTest", neutron, 1.0)); ws->mutableSample().setShape(sampleShape); diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/VesuvioCalculateMS.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/VesuvioCalculateMS.h index 2fe80994b89b86327998eb86896cf8acec067cea..6b52ff86b01c0c7ff8b9c8d26db5a2ba758ec157 100644 --- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/VesuvioCalculateMS.h +++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/VesuvioCalculateMS.h @@ -14,7 +14,7 @@ class ISpectrum; } namespace Geometry { -class Object; +class CSGObject; } namespace CurveFitting { @@ -138,7 +138,7 @@ private: Kernel::V3D m_beamDir; // Directional vector for beam double m_srcR2; // beam penumbra radius (m) double m_halfSampleHeight, m_halfSampleWidth, m_halfSampleThick; // (m) - Geometry::Object const *m_sampleShape; // sample shape + Geometry::CSGObject const *m_sampleShape; // sample shape SampleComptonProperties *m_sampleProps; // description of sample properties double m_detHeight, m_detWidth, m_detThick; // (m) double m_tmin, m_tmax, m_delt; // min, max & dt TOF value diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h b/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h index 8c0f9ef28ce26aacfa4a8e5b8ec8cde0d9f13c3b..025c1a5127ff1744b086b0f25f3f1d55828f5f3f 100644 --- a/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h +++ b/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h @@ -30,7 +30,7 @@ class MatrixWorkspace; namespace Geometry { class CompAssembly; class Component; -class Object; +class CSGObject; class ObjComponent; class Instrument; } diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadParameterFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadParameterFile.h index f1faa80c7e01af17054665b9ad519cad0e824c9d..69dcefb4a09b39a1fdc80774d3f1f2de5bb9da50 100644 --- a/Framework/DataHandling/inc/MantidDataHandling/LoadParameterFile.h +++ b/Framework/DataHandling/inc/MantidDataHandling/LoadParameterFile.h @@ -24,7 +24,7 @@ class V3D; namespace Geometry { class CompAssembly; class Component; -class Object; +class CSGObject; class ObjComponent; class Instrument; } diff --git a/Framework/DataHandling/src/DefineGaugeVolume.cpp b/Framework/DataHandling/src/DefineGaugeVolume.cpp index 7c08358fa9d0858850eb3cb2156b59ca1557fb58..808f34c05cbd8f409c9bfd1f9a31128dfb5d2223 100644 --- a/Framework/DataHandling/src/DefineGaugeVolume.cpp +++ b/Framework/DataHandling/src/DefineGaugeVolume.cpp @@ -33,7 +33,7 @@ void DefineGaugeVolume::exec() { // Get the XML definition const std::string shapeXML = getProperty("ShapeXML"); // Try creating the shape to make sure the input's valid - boost::shared_ptr<Geometry::Object> shape_sptr = + boost::shared_ptr<Geometry::CSGObject> shape_sptr = Geometry::ShapeFactory().createShape(shapeXML); if (!shape_sptr->hasValidShape()) { g_log.error("Invalid shape definition provided. Gauge Volume NOT added to " diff --git a/Framework/DataHandling/src/LoadNXSPE.cpp b/Framework/DataHandling/src/LoadNXSPE.cpp index a5b3c81c73d32d996456ee0df2f1a75e0ec65264..93d65abcae61d96454efab5c8ebfd3641f6810fd 100644 --- a/Framework/DataHandling/src/LoadNXSPE.cpp +++ b/Framework/DataHandling/src/LoadNXSPE.cpp @@ -403,7 +403,7 @@ Geometry::Object_sptr LoadNXSPE::createCuboid(double dx, double dy, double dz) { // A sphere std::string ObjSphere = "-41"; - Geometry::Object_sptr retVal = boost::make_shared<Geometry::Object>(); + Geometry::Object_sptr retVal = boost::make_shared<Geometry::CSGObject>(); retVal->setObject(41, ObjSphere); retVal->populate(SphSurMap); diff --git a/Framework/DataHandling/test/CreateSampleShapeTest.h b/Framework/DataHandling/test/CreateSampleShapeTest.h index b950764814f48238a0b01e7693b00d44c172832e..c90274d0d612aa1dc11d012619593ee63db9b801 100644 --- a/Framework/DataHandling/test/CreateSampleShapeTest.h +++ b/Framework/DataHandling/test/CreateSampleShapeTest.h @@ -100,7 +100,7 @@ public: Mantid::API::AnalysisDataService::Instance().retrieve( "TestWorkspace")); - const Mantid::Geometry::Object &sample = ws->sample().getShape(); + const Mantid::Geometry::CSGObject &sample = ws->sample().getShape(); Mantid::Kernel::V3D point(x, y, z); if (inside) { diff --git a/Framework/DataHandling/test/SetSampleTest.h b/Framework/DataHandling/test/SetSampleTest.h index d15ae0e33896641ab5a1aa6ddc6471cd0ce3b7ea..677315555764927fde1fbd682bd84c8c37471994 100644 --- a/Framework/DataHandling/test/SetSampleTest.h +++ b/Framework/DataHandling/test/SetSampleTest.h @@ -554,7 +554,7 @@ private: return props; } - double getSphereRadius(const Mantid::Geometry::Object &shape) { + double getSphereRadius(const Mantid::Geometry::CSGObject &shape) { using Mantid::Geometry::SurfPoint; using Mantid::Geometry::Sphere; auto topRule = shape.topRule(); diff --git a/Framework/DataObjects/test/WorkspaceValidatorsTest.h b/Framework/DataObjects/test/WorkspaceValidatorsTest.h index b703204158ffaa74a99fc6ea698b9d23118c2f8a..2fa8dc023509adf12d9e87d6c9e32bce0ac737e0 100644 --- a/Framework/DataObjects/test/WorkspaceValidatorsTest.h +++ b/Framework/DataObjects/test/WorkspaceValidatorsTest.h @@ -219,7 +219,7 @@ public: } void testSampleValidator() { - using Mantid::Geometry::Object; + using Mantid::Geometry::CSGObject; using Mantid::Kernel::Material; using Mantid::PhysicalConstants::NeutronAtom; // These should be separate tests when they are refactored out @@ -243,7 +243,7 @@ public: TS_ASSERT_EQUALS( sampleVal->isValid(ws), "The sample is missing the following properties: material"); - auto noShape = boost::make_shared<Object>(); + auto noShape = boost::make_shared<CSGObject>(); noShape->setMaterial(Material("V", NeutronAtom(), 0.072)); ws->mutableSample().setShape(*noShape); TS_ASSERT_EQUALS(sampleVal->isValid(ws), ""); diff --git a/Framework/Geometry/inc/MantidGeometry/IObjComponent.h b/Framework/Geometry/inc/MantidGeometry/IObjComponent.h index 17b29750842746e243ff3f7b4cf96c066e3f3dab..9bf0386acf84dfba1ddeeeceadcde21745172493 100644 --- a/Framework/Geometry/inc/MantidGeometry/IObjComponent.h +++ b/Framework/Geometry/inc/MantidGeometry/IObjComponent.h @@ -12,7 +12,7 @@ class Material; namespace Geometry { class Track; -class Object; +class CSGObject; class GeometryHandler; /** Object Component class, this class brings together the physical attributes @@ -95,7 +95,7 @@ public: virtual void initDraw() const = 0; /// Returns the shape of the Object - virtual const boost::shared_ptr<const Object> shape() const = 0; + virtual const boost::shared_ptr<const CSGObject> shape() const = 0; /// Returns the material of the Object virtual const Kernel::Material material() const = 0; diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/ComponentHelper.h b/Framework/Geometry/inc/MantidGeometry/Instrument/ComponentHelper.h index b989cf758daaf100dd734c7225a3dff9b10c2492..c97c75ca9739ee9fc0daa0f6074ebdc2df0e67a5 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/ComponentHelper.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/ComponentHelper.h @@ -62,7 +62,7 @@ createVirtualInstrument(Kernel::V3D sourcePos, Kernel::V3D samplePos, const std::vector<Kernel::V3D> &vecdetpos, const std::vector<detid_t> &vecdetid); -MANTID_GEOMETRY_DLL boost::shared_ptr<Object> +MANTID_GEOMETRY_DLL boost::shared_ptr<CSGObject> createSphere(double radius, const Kernel::V3D ¢re, const std::string &id); MANTID_GEOMETRY_DLL std::string diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/ComponentInfo.h b/Framework/Geometry/inc/MantidGeometry/Instrument/ComponentInfo.h index 8c36b8c21347e66ec02223ca91edf2140f24e389..801fbab9c55a028ec2dd99ef7af38cc8aa5d01da 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/ComponentInfo.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/ComponentInfo.h @@ -16,7 +16,7 @@ class V3D; namespace Geometry { class BoundingBox; class IComponent; -class Object; +class CSGObject; } namespace Beamline { @@ -61,7 +61,7 @@ private: m_compIDToIndex; /// Shapes for each component - boost::shared_ptr<std::vector<boost::shared_ptr<const Geometry::Object>>> + boost::shared_ptr<std::vector<boost::shared_ptr<const Geometry::CSGObject>>> m_shapes; BoundingBox componentBoundingBox(const size_t index, @@ -74,7 +74,7 @@ public: componentIds, boost::shared_ptr<const std::unordered_map<Geometry::IComponent *, size_t>> componentIdToIndexMap, - boost::shared_ptr<std::vector<boost::shared_ptr<const Geometry::Object>>> + boost::shared_ptr<std::vector<boost::shared_ptr<const Geometry::CSGObject>>> shapes); ComponentInfo(const ComponentInfo &other); ~ComponentInfo(); @@ -108,7 +108,7 @@ public: return m_componentIds->operator[](componentIndex); } bool hasShape(const size_t componentIndex) const; - const Geometry::Object &shape(const size_t componentIndex) const; + const Geometry::CSGObject &shape(const size_t componentIndex) const; double solidAngle(const size_t componentIndex, const Kernel::V3D &observer) const; BoundingBox boundingBox(const size_t componentIndex, diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/Container.h b/Framework/Geometry/inc/MantidGeometry/Instrument/Container.h index 26a5a11ad7c1cea9cbdffcff2b33602956efafd7..01d7fac32901fc685a2d3b0143b74391d97cff10 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/Container.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/Container.h @@ -35,7 +35,7 @@ namespace Geometry { File change history is stored at: <https://github.com/mantidproject/mantid> Code Documentation is available at: <http://doxygen.mantidproject.org> */ -class MANTID_GEOMETRY_DLL Container final : public Object { +class MANTID_GEOMETRY_DLL Container final : public CSGObject { public: typedef std::unordered_map<std::string, double> ShapeArgs; diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h b/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h index 70dfa6661a7a5f0e006779148eed7cf933ccbd99..7400f4c1c1fce2b4f7d89f92ec8d02ac9eee4caa 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h @@ -50,7 +50,7 @@ public: std::string type() const override { return "DetectorComponent"; } Detector(const std::string &name, int id, IComponent *parent); - Detector(const std::string &name, int id, boost::shared_ptr<Object> shape, + Detector(const std::string &name, int id, boost::shared_ptr<CSGObject> shape, IComponent *parent); // functions inherited from IObjectComponent Component *clone() const override { return new Detector(*this); } diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h b/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h index 3622e55de486bbf41b856b11810087a30b067349..da23c07837b69893b2a9cb195c4a22de970a4ab8 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h @@ -246,8 +246,8 @@ protected: void initDraw() const override {} /// Returns the shape of the Object - const boost::shared_ptr<const Object> shape() const override { - return boost::shared_ptr<const Object>(); + const boost::shared_ptr<const CSGObject> shape() const override { + return boost::shared_ptr<const CSGObject>(); } /// Returns the material of the Object const Kernel::Material material() const override; diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentDefinitionParser.h b/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentDefinitionParser.h index 0b0183e94b60e73f8537ac10cd03b02a5565db92..1a5cd159f3abbd9b3040c3447084b556f5a33c27 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentDefinitionParser.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentDefinitionParser.h @@ -26,7 +26,7 @@ class ICompAssembly; class IComponent; class Instrument; class ObjComponent; -class Object; +class CSGObject; class ShapeFactory; /** Creates an instrument data from a XML instrument description file @@ -359,7 +359,7 @@ private: */ std::map<std::string, bool> isTypeAssembly; /// map which maps the type name to a shared pointer to a geometric shape - std::map<std::string, boost::shared_ptr<Geometry::Object>> mapTypeNameToShape; + std::map<std::string, boost::shared_ptr<Geometry::CSGObject>> mapTypeNameToShape; /// Container to hold all detectors and monitors added to the instrument. Used /// for 'facing' these to component specified under \<defaults\>. NOTE: Seems /// unused, ever. diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentVisitor.h b/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentVisitor.h index d44302c5ba18422fc5a9a3326876fc280ad3bdb7..ed8aab85500a91e2caca7f23e7ee099d3b1adea3 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentVisitor.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentVisitor.h @@ -24,7 +24,7 @@ class IComponent; class IDetector; class IObjComponent; class Instrument; -class Object; +class CSGObject; class ParameterMap; class RectangularDetector; @@ -124,11 +124,11 @@ private: int64_t m_sampleIndex = -1; /// Null shared (empty shape) - boost::shared_ptr<const Mantid::Geometry::Object> m_nullShape; + boost::shared_ptr<const Mantid::Geometry::CSGObject> m_nullShape; /// Shapes stored in fly-weight fashion boost::shared_ptr< - std::vector<boost::shared_ptr<const Mantid::Geometry::Object>>> m_shapes; + std::vector<boost::shared_ptr<const Mantid::Geometry::CSGObject>>> m_shapes; /// Scale factors boost::shared_ptr<std::vector<Eigen::Vector3d>> m_scaleFactors; diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h b/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h index 7e938882c573d0b711aeaffdcc04bcc060a2d8e5..f1dff29b46b48395126f674e144ebb4bafb1ff2d 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h @@ -93,8 +93,8 @@ public: Kernel::V3D getPos() const override; //! Set the outline of the assembly - boost::shared_ptr<Object> createOutline(); - void setOutline(boost::shared_ptr<const Object> obj); + boost::shared_ptr<CSGObject> createOutline(); + void setOutline(boost::shared_ptr<const CSGObject> obj); /** Test the intersection of the ray with the children of the component * assembly */ diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/ObjComponent.h b/Framework/Geometry/inc/MantidGeometry/Instrument/ObjComponent.h index 59d85f718d485f49180250772d9174a9f768e5c6..179a78ba0dd6e600e3bd20789d79f43d0db498df 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/ObjComponent.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/ObjComponent.h @@ -58,7 +58,7 @@ public: // probably add others) explicit ObjComponent(const std::string &name, IComponent *parent = nullptr); explicit ObjComponent(const std::string &name, - boost::shared_ptr<const Object> shape, + boost::shared_ptr<const CSGObject> shape, IComponent *parent = nullptr); /** Virtual Copy Constructor @@ -89,9 +89,9 @@ public: void initDraw() const override; /// Return the shape of the component - const boost::shared_ptr<const Object> shape() const override; + const boost::shared_ptr<const CSGObject> shape() const override; /// Set a new shape on the component - void setShape(boost::shared_ptr<const Object> newShape); + void setShape(boost::shared_ptr<const CSGObject> newShape); /// Return the material this component is made from const Kernel::Material material() const override; @@ -103,7 +103,7 @@ protected: // Made a pointer to a const object. Since this is a shared object we // shouldn't be // exposing non-const methods of Object through this class. - boost::shared_ptr<const Object> m_shape; + boost::shared_ptr<const CSGObject> m_shape; const Kernel::V3D factorOutComponentPosition(const Kernel::V3D &point) const; const Kernel::V3D takeOutRotation(Kernel::V3D point) const; diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h b/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h index be133ce58f3ecd8fa81e331fabaa153d3c02e03a..ec98b3c21eb7a585d184854ec21a5a7755ccbcaa 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h @@ -65,7 +65,7 @@ public: static bool compareName(const std::string &proposedMatch); /// Create all the detector pixels of this rectangular detector. - void initialize(boost::shared_ptr<Object> shape, int xpixels, double xstart, + void initialize(boost::shared_ptr<CSGObject> shape, int xpixels, double xstart, double xstep, int ypixels, double ystart, double ystep, int idstart, bool idfillbyfirst_y, int idstepbyrow, int idstep = 1); @@ -151,7 +151,7 @@ public: void initDraw() const override; /// Returns the shape of the Object - const boost::shared_ptr<const Object> shape() const override; + const boost::shared_ptr<const CSGObject> shape() const override; /// Returns the material of the detector const Kernel::Material material() const override; @@ -192,7 +192,7 @@ private: unsigned int m_textureID; /// Pointer to the shape of the pixels in this detector array. - boost::shared_ptr<Object> mShape; + boost::shared_ptr<CSGObject> mShape; /// minimum detector id int m_minDetId; /// maximum detector id diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetectorPixel.h b/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetectorPixel.h index 8414a919f1a415407f88c52091ab11ef906605fc..1e43fc190ac1d921203590f5972fe5e5f767d137 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetectorPixel.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetectorPixel.h @@ -50,7 +50,7 @@ public: std::string type() const override { return "RectangularDetectorPixel"; } RectangularDetectorPixel(const std::string &name, int id, - boost::shared_ptr<Object> shape, IComponent *parent, + boost::shared_ptr<CSGObject> shape, IComponent *parent, RectangularDetector *panel, size_t row, size_t col); RectangularDetectorPixel(); diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/StructuredDetector.h b/Framework/Geometry/inc/MantidGeometry/Instrument/StructuredDetector.h index 8e94bcc76538b21ea6a9241cfb4f97ab3661a651..d2c889b04f33c89f309d2f1adb560d8d02967c91 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/StructuredDetector.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/StructuredDetector.h @@ -139,7 +139,7 @@ public: void initDraw() const override; /// Returns the shape of the Object - const boost::shared_ptr<const Object> shape() const override; + const boost::shared_ptr<const CSGObject> shape() const override; /// Returns the material of the detector const Kernel::Material material() const override; diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/Object.h b/Framework/Geometry/inc/MantidGeometry/Objects/Object.h index d43b6a6dd976f4feb2f08ba7c4106646c53770cb..4fdbe2e34e80a1b47fd0e3e12f734c4e28a18b21 100644 --- a/Framework/Geometry/inc/MantidGeometry/Objects/Object.h +++ b/Framework/Geometry/inc/MantidGeometry/Objects/Object.h @@ -60,18 +60,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. File change history is stored at: <https://github.com/mantidproject/mantid> Code Documentation is available at: <http://doxygen.mantidproject.org> */ -class MANTID_GEOMETRY_DLL Object { +class MANTID_GEOMETRY_DLL CSGObject { public: /// Default constructor - Object(); + CSGObject(); /// Constructor providing shape xml. - Object(const std::string &shapeXML); + CSGObject(const std::string &shapeXML); /// Copy constructor - Object(const Object &); + CSGObject(const CSGObject &); /// Assignment operator - Object &operator=(const Object &); + CSGObject &operator=(const CSGObject &); /// Destructor - virtual ~Object(); + virtual ~CSGObject(); /// Return the top rule const Rule *topRule() const { return TopRule.get(); } @@ -99,7 +99,7 @@ public: int substituteSurf(const int SurfN, const int NsurfN, const boost::shared_ptr<Surface> &SPtr); void makeComplement(); - void convertComplement(const std::map<int, Object> &); + void convertComplement(const std::map<int, CSGObject> &); virtual void print() const; void printTree() const; @@ -117,7 +117,7 @@ public: std::vector<const Surface *> &getSurfacePtr() { return SurList; } std::string cellCompStr() const; - std::string cellStr(const std::map<int, Object> &) const; + std::string cellStr(const std::map<int, CSGObject> &) const; std::string str() const; void write(std::ostream &) const; ///< MCNPX output @@ -264,9 +264,9 @@ protected: }; /// Typdef for a shared pointer -typedef boost::shared_ptr<Object> Object_sptr; +typedef boost::shared_ptr<CSGObject> Object_sptr; /// Typdef for a shared pointer to a const object -typedef boost::shared_ptr<const Object> Object_const_sptr; +typedef boost::shared_ptr<const CSGObject> Object_const_sptr; } // NAMESPACE Geometry } // NAMESPACE Mantid diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h b/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h index b0214d0159fe2099e32014dd7b952ab65b93a636..e380924507027d1d522df5a18b393a010911af3b 100644 --- a/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h +++ b/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h @@ -10,7 +10,7 @@ namespace Mantid { namespace Geometry { -class Object; +class CSGObject; class Surface; /** @@ -298,7 +298,7 @@ Care must be taken to avoid a cyclic loop class MANTID_GEOMETRY_DLL CompObj : public Rule { private: int objN; ///< Object number - Object *key; ///< Object Pointer + CSGObject *key; ///< Object Pointer CompObj *doClone() const override; protected: @@ -323,14 +323,14 @@ public: } ///< Always returns true (1) void setObjN(const int Ky); ///< set object Number - void setObj(Object *); ///< Set a Object state + void setObj(CSGObject *); ///< Set a Object state bool isValid(const Kernel::V3D &) const override; bool isValid(const std::map<int, int> &) const override; /// Get object number of component int getObjN() const { return objN; } int simplify() override; - Object *getObj() const { return key; } ///< Get Object Ptr + CSGObject *getObj() const { return key; } ///< Get Object Ptr std::string display() const override; std::string displayAddress() const override; void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin, diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h b/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h index 1327e12b3d1ed3d73e82cc66e67bf1287c38de89..d389d088cc6ed0f512d3d56b5aec1239964a2018 100644 --- a/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h +++ b/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h @@ -26,7 +26,7 @@ namespace Mantid { namespace Geometry { class Surface; -class Object; +class CSGObject; struct CuboidCorners { Kernel::V3D lfb; @@ -83,13 +83,13 @@ File change history is stored at: <https://github.com/mantidproject/mantid> */ class MANTID_GEOMETRY_DLL ShapeFactory { public: - template <typename ObjectType = Object> + template <typename ObjectType = CSGObject> boost::shared_ptr<ObjectType> createShape(Poco::XML::Element *pElem); - template <typename ObjectType = Object> + template <typename ObjectType = CSGObject> boost::shared_ptr<ObjectType> createShape(std::string shapeXML, bool addTypeTag = true); - boost::shared_ptr<Object> createHexahedralShape(double xlb, double xlf, + boost::shared_ptr<CSGObject> createHexahedralShape(double xlb, double xlf, double xrf, double xrb, double ylb, double ylf, double yrf, double yrb); @@ -154,7 +154,7 @@ private: const std::string &name); double getDoubleAttribute(Poco::XML::Element *pElem, const std::string &name); Kernel::V3D parsePosition(Poco::XML::Element *pElem); - void createGeometryHandler(Poco::XML::Element *, boost::shared_ptr<Object>); + void createGeometryHandler(Poco::XML::Element *, boost::shared_ptr<CSGObject>); }; } // namespace Geometry diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/Track.h b/Framework/Geometry/inc/MantidGeometry/Objects/Track.h index 3a7863d289fb37228af9e32feb383085c462ec4a..af110564e82785d06ac6d736e364c6ece3e7c79e 100644 --- a/Framework/Geometry/inc/MantidGeometry/Objects/Track.h +++ b/Framework/Geometry/inc/MantidGeometry/Objects/Track.h @@ -58,7 +58,7 @@ struct MANTID_GEOMETRY_DLL Link { * hit. (Default=NULL) */ inline Link(const Kernel::V3D &entry, const Kernel::V3D &exit, - const double totalDistance, const Object &obj, + const double totalDistance, const CSGObject &obj, const ComponentID compID = nullptr) : entryPoint(entry), exitPoint(exit), distFromStart(totalDistance), distInsideObject(entryPoint.distance(exitPoint)), object(&obj), @@ -78,7 +78,7 @@ struct MANTID_GEOMETRY_DLL Link { Kernel::V3D exitPoint; ///< Exit point double distFromStart; ///< Total distance from track beginning double distInsideObject; ///< Total distance covered inside object - const Object *object; ///< The object that was intersected + const CSGObject *object; ///< The object that was intersected ComponentID componentID; ///< ComponentID of the intersected component //@} }; @@ -104,7 +104,7 @@ struct IntersectionPoint { * @param obj :: A reference to the object that was intersected */ inline IntersectionPoint(const int flag, const Kernel::V3D &end, - const double distFromStartOfTrack, const Object &obj, + const double distFromStartOfTrack, const CSGObject &obj, const ComponentID compID = nullptr) : directionFlag(flag), endPoint(end), distFromStart(distFromStartOfTrack), object(&obj), componentID(compID) {} @@ -130,7 +130,7 @@ struct IntersectionPoint { int directionFlag; ///< Directional flag Kernel::V3D endPoint; ///< Point double distFromStart; ///< Total distance from track begin - const Object *object; ///< The object that was intersected + const CSGObject *object; ///< The object that was intersected ComponentID componentID; ///< Unique component ID //@} }; @@ -153,10 +153,10 @@ public: Track(const Kernel::V3D &startPt, const Kernel::V3D &unitVector); /// Adds a point of intersection to the track void addPoint(const int directionFlag, const Kernel::V3D &endPoint, - const Object &obj, const ComponentID compID = nullptr); + const CSGObject &obj, const ComponentID compID = nullptr); /// Adds a link to the track int addLink(const Kernel::V3D &firstPoint, const Kernel::V3D &secondPoint, - const double distanceAlongTrack, const Object &obj, + const double distanceAlongTrack, const CSGObject &obj, const ComponentID compID = nullptr); /// Remove touching Links that have identical components void removeCojoins(); diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/BitmapGeometryHandler.h b/Framework/Geometry/inc/MantidGeometry/Rendering/BitmapGeometryHandler.h index fdf02d50f1a91fda42c1fa790f2aa4d532ebf6d1..3e8017c3f2497cb65d8335e2adae2ca2fea77f20 100644 --- a/Framework/Geometry/inc/MantidGeometry/Rendering/BitmapGeometryHandler.h +++ b/Framework/Geometry/inc/MantidGeometry/Rendering/BitmapGeometryHandler.h @@ -49,7 +49,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. File change history is stored at: <https://github.com/mantidproject/mantid> */ class ObjComponent; -class Object; +class CSGObject; class MANTID_GEOMETRY_DLL BitmapGeometryHandler : public GeometryHandler { private: static Kernel::Logger &PLog; ///< The official logger @@ -71,9 +71,9 @@ public: BitmapGeometryHandler *createInstance( IObjComponent *) override; ///< Create an instance of concrete geometry /// handler for ObjComponent - BitmapGeometryHandler *createInstance(boost::shared_ptr<Object>) + BitmapGeometryHandler *createInstance(boost::shared_ptr<CSGObject>) override; ///< Create an instance of concrete geometry handler for Object - GeometryHandler *createInstance(Object *) + GeometryHandler *createInstance(CSGObject *) override; ///< Create an instance of concrete geometry handler for Object void Triangulate() override; ///< Triangulate the Object void Render() override; ///< Render Object or ObjComponent diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryGenerator.h b/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryGenerator.h index 5cee18aeaf0fac21bafd6bc1c52a8cb264269e19..5b9371b8744c7ddd51ba6257c804a18159e2294b 100644 --- a/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryGenerator.h +++ b/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryGenerator.h @@ -39,16 +39,16 @@ namespace Geometry { File change history is stored at: <https://github.com/mantidproject/mantid> */ -class Object; +class CSGObject; class MANTID_GEOMETRY_DLL CacheGeometryGenerator { private: - Object *Obj; ///< Input Object + CSGObject *Obj; ///< Input Object int mNoOfVertices; ///< number of vertices int mNoOfTriangles; ///< number of triangles double *mPoints; ///<double array or points int *mFaces; ///< Integer array of faces public: - CacheGeometryGenerator(Object *obj); + CacheGeometryGenerator(CSGObject *obj); ~CacheGeometryGenerator(); /// Generate the trangles void Generate(); diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryHandler.h b/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryHandler.h index 7d456c96e500be84e6c3373ed8c1eccba5edc846..3e897698472c2c2294da4d05d7d009fae9c9bf50 100644 --- a/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryHandler.h +++ b/Framework/Geometry/inc/MantidGeometry/Rendering/CacheGeometryHandler.h @@ -14,7 +14,7 @@ class GeometryHandler; class CacheGeometryRenderer; class CacheGeometryGenerator; class IObjComponent; -class Object; +class CSGObject; /** \class CacheGeometryHandler @@ -57,13 +57,13 @@ private: public: CacheGeometryHandler(IObjComponent *comp); ///< Constructor - CacheGeometryHandler(boost::shared_ptr<Object> obj); ///< Constructor - CacheGeometryHandler(Object *obj); ///< Constructor + CacheGeometryHandler(boost::shared_ptr<CSGObject> obj); ///< Constructor + CacheGeometryHandler(CSGObject *obj); ///< Constructor boost::shared_ptr<GeometryHandler> clone() const override; ~CacheGeometryHandler() override; ///< Destructor GeometryHandler *createInstance(IObjComponent *comp) override; - GeometryHandler *createInstance(boost::shared_ptr<Object> obj) override; - GeometryHandler *createInstance(Object *obj) override; + GeometryHandler *createInstance(boost::shared_ptr<CSGObject> obj) override; + GeometryHandler *createInstance(CSGObject *obj) override; void Triangulate() override; void Render() override; diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h b/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h index d6b9b843c9f0512f9ac40d8690b1ff10b0d574b1..4997af4df399d3026d490762491a20f4f35e47ee 100644 --- a/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h +++ b/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h @@ -12,7 +12,7 @@ namespace Mantid { namespace Geometry { class IObjComponent; class ObjComponent; -class Object; +class CSGObject; /** \class GeometryHandler @@ -49,14 +49,14 @@ private: protected: IObjComponent *ObjComp; ///< ObjComponent that uses this geometry handler - Object *Obj; ///< Object that uses this geometry handler + CSGObject *Obj; ///< Object that uses this geometry handler bool boolTriangulated; ///< state of the geometry triangulation bool boolIsInitialized; ///< state of the geometry initialization for rendering public: GeometryHandler(IObjComponent *comp); ///< Constructor - GeometryHandler(boost::shared_ptr<Object> obj); ///<Constructor - GeometryHandler(Object *obj); ///<Constructor + GeometryHandler(boost::shared_ptr<CSGObject> obj); ///<Constructor + GeometryHandler(CSGObject *obj); ///<Constructor virtual boost::shared_ptr<GeometryHandler> clone() const = 0; ///< Virtual copy constructor virtual ~GeometryHandler(); @@ -67,10 +67,10 @@ public: /// handler for /// ObjComponent virtual GeometryHandler * - createInstance(boost::shared_ptr<Object>) = 0; ///< Create an instance of + createInstance(boost::shared_ptr<CSGObject>) = 0; ///< Create an instance of /// concrete geometry /// handler for Object - virtual GeometryHandler *createInstance(Object *) = 0; ///< Create an instance + virtual GeometryHandler *createInstance(CSGObject *) = 0; ///< Create an instance /// of concrete geometry /// handler for Object virtual void Triangulate() = 0; ///< Triangulate the Object diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryHandler.h b/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryHandler.h index ff1dac03400cff8459f6f689f57794af8ea45d0f..b13d233fceb0005cb97cbf3592bee30e01671bf1 100644 --- a/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryHandler.h +++ b/Framework/Geometry/inc/MantidGeometry/Rendering/GluGeometryHandler.h @@ -12,7 +12,7 @@ namespace Geometry { class GeometryHandler; class GluGeometryRenderer; class IObjComponent; -class Object; +class CSGObject; /** \class GluGeometryHandler \brief Place holder for geometry triangulation and rendering with special @@ -72,13 +72,13 @@ private: public: GluGeometryHandler(const GluGeometryHandler &other); GluGeometryHandler(IObjComponent *comp); ///< Constructor - GluGeometryHandler(boost::shared_ptr<Object> obj); ///< Constructor - GluGeometryHandler(Object *obj); ///< Constructor + GluGeometryHandler(boost::shared_ptr<CSGObject> obj); ///< Constructor + GluGeometryHandler(CSGObject *obj); ///< Constructor boost::shared_ptr<GeometryHandler> clone() const override; ~GluGeometryHandler() override; ///< Destructor GeometryHandler *createInstance(IObjComponent *comp) override; - GeometryHandler *createInstance(boost::shared_ptr<Object> obj) override; - GeometryHandler *createInstance(Object *) override; + GeometryHandler *createInstance(boost::shared_ptr<CSGObject> obj) override; + GeometryHandler *createInstance(CSGObject *) override; /// sets the geometry handler for a cuboid void setCuboid(const Kernel::V3D &, const Kernel::V3D &, const Kernel::V3D &, const Kernel::V3D &); diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/OCGeometryGenerator.h b/Framework/Geometry/inc/MantidGeometry/Rendering/OCGeometryGenerator.h index 25bef1348fab5081fcbdc0c87ebadc1a54d781c5..85519dd94da42ff7f19b5426c8d299e6a0b2d370 100644 --- a/Framework/Geometry/inc/MantidGeometry/Rendering/OCGeometryGenerator.h +++ b/Framework/Geometry/inc/MantidGeometry/Rendering/OCGeometryGenerator.h @@ -7,7 +7,7 @@ class TopoDS_Shape; namespace Mantid { namespace Geometry { -class Object; +class CSGObject; class Intersection; class Union; class SurfPoint; @@ -54,13 +54,13 @@ class Torus; */ class MANTID_GEOMETRY_DLL OCGeometryGenerator { private: - const Object *Obj; ///< Input Object + const CSGObject *Obj; ///< Input Object TopoDS_Shape *ObjSurface; ///< Storage for the output surface /// Analyze the object void AnalyzeObject(); public: - OCGeometryGenerator(const Object *obj); + OCGeometryGenerator(const CSGObject *obj); ~OCGeometryGenerator(); void Generate(); TopoDS_Shape *getObjectSurface(); diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/OCGeometryHandler.h b/Framework/Geometry/inc/MantidGeometry/Rendering/OCGeometryHandler.h index fd86b49727f446bd3c5b0947c0c07253fce535c6..9e0b7cd83c798effcf7ce734a9bafca1430ec1f6 100644 --- a/Framework/Geometry/inc/MantidGeometry/Rendering/OCGeometryHandler.h +++ b/Framework/Geometry/inc/MantidGeometry/Rendering/OCGeometryHandler.h @@ -10,7 +10,7 @@ class GeometryHandler; class OCGeometryRenderer; class OCGeometryGenerator; class IObjComponent; -class Object; +class CSGObject; /** \class OCGeometryHandler \brief Place holder for OpenCascade library geometry triangulation and @@ -56,14 +56,14 @@ private: Triangulator; ///< Geometry generator to triangulate Object public: OCGeometryHandler(IObjComponent *comp); ///< Constructor - OCGeometryHandler(boost::shared_ptr<Object> obj); ///< Constructor - OCGeometryHandler(Object *obj); ///< Constructor + OCGeometryHandler(boost::shared_ptr<CSGObject> obj); ///< Constructor + OCGeometryHandler(CSGObject *obj); ///< Constructor boost::shared_ptr<GeometryHandler> clone() const override; ///< Virtual copy constructor ~OCGeometryHandler() override; ///< Destructor GeometryHandler *createInstance(IObjComponent *comp) override; - GeometryHandler *createInstance(boost::shared_ptr<Object> obj) override; - GeometryHandler *createInstance(Object *) override; + GeometryHandler *createInstance(boost::shared_ptr<CSGObject> obj) override; + GeometryHandler *createInstance(CSGObject *) override; void Triangulate() override; void Render() override; void Initialize() override; diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/StructuredGeometryHandler.h b/Framework/Geometry/inc/MantidGeometry/Rendering/StructuredGeometryHandler.h index 4f5aa98ad6a19bd554fb32a4b40bffb612870eb8..cc645f396a90a9e02cdf0878425415cfffa3085b 100644 --- a/Framework/Geometry/inc/MantidGeometry/Rendering/StructuredGeometryHandler.h +++ b/Framework/Geometry/inc/MantidGeometry/Rendering/StructuredGeometryHandler.h @@ -44,7 +44,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. File change history is stored at: <https://github.com/mantidproject/mantid> */ class ObjComponent; -class Object; +class CSGObject; class MANTID_GEOMETRY_DLL StructuredGeometryHandler : public GeometryHandler { private: static Kernel::Logger &PLog; ///< The official logger @@ -61,9 +61,9 @@ public: StructuredGeometryHandler *createInstance( IObjComponent *) override; ///< Create an instance of concrete geometry /// handler for ObjComponent - StructuredGeometryHandler *createInstance(boost::shared_ptr<Object>) + StructuredGeometryHandler *createInstance(boost::shared_ptr<CSGObject>) override; ///< Create an instance of concrete geometry handler for Object - GeometryHandler *createInstance(Object *) + GeometryHandler *createInstance(CSGObject *) override; ///< Create an instance of concrete geometry handler for Object void Triangulate() override; ///< Triangulate the Object void Render() override; ///< Render Object or ObjComponent diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheReader.h b/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheReader.h index 55a6d34a4ded04dcaa9a8f9a68ac6add8157f79e..11ed3c07fdd8b1c2bd422d69091a74dff29f6144 100644 --- a/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheReader.h +++ b/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheReader.h @@ -57,7 +57,7 @@ private: public: vtkGeometryCacheReader(std::string filename); ///< Constructor ~vtkGeometryCacheReader(); ///< Destructor - void readCacheForObject(Object *obj); + void readCacheForObject(CSGObject *obj); }; } // NAMESPACE Geometry diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheWriter.h b/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheWriter.h index ab685bb44b396d1aa3c636e66b562648a7490c7d..8c0e19e755fa0862b9363d53300c565603038099 100644 --- a/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheWriter.h +++ b/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheWriter.h @@ -43,7 +43,7 @@ namespace Geometry { File change history is stored at: <https://github.com/mantidproject/mantid> */ -class Object; +class CSGObject; class MANTID_GEOMETRY_DLL vtkGeometryCacheWriter { private: Poco::XML::Document *mDoc; ///< The XML document @@ -56,7 +56,7 @@ private: public: vtkGeometryCacheWriter(std::string); ///< Constructor ~vtkGeometryCacheWriter(); ///< Destructor - void addObject(Object *obj); + void addObject(CSGObject *obj); void write(); ///< Write the XML to a file }; diff --git a/Framework/Geometry/src/Instrument/ComponentInfo.cpp b/Framework/Geometry/src/Instrument/ComponentInfo.cpp index ef44f1e7987659f0ff6558a6b53f15e81ab95708..ab55e94228e75e13b4d8c661175e19af83afd6ad 100644 --- a/Framework/Geometry/src/Instrument/ComponentInfo.cpp +++ b/Framework/Geometry/src/Instrument/ComponentInfo.cpp @@ -55,7 +55,7 @@ ComponentInfo::ComponentInfo( componentIds, boost::shared_ptr<const std::unordered_map<Geometry::IComponent *, size_t>> componentIdToIndexMap, - boost::shared_ptr<std::vector<boost::shared_ptr<const Geometry::Object>>> + boost::shared_ptr<std::vector<boost::shared_ptr<const Geometry::CSGObject>>> shapes) : m_componentInfo(std::move(componentInfo)), m_componentIds(std::move(componentIds)), @@ -166,7 +166,7 @@ void ComponentInfo::setRotation(const size_t componentIndex, Kernel::toQuaterniond(newRotation)); } -const Object &ComponentInfo::shape(const size_t componentIndex) const { +const CSGObject &ComponentInfo::shape(const size_t componentIndex) const { return *(*m_shapes)[componentIndex]; } diff --git a/Framework/Geometry/src/Instrument/Container.cpp b/Framework/Geometry/src/Instrument/Container.cpp index c98de068f685f25bfbf2181991fd29a93de4de49..f9f1664c0db4826eb576e39dd23b90b732cc06fa 100644 --- a/Framework/Geometry/src/Instrument/Container.cpp +++ b/Framework/Geometry/src/Instrument/Container.cpp @@ -49,7 +49,7 @@ void updateTreeValues(Poco::XML::Element *root, * Construct a container providing an XML definition shape * @param xml Definition of the shape in xml */ -Container::Container(std::string xml) : Object(xml) {} +Container::Container(std::string xml) : CSGObject(xml) {} /** * @return True if the can contains a defintion of the sample shape @@ -87,7 +87,7 @@ Container::createSampleShape(const Container::ShapeArgs &args) const { updateTreeValues(root, args); ShapeFactory factory; - return factory.createShape<Object>(root); + return factory.createShape<CSGObject>(root); } /** diff --git a/Framework/Geometry/src/Instrument/Detector.cpp b/Framework/Geometry/src/Instrument/Detector.cpp index 324d481934e895b981876a847d911756c4e8b257..2434ec8fc767e1fe00745b169a651ad4c331b056 100644 --- a/Framework/Geometry/src/Instrument/Detector.cpp +++ b/Framework/Geometry/src/Instrument/Detector.cpp @@ -39,7 +39,7 @@ Detector::Detector(const std::string &name, int id, IComponent *parent) * @param parent :: The parent component */ Detector::Detector(const std::string &name, int id, - boost::shared_ptr<Object> shape, IComponent *parent) + boost::shared_ptr<CSGObject> shape, IComponent *parent) : IDetector(), ObjComponent(name, shape, parent), m_id(id) {} /** Gets the detector id diff --git a/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp b/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp index c79b38a28abcd9a7727bc024fdb21b3ecb26dd5e..d4b9b68d13de34e9f4deba77cc356b531d4fc64f 100644 --- a/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp +++ b/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp @@ -1253,7 +1253,7 @@ void InstrumentDefinitionParser::appendAssembly( } if (pType->getAttribute("object_created") == "no") { pType->setAttribute("object_created", "yes"); - boost::shared_ptr<Geometry::Object> obj = objAss->createOutline(); + boost::shared_ptr<Geometry::CSGObject> obj = objAss->createOutline(); if (obj) { mapTypeNameToShape[pType->getAttribute("name")] = obj; } else { // object failed to be created @@ -1402,7 +1402,7 @@ void InstrumentDefinitionParser::createRectangularDetector( // Given that this leaf component is actually an assembly, its constituent // component detector shapes comes from its type attribute. const std::string shapeType = pType->getAttribute("type"); - boost::shared_ptr<Geometry::Object> shape = mapTypeNameToShape[shapeType]; + boost::shared_ptr<Geometry::CSGObject> shape = mapTypeNameToShape[shapeType]; // These parameters are in the TYPE defining RectangularDetector if (pType->hasAttribute("xpixels")) @@ -1502,7 +1502,7 @@ void InstrumentDefinitionParser::createStructuredDetector( // Given that this leaf component is actually an assembly, its constituent // component detector shapes comes from its type attribute. const std::string shapeType = pType->getAttribute("type"); - boost::shared_ptr<Geometry::Object> shape = mapTypeNameToShape[shapeType]; + boost::shared_ptr<Geometry::CSGObject> shape = mapTypeNameToShape[shapeType]; std::string typeName = pType->getAttribute("name"); // These parameters are in the TYPE defining StructuredDetector @@ -2460,7 +2460,7 @@ void InstrumentDefinitionParser::applyCache(IDFObject_const_sptr cacheToApply) { const std::string cacheFullPath = cacheToApply->getFileFullPathStr(); g_log.information("Loading geometry cache from " + cacheFullPath); // create a vtk reader - std::map<std::string, boost::shared_ptr<Geometry::Object>>::iterator objItr; + std::map<std::string, boost::shared_ptr<Geometry::CSGObject>>::iterator objItr; boost::shared_ptr<Mantid::Geometry::vtkGeometryCacheReader> reader( new Mantid::Geometry::vtkGeometryCacheReader(cacheFullPath)); for (objItr = mapTypeNameToShape.begin(); objItr != mapTypeNameToShape.end(); @@ -2499,7 +2499,7 @@ InstrumentDefinitionParser::writeAndApplyCache( const std::string cacheFullPath = usedCache->getFileFullPathStr(); g_log.information() << "Creating cache in " << cacheFullPath << "\n"; // create a vtk writer - std::map<std::string, boost::shared_ptr<Geometry::Object>>::iterator objItr; + std::map<std::string, boost::shared_ptr<Geometry::CSGObject>>::iterator objItr; boost::shared_ptr<Mantid::Geometry::vtkGeometryCacheWriter> writer( new Mantid::Geometry::vtkGeometryCacheWriter(cacheFullPath)); for (objItr = mapTypeNameToShape.begin(); objItr != mapTypeNameToShape.end(); diff --git a/Framework/Geometry/src/Instrument/InstrumentVisitor.cpp b/Framework/Geometry/src/Instrument/InstrumentVisitor.cpp index 13adc7e538800b24e92c5da9b3489683ff17ad1a..d29c9711423bd03dc78dee6decfdf95b45da840c 100644 --- a/Framework/Geometry/src/Instrument/InstrumentVisitor.cpp +++ b/Framework/Geometry/src/Instrument/InstrumentVisitor.cpp @@ -80,8 +80,8 @@ InstrumentVisitor::InstrumentVisitor( m_orderedDetectorIds->size())), m_monitorIndices(boost::make_shared<std::vector<size_t>>()), m_instrument(std::move(instrument)), m_pmap(nullptr), - m_nullShape(boost::make_shared<const Object>()), - m_shapes(boost::make_shared<std::vector<boost::shared_ptr<const Object>>>( + m_nullShape(boost::make_shared<const CSGObject>()), + m_shapes(boost::make_shared<std::vector<boost::shared_ptr<const CSGObject>>>( m_orderedDetectorIds->size(), m_nullShape)), m_scaleFactors(boost::make_shared<std::vector<Eigen::Vector3d>>( m_orderedDetectorIds->size(), Eigen::Vector3d{1, 1, 1})), diff --git a/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp b/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp index 569b35a90d9b18a89ffd492e16f14996cdd26f4e..ee27e1208021627b2a3265a5a83894d1512d5c81 100644 --- a/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp +++ b/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp @@ -367,7 +367,7 @@ size_t ObjCompAssembly::registerContents( * The shape can be either a box or a cylinder. * @return The shape of the outline: "cylinder", "box", ... */ -boost::shared_ptr<Object> ObjCompAssembly::createOutline() { +boost::shared_ptr<CSGObject> ObjCompAssembly::createOutline() { if (group.empty()) { throw Kernel::Exception::InstrumentDefinitionError("Empty ObjCompAssembly"); } @@ -382,7 +382,7 @@ boost::shared_ptr<Object> ObjCompAssembly::createOutline() { int otype; std::vector<Kernel::V3D> vectors; double radius, height; - boost::shared_ptr<const Object> obj = group.front()->shape(); + boost::shared_ptr<const CSGObject> obj = group.front()->shape(); if (!obj) { throw Kernel::Exception::InstrumentDefinitionError( "Found ObjComponent without shape"); @@ -596,18 +596,18 @@ boost::shared_ptr<Object> ObjCompAssembly::createOutline() { } if (!obj_str.str().empty()) { - boost::shared_ptr<Object> s = ShapeFactory().createShape(obj_str.str()); + boost::shared_ptr<CSGObject> s = ShapeFactory().createShape(obj_str.str()); setOutline(s); return s; } - return boost::shared_ptr<Object>(); + return boost::shared_ptr<CSGObject>(); } /** * Sets the outline shape for this assembly * @param obj :: The outline shape created previously fith createOutline() */ -void ObjCompAssembly::setOutline(boost::shared_ptr<const Object> obj) { +void ObjCompAssembly::setOutline(boost::shared_ptr<const CSGObject> obj) { m_shape = obj; } diff --git a/Framework/Geometry/src/Instrument/ObjComponent.cpp b/Framework/Geometry/src/Instrument/ObjComponent.cpp index dd3afc4ee930e96c2cb78636649874aad4aaf1a8..33d8825e12049be62d564432d2a0b699d67cbc50 100644 --- a/Framework/Geometry/src/Instrument/ObjComponent.cpp +++ b/Framework/Geometry/src/Instrument/ObjComponent.cpp @@ -35,7 +35,7 @@ ObjComponent::ObjComponent(const std::string &name, IComponent *parent) * @param parent :: The Parent geometry object of this component */ ObjComponent::ObjComponent(const std::string &name, - boost::shared_ptr<const Object> shape, + boost::shared_ptr<const CSGObject> shape, IComponent *parent) : IObjComponent(), Component(name, parent), m_shape(shape) {} diff --git a/Framework/Geometry/src/Instrument/RectangularDetector.cpp b/Framework/Geometry/src/Instrument/RectangularDetector.cpp index da83a5593865c3729267659df74bf3fb19b2671b..bacadf56c4058fd8af54054c5b2e99a93af8072a 100644 --- a/Framework/Geometry/src/Instrument/RectangularDetector.cpp +++ b/Framework/Geometry/src/Instrument/RectangularDetector.cpp @@ -367,7 +367,7 @@ V3D RectangularDetector::getRelativePosAtXY(int x, int y) const { * and idstep=100 and idstart=1 then (0,0)=1; (0,1)=101; and so on * */ -void RectangularDetector::initialize(boost::shared_ptr<Object> shape, +void RectangularDetector::initialize(boost::shared_ptr<CSGObject> shape, int xpixels, double xstart, double xstep, int ypixels, double ystart, double ystep, int idstart, bool idfillbyfirst_y, @@ -701,7 +701,7 @@ void RectangularDetector::initDraw() const { //------------------------------------------------------------------------------------------------- /// Returns the shape of the Object -const boost::shared_ptr<const Object> RectangularDetector::shape() const { +const boost::shared_ptr<const CSGObject> RectangularDetector::shape() const { // --- Create a cuboid shape for your pixels ---- double szX = m_xpixels; double szY = m_ypixels; @@ -720,7 +720,7 @@ const boost::shared_ptr<const Object> RectangularDetector::shape() const { std::string xmlCuboidShape(xmlShapeStream.str()); Geometry::ShapeFactory shapeCreator; - boost::shared_ptr<Geometry::Object> cuboidShape = + boost::shared_ptr<Geometry::CSGObject> cuboidShape = shapeCreator.createShape(xmlCuboidShape); return cuboidShape; diff --git a/Framework/Geometry/src/Instrument/RectangularDetectorPixel.cpp b/Framework/Geometry/src/Instrument/RectangularDetectorPixel.cpp index c51c212b620ec3d8e00133964a986a31e60b1651..e0fdb8804ba779e06e97fae3190f7d9266a89546 100644 --- a/Framework/Geometry/src/Instrument/RectangularDetectorPixel.cpp +++ b/Framework/Geometry/src/Instrument/RectangularDetectorPixel.cpp @@ -29,7 +29,7 @@ RectangularDetectorPixel::RectangularDetectorPixel( * @param col :: column of the pixel in the panel */ RectangularDetectorPixel::RectangularDetectorPixel( - const std::string &name, int id, boost::shared_ptr<Object> shape, + const std::string &name, int id, boost::shared_ptr<CSGObject> shape, IComponent *parent, RectangularDetector *panel, size_t row, size_t col) : Detector(name, id, shape, parent), m_panel(panel), m_row(row), m_col(col) { diff --git a/Framework/Geometry/src/Instrument/SampleEnvironmentSpecParser.cpp b/Framework/Geometry/src/Instrument/SampleEnvironmentSpecParser.cpp index 4bd481f98a8883d1f4a6e99853ff754f8a94915c..14adc1fc2916ce8506646bf4095c7f8cdf2c52b3 100644 --- a/Framework/Geometry/src/Instrument/SampleEnvironmentSpecParser.cpp +++ b/Framework/Geometry/src/Instrument/SampleEnvironmentSpecParser.cpp @@ -157,7 +157,7 @@ void SampleEnvironmentSpecParser::parseAndAddComponents( if (nodeName == CONTAINERS_TAG) { parseAndAddContainers(spec, childElement); } else if (nodeName == COMPONENT_TAG) { - spec->addComponent(parseComponent<Object>(childElement)); + spec->addComponent(parseComponent<CSGObject>(childElement)); } node = nodeIter.nextNode(); } @@ -237,7 +237,7 @@ Mantid::Geometry::SampleEnvironmentSpecParser::parseComponent( // Concrete instantions //------------------------------------------------------------------------------ ///@cond -template boost::shared_ptr<Object> +template boost::shared_ptr<CSGObject> Mantid::Geometry::SampleEnvironmentSpecParser::parseComponent(Element *) const; template boost::shared_ptr<Container> Mantid::Geometry::SampleEnvironmentSpecParser::parseComponent(Element *) const; diff --git a/Framework/Geometry/src/Instrument/StructuredDetector.cpp b/Framework/Geometry/src/Instrument/StructuredDetector.cpp index 2c42ccb6cf0a79ef086571f3cfb5609208071e23..f13c5f4aec52929cb9ee3a801018e099aa21a1a1 100644 --- a/Framework/Geometry/src/Instrument/StructuredDetector.cpp +++ b/Framework/Geometry/src/Instrument/StructuredDetector.cpp @@ -420,7 +420,7 @@ Detector *StructuredDetector::addDetector(CompAssembly *parent, ylb -= ypos; ShapeFactory factory; - boost::shared_ptr<Mantid::Geometry::Object> shape = + boost::shared_ptr<Mantid::Geometry::CSGObject> shape = factory.createHexahedralShape(xlb, xlf, xrf, xrb, ylb, ylf, yrf, yrb); // Create detector @@ -572,7 +572,7 @@ void StructuredDetector::initDraw() const { } /// Returns the shape of the Object -const boost::shared_ptr<const Object> StructuredDetector::shape() const { +const boost::shared_ptr<const CSGObject> StructuredDetector::shape() const { // --- Create a hexahedral shape for your pixels ---- auto w = this->xPixels() + 1; auto xlb = m_xvalues[0]; diff --git a/Framework/Geometry/src/Objects/Object.cpp b/Framework/Geometry/src/Objects/Object.cpp index 2c4be44710d83b3e27bf0b8830d6122ecc9c5187..472153965c28296917b45e88b7c4bb5bc510adda 100644 --- a/Framework/Geometry/src/Objects/Object.cpp +++ b/Framework/Geometry/src/Objects/Object.cpp @@ -46,13 +46,13 @@ using Kernel::Quat; /** * Default constuctor */ -Object::Object() : Object("") {} +CSGObject::CSGObject() : CSGObject("") {} /** * Construct with original shape xml knowledge. * @param shapeXML : string with original shape xml. */ -Object::Object(const std::string &shapeXML) +CSGObject::CSGObject(const std::string &shapeXML) : TopRule(nullptr), m_boundingBox(), AABBxMax(0), AABByMax(0), AABBzMax(0), AABBxMin(0), AABByMin(0), AABBzMin(0), boolBounded(false), ObjNum(0), handle(), bGeometryCaching(false), @@ -67,14 +67,14 @@ Object::Object(const std::string &shapeXML) * Copy constructor * @param A :: The object to initialise this copy from */ -Object::Object(const Object &A) : Object() { *this = A; } +CSGObject::CSGObject(const CSGObject &A) : CSGObject() { *this = A; } /** * Assignment operator * @param A :: Object to copy * @return *this */ -Object &Object::operator=(const Object &A) { +CSGObject &CSGObject::operator=(const CSGObject &A) { if (this != &A) { TopRule = (A.TopRule) ? A.TopRule->clone() : nullptr; AABBxMax = A.AABBxMax; @@ -100,19 +100,19 @@ Object &Object::operator=(const Object &A) { } /// Destructor in .cpp so we can forward declare Rule class. -Object::~Object() = default; +CSGObject::~CSGObject() = default; /** * @param material The new Material that the object is composed from */ -void Object::setMaterial(const Kernel::Material &material) { +void CSGObject::setMaterial(const Kernel::Material &material) { m_material = Mantid::Kernel::make_unique<Material>(material); } /** * @return The Material that the object is composed from */ -const Kernel::Material Object::material() const { +const Kernel::Material CSGObject::material() const { if (m_material) return *m_material; else @@ -124,7 +124,7 @@ const Kernel::Material Object::material() const { * @returns True if the surface list is populated and there is a * defined TopRule, false otherwise. */ -bool Object::hasValidShape() const { +bool CSGObject::hasValidShape() const { // Assume invalid shape if object has no 'TopRule' or surfaces return (TopRule != nullptr && !SurList.empty()); } @@ -135,7 +135,7 @@ bool Object::hasValidShape() const { * @param Ln :: Input string must be : {rules} * @returns 1 on success and zero on failure */ -int Object::setObject(const int ON, const std::string &Ln) { +int CSGObject::setObject(const int ON, const std::string &Ln) { // Split line const boost::regex letters("[a-zA-Z]"); // Does the string now contain junk... if (Mantid::Kernel::Strings::StrLook(Ln, letters)) @@ -158,7 +158,7 @@ int Object::setObject(const int ON, const std::string &Ln) { * @return Cell String (from TopRule) * @todo Break infinite recusion */ -void Object::convertComplement(const std::map<int, Object> &MList) +void CSGObject::convertComplement(const std::map<int, CSGObject> &MList) { this->procString(this->cellStr(MList)); @@ -170,7 +170,7 @@ void Object::convertComplement(const std::map<int, Object> &MList) * @return Cell String (from TopRule) * @todo Break infinite recusion */ -std::string Object::cellStr(const std::map<int, Object> &MList) const { +std::string CSGObject::cellStr(const std::map<int, CSGObject> &MList) const { std::string TopStr = this->topRule()->display(); std::string::size_type pos = TopStr.find('#'); std::ostringstream cx; @@ -208,7 +208,7 @@ std::string Object::cellStr(const std::map<int, Object> &MList) const { * @retval 0 on no work to do * @retval 1 :: A (maybe there are many) #(...) object found */ -int Object::complementaryObject(const int Cnum, std::string &Ln) { +int CSGObject::complementaryObject(const int Cnum, std::string &Ln) { std::string::size_type posA = Ln.find("#("); // No work to do ? if (posA == std::string::npos) @@ -252,7 +252,7 @@ int Object::complementaryObject(const int Cnum, std::string &Ln) { * @retval 1 :: true * @retval 0 :: false */ -int Object::hasComplement() const { +int CSGObject::hasComplement() const { if (TopRule) return TopRule->isComplementary(); @@ -266,7 +266,7 @@ int Object::hasComplement() const { * @retval 1000+ keyNumber :: Error with keyNumber * @retval 0 :: successfully populated all the whole Object. */ -int Object::populate(const std::map<int, boost::shared_ptr<Surface>> &Smap) { +int CSGObject::populate(const std::map<int, boost::shared_ptr<Surface>> &Smap) { std::deque<Rule *> Rst; Rst.push_back(TopRule.get()); while (!Rst.empty()) { @@ -311,7 +311,7 @@ int Object::populate(const std::map<int, boost::shared_ptr<Surface>> &Smap) { * @retval 0 :: No rule to find * @retval 1 :: A rule has been combined */ -int Object::procPair(std::string &Ln, +int CSGObject::procPair(std::string &Ln, std::map<int, std::unique_ptr<Rule>> &Rlist, int &compUnit) const @@ -378,7 +378,7 @@ int Object::procPair(std::string &Ln, * @param RItem :: to encapsulate * @returns the complementary group */ -std::unique_ptr<CompGrp> Object::procComp(std::unique_ptr<Rule> RItem) const { +std::unique_ptr<CompGrp> CSGObject::procComp(std::unique_ptr<Rule> RItem) const { if (!RItem) return Mantid::Kernel::make_unique<CompGrp>(); @@ -412,7 +412,7 @@ std::unique_ptr<CompGrp> Object::procComp(std::unique_ptr<Rule> RItem) const { * @param Pt :: Point to check * @returns 1 if the point is on the surface */ -bool Object::isOnSide(const Kernel::V3D &Pt) const { +bool CSGObject::isOnSide(const Kernel::V3D &Pt) const { std::list<Kernel::V3D> Snorms; // Normals from the constact surface. std::vector<const Surface *>::const_iterator vc; @@ -448,7 +448,7 @@ bool Object::isOnSide(const Kernel::V3D &Pt) const { * @retval -1 :: Point included (e.g at convex intersection) * @retval 0 :: success */ -int Object::checkSurfaceValid(const Kernel::V3D &C, +int CSGObject::checkSurfaceValid(const Kernel::V3D &C, const Kernel::V3D &Nm) const { int status(0); Kernel::V3D tmp = C + Nm * (Kernel::Tolerance * 5.0); @@ -463,7 +463,7 @@ int Object::checkSurfaceValid(const Kernel::V3D &C, * @param Pt :: Point to be tested * @returns 1 if true and 0 if false */ -bool Object::isValid(const Kernel::V3D &Pt) const { +bool CSGObject::isValid(const Kernel::V3D &Pt) const { if (!TopRule) return false; return TopRule->isValid(Pt); @@ -474,7 +474,7 @@ bool Object::isValid(const Kernel::V3D &Pt) const { * @param SMap :: map of SurfaceNumber : status * @returns 1 if true and 0 if false */ -bool Object::isValid(const std::map<int, int> &SMap) const { +bool CSGObject::isValid(const std::map<int, int> &SMap) const { if (!TopRule) return false; return TopRule->isValid(SMap); @@ -486,7 +486,7 @@ bool Object::isValid(const std::map<int, int> &SMap) const { * @param outFlag :: Sends output to standard error if true * @return 1 (should be number of surfaces) */ -int Object::createSurfaceList(const int outFlag) { +int CSGObject::createSurfaceList(const int outFlag) { SurList.clear(); std::stack<const Rule *> TreeLine; TreeLine.push(TopRule.get()); @@ -528,7 +528,7 @@ int Object::createSurfaceList(const int outFlag) { * Returns all of the numbers of surfaces * @return Surface numbers */ -std::vector<int> Object::getSurfaceIndex() const { +std::vector<int> CSGObject::getSurfaceIndex() const { std::vector<int> out; transform(SurList.begin(), SurList.end(), std::insert_iterator<std::vector<int>>(out, out.begin()), @@ -543,7 +543,7 @@ std::vector<int> Object::getSurfaceIndex() const { * @param SurfN :: Number for the surface * @return number of surfaces removes */ -int Object::removeSurface(const int SurfN) { +int CSGObject::removeSurface(const int SurfN) { if (!TopRule) return -1; const int cnt = Rule::removeItem(TopRule, SurfN); @@ -559,7 +559,7 @@ int Object::removeSurface(const int SurfN) { * @param SPtr :: Surface pointer for surface NsurfN * @return number of surfaces substituted */ -int Object::substituteSurf(const int SurfN, const int NsurfN, +int CSGObject::substituteSurf(const int SurfN, const int NsurfN, const boost::shared_ptr<Surface> &SPtr) { if (!TopRule) return 0; @@ -572,7 +572,7 @@ int Object::substituteSurf(const int SurfN, const int NsurfN, /** * Prints almost everything */ -void Object::print() const { +void CSGObject::print() const { std::deque<Rule *> Rst; std::vector<int> Cells; int Rcount(0); @@ -611,7 +611,7 @@ void Object::print() const { /** * Takes the complement of a group */ -void Object::makeComplement() { +void CSGObject::makeComplement() { std::unique_ptr<Rule> NCG = procComp(std::move(TopRule)); TopRule = std::move(NCG); } @@ -619,7 +619,7 @@ void Object::makeComplement() { /** * Displays the rule tree */ -void Object::printTree() const { +void CSGObject::printTree() const { std::cout << "Name == " << ObjNum << '\n'; std::cout << TopRule->display() << '\n'; } @@ -629,7 +629,7 @@ void Object::printTree() const { * This includes only rules. * @return Object Line */ -std::string Object::cellCompStr() const { +std::string CSGObject::cellCompStr() const { std::ostringstream cx; if (TopRule) cx << TopRule->display(); @@ -641,7 +641,7 @@ std::string Object::cellCompStr() const { * This includes the Name but not post-fix operators * @return Object Line */ -std::string Object::str() const { +std::string CSGObject::str() const { std::ostringstream cx; if (TopRule) { cx << ObjNum << " "; @@ -655,7 +655,7 @@ std::string Object::str() const { * in standard MCNPX output format. * @param OX :: Output stream (required for multiple std::endl) */ -void Object::write(std::ostream &OX) const { +void CSGObject::write(std::ostream &OX) const { std::ostringstream cx; cx.precision(10); cx << str(); @@ -668,7 +668,7 @@ void Object::write(std::ostream &OX) const { * @param Line :: String value * @returns 1 on success */ -int Object::procString(const std::string &Line) { +int CSGObject::procString(const std::string &Line) { TopRule = nullptr; std::map<int, std::unique_ptr<Rule>> RuleList; // List for the rules int Ridx = 0; // Current index (not necessary size of RuleList @@ -752,7 +752,7 @@ int Object::procString(const std::string &Line) { * @param UT :: Initial track * @return Number of segments added */ -int Object::interceptSurface(Geometry::Track &UT) const { +int CSGObject::interceptSurface(Geometry::Track &UT) const { int cnt = UT.count(); // Number of intersections original track // Loop over all the surfaces. LineIntersectVisit LI(UT.startPoint(), UT.direction()); @@ -786,7 +786,7 @@ int Object::interceptSurface(Geometry::Track &UT) const { * @retval 1 :: Entry point * @retval -1 :: Exit Point */ -int Object::calcValidType(const Kernel::V3D &Pt, +int CSGObject::calcValidType(const Kernel::V3D &Pt, const Kernel::V3D &uVec) const { const Kernel::V3D shift(uVec * Kernel::Tolerance * 25.0); const Kernel::V3D testA(Pt - shift); @@ -808,7 +808,7 @@ int Object::calcValidType(const Kernel::V3D &Pt, * @return :: estimate of solid angle of object. Accuracy depends on object * shape. */ -double Object::solidAngle(const Kernel::V3D &observer) const { +double CSGObject::solidAngle(const Kernel::V3D &observer) const { if (this->NumberOfTriangles() > 30000) return rayTraceSolidAngle(observer); return triangleSolidAngle(observer); @@ -821,7 +821,7 @@ double Object::solidAngle(const Kernel::V3D &observer) const { * @return :: estimate of solid angle of object. Accuracy depends on * triangulation quality. */ -double Object::solidAngle(const Kernel::V3D &observer, +double CSGObject::solidAngle(const Kernel::V3D &observer, const Kernel::V3D &scaleFactor) const { @@ -833,7 +833,7 @@ double Object::solidAngle(const Kernel::V3D &observer, * @param observer :: position of the observer (V3D) * @return Solid angle in steradians (+/- 1% if accurate bounding box available) */ -double Object::rayTraceSolidAngle(const Kernel::V3D &observer) const { +double CSGObject::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 // using a light weight version of the interceptSurface method - this does @@ -960,7 +960,7 @@ double Object::rayTraceSolidAngle(const Kernel::V3D &observer) const { * @param observer :: point from which solid angle is required * @return :: solid angle of triangle in Steradians. */ -double Object::getTriangleSolidAngle(const V3D &a, const V3D &b, const V3D &c, +double CSGObject::getTriangleSolidAngle(const V3D &a, const V3D &b, const V3D &c, const V3D &observer) const { const V3D ao = a - observer; const V3D bo = b - observer; @@ -987,7 +987,7 @@ double Object::getTriangleSolidAngle(const V3D &a, const V3D &b, const V3D &c, * @param observer :: Point from which solid angle is required * @return the solid angle */ -double Object::triangleSolidAngle(const V3D &observer) const { +double CSGObject::triangleSolidAngle(const V3D &observer) const { // // Because the triangles from OC are not consistently ordered wrt their // outward normal @@ -1068,7 +1068,7 @@ double Object::triangleSolidAngle(const V3D &observer) const { *(not observer) * @return the solid angle */ -double Object::triangleSolidAngle(const V3D &observer, +double CSGObject::triangleSolidAngle(const V3D &observer, const V3D &scaleFactor) const { // // Because the triangles from OC are not consistently ordered wrt their @@ -1150,7 +1150,7 @@ double Object::triangleSolidAngle(const V3D &observer, * @param radius :: sphere radius * @return :: solid angle of sphere */ -double Object::SphereSolidAngle(const V3D observer, +double CSGObject::SphereSolidAngle(const V3D observer, const std::vector<Kernel::V3D> vectors, const double radius) const { const double distance = (observer - vectors[0]).norm(); @@ -1173,7 +1173,7 @@ double Object::SphereSolidAngle(const V3D observer, * the cuboid * @return :: solid angle of cuboid - good accuracy */ -double Object::CuboidSolidAngle(const V3D observer, +double CSGObject::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 @@ -1252,7 +1252,7 @@ double Object::CuboidSolidAngle(const V3D observer, * @param height :: The height * @returns The solid angle value */ -double Object::CylinderSolidAngle(const V3D &observer, +double CSGObject::CylinderSolidAngle(const V3D &observer, const Mantid::Kernel::V3D ¢re, const Mantid::Kernel::V3D &axis, const double radius, @@ -1333,7 +1333,7 @@ double Object::CylinderSolidAngle(const V3D &observer, * @param height :: The height * @returns The solid angle value */ -double Object::ConeSolidAngle(const V3D &observer, +double CSGObject::ConeSolidAngle(const V3D &observer, const Mantid::Kernel::V3D ¢re, const Mantid::Kernel::V3D &axis, const double radius, const double height) const { @@ -1486,7 +1486,7 @@ double Object::ConeSolidAngle(const V3D &observer, * complex cases, we fall back to Monte Carlo. * @return The volume. */ -double Object::volume() const { +double CSGObject::volume() const { int type; double height; double radius; @@ -1541,7 +1541,7 @@ double Object::volume() const { * standard error as the convergence criteria. * @returns The simulated volume of this object. */ -double Object::monteCarloVolume() const { +double CSGObject::monteCarloVolume() const { using namespace boost::accumulators; const int singleShotIterations = 10000; accumulator_set<double, features<tag::mean, tag::error_of<tag::mean>>> @@ -1578,7 +1578,7 @@ double Object::monteCarloVolume() const { * @param seed A number to seed the random number generator. * @returns The simulated volume of this object. */ -double Object::singleShotMonteCarloVolume(const int shotSize, +double CSGObject::singleShotMonteCarloVolume(const int shotSize, const size_t seed) const { const auto &boundingBox = getBoundingBox(); if (boundingBox.isNull()) { @@ -1632,7 +1632,7 @@ double Object::singleShotMonteCarloVolume(const int shotSize, * Returns an axis-aligned bounding box that will fit the shape * @returns A reference to a bounding box for this shape. */ -const BoundingBox &Object::getBoundingBox() const { +const BoundingBox &CSGObject::getBoundingBox() const { // This member function is const given that from a user's perspective it is // perfectly reasonable to call it on a const object. We need to call a // non-const function in places to update the cache, which is where the @@ -1641,7 +1641,7 @@ const BoundingBox &Object::getBoundingBox() const { // If we don't know the extent of the object, the bounding box doesn't mean // anything if (!TopRule) { - const_cast<Object *>(this)->setNullBoundingBox(); + const_cast<CSGObject *>(this)->setNullBoundingBox(); return m_boundingBox; } @@ -1650,17 +1650,17 @@ const BoundingBox &Object::getBoundingBox() const { return m_boundingBox; // Try to calculate using Rule method first - const_cast<Object *>(this)->calcBoundingBoxByRule(); + const_cast<CSGObject *>(this)->calcBoundingBoxByRule(); if (m_boundingBox.isNonNull()) return m_boundingBox; // Rule method failed; Try geometric method - const_cast<Object *>(this)->calcBoundingBoxByGeometry(); + const_cast<CSGObject *>(this)->calcBoundingBoxByGeometry(); if (m_boundingBox.isNonNull()) return m_boundingBox; // Geometric method failed; try to calculate by vertices - const_cast<Object *>(this)->calcBoundingBoxByVertices(); + const_cast<CSGObject *>(this)->calcBoundingBoxByVertices(); if (m_boundingBox.isNonNull()) return m_boundingBox; @@ -1668,7 +1668,7 @@ const BoundingBox &Object::getBoundingBox() const { // Set to a large box so that a) we don't keep trying to calculate a box // every time this is called and b) to serve as a visual indicator that // something went wrong. - const_cast<Object *>(this) + const_cast<CSGObject *>(this) ->defineBoundingBox(100, 100, 100, -100, -100, -100); return m_boundingBox; } @@ -1680,7 +1680,7 @@ const BoundingBox &Object::getBoundingBox() const { * that consist entirely of axis-aligned surfaces and a few special cases (such * as Spheres). */ -void Object::calcBoundingBoxByRule() { +void CSGObject::calcBoundingBoxByRule() { // Must have a top rule for this to work if (!TopRule) return; @@ -1711,7 +1711,7 @@ void Object::calcBoundingBoxByRule() { * * @see GeometryHandler::canTriangulate() */ -void Object::calcBoundingBoxByVertices() { +void CSGObject::calcBoundingBoxByVertices() { // Grab vertex information auto vertCount = this->NumberOfPoints(); auto vertArray = this->getTriangleVertices(); @@ -1748,7 +1748,7 @@ void Object::calcBoundingBoxByVertices() { * Stores result in bounding box cache if successful. Will only work for basic * shapes that are handled by GluGeometryHandler. */ -void Object::calcBoundingBoxByGeometry() { +void CSGObject::calcBoundingBoxByGeometry() { // Must have a GeometryHandler for this to work if (!handle) return; @@ -1882,7 +1882,7 @@ void Object::calcBoundingBoxByGeometry() { * @param ymin :: Minimum value for the bounding box in y direction * @param zmin :: Minimum value for the bounding box in z direction */ -void Object::getBoundingBox(double &xmax, double &ymax, double &zmax, +void CSGObject::getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) const { if (!TopRule) { // If no rule defined then return zero boundbing box xmax = ymax = zmax = xmin = ymin = zmin = 0.0; @@ -1925,7 +1925,7 @@ void Object::getBoundingBox(double &xmax, double &ymax, double &zmax, * @param yMin :: Minimum value for the bounding box in y direction * @param zMin :: Minimum value for the bounding box in z direction */ -void Object::defineBoundingBox(const double &xMax, const double &yMax, +void CSGObject::defineBoundingBox(const double &xMax, const double &yMax, const double &zMax, const double &xMin, const double &yMin, const double &zMin) { BoundingBox::checkValid(xMax, yMax, zMax, xMin, yMin, zMin); @@ -1946,14 +1946,14 @@ void Object::defineBoundingBox(const double &xMax, const double &yMax, /** * Set the bounding box to a null box */ -void Object::setNullBoundingBox() { m_boundingBox = BoundingBox(); } +void CSGObject::setNullBoundingBox() { m_boundingBox = BoundingBox(); } /** Try to find a point that lies within (or on) the object @param[out] point :: on exit set to the point value, if found @return 1 if point found, 0 otherwise */ -int Object::getPointInObject(Kernel::V3D &point) const { +int CSGObject::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 @@ -1985,7 +1985,7 @@ int Object::getPointInObject(Kernel::V3D &point) const { * @param maxAttempts The maximum number of attempts at generating a point * @return The generated point */ -V3D Object::generatePointInObject(Kernel::PseudoRandomNumberGenerator &rng, +V3D CSGObject::generatePointInObject(Kernel::PseudoRandomNumberGenerator &rng, const size_t maxAttempts) const { const auto &bbox = getBoundingBox(); if (bbox.isNull()) { @@ -2005,7 +2005,7 @@ V3D Object::generatePointInObject(Kernel::PseudoRandomNumberGenerator &rng, * @param maxAttempts The maximum number of attempts at generating a point * @return The newly generated point */ -V3D Object::generatePointInObject(Kernel::PseudoRandomNumberGenerator &rng, +V3D CSGObject::generatePointInObject(Kernel::PseudoRandomNumberGenerator &rng, const BoundingBox &activeRegion, const size_t maxAttempts) const { size_t attempts(0); @@ -2029,7 +2029,7 @@ V3D Object::generatePointInObject(Kernel::PseudoRandomNumberGenerator &rng, * @param point :: on entry the seed point, on exit point in object, if found * @return 1 if point found, 0 otherwise */ -int Object::searchForObject(Kernel::V3D &point) const { +int CSGObject::searchForObject(Kernel::V3D &point) const { // // Method - check if point in object, if not search directions along // principle axes using interceptSurface @@ -2054,7 +2054,7 @@ int Object::searchForObject(Kernel::V3D &point) const { * @param[in] h is pointer to the geometry handler. don't delete this pointer in * the calling function. */ -void Object::setGeometryHandler(boost::shared_ptr<GeometryHandler> h) { +void CSGObject::setGeometryHandler(boost::shared_ptr<GeometryHandler> h) { if (h == nullptr) return; handle = h; @@ -2064,7 +2064,7 @@ void Object::setGeometryHandler(boost::shared_ptr<GeometryHandler> h) { * Draws the Object using geometry handler, If the handler is not set then this * function does nothing. */ -void Object::draw() const { +void CSGObject::draw() const { if (handle == nullptr) return; // Render the Object @@ -2076,7 +2076,7 @@ void Object::draw() const { * for object, * If the handler is not set then this function does nothing. */ -void Object::initDraw() const { +void CSGObject::initDraw() const { if (handle == nullptr) return; // Render the Object @@ -2085,7 +2085,7 @@ void Object::initDraw() const { /** * set vtkGeometryCache writer */ -void Object::setVtkGeometryCacheWriter( +void CSGObject::setVtkGeometryCacheWriter( boost::shared_ptr<vtkGeometryCacheWriter> writer) { vtkCacheWriter = writer; updateGeometryHandler(); @@ -2094,7 +2094,7 @@ void Object::setVtkGeometryCacheWriter( /** * set vtkGeometryCache reader */ -void Object::setVtkGeometryCacheReader( +void CSGObject::setVtkGeometryCacheReader( boost::shared_ptr<vtkGeometryCacheReader> reader) { vtkCacheReader = reader; updateGeometryHandler(); @@ -2103,7 +2103,7 @@ void Object::setVtkGeometryCacheReader( /** * Returns the geometry handler */ -boost::shared_ptr<GeometryHandler> Object::getGeometryHandler() { +boost::shared_ptr<GeometryHandler> CSGObject::getGeometryHandler() { // Check if the geometry handler is upto dated with the cache, if not then // cache it now. return handle; @@ -2112,7 +2112,7 @@ boost::shared_ptr<GeometryHandler> Object::getGeometryHandler() { /** * Updates the geometry handler if needed */ -void Object::updateGeometryHandler() { +void CSGObject::updateGeometryHandler() { if (bGeometryCaching) return; bGeometryCaching = true; @@ -2137,7 +2137,7 @@ void Object::updateGeometryHandler() { * get number of triangles * @return the number of triangles */ -int Object::NumberOfTriangles() const { +int CSGObject::NumberOfTriangles() const { if (handle == nullptr) return 0; return handle->NumberOfTriangles(); @@ -2146,7 +2146,7 @@ int Object::NumberOfTriangles() const { /** * get number of points */ -int Object::NumberOfPoints() const { +int CSGObject::NumberOfPoints() const { if (handle == nullptr) return 0; return handle->NumberOfPoints(); @@ -2155,7 +2155,7 @@ int Object::NumberOfPoints() const { /** * get vertices */ -double *Object::getTriangleVertices() const { +double *CSGObject::getTriangleVertices() const { if (handle == nullptr) return nullptr; return handle->getTriangleVertices(); @@ -2164,7 +2164,7 @@ double *Object::getTriangleVertices() const { /** * get faces */ -int *Object::getTriangleFaces() const { +int *CSGObject::getTriangleFaces() const { if (handle == nullptr) return nullptr; return handle->getTriangleFaces(); @@ -2173,7 +2173,7 @@ int *Object::getTriangleFaces() const { /** * get info on standard shapes */ -void Object::GetObjectGeom(int &type, std::vector<Kernel::V3D> &vectors, +void CSGObject::GetObjectGeom(int &type, std::vector<Kernel::V3D> &vectors, double &myradius, double &myheight) const { type = 0; if (handle == nullptr) @@ -2184,7 +2184,7 @@ void Object::GetObjectGeom(int &type, std::vector<Kernel::V3D> &vectors, /** Getter for the shape xml @return the shape xml. */ -std::string Object::getShapeXML() const { return this->m_shapeXML; } +std::string CSGObject::getShapeXML() const { return this->m_shapeXML; } } // NAMESPACE Geometry } // NAMESPACE Mantid diff --git a/Framework/Geometry/src/Objects/RuleItems.cpp b/Framework/Geometry/src/Objects/RuleItems.cpp index f4d232b628fb3f7b964bac96af338439e5bf805c..5f6b5e34cd5d74f9a07f4c1f1ce5ba56e612e2ea 100644 --- a/Framework/Geometry/src/Objects/RuleItems.cpp +++ b/Framework/Geometry/src/Objects/RuleItems.cpp @@ -983,7 +983,7 @@ void CompObj::setObjN(const int Ky) objN = Ky; } -void CompObj::setObj(Object *val) +void CompObj::setObj(CSGObject *val) /** Sets the object @param val :: Object value diff --git a/Framework/Geometry/src/Objects/ShapeFactory.cpp b/Framework/Geometry/src/Objects/ShapeFactory.cpp index f0506b5004569fe615afdaa1f0c61d0d15d7db0f..571acb1f18c1c2329be258891bdd7cecdbca169e 100644 --- a/Framework/Geometry/src/Objects/ShapeFactory.cpp +++ b/Framework/Geometry/src/Objects/ShapeFactory.cpp @@ -1385,7 +1385,7 @@ V3D ShapeFactory::parsePosition(Poco::XML::Element *pElem) { @returns the newly created hexahedral shape object */ -boost::shared_ptr<Object> +boost::shared_ptr<CSGObject> ShapeFactory::createHexahedralShape(double xlb, double xlf, double xrf, double xrb, double ylb, double ylf, double yrf, double yrb) { @@ -1404,7 +1404,7 @@ ShapeFactory::createHexahedralShape(double xlb, double xlf, double xrf, int l_id = 1; auto algebra = parseHexahedronFromStruct(hex, prim, l_id); - auto shape = boost::make_shared<Object>(); + auto shape = boost::make_shared<CSGObject>(); shape->setObject(21, algebra); shape->populate(prim); @@ -1423,7 +1423,7 @@ ShapeFactory::createHexahedralShape(double xlb, double xlf, double xrf, /// create a special geometry handler for the known finite primitives void ShapeFactory::createGeometryHandler(Poco::XML::Element *pElem, - boost::shared_ptr<Object> Obj) { + boost::shared_ptr<CSGObject> Obj) { auto geomHandler = boost::make_shared<GluGeometryHandler>(Obj); Obj->setGeometryHandler(geomHandler); @@ -1481,12 +1481,12 @@ void ShapeFactory::createGeometryHandler(Poco::XML::Element *pElem, ///@cond // Template instantations -template MANTID_GEOMETRY_DLL boost::shared_ptr<Object> +template MANTID_GEOMETRY_DLL boost::shared_ptr<CSGObject> ShapeFactory::createShape(std::string shapeXML, bool addTypeTag); template MANTID_GEOMETRY_DLL boost::shared_ptr<Container> ShapeFactory::createShape(std::string shapeXML, bool addTypeTag); -template MANTID_GEOMETRY_DLL boost::shared_ptr<Object> +template MANTID_GEOMETRY_DLL boost::shared_ptr<CSGObject> ShapeFactory::createShape(Poco::XML::Element *pElem); template MANTID_GEOMETRY_DLL boost::shared_ptr<Container> ShapeFactory::createShape(Poco::XML::Element *pElem); diff --git a/Framework/Geometry/src/Objects/Track.cpp b/Framework/Geometry/src/Objects/Track.cpp index 8467f9a05f419080083ad7738a7c807ed52515e8..17997ba9050057af3116f1a6db09ec7f66d574cd 100644 --- a/Framework/Geometry/src/Objects/Track.cpp +++ b/Framework/Geometry/src/Objects/Track.cpp @@ -109,7 +109,7 @@ void Track::removeCojoins() { * @param compID :: ID of the component that this link is about (Default=NULL) */ void Track::addPoint(const int directionFlag, const V3D &endPoint, - const Object &obj, const ComponentID compID) { + const CSGObject &obj, const ComponentID compID) { IntersectionPoint newPoint(directionFlag, endPoint, endPoint.distance(m_startPoint), obj, compID); auto lowestPtr = @@ -128,7 +128,7 @@ void Track::addPoint(const int directionFlag, const V3D &endPoint, * @retval Index of link within the track */ int Track::addLink(const V3D &firstPoint, const V3D &secondPoint, - const double distanceAlongTrack, const Object &obj, + const double distanceAlongTrack, const CSGObject &obj, const ComponentID compID) { // Process First Point Link newLink(firstPoint, secondPoint, distanceAlongTrack, obj, compID); diff --git a/Framework/Geometry/src/Rendering/BitmapGeometryHandler.cpp b/Framework/Geometry/src/Rendering/BitmapGeometryHandler.cpp index 76fffbd4628be7a32fa2f58fc85de55d13a163c0..abf8021c0a6c17fe48166435b595d23afeb12e0e 100644 --- a/Framework/Geometry/src/Rendering/BitmapGeometryHandler.cpp +++ b/Framework/Geometry/src/Rendering/BitmapGeometryHandler.cpp @@ -25,7 +25,7 @@ BitmapGeometryHandler::BitmapGeometryHandler(RectangularDetector *comp) } BitmapGeometryHandler::BitmapGeometryHandler() - : GeometryHandler(static_cast<Object *>(nullptr)), m_rectDet(nullptr) {} + : GeometryHandler(static_cast<CSGObject *>(nullptr)), m_rectDet(nullptr) {} ///< Create an instance of concrete geometry handler for ObjComponent BitmapGeometryHandler * @@ -36,13 +36,13 @@ BitmapGeometryHandler::createInstance(IObjComponent *comp) { ///< Create an instance of concrete geometry handler for Object BitmapGeometryHandler * -BitmapGeometryHandler::createInstance(boost::shared_ptr<Object> obj) { +BitmapGeometryHandler::createInstance(boost::shared_ptr<CSGObject> obj) { (void)obj; return new BitmapGeometryHandler(); } ///< Create an instance of concrete geometry handler for Object -GeometryHandler *BitmapGeometryHandler::createInstance(Object *obj) { +GeometryHandler *BitmapGeometryHandler::createInstance(CSGObject *obj) { (void)obj; return new BitmapGeometryHandler(); } diff --git a/Framework/Geometry/src/Rendering/CacheGeometryGenerator.cpp b/Framework/Geometry/src/Rendering/CacheGeometryGenerator.cpp index ee1f51c1454b1d80553d4860ce918c89ff162c23..a4c0704e4df36fae6e6630b4a1f72ad544bd54d2 100644 --- a/Framework/Geometry/src/Rendering/CacheGeometryGenerator.cpp +++ b/Framework/Geometry/src/Rendering/CacheGeometryGenerator.cpp @@ -16,7 +16,7 @@ namespace Geometry { * Constructor * @param obj :: input object */ -CacheGeometryGenerator::CacheGeometryGenerator(Object *obj) : Obj(obj) { +CacheGeometryGenerator::CacheGeometryGenerator(CSGObject *obj) : Obj(obj) { mNoOfVertices = 0; mNoOfTriangles = 0; mFaces = nullptr; diff --git a/Framework/Geometry/src/Rendering/CacheGeometryHandler.cpp b/Framework/Geometry/src/Rendering/CacheGeometryHandler.cpp index 54a9d8d3926f7d608a1d7bfd01388dc5243ca592..44464814283b88c29bf0a85b36f46a50b1dc5352 100644 --- a/Framework/Geometry/src/Rendering/CacheGeometryHandler.cpp +++ b/Framework/Geometry/src/Rendering/CacheGeometryHandler.cpp @@ -17,13 +17,13 @@ CacheGeometryHandler::CacheGeometryHandler(IObjComponent *comp) Renderer = new CacheGeometryRenderer(); } -CacheGeometryHandler::CacheGeometryHandler(boost::shared_ptr<Object> obj) +CacheGeometryHandler::CacheGeometryHandler(boost::shared_ptr<CSGObject> obj) : GeometryHandler(obj) { Triangulator = new CacheGeometryGenerator(obj.get()); Renderer = new CacheGeometryRenderer(); } -CacheGeometryHandler::CacheGeometryHandler(Object *obj) : GeometryHandler(obj) { +CacheGeometryHandler::CacheGeometryHandler(CSGObject *obj) : GeometryHandler(obj) { Triangulator = new CacheGeometryGenerator(obj); Renderer = new CacheGeometryRenderer(); } @@ -50,11 +50,11 @@ GeometryHandler *CacheGeometryHandler::createInstance(IObjComponent *comp) { } GeometryHandler * -CacheGeometryHandler::createInstance(boost::shared_ptr<Object> obj) { +CacheGeometryHandler::createInstance(boost::shared_ptr<CSGObject> obj) { return new CacheGeometryHandler(obj); } -GeometryHandler *CacheGeometryHandler::createInstance(Object *obj) { +GeometryHandler *CacheGeometryHandler::createInstance(CSGObject *obj) { return new CacheGeometryHandler(obj); } diff --git a/Framework/Geometry/src/Rendering/GeometryHandler.cpp b/Framework/Geometry/src/Rendering/GeometryHandler.cpp index 75b3d9215f999a2f2f0af8e3069ddbb525d80735..1d8612460364b4ff077d10875dc98807faa30279 100644 --- a/Framework/Geometry/src/Rendering/GeometryHandler.cpp +++ b/Framework/Geometry/src/Rendering/GeometryHandler.cpp @@ -17,7 +17,7 @@ GeometryHandler::GeometryHandler(IObjComponent *comp) : Obj() { * @param[in] obj * This geometry handler will be Object's geometry handler */ -GeometryHandler::GeometryHandler(boost::shared_ptr<Object> obj) +GeometryHandler::GeometryHandler(boost::shared_ptr<CSGObject> obj) : Obj(obj.get()) { ObjComp = nullptr; boolTriangulated = false; @@ -28,7 +28,7 @@ GeometryHandler::GeometryHandler(boost::shared_ptr<Object> obj) * @param[in] obj * This geometry handler will be Object's geometry handler */ -GeometryHandler::GeometryHandler(Object *obj) : Obj(obj) { +GeometryHandler::GeometryHandler(CSGObject *obj) : Obj(obj) { ObjComp = nullptr; boolTriangulated = false; boolIsInitialized = false; diff --git a/Framework/Geometry/src/Rendering/GluGeometryHandler.cpp b/Framework/Geometry/src/Rendering/GluGeometryHandler.cpp index 3ecd3e61fc9033bc6315ed5630e7dde6852ece11..009a2046fa2a1ca647c54625ee22c991e790968a 100644 --- a/Framework/Geometry/src/Rendering/GluGeometryHandler.cpp +++ b/Framework/Geometry/src/Rendering/GluGeometryHandler.cpp @@ -16,12 +16,12 @@ GluGeometryHandler::GluGeometryHandler(IObjComponent *comp) Renderer(Kernel::make_unique<GluGeometryRenderer>()), radius(0.0), height(0.0), type(GeometryType::NOSHAPE) {} -GluGeometryHandler::GluGeometryHandler(boost::shared_ptr<Object> obj) +GluGeometryHandler::GluGeometryHandler(boost::shared_ptr<CSGObject> obj) : GeometryHandler(std::move(obj)), Renderer(Kernel::make_unique<GluGeometryRenderer>()), radius(0.0), height(0.0), type(GeometryType::NOSHAPE) {} -GluGeometryHandler::GluGeometryHandler(Object *obj) +GluGeometryHandler::GluGeometryHandler(CSGObject *obj) : GeometryHandler(obj), Renderer(Kernel::make_unique<GluGeometryRenderer>()), radius(0.0), height(0.0), type(GeometryType::NOSHAPE) {} @@ -43,11 +43,11 @@ GeometryHandler *GluGeometryHandler::createInstance(IObjComponent *comp) { } GeometryHandler * -GluGeometryHandler::createInstance(boost::shared_ptr<Object> obj) { +GluGeometryHandler::createInstance(boost::shared_ptr<CSGObject> obj) { return new GluGeometryHandler(obj); } -GeometryHandler *GluGeometryHandler::createInstance(Object *obj) { +GeometryHandler *GluGeometryHandler::createInstance(CSGObject *obj) { return new GluGeometryHandler(obj); } diff --git a/Framework/Geometry/src/Rendering/OCGeometryGenerator.cpp b/Framework/Geometry/src/Rendering/OCGeometryGenerator.cpp index 4f82813e63c5d321685a0f639d44ce5ea635ce61..16c061088a2fab0c9c2b68e9b06475a2f4f87433 100644 --- a/Framework/Geometry/src/Rendering/OCGeometryGenerator.cpp +++ b/Framework/Geometry/src/Rendering/OCGeometryGenerator.cpp @@ -77,7 +77,7 @@ Kernel::Logger g_log("OCGeometryGenerator"); * Constructor * @param obj :: input object */ -OCGeometryGenerator::OCGeometryGenerator(const Object *obj) : Obj(obj) { +OCGeometryGenerator::OCGeometryGenerator(const CSGObject *obj) : Obj(obj) { ObjSurface = nullptr; } diff --git a/Framework/Geometry/src/Rendering/OCGeometryHandler.cpp b/Framework/Geometry/src/Rendering/OCGeometryHandler.cpp index c498c40db5995dc855315287b4e5523efff296ae..5355214b3ca89acaf8b0f958790554dce40d379a 100644 --- a/Framework/Geometry/src/Rendering/OCGeometryHandler.cpp +++ b/Framework/Geometry/src/Rendering/OCGeometryHandler.cpp @@ -15,13 +15,13 @@ OCGeometryHandler::OCGeometryHandler(IObjComponent *comp) Renderer = new OCGeometryRenderer(); } -OCGeometryHandler::OCGeometryHandler(boost::shared_ptr<Object> obj) +OCGeometryHandler::OCGeometryHandler(boost::shared_ptr<CSGObject> obj) : GeometryHandler(obj) { Triangulator = new OCGeometryGenerator(obj.get()); Renderer = new OCGeometryRenderer(); } -OCGeometryHandler::OCGeometryHandler(Object *obj) : GeometryHandler(obj) { +OCGeometryHandler::OCGeometryHandler(CSGObject *obj) : GeometryHandler(obj) { Triangulator = new OCGeometryGenerator(obj); Renderer = new OCGeometryRenderer(); } @@ -46,11 +46,11 @@ GeometryHandler *OCGeometryHandler::createInstance(IObjComponent *comp) { } GeometryHandler * -OCGeometryHandler::createInstance(boost::shared_ptr<Object> obj) { +OCGeometryHandler::createInstance(boost::shared_ptr<CSGObject> obj) { return new OCGeometryHandler(obj); } -GeometryHandler *OCGeometryHandler::createInstance(Object *obj) { +GeometryHandler *OCGeometryHandler::createInstance(CSGObject *obj) { return new OCGeometryHandler(obj); } diff --git a/Framework/Geometry/src/Rendering/StructuredGeometryHandler.cpp b/Framework/Geometry/src/Rendering/StructuredGeometryHandler.cpp index 7c586fda638cb69c7a591b352e143c4f2f8b22a6..cb756fdfad08f6111bc8625c955574bc15fbdf51 100644 --- a/Framework/Geometry/src/Rendering/StructuredGeometryHandler.cpp +++ b/Framework/Geometry/src/Rendering/StructuredGeometryHandler.cpp @@ -25,7 +25,7 @@ StructuredGeometryHandler::StructuredGeometryHandler(StructuredDetector *comp) } StructuredGeometryHandler::StructuredGeometryHandler() - : GeometryHandler(static_cast<Object *>(nullptr)), m_Det(nullptr) {} + : GeometryHandler(static_cast<CSGObject *>(nullptr)), m_Det(nullptr) {} ///< Create an instance of concrete geometry handler for ObjComponent StructuredGeometryHandler * @@ -35,12 +35,12 @@ StructuredGeometryHandler::createInstance(IObjComponent *) { ///< Create an instance of concrete geometry handler for Object StructuredGeometryHandler * - StructuredGeometryHandler::createInstance(boost::shared_ptr<Object>) { + StructuredGeometryHandler::createInstance(boost::shared_ptr<CSGObject>) { return new StructuredGeometryHandler(); } ///< Create an instance of concrete geometry handler for Object -GeometryHandler *StructuredGeometryHandler::createInstance(Object *) { +GeometryHandler *StructuredGeometryHandler::createInstance(CSGObject *) { return new StructuredGeometryHandler(); } diff --git a/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp b/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp index 6f9938bcbd4bc3da0fb272dffd9d7699e1eeb64c..9bec9f29370e7c6ace18ecf1604f89c3c850e13c 100644 --- a/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp +++ b/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp @@ -57,7 +57,7 @@ void vtkGeometryCacheReader::Init() { /** * Set the geometry for the object */ -void vtkGeometryCacheReader::readCacheForObject(Object *obj) { +void vtkGeometryCacheReader::readCacheForObject(CSGObject *obj) { // Get the element corresponding to the name of the object std::stringstream objName; objName << obj->getName(); diff --git a/Framework/Geometry/src/Rendering/vtkGeometryCacheWriter.cpp b/Framework/Geometry/src/Rendering/vtkGeometryCacheWriter.cpp index 2c89d5dae32e88031a3b450572c324e57f08126f..a67c52e508aa651be2c1d7adc94297c467778387 100644 --- a/Framework/Geometry/src/Rendering/vtkGeometryCacheWriter.cpp +++ b/Framework/Geometry/src/Rendering/vtkGeometryCacheWriter.cpp @@ -76,7 +76,7 @@ void vtkGeometryCacheWriter::createVTKFileHeader() { * Adds the geometry of the Object to the document * @param obj :: The object to add */ -void vtkGeometryCacheWriter::addObject(Object *obj) { +void vtkGeometryCacheWriter::addObject(CSGObject *obj) { // First check whether Object can be written to the file boost::shared_ptr<GeometryHandler> handle = obj->getGeometryHandler(); if (!(handle->canTriangulate())) diff --git a/Framework/Geometry/test/CompAssemblyTest.h b/Framework/Geometry/test/CompAssemblyTest.h index 630ba06d8078017e1d6c62dd769cd11c8e660ff9..fd5fcd53f4a32719e3692ca973c159125cafcc64 100644 --- a/Framework/Geometry/test/CompAssemblyTest.h +++ b/Framework/Geometry/test/CompAssemblyTest.h @@ -503,7 +503,7 @@ public: CompAssembly *bank3 = new CompAssembly("bank 111", detectors); // add some rectangular detectors - boost::shared_ptr<Object> cuboidShape = + boost::shared_ptr<CSGObject> cuboidShape = ComponentCreationHelper::createCuboid(0.5); for (size_t i = 0; i < 15; i++) { diff --git a/Framework/Geometry/test/ComponentInfoTest.h b/Framework/Geometry/test/ComponentInfoTest.h index a0a6c20633c6d29ff40b7787c00efab47014749b..e03b8f2f3c114b6bf91b1e989a2aadf5f1318f22 100644 --- a/Framework/Geometry/test/ComponentInfoTest.h +++ b/Framework/Geometry/test/ComponentInfoTest.h @@ -44,7 +44,7 @@ makeComponentIDMap(const boost::shared_ptr< return idMap; } -boost::shared_ptr<Object> createCappedCylinder() { +boost::shared_ptr<CSGObject> createCappedCylinder() { std::string C31 = "cx 0.5"; // cylinder x-axis radius 0.5 std::string C32 = "px 1.2"; std::string C33 = "px -3.2"; @@ -66,7 +66,7 @@ boost::shared_ptr<Object> createCappedCylinder() { // using surface ids: 31 (cylinder) 32 (plane (top) ) and 33 (plane (base)) std::string ObjCapCylinder = "-31 -32 33"; - auto retVal = boost::make_shared<Object>(); + auto retVal = boost::make_shared<CSGObject>(); retVal->setObject(21, ObjCapCylinder); retVal->populate(CylSurMap); @@ -158,9 +158,9 @@ public: std::vector<Mantid::Geometry::ComponentID>{&comp1, &comp2}); auto shapes = boost::make_shared< - std::vector<boost::shared_ptr<const Geometry::Object>>>(); - shapes->push_back(boost::make_shared<const Geometry::Object>()); - shapes->push_back(boost::make_shared<const Geometry::Object>()); + std::vector<boost::shared_ptr<const Geometry::CSGObject>>>(); + shapes->push_back(boost::make_shared<const Geometry::CSGObject>()); + shapes->push_back(boost::make_shared<const Geometry::CSGObject>()); ComponentInfo info(std::move(internalInfo), componentIds, makeComponentIDMap(componentIds), shapes); @@ -177,7 +177,7 @@ public: std::vector<Mantid::Geometry::ComponentID>{&comp1}); auto shapes = boost::make_shared< - std::vector<boost::shared_ptr<const Geometry::Object>>>(); + std::vector<boost::shared_ptr<const Geometry::CSGObject>>>(); shapes->push_back(createCappedCylinder()); ComponentInfo a(std::move(internalInfo), componentIds, @@ -203,7 +203,7 @@ public: std::vector<Mantid::Geometry::ComponentID>{&comp1}); auto shapes = boost::make_shared< - std::vector<boost::shared_ptr<const Geometry::Object>>>(); + std::vector<boost::shared_ptr<const Geometry::CSGObject>>>(); shapes->push_back(createCappedCylinder()); ComponentInfo compInfo(std::move(internalInfo), componentIds, @@ -211,7 +211,7 @@ public: TS_ASSERT(compInfo.hasShape(0)); // Nullify the shape of the component - shapes->at(0) = boost::shared_ptr<const Geometry::Object>(nullptr); + shapes->at(0) = boost::shared_ptr<const Geometry::CSGObject>(nullptr); TS_ASSERT(!compInfo.hasShape(0)); TS_ASSERT_THROWS(compInfo.solidAngle(0, V3D{1, 1, 1}), Mantid::Kernel::Exception::NullPointerException &); @@ -231,7 +231,7 @@ public: std::vector<Mantid::Geometry::ComponentID>{&comp1}); auto shapes = boost::make_shared< - std::vector<boost::shared_ptr<const Geometry::Object>>>(); + std::vector<boost::shared_ptr<const Geometry::CSGObject>>>(); shapes->push_back(ComponentCreationHelper::createSphere(radius)); ComponentInfo info(std::move(internalInfo), componentIds, @@ -247,7 +247,7 @@ public: observer = V3D{0, 0, 0}; TS_ASSERT_DELTA(info.solidAngle(0, observer), 4 * M_PI, satol); // Nullify the shape and retest solid angle - shapes->at(0) = boost::shared_ptr<const Geometry::Object>(nullptr); + shapes->at(0) = boost::shared_ptr<const Geometry::CSGObject>(nullptr); TS_ASSERT_THROWS(info.solidAngle(0, observer), Mantid::Kernel::Exception::NullPointerException &); } @@ -266,7 +266,7 @@ public: std::vector<Mantid::Geometry::ComponentID>{&comp1}); auto shapes = boost::make_shared< - std::vector<boost::shared_ptr<const Geometry::Object>>>(); + std::vector<boost::shared_ptr<const Geometry::CSGObject>>>(); shapes->push_back(createCappedCylinder()); ComponentInfo info(std::move(internalInfo), componentIds, @@ -289,7 +289,7 @@ public: std::vector<Mantid::Geometry::ComponentID>{&comp1}); auto shapes = boost::make_shared< - std::vector<boost::shared_ptr<const Geometry::Object>>>(); + std::vector<boost::shared_ptr<const Geometry::CSGObject>>>(); shapes->push_back(ComponentCreationHelper::createSphere(radius)); ComponentInfo componentInfo(std::move(internalInfo), componentIds, @@ -304,7 +304,7 @@ public: (Kernel::V3D{position[0] + radius, position[1] + radius, position[2] + radius})).norm() < 1e-9); // Nullify shape and retest BoundingBox - shapes->at(0) = boost::shared_ptr<const Geometry::Object>(nullptr); + shapes->at(0) = boost::shared_ptr<const Geometry::CSGObject>(nullptr); boundingBox = componentInfo.boundingBox(0); TS_ASSERT(boundingBox.isNull()); } diff --git a/Framework/Geometry/test/ContainerTest.h b/Framework/Geometry/test/ContainerTest.h index 868d3edcd64929953ca9a3df8a107c9405718437..e60f5856eed838c495274f655503a217258c1048 100644 --- a/Framework/Geometry/test/ContainerTest.h +++ b/Framework/Geometry/test/ContainerTest.h @@ -100,7 +100,7 @@ private: "<height val =\"0.05\" />" "</cylinder></type>"); } - double getSphereRadius(const Mantid::Geometry::Object &shape) { + double getSphereRadius(const Mantid::Geometry::CSGObject &shape) { using Mantid::Geometry::SurfPoint; using Mantid::Geometry::Sphere; auto topRule = shape.topRule(); diff --git a/Framework/Geometry/test/ObjCompAssemblyTest.h b/Framework/Geometry/test/ObjCompAssemblyTest.h index 93ce0e0731b6baa547c349b1925254505424dc3e..4ee542cb69467a7ce193aaae101327cfc6f3b528 100644 --- a/Framework/Geometry/test/ObjCompAssemblyTest.h +++ b/Framework/Geometry/test/ObjCompAssemblyTest.h @@ -342,7 +342,7 @@ public: obj_str << "<radius val=\"0.1\" />"; obj_str << "<height val=\"0.2\" />"; obj_str << "</cylinder>"; - boost::shared_ptr<Object> s = + boost::shared_ptr<CSGObject> s = Mantid::Geometry::ShapeFactory().createShape(obj_str.str()); ObjCompAssembly bank("BankName"); @@ -357,7 +357,7 @@ public: bank.add(det2); bank.add(det3); - boost::shared_ptr<Object> shape = bank.createOutline(); + boost::shared_ptr<CSGObject> shape = bank.createOutline(); TS_ASSERT(shape); int otype; @@ -379,7 +379,7 @@ public: obj_str << "<radius val=\"0.1\" />"; obj_str << "<height val=\"0.2\" />"; obj_str << "</segmented-cylinder>"; - boost::shared_ptr<Object> s = + boost::shared_ptr<CSGObject> s = Mantid::Geometry::ShapeFactory().createShape(obj_str.str()); ObjCompAssembly bank("BankName"); @@ -394,7 +394,7 @@ public: bank.add(det2); bank.add(det3); - TS_ASSERT_THROWS(boost::shared_ptr<Object> shape = bank.createOutline(), + TS_ASSERT_THROWS(boost::shared_ptr<CSGObject> shape = bank.createOutline(), std::runtime_error); } }; diff --git a/Framework/Geometry/test/ObjComponentTest.h b/Framework/Geometry/test/ObjComponentTest.h index 37f19be9f51d9fa5f5c8ba04090adae7a0a4167b..5d158f94dcc4282dcab8c312cc9b9bbd43def6a8 100644 --- a/Framework/Geometry/test/ObjComponentTest.h +++ b/Framework/Geometry/test/ObjComponentTest.h @@ -40,12 +40,12 @@ public: void testShape() { // Create an empty shape and put it in an ObjComponent - Object_const_sptr shape(new Object); + Object_const_sptr shape(new CSGObject); ObjComponent objComp("obj", shape); // Get it back - it's the same one TS_ASSERT_EQUALS(objComp.shape(), shape); // Put a different shape object in there and check we get back that one - Object_const_sptr shape2(new Object); + Object_const_sptr shape2(new CSGObject); objComp.setShape(shape2); TS_ASSERT_DIFFERS(objComp.shape(), shape); TS_ASSERT_EQUALS(objComp.shape(), shape2); @@ -442,7 +442,7 @@ public: } private: - boost::shared_ptr<Object> createCappedCylinder() { + boost::shared_ptr<CSGObject> createCappedCylinder() { std::string C31 = "cx 0.5"; // cylinder x-axis radius 0.5 std::string C32 = "px 1.2"; std::string C33 = "px -3.2"; @@ -464,14 +464,14 @@ private: // using surface ids: 31 (cylinder) 32 (plane (top) ) and 33 (plane (base)) std::string ObjCapCylinder = "-31 -32 33"; - auto retVal = boost::make_shared<Object>(); + auto retVal = boost::make_shared<CSGObject>(); retVal->setObject(21, ObjCapCylinder); retVal->populate(CylSurMap); return retVal; } - boost::shared_ptr<Object> createCappedCylinder2() { + boost::shared_ptr<CSGObject> createCappedCylinder2() { std::string C31 = "cx 0.5"; // cylinder x-axis radius 0.5 std::string C32 = "px -1.0"; std::string C33 = "px -3.0"; @@ -493,14 +493,14 @@ private: // using surface ids: 31 (cylinder) 32 (plane (top) ) and 33 (plane (base)) std::string ObjCapCylinder = "-31 -32 33"; - boost::shared_ptr<Object> retVal = boost::make_shared<Object>(); + boost::shared_ptr<CSGObject> retVal = boost::make_shared<CSGObject>(); retVal->setObject(21, ObjCapCylinder); retVal->populate(CylSurMap); return retVal; } - boost::shared_ptr<Object> createCuboid(std::vector<std::string> &planes) { + boost::shared_ptr<CSGObject> createCuboid(std::vector<std::string> &planes) { std::string C1 = planes[0]; std::string C2 = planes[1]; std::string C3 = planes[2]; @@ -534,7 +534,7 @@ private: // using surface ids: 1-6 std::string ObjCube = "1 -2 3 -4 5 -6"; - boost::shared_ptr<Object> retVal = boost::make_shared<Object>(); + boost::shared_ptr<CSGObject> retVal = boost::make_shared<CSGObject>(); retVal->setObject(68, ObjCube); retVal->populate(CubeSurMap); diff --git a/Framework/Geometry/test/ObjectTest.h b/Framework/Geometry/test/ObjectTest.h index 6bf398f45a92e0215a34d670507c9b7b5f7983d3..dac2e30e72e4e98459532a202e7196e82a8a43ec 100644 --- a/Framework/Geometry/test/ObjectTest.h +++ b/Framework/Geometry/test/ObjectTest.h @@ -61,7 +61,7 @@ class ObjectTest : public CxxTest::TestSuite { public: void testDefaultObjectHasEmptyMaterial() { - Object obj; + CSGObject obj; TSM_ASSERT_DELTA("Expected a zero number density", 0.0, obj.material().numberDensity(), 1e-12); @@ -69,7 +69,7 @@ public: void testObjectSetMaterialReplacesExisting() { using Mantid::Kernel::Material; - Object obj; + CSGObject obj; TSM_ASSERT_DELTA("Expected a zero number density", 0.0, obj.material().numberDensity(), 1e-12); @@ -90,7 +90,7 @@ public: TS_ASSERT(boost::dynamic_pointer_cast<GluGeometryHandler>( original->getGeometryHandler())); - Object copy(*original); + CSGObject copy(*original); // The copy should be a primitive object with a GluGeometryHandler objType = -1; copy.GetObjectGeom(objType, pts, radius, height); @@ -116,7 +116,7 @@ public: TS_ASSERT(boost::dynamic_pointer_cast<GluGeometryHandler>( original->getGeometryHandler())); - Object lhs; // initialize + CSGObject lhs; // initialize lhs = *original; // assign // The copy should be a primitive object with a GluGeometryHandler objType = -1; @@ -330,7 +330,7 @@ public: // A sphere std::string ObjSphere = "-41"; - Object_sptr geom_obj = Object_sptr(new Object); + Object_sptr geom_obj = Object_sptr(new CSGObject); geom_obj->setObject(41, ObjSphere); geom_obj->populate(SphSurMap); @@ -431,12 +431,12 @@ public: std::string ObjB = "80001 -80002 60003 -60004 60005 -60006"; createSurfaces(ObjA); - Object object1 = Object(); + CSGObject object1 = CSGObject(); object1.setObject(3, ObjA); object1.populate(SMap); createSurfaces(ObjB); - Object object2 = Object(); + CSGObject object2 = CSGObject(); object2.setObject(4, ObjB); object2.populate(SMap); @@ -462,12 +462,12 @@ public: std::string ObjB = "60002 -80002 60003 -60004 60005 -60006"; createSurfaces(ObjA); - Object object1 = Object(); + CSGObject object1 = CSGObject(); object1.setObject(3, ObjA); object1.populate(SMap); createSurfaces(ObjB); - Object object2 = Object(); + CSGObject object2 = CSGObject(); object2.setObject(4, ObjB); object2.populate(SMap); @@ -494,12 +494,12 @@ public: std::string ObjB = "-71"; createSurfaces(ObjA); - Object object1 = Object(); + CSGObject object1 = CSGObject(); object1.setObject(3, ObjA); object1.populate(SMap); createSurfaces(ObjB); - Object object2 = Object(); + CSGObject object2 = CSGObject(); object2.setObject(4, ObjB); object2.populate(SMap); @@ -527,12 +527,12 @@ public: std::string ObjB = "(-72 : -73)"; createSurfaces(ObjA); - Object object1 = Object(); + CSGObject object1 = CSGObject(); object1.setObject(3, ObjA); object1.populate(SMap); createSurfaces(ObjB); - Object object2 = Object(); + CSGObject object2 = CSGObject(); object2.setObject(4, ObjB); object2.populate(SMap); @@ -560,12 +560,12 @@ public: std::string ObjB = "(-72 : -73)"; createSurfaces(ObjA); - Object object1 = Object(); + CSGObject object1 = CSGObject(); object1.setObject(3, ObjA); object1.populate(SMap); createSurfaces(ObjB); - Object object2 = Object(); + CSGObject object2 = CSGObject(); object2.setObject(4, ObjB); object2.populate(SMap); @@ -952,7 +952,7 @@ public: } void testVolumeThrowsWhenBoundingBoxIsInvalid() { - Object shape("This text gives an invalid Object."); + CSGObject shape("This text gives an invalid Object."); TS_ASSERT_THROWS(shape.volume(), std::runtime_error); } @@ -1168,7 +1168,7 @@ private: // using surface ids: 31 (cylinder) 32 (plane (top) ) and 33 (plane (base)) std::string ObjCapCylinder = "-31 -32 33"; - Object_sptr retVal = Object_sptr(new Object); + Object_sptr retVal = Object_sptr(new CSGObject); retVal->setObject(21, ObjCapCylinder); retVal->populate(CylSurMap); @@ -1203,7 +1203,7 @@ private: // using surface ids: 31 (cylinder) 32 (plane (top) ) and 33 (plane (base)) std::string ObjCapCylinder = "-31 -32 33"; - Object_sptr retVal = Object_sptr(new Object); + Object_sptr retVal = Object_sptr(new CSGObject); retVal->setObject(21, ObjCapCylinder); retVal->populate(CylSurMap); @@ -1303,7 +1303,7 @@ private: // using surface ids: 1-6 std::string ObjCube = "1 -2 3 -4 5 -6"; - Object_sptr retVal = Object_sptr(new Object); + Object_sptr retVal = Object_sptr(new CSGObject); retVal->setObject(68, ObjCube); retVal->populate(CubeSurMap); @@ -1344,7 +1344,7 @@ private: // using surface ids: 1-6 std::string ObjCube = "1 -2 3 -4 5 -6"; - Object_sptr retVal = Object_sptr(new Object); + Object_sptr retVal = Object_sptr(new CSGObject); retVal->setObject(68, ObjCube); retVal->populate(CubeSurMap); @@ -1424,7 +1424,7 @@ private: std::string ObjHex = "-1 2 3 -4 -5 6"; - Object_sptr retVal = Object_sptr(new Object); + Object_sptr retVal = Object_sptr(new CSGObject); // Explicitly setting the GluGeometryHanler hexahedron allows // for the correct bounding box calculation. diff --git a/Framework/Geometry/test/ParObjCompAssemblyTest.h b/Framework/Geometry/test/ParObjCompAssemblyTest.h index 0f097818bb6dc28efac0879474833583d5753bd2..dd8d44452bad477d7776d60b5714eb431f331c03 100644 --- a/Framework/Geometry/test/ParObjCompAssemblyTest.h +++ b/Framework/Geometry/test/ParObjCompAssemblyTest.h @@ -117,7 +117,7 @@ public: obj_str << "<radius val=\"0.1\" />"; obj_str << "<height val=\"0.2\" />"; obj_str << "</cylinder>"; - boost::shared_ptr<Object> s = + boost::shared_ptr<CSGObject> s = Mantid::Geometry::ShapeFactory().createShape(obj_str.str()); ObjCompAssembly bank("BankName"); @@ -132,7 +132,7 @@ public: bank.add(det2); bank.add(det3); - boost::shared_ptr<Object> shape = bank.createOutline(); + boost::shared_ptr<CSGObject> shape = bank.createOutline(); TS_ASSERT(shape); int otype; diff --git a/Framework/Geometry/test/ParObjComponentTest.h b/Framework/Geometry/test/ParObjComponentTest.h index 97a1d8c11de4e5abcf19fdd28299850ca5313248..d010fbe9a02159d801618f736361ed9f17cc60c9 100644 --- a/Framework/Geometry/test/ParObjComponentTest.h +++ b/Framework/Geometry/test/ParObjComponentTest.h @@ -296,7 +296,7 @@ public: } private: - boost::shared_ptr<Object> createCappedCylinder() { + boost::shared_ptr<CSGObject> createCappedCylinder() { std::string C31 = "cx 0.5"; // cylinder x-axis radius 0.5 std::string C32 = "px 1.2"; std::string C33 = "px -3.2"; @@ -318,14 +318,14 @@ private: // using surface ids: 31 (cylinder) 32 (plane (top) ) and 33 (plane (base)) std::string ObjCapCylinder = "-31 -32 33"; - auto retVal = boost::make_shared<Object>(); + auto retVal = boost::make_shared<CSGObject>(); retVal->setObject(21, ObjCapCylinder); retVal->populate(CylSurMap); return retVal; } - boost::shared_ptr<Object> createCuboid(std::vector<std::string> &planes) { + boost::shared_ptr<CSGObject> createCuboid(std::vector<std::string> &planes) { std::string C1 = planes[0]; std::string C2 = planes[1]; std::string C3 = planes[2]; @@ -359,7 +359,7 @@ private: // using surface ids: 1-6 std::string ObjCube = "1 -2 3 -4 5 -6"; - boost::shared_ptr<Object> retVal = boost::make_shared<Object>(); + boost::shared_ptr<CSGObject> retVal = boost::make_shared<CSGObject>(); retVal->setObject(68, ObjCube); retVal->populate(CubeSurMap); diff --git a/Framework/Geometry/test/RectangularDetectorTest.h b/Framework/Geometry/test/RectangularDetectorTest.h index 37f30fe520c431494aea2f915eb3c4201df1b471..fb8f65d237234731536c64b89b58b5cdf9eb2e64 100644 --- a/Framework/Geometry/test/RectangularDetectorTest.h +++ b/Framework/Geometry/test/RectangularDetectorTest.h @@ -86,7 +86,7 @@ public: } void testFullConstructor() { - boost::shared_ptr<Geometry::Object> cuboidShape = + boost::shared_ptr<Geometry::CSGObject> cuboidShape = ComponentCreationHelper::createCuboid(0.5); RectangularDetector *det = new RectangularDetector("MyRectangle"); @@ -202,7 +202,7 @@ public: * resizes it. */ void testResizingParameter() { - boost::shared_ptr<Geometry::Object> cuboidShape = + boost::shared_ptr<Geometry::CSGObject> cuboidShape = ComponentCreationHelper::createCuboid(0.5); RectangularDetector *det = new RectangularDetector("MyRectangle"); diff --git a/Framework/Geometry/test/RulesCompObjTest.h b/Framework/Geometry/test/RulesCompObjTest.h index 7d8bbb14828b010ccb0d3da017bd171899a00170..8736c2d52a6ad2b62fc6a232c90cac4d35811244 100644 --- a/Framework/Geometry/test/RulesCompObjTest.h +++ b/Framework/Geometry/test/RulesCompObjTest.h @@ -29,12 +29,12 @@ public: TS_ASSERT_EQUALS(A.leaf(1), (Rule *)nullptr); TS_ASSERT_EQUALS(A.display(), "#0"); TS_ASSERT_EQUALS(A.getObjN(), 0); - TS_ASSERT_EQUALS(A.getObj(), (Object *)nullptr); + TS_ASSERT_EQUALS(A.getObj(), (CSGObject *)nullptr); TS_ASSERT_EQUALS(A.isComplementary(), 1); } void testSetObject() { - Object cpCylinder = createCappedCylinder(); + CSGObject cpCylinder = createCappedCylinder(); CompObj A; A.setObj(&cpCylinder); A.setObjN(10); @@ -44,7 +44,7 @@ public: } void testClone() { - Object cpCylinder = createCappedCylinder(); + CSGObject cpCylinder = createCappedCylinder(); CompObj A; A.setObj(&cpCylinder); A.setObjN(10); @@ -55,7 +55,7 @@ public: } void testSetLeaves() { - Object cpCylinder = createCappedCylinder(); + CSGObject cpCylinder = createCappedCylinder(); CompObj A; A.setObj(&cpCylinder); A.setObjN(10); @@ -67,7 +67,7 @@ public: } void testSetLeaf() { - Object cpCylinder = createCappedCylinder(); + CSGObject cpCylinder = createCappedCylinder(); CompObj A; A.setObj(&cpCylinder); A.setObjN(10); @@ -79,7 +79,7 @@ public: } void testFindLeaf() { - Object cpCylinder = createCappedCylinder(); + CSGObject cpCylinder = createCappedCylinder(); CompObj A; A.setObj(&cpCylinder); A.setObjN(10); @@ -89,7 +89,7 @@ public: } void testFindKey() { - Object cpCylinder = createCappedCylinder(); + CSGObject cpCylinder = createCappedCylinder(); CompObj A; A.setObj(&cpCylinder); A.setObjN(10); @@ -99,7 +99,7 @@ public: } void testIsValid() { - Object cpCylinder = createCappedCylinder(); + CSGObject cpCylinder = createCappedCylinder(); CompObj A; A.setObj(&cpCylinder); A.setObjN(10); @@ -127,7 +127,7 @@ public: } void testIsValidMap() { - Object cpCylinder = createCappedCylinder(); + CSGObject cpCylinder = createCappedCylinder(); CompObj A; A.setObj(&cpCylinder); A.setObjN(10); @@ -150,7 +150,7 @@ public: } void testSimplyfy() { - Object cpCylinder = createCappedCylinder(); + CSGObject cpCylinder = createCappedCylinder(); CompObj A; A.setObj(&cpCylinder); A.setObjN(10); @@ -159,7 +159,7 @@ public: } private: - Object createCappedCylinder() { + CSGObject createCappedCylinder() { std::string C31 = "cx 3.0"; // cylinder x-axis radius 3 std::string C32 = "px 1.2"; std::string C33 = "px -3.2"; @@ -181,7 +181,7 @@ private: // using surface ids: 31 (cylinder) 32 (plane (top) ) and 33 (plane (base)) std::string ObjCapCylinder = "-31 -32 33"; - Object retVal; + CSGObject retVal; retVal.setObject(21, ObjCapCylinder); retVal.populate(CylSurMap); diff --git a/Framework/Geometry/test/ShapeFactoryTest.h b/Framework/Geometry/test/ShapeFactoryTest.h index 5419002cb2253358cb54f822392c08ee7ff4ea7e..ce609ce155ba528f4f7405038be408e0686e6cd3 100644 --- a/Framework/Geometry/test/ShapeFactoryTest.h +++ b/Framework/Geometry/test/ShapeFactoryTest.h @@ -33,7 +33,7 @@ public: xmlShape += "</cuboid> "; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr->isValid(V3D(0.0, 0.0, 0.00001))); TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 0.001))); @@ -149,7 +149,7 @@ public: std::string expectedXML = "<type name=\"userShape\"> " + xmlShape + " </type>"; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TSM_ASSERT("Empty shape xml given.", !shape_sptr->getShapeXML().empty()); TSM_ASSERT_EQUALS("Shape xml not relayed through to shape object.", expectedXML, shape_sptr->getShapeXML()); @@ -168,7 +168,7 @@ public: xmlShape += "</hexahedron> "; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr->isValid(V3D(0.0, 0.0, 0.0))); TS_ASSERT(!shape_sptr->isValid(V3D(1.1, 0.0, 0.0))); @@ -198,7 +198,7 @@ public: xmlShape += "</hexahedron> "; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr->isValid(V3D(0.0001, 0.0, 0.0))); TS_ASSERT(!shape_sptr->isValid(V3D(0.0055, 0.0, 0.0))); @@ -215,7 +215,7 @@ public: xmlShape += "</tapered-guide>"; xmlShape += "<algebra val=\"shape\"/>"; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); // Vertices. TS_ASSERT(shape_sptr->isValid(V3D(2.0, -2.0, 2.0))); @@ -250,7 +250,7 @@ public: xmlShape += "</tapered-guide>"; xmlShape += "<algebra val=\"shape\"/>"; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); // Vertices. TS_ASSERT(shape_sptr->isValid(V3D(0.0, -1.0, 0.0))); @@ -283,7 +283,7 @@ public: xmlShape += "</sphere>"; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr->isValid(V3D(4.1, 2.1, 8.1))); TS_ASSERT(!shape_sptr->isValid(V3D(47.1, 2.1, 8.1))); @@ -304,7 +304,7 @@ public: xmlShape += "</sphere>"; xmlShape += "<algebra val=\"shape1 : shape2\" /> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr->isValid(V3D(4.1, 2.1, 8.1))); TS_ASSERT(!shape_sptr->isValid(V3D(47.1, 2.1, 8.1))); @@ -326,7 +326,7 @@ public: xmlShape += "<radius val=\"3.2\" /> "; xmlShape += "</sphere>"; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr->isValid(V3D(4.1, 2.1, 8.1))); TS_ASSERT(!shape_sptr->isValid(V3D(47.1, 2.1, 8.1))); @@ -343,7 +343,7 @@ public: xmlShape += "</sphere>"; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr->isValid(V3D(1.0, 0.0, 0.0))); TS_ASSERT(shape_sptr->isValid(V3D(0.0, 1.0, 0.0))); @@ -370,7 +370,7 @@ public: xmlShape += "</cylinder>"; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr->isValid(V3D(0.0, 0.0, 1))); TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 10))); @@ -388,7 +388,7 @@ public: xmlShape += "<height val=\"3\" /> "; xmlShape += "</cylinder>"; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr->isValid(V3D(0.0, 0.0, 1))); TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 10))); @@ -408,7 +408,7 @@ public: xmlShape += "<algebra val=\"shape\" /> "; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 1))); TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 10))); @@ -427,7 +427,7 @@ public: " <height val=\"0.05\" />" "</hollow-cylinder> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr); TS_ASSERT(shape_sptr->hasValidShape()); // centre is not valid @@ -453,7 +453,7 @@ public: " <height val=\"0.05\" />" "</hollow-cylinder> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr); TS_ASSERT(!shape_sptr->hasValidShape()); } @@ -468,7 +468,7 @@ public: " <height val=\"-0.05\" />" "</hollow-cylinder> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr); TS_ASSERT(!shape_sptr->hasValidShape()); } @@ -483,7 +483,7 @@ public: " <height val=\"-0.05\" />" "</hollow-cylinder> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr); TS_ASSERT(!shape_sptr->hasValidShape()); } @@ -498,7 +498,7 @@ public: " <height val=\"-0.05\" />" "</hollow-cylinder> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr); TS_ASSERT(!shape_sptr->hasValidShape()); } @@ -512,7 +512,7 @@ public: xmlShape += "</infinite-cylinder>"; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(shape_sptr->isValid(V3D(0.0, 0.0, 1))); TS_ASSERT(shape_sptr->isValid(V3D(0.0, 0.0, 10))); @@ -531,7 +531,7 @@ public: xmlShape += "</cone>"; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 1))); TS_ASSERT(shape_sptr->isValid(V3D(0.0, 0.0, -1))); @@ -551,7 +551,7 @@ public: xmlShape += "<algebra val=\"shape\" /> "; ShapeFactory sFactory; - boost::shared_ptr<Object> shape_sptr = sFactory.createShape(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = sFactory.createShape(xmlShape); TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 1))); TS_ASSERT(shape_sptr->isValid(V3D(0.0, 0.0, -1))); @@ -573,7 +573,7 @@ public: xmlShape += "</sphere>"; xmlShape += "<algebra val=\"some-sphere # stick\" />"; - boost::shared_ptr<Object> shape_sptr = getObject(xmlShape); + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 0.0))); TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, -0.04))); @@ -596,7 +596,7 @@ public: xmlShape += "</c5one>"; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); // should return empty object TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 1))); @@ -612,7 +612,7 @@ public: xmlShape += "</cone>"; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); // should return empty object TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 1))); @@ -628,13 +628,13 @@ public: xmlShape += "</cone>"; xmlShape += "<algebra val=\"shape\" /> "; - boost::shared_ptr<Object> shape_sptr = + boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape); // should return empty object TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 1))); } - boost::shared_ptr<Object> getObject(std::string xmlShape) { + boost::shared_ptr<CSGObject> getObject(std::string xmlShape) { std::string shapeXML = "<type name=\"userShape\"> " + xmlShape + " </type>"; // Set up the DOM parser and parse xml string @@ -646,7 +646,7 @@ public: // convert into a Geometry object ShapeFactory sFactory; - boost::shared_ptr<Object> shape_sptr = sFactory.createShape(pRootElem); + boost::shared_ptr<CSGObject> shape_sptr = sFactory.createShape(pRootElem); return shape_sptr; } diff --git a/Framework/Geometry/test/StructuredDetectorTest.h b/Framework/Geometry/test/StructuredDetectorTest.h index 0976bdb323dd5ef73a6da5ec50da7485c5fef39b..7306531056604406cb6fc8c96b0185cdfcc5368b 100644 --- a/Framework/Geometry/test/StructuredDetectorTest.h +++ b/Framework/Geometry/test/StructuredDetectorTest.h @@ -116,7 +116,7 @@ public: } void testFullConstructor() { - boost::shared_ptr<Geometry::Object> cuboidShape = + boost::shared_ptr<Geometry::CSGObject> cuboidShape = ComponentCreationHelper::createCuboid(0.5); StructuredDetector *det = new StructuredDetector("MyStructuredDetector"); @@ -155,7 +155,7 @@ public: } void testIncorrectVertexArraySize() { - boost::shared_ptr<Geometry::Object> cuboidShape = + boost::shared_ptr<Geometry::CSGObject> cuboidShape = ComponentCreationHelper::createCuboid(0.5); StructuredDetector *det = new StructuredDetector("MyStructuredDetector"); diff --git a/Framework/Geometry/test/TrackTest.h b/Framework/Geometry/test/TrackTest.h index 683994a2c6fd6d7c6ac47fba2620d6689fae7d6f..a4f3461281301a11d8b0a6fd416262269ebe1a5e 100644 --- a/Framework/Geometry/test/TrackTest.h +++ b/Framework/Geometry/test/TrackTest.h @@ -38,7 +38,7 @@ public: void testAddLink() { Track A(V3D(1, 1, 1), V3D(1.0, 0.0, 0.0)); - Object shape; + CSGObject shape; A.addLink(V3D(2, 2, 2), V3D(3, 3, 3), 2.0, shape, nullptr); const auto &linkFront = A.front(); const auto &linkBack = A.back(); @@ -72,7 +72,7 @@ public: void testBuildLink() { Track A(V3D(-5, -5, 0), V3D(1.0, 0.0, 0.0)); - Object shape; + CSGObject shape; TS_ASSERT_EQUALS(A.startPoint(), V3D(-5.0, -5.0, 0.0)); TS_ASSERT_EQUALS(A.direction(), V3D(1.0, 0.0, 0.0)); @@ -94,7 +94,7 @@ public: void testRemoveCojoins() { Track A(V3D(1, 1, 1), V3D(1.0, 0.0, 0.0)); - Object shape; + CSGObject shape; A.addLink(V3D(2, 2, 2), V3D(3, 3, 3), 2.0, shape); A.addLink(V3D(2.0001, 2.0001, 2.0001), V3D(3, 3, 3), 2.001, shape); // Check track length @@ -115,7 +115,7 @@ public: void testNonComplete() { Track A(V3D(1, 1, 1), V3D(1.0, 0.0, 0.0)); - Object shape; + CSGObject shape; A.addLink(V3D(2, 2, 2), V3D(3, 3, 3), 2.0, shape); A.addLink(V3D(2.0001, 2.0001, 2.0001), V3D(3, 3, 3), 2.001, shape); TS_ASSERT(A.nonComplete() > 0); diff --git a/Framework/MDAlgorithms/src/Quantification/CachedExperimentInfo.cpp b/Framework/MDAlgorithms/src/Quantification/CachedExperimentInfo.cpp index d96887e49fd20811a89de313b1bd0a64bf39b033..c09a1b05041e34e3984e32658421ad4f802f2b18 100644 --- a/Framework/MDAlgorithms/src/Quantification/CachedExperimentInfo.cpp +++ b/Framework/MDAlgorithms/src/Quantification/CachedExperimentInfo.cpp @@ -173,7 +173,7 @@ void CachedExperimentInfo::initCaches( // Sample volume const API::Sample &sampleDescription = m_exptInfo.sample(); - const Geometry::Object &shape = sampleDescription.getShape(); + const Geometry::CSGObject &shape = sampleDescription.getShape(); m_sampleWidths = shape.getBoundingBox().width(); // Detector volume diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/IObjComponent.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/IObjComponent.cpp index fc4a61effcf4fb5d3c7447ac59c3e399e3112460..1051f109c5ee3a58bf0a8f0d51491697cf5546b6 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/IObjComponent.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/IObjComponent.cpp @@ -18,8 +18,8 @@ namespace { * @param self A reference to the calling object to emulate method on Python * object */ -boost::shared_ptr<Mantid::Geometry::Object> getShape(IObjComponent &self) { - return boost::const_pointer_cast<Mantid::Geometry::Object>(self.shape()); +boost::shared_ptr<Mantid::Geometry::CSGObject> getShape(IObjComponent &self) { + return boost::const_pointer_cast<Mantid::Geometry::CSGObject>(self.shape()); } } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/Object.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/Object.cpp index 2533848b60e5017e528894826135cce2886b5da0..0fd4cda11b3514380852eb9b859b25e392a5e76f 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/Object.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/Object.cpp @@ -4,24 +4,24 @@ #include <boost/python/copy_const_reference.hpp> #include <boost/python/register_ptr_to_python.hpp> -using Mantid::Geometry::Object; +using Mantid::Geometry::CSGObject; using Mantid::Geometry::BoundingBox; using namespace boost::python; -GET_POINTER_SPECIALIZATION(Object) +GET_POINTER_SPECIALIZATION(CSGObject) void export_Object() { - register_ptr_to_python<boost::shared_ptr<Object>>(); + register_ptr_to_python<boost::shared_ptr<CSGObject>>(); - class_<Object, boost::noncopyable>("Object", no_init) + class_<CSGObject, boost::noncopyable>("Object", no_init) .def("getBoundingBox", - (const BoundingBox &(Object::*)() const) & Object::getBoundingBox, + (const BoundingBox &(CSGObject::*)() const) & CSGObject::getBoundingBox, arg("self"), return_value_policy<copy_const_reference>(), "Return the axis-aligned bounding box for this shape") - .def("getShapeXML", &Object::getShapeXML, arg("self"), + .def("getShapeXML", &CSGObject::getShapeXML, arg("self"), "Returns the XML that was used to create this shape.") - .def("volume", &Object::volume, arg("self"), + .def("volume", &CSGObject::volume, arg("self"), "Returns the volume of this shape."); } diff --git a/Framework/TestHelpers/src/ComponentCreationHelper.cpp b/Framework/TestHelpers/src/ComponentCreationHelper.cpp index 85e290caf03b8e2e2714801b0afb60e8c9d05f05..0ba60bd7e946737aab54b316f537c0d788cc7123 100644 --- a/Framework/TestHelpers/src/ComponentCreationHelper.cpp +++ b/Framework/TestHelpers/src/ComponentCreationHelper.cpp @@ -301,7 +301,7 @@ Instrument_sptr createTestInstrumentCylindrical( // Define a source component ObjComponent *source = - new ObjComponent("moderator", Object_sptr(new Object), testInst.get()); + new ObjComponent("moderator", Object_sptr(new CSGObject), testInst.get()); source->setPos(sourcePos); testInst->add(source); testInst->markAsSource(source); @@ -393,7 +393,7 @@ createCylInstrumentWithDetInGivenPositions(const std::vector<double> &L2, // Define a source component ObjComponent *source = - new ObjComponent("moderator", Object_sptr(new Object), testInst.get()); + new ObjComponent("moderator", Object_sptr(new CSGObject), testInst.get()); source->setPos(V3D(0.0, 0.0, -L2_min)); testInst->add(source); testInst->markAsSource(source); @@ -543,7 +543,7 @@ Instrument_sptr createTestInstrumentRectangular2(int num_banks, int pixels, // Define a source component ObjComponent *source = - new ObjComponent("moderator", Object_sptr(new Object), testInst.get()); + new ObjComponent("moderator", Object_sptr(new CSGObject), testInst.get()); source->setPos(V3D(0.0, 0.0, -10.)); testInst->add(source); testInst->markAsSource(source); diff --git a/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp b/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp index 06ebe56ad3fd6faf3a90b488ff70e05dbd260648..a2260a56139906745b862e569ad485c65e7c92ae 100644 --- a/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp +++ b/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp @@ -259,7 +259,7 @@ Workspace2D_sptr maskSpectra(Workspace2D_sptr workspace, xmlShape += "<algebra val=\"shape\" /> "; ShapeFactory sFactory; - boost::shared_ptr<Object> shape = sFactory.createShape(xmlShape); + boost::shared_ptr<CSGObject> shape = sFactory.createShape(xmlShape); for (int i = 0; i < nhist; ++i) { Detector *det = new Detector("det", detid_t(i + 1), shape, nullptr); det->setPos(i, i + 1, 1); diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/CompAssemblyActor.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/CompAssemblyActor.h index 84b3931f05dce548e455fa342e0225f4abba78e2..9116c22d17a99060ca3771bd6bba980159ba57cf 100644 --- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/CompAssemblyActor.h +++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/CompAssemblyActor.h @@ -44,7 +44,7 @@ class V3D; } namespace Geometry { class ICompAssembly; -class Object; +class CSGObject; } } diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/ICompAssemblyActor.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/ICompAssemblyActor.h index cb4bb5dfef72d4471bf4dd12ba0362d0aac511ff..21cbebe5e5465bb6635a765674dd87a5eab1a0bb 100644 --- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/ICompAssemblyActor.h +++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/ICompAssemblyActor.h @@ -44,7 +44,7 @@ class V3D; namespace Geometry { class ICompAssembly; -class Object; +class CSGObject; } } diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/RectangularDetectorActor.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/RectangularDetectorActor.h index ac19dc3a3b3e8ed0fbca5780662d730505de9e1e..887dcf9a2bb41a13fe961c11b674f66574ce9cac 100644 --- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/RectangularDetectorActor.h +++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/RectangularDetectorActor.h @@ -41,7 +41,7 @@ class V3D; } namespace Geometry { class ICompAssembly; -class Object; +class CSGObject; } } diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/StructuredDetectorActor.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/StructuredDetectorActor.h index 5a580af83e3c19800ca9f33268f34a95b5326624..07e72cb3e303f2ae96213cfaeaa477444d12839a 100644 --- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/StructuredDetectorActor.h +++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/StructuredDetectorActor.h @@ -41,7 +41,7 @@ class V3D; } namespace Geometry { class ICompAssembly; -class Object; +class CSGObject; } } diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedSurface.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedSurface.h index e7d844ac258c4dc13015b3093b1ffd45987ebb34..2fe48df763271eef77580b7e2fa8caa5a906ba60 100644 --- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedSurface.h +++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedSurface.h @@ -58,7 +58,7 @@ public: Mantid::detid_t detID; ///< Detector ID Mantid::Kernel::V3D position; ///< Detector position Mantid::Kernel::Quat rotation; ///< Detector orientation - boost::shared_ptr<const Mantid::Geometry::Object> + boost::shared_ptr<const Mantid::Geometry::CSGObject> shape; ///< Shape of the detector Mantid::Kernel::V3D scaleFactor; ///< Detector's scale factor }; diff --git a/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/MantidGLWidget.h b/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/MantidGLWidget.h index af4d28598208e18a8a0138c99d7b036dd3f0bb35..ef3153ae9777c1235e03cb02d27490c224ea641f 100644 --- a/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/MantidGLWidget.h +++ b/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/MantidGLWidget.h @@ -14,7 +14,7 @@ //----------------------------------------- namespace Mantid { namespace Geometry { -class Object; +class CSGObject; } } @@ -60,7 +60,7 @@ public: ~MantidGLWidget() override; /// Set the Mantid geometry object - void setDisplayObject(boost::shared_ptr<Mantid::Geometry::Object> object); + void setDisplayObject(boost::shared_ptr<Mantid::Geometry::CSGObject> object); protected: /// Initialize the renderer @@ -88,7 +88,7 @@ private: /// Handle a MouseMoveEvent void mouseMoveEvent(QMouseEvent *event) override; /// A Mantid geometry object - boost::shared_ptr<Mantid::Geometry::Object> m_display_object; + boost::shared_ptr<Mantid::Geometry::CSGObject> m_display_object; /// The current X, Y and Z rotations GLdouble m_x_rot, m_y_rot, m_z_rot; /// The scaling factor to use diff --git a/qt/widgets/plugins/algorithm_dialogs/src/CreateSampleShapeDialog.cpp b/qt/widgets/plugins/algorithm_dialogs/src/CreateSampleShapeDialog.cpp index 15744016d859746d1069f5d4b60360a87e0689af..74f84aa3e46bdffe3c6e24ee366c7c96dbf0fb1b 100644 --- a/qt/widgets/plugins/algorithm_dialogs/src/CreateSampleShapeDialog.cpp +++ b/qt/widgets/plugins/algorithm_dialogs/src/CreateSampleShapeDialog.cpp @@ -200,11 +200,11 @@ void CreateSampleShapeDialog::update3DView() { // (infcyl_1:(infcyl_2:infcyl_3))))\" />\n"; Mantid::Geometry::ShapeFactory sFactory; - boost::shared_ptr<Mantid::Geometry::Object> shape_sptr = + boost::shared_ptr<Mantid::Geometry::CSGObject> shape_sptr = sFactory.createShape(shapexml); // std::cerr << "\n--------- XML String -----------\n" << shapexml << // "\n---------------------\n"; - if (shape_sptr == boost::shared_ptr<Mantid::Geometry::Object>()) + if (shape_sptr == boost::shared_ptr<Mantid::Geometry::CSGObject>()) return; try { shape_sptr->initDraw(); diff --git a/qt/widgets/plugins/algorithm_dialogs/src/MantidGLWidget.cpp b/qt/widgets/plugins/algorithm_dialogs/src/MantidGLWidget.cpp index 84d8c0a324ae6e291f505e5e3c7de41ffe5ddf23..6e734ea959a320f45fc8494a75e22edc2f6da6f4 100644 --- a/qt/widgets/plugins/algorithm_dialogs/src/MantidGLWidget.cpp +++ b/qt/widgets/plugins/algorithm_dialogs/src/MantidGLWidget.cpp @@ -21,7 +21,7 @@ MantidGLWidget::MantidGLWidget(QWidget *parent) : QGLWidget(QGLFormat(QGL::DepthBuffer | QGL::NoAlphaChannel | QGL::SampleBuffers), parent), - m_display_object(boost::shared_ptr<Mantid::Geometry::Object>()), + m_display_object(boost::shared_ptr<Mantid::Geometry::CSGObject>()), m_x_rot(0.0), m_y_rot(0.0), m_z_rot(0.0), m_scale_factor(1.0) { setAutoFillBackground(false); m_bb_widths[0] = 0.0; @@ -43,7 +43,7 @@ MantidGLWidget::~MantidGLWidget() { makeCurrent(); } * @param object :: A pointer to the Mantid::Geometry::Object */ void MantidGLWidget::setDisplayObject( - boost::shared_ptr<Mantid::Geometry::Object> object) { + boost::shared_ptr<Mantid::Geometry::CSGObject> object) { m_display_object = object; m_x_rot = 0.0; m_y_rot = 0.0; @@ -144,7 +144,7 @@ void MantidGLWidget::initializeGL() { */ void MantidGLWidget::paintGL() { // Nothing to draw - if (m_display_object == boost::shared_ptr<Mantid::Geometry::Object>()) + if (m_display_object == boost::shared_ptr<Mantid::Geometry::CSGObject>()) return; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);