Commit 400df480 authored by Karl Palmen's avatar Karl Palmen
Browse files

Rename Geometry::Object class to Geometry::CSGObject re #12827



The files are yet to be renamed

Signed-off-by: default avatarKarl Palmen <karl.palmen@stfc.ac.uk>
parent a2d24486
...@@ -69,9 +69,9 @@ public: ...@@ -69,9 +69,9 @@ public:
/// Set the name of the sample /// Set the name of the sample
void setName(const std::string &name); void setName(const std::string &name);
/// Return the sample shape /// Return the sample shape
const Geometry::Object &getShape() const; const Geometry::CSGObject &getShape() const;
/// Update the shape of the object /// Update the shape of the object
void setShape(const Geometry::Object &shape); void setShape(const Geometry::CSGObject &shape);
/** @name Material properties.*/ /** @name Material properties.*/
//@{ //@{
...@@ -138,7 +138,7 @@ private: ...@@ -138,7 +138,7 @@ private:
/// The sample name /// The sample name
std::string m_name; std::string m_name;
/// The sample shape object /// The sample shape object
Geometry::Object m_shape; Geometry::CSGObject m_shape;
/// An owned pointer to the SampleEnvironment object /// An owned pointer to the SampleEnvironment object
boost::shared_ptr<Geometry::SampleEnvironment> m_environment; boost::shared_ptr<Geometry::SampleEnvironment> m_environment;
/// Pointer to the OrientedLattice of the sample, NULL if not set. /// Pointer to the OrientedLattice of the sample, NULL if not set.
......
...@@ -16,7 +16,7 @@ namespace Mantid { ...@@ -16,7 +16,7 @@ namespace Mantid {
namespace API { namespace API {
using namespace Mantid::Kernel; using namespace Mantid::Kernel;
using Geometry::Object; using Geometry::CSGObject;
using Geometry::OrientedLattice; using Geometry::OrientedLattice;
using Geometry::SampleEnvironment; using Geometry::SampleEnvironment;
using Geometry::ShapeFactory; using Geometry::ShapeFactory;
...@@ -101,13 +101,13 @@ void Sample::setName(const std::string &name) { m_name = name; } ...@@ -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] * its own coordinate system with its centre at [0,0,0]
* @return A reference to the object describing the shape * @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 /** Set the object that describes the sample shape. The object is defined within
* its own coordinate system * its own coordinate system
* @param shape :: The object describing the shape * @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 the material.
* @return A reference to the material the sample is composed of * @return A reference to the material the sample is composed of
......
...@@ -34,13 +34,13 @@ public: ...@@ -34,13 +34,13 @@ public:
0.0127, 1.0, V3D(), V3D(0.0, 1.0, 0.0), "cyl"); 0.0127, 1.0, V3D(), V3D(0.0, 1.0, 0.0), "cyl");
Sample sample; Sample sample;
TS_ASSERT_THROWS_NOTHING(sample.setShape(*shape_sptr)) 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()); TS_ASSERT_EQUALS(shape_sptr->getName(), sampleShape.getName());
} }
void test_Setting_Default_Shape_Is_Accepted() { void test_Setting_Default_Shape_Is_Accepted() {
Sample sample; Sample sample;
Object object; CSGObject object;
TS_ASSERT_EQUALS(object.hasValidShape(), false); TS_ASSERT_EQUALS(object.hasValidShape(), false);
TS_ASSERT_THROWS_NOTHING(sample.setShape(object)); TS_ASSERT_THROWS_NOTHING(sample.setShape(object));
} }
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
const std::string envName("TestKit"); const std::string envName("TestKit");
SampleEnvironment *kit = SampleEnvironment *kit =
new SampleEnvironment(envName, boost::make_shared<const Container>("")); 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)); TS_ASSERT_THROWS_NOTHING(sample.setEnvironment(kit));
...@@ -259,7 +259,7 @@ public: ...@@ -259,7 +259,7 @@ public:
Material vanBlock("vanBlock", Material vanBlock("vanBlock",
Mantid::PhysicalConstants::getNeutronAtom(23, 0), 0.072); Mantid::PhysicalConstants::getNeutronAtom(23, 0), 0.072);
Sample sample; Sample sample;
Object shape; CSGObject shape;
shape.setMaterial(vanBlock); shape.setMaterial(vanBlock);
sample.setShape(shape); sample.setShape(shape);
......
...@@ -13,7 +13,7 @@ class Sample; ...@@ -13,7 +13,7 @@ class Sample;
} }
namespace Geometry { namespace Geometry {
class IDetector; class IDetector;
class Object; class CSGObject;
} }
namespace Algorithms { namespace Algorithms {
...@@ -114,7 +114,7 @@ protected: ...@@ -114,7 +114,7 @@ protected:
virtual void initialiseCachedDistances() = 0; virtual void initialiseCachedDistances() = 0;
API::MatrixWorkspace_sptr m_inputWS; ///< A pointer to the input workspace 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. Kernel::V3D m_beamDirection; ///< The direction of the beam.
std::vector<double> m_L1s, ///< Cached L1 distances std::vector<double> m_L1s, ///< Cached L1 distances
m_elementVolumes; ///< Cached element volumes m_elementVolumes; ///< Cached element volumes
......
...@@ -12,7 +12,7 @@ class Material; ...@@ -12,7 +12,7 @@ class Material;
class V3D; class V3D;
} }
namespace Geometry { namespace Geometry {
class Object; class CSGObject;
} }
namespace Algorithms { namespace Algorithms {
......
...@@ -106,7 +106,7 @@ private: ...@@ -106,7 +106,7 @@ private:
std::string sampleXML() override; std::string sampleXML() override;
void initialiseCachedDistances() override; void initialiseCachedDistances() override;
/// Create the gague volume for the correction /// 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 double m_cubeSide; ///< The length of the side of an element cube in m
}; };
......
...@@ -114,7 +114,7 @@ private: ...@@ -114,7 +114,7 @@ private:
Kernel::V3D &detAxis); Kernel::V3D &detAxis);
/// Computes the distance to the given shape from a starting point /// Computes the distance to the given shape from a starting point
double distToSurface(const Kernel::V3D &start, double distToSurface(const Kernel::V3D &start,
const Geometry::Object *shape) const; const Geometry::CSGObject *shape) const;
/// Computes the detector efficiency for a given paramater /// Computes the detector efficiency for a given paramater
double detectorEfficiency(const double alpha) const; double detectorEfficiency(const double alpha) const;
/// Computes an approximate expansion of a Chebysev polynomial /// Computes an approximate expansion of a Chebysev polynomial
...@@ -138,7 +138,7 @@ private: ...@@ -138,7 +138,7 @@ private:
/// A lookup of previously seen shape objects used to save calculation time as /// A lookup of previously seen shape objects used to save calculation time as
/// most detectors have the same shape /// 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; m_shapeCache;
/// Sample position /// Sample position
Kernel::V3D m_samplePos; Kernel::V3D m_samplePos;
......
...@@ -11,7 +11,7 @@ namespace Mantid { ...@@ -11,7 +11,7 @@ namespace Mantid {
// forward declarations // forward declarations
namespace Geometry { namespace Geometry {
class IDetector; class IDetector;
class Object; class CSGObject;
class ParameterMap; class ParameterMap;
} }
...@@ -92,7 +92,7 @@ private: ...@@ -92,7 +92,7 @@ private:
Kernel::V3D &detAxis); Kernel::V3D &detAxis);
/// Computes the distance to the given shape from a starting point /// Computes the distance to the given shape from a starting point
double distToSurface(const Kernel::V3D start, double distToSurface(const Kernel::V3D start,
const Geometry::Object *shape) const; const Geometry::CSGObject *shape) const;
/// Calculate the detector efficiency /// Calculate the detector efficiency
double detectorEfficiency(const double alpha, double detectorEfficiency(const double alpha,
const double scale_factor = 1.0) const; const double scale_factor = 1.0) const;
...@@ -115,7 +115,7 @@ private: ...@@ -115,7 +115,7 @@ private:
const Geometry::ParameterMap *paraMap; const Geometry::ParameterMap *paraMap;
/// A lookup of previously seen shape objects used to save calculation time as /// A lookup of previously seen shape objects used to save calculation time as
/// most detectors have the same shape /// 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 /// Sample position
Kernel::V3D samplePos; Kernel::V3D samplePos;
/// The spectra numbers that were skipped /// The spectra numbers that were skipped
......
...@@ -9,7 +9,7 @@ namespace API { ...@@ -9,7 +9,7 @@ namespace API {
class Sample; class Sample;
} }
namespace Geometry { namespace Geometry {
class Object; class CSGObject;
class SampleEnvironment; class SampleEnvironment;
} }
namespace Kernel { namespace Kernel {
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
double lambdaAfter) const; double lambdaAfter) const;
private: private:
const Geometry::Object &m_sample; const Geometry::CSGObject &m_sample;
const Geometry::SampleEnvironment *m_env; const Geometry::SampleEnvironment *m_env;
const Geometry::BoundingBox m_activeRegion; const Geometry::BoundingBox m_activeRegion;
const size_t m_maxScatterAttempts; const size_t m_maxScatterAttempts;
......
...@@ -19,7 +19,7 @@ class V3D; ...@@ -19,7 +19,7 @@ class V3D;
} }
namespace Geometry { namespace Geometry {
class Object; class CSGObject;
} }
namespace Algorithms { namespace Algorithms {
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
protected: protected:
API::MatrixWorkspace_sptr m_inputWS; ///< A pointer to the input workspace 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. Kernel::V3D m_beamDirection; ///< The direction of the beam.
std::vector<double> m_L1s, ///< Cached L1 distances std::vector<double> m_L1s, ///< Cached L1 distances
m_elementVolumes; ///< Cached element volumes m_elementVolumes; ///< Cached element volumes
......
...@@ -244,7 +244,7 @@ void AbsorptionCorrection::retrieveBaseProperties() { ...@@ -244,7 +244,7 @@ void AbsorptionCorrection::retrieveBaseProperties() {
static_cast<uint16_t>(0), 0.0, 0.0, sigma_s, 0.0, static_cast<uint16_t>(0), 0.0, 0.0, sigma_s, 0.0,
sigma_s, sigma_atten); sigma_s, sigma_atten);
Object shape = m_inputWS->sample().getShape(); // copy CSGObject shape = m_inputWS->sample().getShape(); // copy
shape.setMaterial(Material("SetInAbsorptionCorrection", neutron, rho)); shape.setMaterial(Material("SetInAbsorptionCorrection", neutron, rho));
m_inputWS->mutableSample().setShape(shape); m_inputWS->mutableSample().setShape(shape);
} }
...@@ -296,7 +296,7 @@ void AbsorptionCorrection::constructSample(API::Sample &sample) { ...@@ -296,7 +296,7 @@ void AbsorptionCorrection::constructSample(API::Sample &sample) {
throw std::invalid_argument(mess); throw std::invalid_argument(mess);
} }
} else { } else {
boost::shared_ptr<Object> shape = ShapeFactory().createShape(xmlstring); boost::shared_ptr<CSGObject> shape = ShapeFactory().createShape(xmlstring);
sample.setShape(*shape); sample.setShape(*shape);
m_sampleObject = &sample.getShape(); m_sampleObject = &sample.getShape();
......
...@@ -43,7 +43,7 @@ std::string AnyShapeAbsorption::sampleXML() { ...@@ -43,7 +43,7 @@ std::string AnyShapeAbsorption::sampleXML() {
void AnyShapeAbsorption::initialiseCachedDistances() { void AnyShapeAbsorption::initialiseCachedDistances() {
// First, check if a 'gauge volume' has been defined. If not, it's the same as // First, check if a 'gauge volume' has been defined. If not, it's the same as
// the sample. // the sample.
Object integrationVolume = *m_sampleObject; CSGObject integrationVolume = *m_sampleObject;
if (m_inputWS->run().hasProperty("GaugeVolume")) { if (m_inputWS->run().hasProperty("GaugeVolume")) {
integrationVolume = constructGaugeVolume(); integrationVolume = constructGaugeVolume();
} }
...@@ -120,12 +120,12 @@ void AnyShapeAbsorption::initialiseCachedDistances() { ...@@ -120,12 +120,12 @@ void AnyShapeAbsorption::initialiseCachedDistances() {
YSliceThickness * ZSliceThickness; YSliceThickness * ZSliceThickness;
} }
Geometry::Object AnyShapeAbsorption::constructGaugeVolume() { Geometry::CSGObject AnyShapeAbsorption::constructGaugeVolume() {
g_log.information("Calculating scattering within the gauge volume defined on " g_log.information("Calculating scattering within the gauge volume defined on "
"the input workspace"); "the input workspace");
// Retrieve and create the gauge volume shape // 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()); m_inputWS->run().getProperty("GaugeVolume")->value());
// Although DefineGaugeVolume algorithm will have checked validity of XML, do // Although DefineGaugeVolume algorithm will have checked validity of XML, do
// so again here // so again here
......
...@@ -565,14 +565,14 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular( ...@@ -565,14 +565,14 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
// Define a source component // Define a source component
ObjComponent *source = 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)); source->setPos(V3D(0.0, 0.0, -sourceSampleDistance));
testInst->add(source); testInst->add(source);
testInst->markAsSource(source); testInst->markAsSource(source);
// Add chopper // Add chopper
ObjComponent *chopper = new ObjComponent( 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)); chopper->setPos(V3D(0.0, 0.0, -0.25 * sourceSampleDistance));
testInst->add(chopper); testInst->add(chopper);
......
...@@ -304,12 +304,12 @@ double DetectorEfficiencyCor::calculateOneOverK(double loBinBound, ...@@ -304,12 +304,12 @@ double DetectorEfficiencyCor::calculateOneOverK(double loBinBound,
void DetectorEfficiencyCor::getDetectorGeometry(const Geometry::IDetector &det, void DetectorEfficiencyCor::getDetectorGeometry(const Geometry::IDetector &det,
double &detRadius, double &detRadius,
V3D &detAxis) { V3D &detAxis) {
boost::shared_ptr<const Object> shape_sptr = det.shape(); boost::shared_ptr<const CSGObject> shape_sptr = det.shape();
if (!shape_sptr->hasValidShape()) { if (!shape_sptr->hasValidShape()) {
throw Exception::NotFoundError("Shape", "Detector has no shape"); 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 = std::pair<double, Kernel::V3D>>::const_iterator it =
m_shapeCache.find(shape_sptr.get()); m_shapeCache.find(shape_sptr.get());
if (it == m_shapeCache.end()) { if (it == m_shapeCache.end()) {
...@@ -369,7 +369,7 @@ void DetectorEfficiencyCor::getDetectorGeometry(const Geometry::IDetector &det, ...@@ -369,7 +369,7 @@ void DetectorEfficiencyCor::getDetectorGeometry(const Geometry::IDetector &det,
* @returns The distance to the surface in meters * @returns The distance to the surface in meters
*/ */
double DetectorEfficiencyCor::distToSurface(const V3D &start, 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 // get a vector from the point that was passed to the origin
V3D direction = V3D(0.0, 0.0, 0.0) - start; V3D direction = V3D(0.0, 0.0, 0.0) - start;
// it needs to be a unit vector // it needs to be a unit vector
......
...@@ -167,7 +167,7 @@ API::MatrixWorkspace_sptr HRPDSlabCanAbsorption::runFlatPlateAbsorption() { ...@@ -167,7 +167,7 @@ API::MatrixWorkspace_sptr HRPDSlabCanAbsorption::runFlatPlateAbsorption() {
NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()),
static_cast<uint16_t>(0), 0.0, 0.0, sigma_s, 0.0, static_cast<uint16_t>(0), 0.0, 0.0, sigma_s, 0.0,
sigma_s, sigma_atten); sigma_s, sigma_atten);
Object shape = m_inputWS->sample().getShape(); // copy CSGObject shape = m_inputWS->sample().getShape(); // copy
shape.setMaterial(Material("SetInSphericalAbsorption", neutron, rho)); shape.setMaterial(Material("SetInSphericalAbsorption", neutron, rho));
m_inputWS->mutableSample().setShape(shape); m_inputWS->mutableSample().setShape(shape);
} }
......
...@@ -258,7 +258,7 @@ He3TubeEfficiency::calculateExponential(std::size_t spectraIndex, ...@@ -258,7 +258,7 @@ He3TubeEfficiency::calculateExponential(std::size_t spectraIndex,
void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det,
double &detRadius, double &detRadius,
Kernel::V3D &detAxis) { 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) { if (!shape_sptr) {
throw std::runtime_error( throw std::runtime_error(
"Detector geometry error: detector with id: " + "Detector geometry error: detector with id: " +
...@@ -267,7 +267,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, ...@@ -267,7 +267,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det,
"The algorithm works for instruments with one-to-one " "The algorithm works for instruments with one-to-one "
"spectra-to-detector maps only!"); "spectra-to-detector maps only!");
} }
std::map<const Geometry::Object *, std::map<const Geometry::CSGObject *,
std::pair<double, Kernel::V3D>>::const_iterator it = std::pair<double, Kernel::V3D>>::const_iterator it =
this->shapeCache.find(shape_sptr.get()); this->shapeCache.find(shape_sptr.get());
if (it == this->shapeCache.end()) { if (it == this->shapeCache.end()) {
...@@ -281,7 +281,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, ...@@ -281,7 +281,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det,
// assume radii in z and x and the axis is in the y // assume radii in z and x and the axis is in the y
PARALLEL_CRITICAL(deteff_shapecachea) { PARALLEL_CRITICAL(deteff_shapecachea) {
this->shapeCache.insert( 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(), shape_sptr.get(),
std::pair<double, Kernel::V3D>(detRadius, detAxis))); std::pair<double, Kernel::V3D>(detRadius, detAxis)));
} }
...@@ -296,7 +296,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, ...@@ -296,7 +296,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det,
// and the axis is perpendicular, in the x direction // and the axis is perpendicular, in the x direction
PARALLEL_CRITICAL(deteff_shapecacheb) { PARALLEL_CRITICAL(deteff_shapecacheb) {
this->shapeCache.insert( 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(), shape_sptr.get(),
std::pair<double, Kernel::V3D>(detRadius, detAxis))); std::pair<double, Kernel::V3D>(detRadius, detAxis)));
} }
...@@ -308,7 +308,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, ...@@ -308,7 +308,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det,
detAxis = Kernel::V3D(0, 0, 1); detAxis = Kernel::V3D(0, 0, 1);
PARALLEL_CRITICAL(deteff_shapecachec) { PARALLEL_CRITICAL(deteff_shapecachec) {
this->shapeCache.insert( 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(), shape_sptr.get(),
std::pair<double, Kernel::V3D>(detRadius, detAxis))); std::pair<double, Kernel::V3D>(detRadius, detAxis)));
} }
...@@ -333,7 +333,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det, ...@@ -333,7 +333,7 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det,
* @returns The distance to the surface in metres * @returns The distance to the surface in metres
*/ */
double He3TubeEfficiency::distToSurface(const Kernel::V3D start, 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 // get a vector from the point that was passed to the origin
Kernel::V3D direction = Kernel::V3D(0.0, 0.0, 0.0) - start; Kernel::V3D direction = Kernel::V3D(0.0, 0.0, 0.0) - start;
// it needs to be a unit vector // it needs to be a unit vector
......
...@@ -140,7 +140,7 @@ void MultipleScatteringCylinderAbsorption::exec() { ...@@ -140,7 +140,7 @@ void MultipleScatteringCylinderAbsorption::exec() {
NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()),
static_cast<uint16_t>(0), 0.0, 0.0, coeff3, 0.0, coeff3, static_cast<uint16_t>(0), 0.0, 0.0, coeff3, 0.0, coeff3,
coeff1); coeff1);
Object shape = in_WS->sample().getShape(); // copy CSGObject shape = in_WS->sample().getShape(); // copy
shape.setMaterial(Material("SetInMultipleScattering", neutron, coeff2)); shape.setMaterial(Material("SetInMultipleScattering", neutron, coeff2));
in_WS->mutableSample().setShape(shape); in_WS->mutableSample().setShape(shape);
} }
......
...@@ -287,7 +287,7 @@ void SofQWNormalisedPolygon::initAngularCachesNonPSD( ...@@ -287,7 +287,7 @@ void SofQWNormalisedPolygon::initAngularCachesNonPSD(
* The angular width is computed using the l2 distance from the sample * The angular width is computed using the l2 distance from the sample
*/ */
Kernel::V3D pos; 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 shape; // Defined in its own reference frame with centre at 0,0,0
Kernel::Quat rot; Kernel::Quat rot;
......
...@@ -124,7 +124,7 @@ void SphericalAbsorption::retrieveBaseProperties() { ...@@ -124,7 +124,7 @@ void SphericalAbsorption::retrieveBaseProperties() {
NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()), NeutronAtom neutron(static_cast<uint16_t>(EMPTY_DBL()),
static_cast<uint16_t>(0), 0.0, 0.0, sigma_s, 0.0, static_cast<uint16_t>(0), 0.0, 0.0, sigma_s, 0.0,
sigma_s, sigma_atten); sigma_s, sigma_atten);
Object shape = m_inputWS->sample().getShape(); // copy CSGObject shape = m_inputWS->sample().getShape(); // copy
shape.setMaterial(Material("SetInSphericalAbsorption", neutron, rho)); shape.setMaterial(Material("SetInSphericalAbsorption", neutron, rho));
m_inputWS->mutableSample().setShape(shape); m_inputWS->mutableSample().setShape(shape);
} }
......
...@@ -121,7 +121,7 @@ private: ...@@ -121,7 +121,7 @@ private:
// convert into a Geometry object // convert into a Geometry object
bool addTypeTag = true; bool addTypeTag = true;
boost::shared_ptr<Object> shape =