Commit 81c5b9af authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

ShapeFactory returns IObject. Re #12827

parent 12593ae3
...@@ -70,11 +70,11 @@ private: ...@@ -70,11 +70,11 @@ private:
API::Progress &progress, int numBanks, int numMonitors, int pixels, API::Progress &progress, int numBanks, int numMonitors, int pixels,
double pixelSpacing, const double bankDistanceFromSample, double pixelSpacing, const double bankDistanceFromSample,
const double sourceSampleDistance); const double sourceSampleDistance);
Geometry::Object_sptr createCappedCylinder(double radius, double height, Geometry::IObject_sptr createCappedCylinder(double radius, double height,
const Kernel::V3D &baseCentre, const Kernel::V3D &baseCentre,
const Kernel::V3D &axis, const Kernel::V3D &axis,
const std::string &id); const std::string &id);
Geometry::Object_sptr createSphere(double radius, const Kernel::V3D &centre, Geometry::IObject_sptr createSphere(double radius, const Kernel::V3D &centre,
const std::string &id); const std::string &id);
std::vector<double> evalFunction(const std::string &functionString, std::vector<double> evalFunction(const std::string &functionString,
const std::vector<double> &xVal, const std::vector<double> &xVal,
......
...@@ -504,7 +504,7 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular( ...@@ -504,7 +504,7 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
const double cylRadius(pixelSpacing / 2); const double cylRadius(pixelSpacing / 2);
const double cylHeight(0.0002); const double cylHeight(0.0002);
// One object // One object
Object_sptr pixelShape = createCappedCylinder( auto pixelShape = createCappedCylinder(
cylRadius, cylHeight, V3D(0.0, -cylHeight / 2.0, 0.0), V3D(0., 1.0, 0.), cylRadius, cylHeight, V3D(0.0, -cylHeight / 2.0, 0.0), V3D(0., 1.0, 0.),
"pixel-shape"); "pixel-shape");
...@@ -537,7 +537,7 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular( ...@@ -537,7 +537,7 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
int monitorsStart = (numBanks + 1) * pixels * pixels; int monitorsStart = (numBanks + 1) * pixels * pixels;
Object_sptr monitorShape = auto monitorShape =
createCappedCylinder(0.1, 0.1, V3D(0.0, -cylHeight / 2.0, 0.0), createCappedCylinder(0.1, 0.1, V3D(0.0, -cylHeight / 2.0, 0.0),
V3D(0., 1.0, 0.), "monitor-shape"); V3D(0., 1.0, 0.), "monitor-shape");
...@@ -577,7 +577,7 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular( ...@@ -577,7 +577,7 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
testInst->add(chopper); testInst->add(chopper);
// Define a sample as a simple sphere // Define a sample as a simple sphere
Object_sptr sampleSphere = auto sampleSphere =
createSphere(0.001, V3D(0.0, 0.0, 0.0), "sample-shape"); createSphere(0.001, V3D(0.0, 0.0, 0.0), "sample-shape");
ObjComponent *sample = ObjComponent *sample =
new ObjComponent("sample", sampleSphere, testInst.get()); new ObjComponent("sample", sampleSphere, testInst.get());
...@@ -592,7 +592,7 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular( ...@@ -592,7 +592,7 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
/** /**
* Create a capped cylinder object * Create a capped cylinder object
*/ */
Object_sptr CreateSampleWorkspace::createCappedCylinder(double radius, IObject_sptr CreateSampleWorkspace::createCappedCylinder(double radius,
double height, double height,
const V3D &baseCentre, const V3D &baseCentre,
const V3D &axis, const V3D &axis,
...@@ -616,7 +616,7 @@ Object_sptr CreateSampleWorkspace::createCappedCylinder(double radius, ...@@ -616,7 +616,7 @@ Object_sptr CreateSampleWorkspace::createCappedCylinder(double radius,
/** /**
* Create a sphere object * Create a sphere object
*/ */
Object_sptr CreateSampleWorkspace::createSphere(double radius, IObject_sptr CreateSampleWorkspace::createSphere(double radius,
const V3D &centre, const V3D &centre,
const std::string &id) { const std::string &id) {
ShapeFactory shapeMaker; ShapeFactory shapeMaker;
......
...@@ -153,7 +153,7 @@ modelHistogram(const API::MatrixWorkspace &modelWS, ...@@ -153,7 +153,7 @@ modelHistogram(const API::MatrixWorkspace &modelWS,
/** Creates a rectangular cuboid shape. /** Creates a rectangular cuboid shape.
* @return A cube shape. * @return A cube shape.
*/ */
Geometry::Object_sptr makeCubeShape() { Geometry::IObject_sptr makeCubeShape() {
using namespace Poco::XML; using namespace Poco::XML;
const double dimension = 0.05; const double dimension = 0.05;
AutoPtr<Document> shapeDescription = new Document; AutoPtr<Document> shapeDescription = new Document;
......
...@@ -682,7 +682,7 @@ private: ...@@ -682,7 +682,7 @@ private:
// Geometry::ReferenceFrame(Geometry::PointingAlong::Y,Geometry::X,Geometry::Left,""))); // Geometry::ReferenceFrame(Geometry::PointingAlong::Y,Geometry::X,Geometry::Left,"")));
const double pixelRadius(0.05); const double pixelRadius(0.05);
Geometry::Object_sptr pixelShape = auto pixelShape =
ComponentCreationHelper::createCappedCylinder( ComponentCreationHelper::createCappedCylinder(
pixelRadius, 0.02, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube"); pixelRadius, 0.02, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
......
...@@ -43,16 +43,16 @@ public: ...@@ -43,16 +43,16 @@ public:
auto canShape = ComponentCreationHelper::cappedCylinderXML( auto canShape = ComponentCreationHelper::cappedCylinderXML(
0.5, 1.5, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube"); 0.5, 1.5, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
SampleEnvironment *kit = new SampleEnvironment( SampleEnvironment *kit = new SampleEnvironment(
envName, ShapeFactory().createShape<Container>(canShape)); envName, boost::make_shared<Container>(ShapeFactory().createShape(canShape)));
sample.setEnvironment(kit); sample.setEnvironment(kit);
OrientedLattice *latt = new OrientedLattice(1.0, 2.0, 3.0, 90, 90, 90); OrientedLattice *latt = new OrientedLattice(1.0, 2.0, 3.0, 90, 90, 90);
sample.setOrientedLattice(latt); sample.setOrientedLattice(latt);
delete latt; delete latt;
Object_sptr shape_sptr = ComponentCreationHelper::createCappedCylinder( auto shape_sptr = ComponentCreationHelper::createCappedCylinder(
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");
shape_sptr->setMaterial(Material( shape_sptr->setMaterial(Material(
"vanBlock", Mantid::PhysicalConstants::getNeutronAtom(23, 0), 0.072)); "vanBlock", Mantid::PhysicalConstants::getNeutronAtom(23, 0), 0.072));
sample.setShape(*shape_sptr); sample.setShape(shape_sptr);
return sample; return sample;
} }
......
...@@ -131,7 +131,7 @@ private: ...@@ -131,7 +131,7 @@ private:
// Pixel shape // Pixel shape
const double pixelRadius(0.01); const double pixelRadius(0.01);
const double pixelHeight(0.003); const double pixelHeight(0.003);
Object_sptr pixelShape = ComponentCreationHelper::createCappedCylinder( auto pixelShape = ComponentCreationHelper::createCappedCylinder(
pixelRadius, pixelHeight, V3D(0.0, -0.5 * pixelHeight, 0.0), pixelRadius, pixelHeight, V3D(0.0, -0.5 * pixelHeight, 0.0),
V3D(0.0, 1.0, 0.0), "pixelShape"); V3D(0.0, 1.0, 0.0), "pixelShape");
for (int i = 0; i < nTubes; ++i) { for (int i = 0; i < nTubes; ++i) {
......
...@@ -67,9 +67,9 @@ public: ...@@ -67,9 +67,9 @@ public:
testWS->getAxis(0)->unit() = testWS->getAxis(0)->unit() =
Mantid::Kernel::UnitFactory::Instance().create("Wavelength"); Mantid::Kernel::UnitFactory::Instance().create("Wavelength");
// Define a sample shape // Define a sample shape
Object_sptr sampleShape = auto sampleShape =
ComponentCreationHelper::createCuboid(0.005, 0.003, 0.002); ComponentCreationHelper::createCuboid(0.005, 0.003, 0.002);
testWS->mutableSample().setShape(*sampleShape); testWS->mutableSample().setShape(sampleShape);
Mantid::Algorithms::CuboidGaugeVolumeAbsorption abs; Mantid::Algorithms::CuboidGaugeVolumeAbsorption abs;
abs.initialize(); abs.initialize();
...@@ -96,9 +96,9 @@ public: ...@@ -96,9 +96,9 @@ public:
testWS->getAxis(0)->unit() = testWS->getAxis(0)->unit() =
Mantid::Kernel::UnitFactory::Instance().create("Wavelength"); Mantid::Kernel::UnitFactory::Instance().create("Wavelength");
// Define a sample shape // Define a sample shape
Object_sptr sampleShape = auto sampleShape =
ComponentCreationHelper::createCuboid(0.025, 0.03, 0.02); ComponentCreationHelper::createCuboid(0.025, 0.03, 0.02);
testWS->mutableSample().setShape(*sampleShape); testWS->mutableSample().setShape(sampleShape);
TS_ASSERT_THROWS_NOTHING( TS_ASSERT_THROWS_NOTHING(
atten.setProperty<MatrixWorkspace_sptr>("InputWorkspace", testWS)); atten.setProperty<MatrixWorkspace_sptr>("InputWorkspace", testWS));
......
...@@ -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<CSGObject> shape = auto shape =
ShapeFactory().createShape(xmlShape, addTypeTag); ShapeFactory().createShape(xmlShape, addTypeTag);
boost::shared_ptr<Instrument> instrument = boost::make_shared<Instrument>(); boost::shared_ptr<Instrument> instrument = boost::make_shared<Instrument>();
......
...@@ -137,7 +137,7 @@ public: ...@@ -137,7 +137,7 @@ public:
MCInteractionVolume mcv(sample, sample.getShape().getBoundingBox()), MCInteractionVolume mcv(sample, sample.getShape().getBoundingBox()),
std::invalid_argument); std::invalid_argument);
// valid shape // valid shape
sample.setShape(*ComponentCreationHelper::createSphere(1)); sample.setShape(ComponentCreationHelper::createSphere(1));
TS_ASSERT_THROWS_NOTHING( TS_ASSERT_THROWS_NOTHING(
MCInteractionVolume mcv(sample, sample.getShape().getBoundingBox())); MCInteractionVolume mcv(sample, sample.getShape().getBoundingBox()));
} }
......
...@@ -136,7 +136,7 @@ private: ...@@ -136,7 +136,7 @@ private:
createCappedCylinder(radius, height, V3D(), V3D(0., 1., 0.), "sample"); createCappedCylinder(radius, height, V3D(), V3D(0., 1., 0.), "sample");
const double numberDensity(0.07261); const double numberDensity(0.07261);
cylinder->setMaterial(Material("V", getNeutronAtom(23), numberDensity)); cylinder->setMaterial(Material("V", getNeutronAtom(23), numberDensity));
testWS->mutableSample().setShape(*cylinder); testWS->mutableSample().setShape(cylinder);
// Move the detector to a known position // Move the detector to a known position
const double twoTheta = 0.10821; const double twoTheta = 0.10821;
......
...@@ -37,12 +37,12 @@ void addSample(Mantid::API::MatrixWorkspace_sptr ws, ...@@ -37,12 +37,12 @@ void addSample(Mantid::API::MatrixWorkspace_sptr ws,
namespace PhysicalConstants = Mantid::PhysicalConstants; namespace PhysicalConstants = Mantid::PhysicalConstants;
// Define a sample shape // Define a sample shape
Object_sptr sampleShape = auto sampleShape =
ComponentCreationHelper::createSphere(0.1, V3D(), "sample-sphere"); ComponentCreationHelper::createSphere(0.1, V3D(), "sample-sphere");
// And a material // And a material
sampleShape->setMaterial( sampleShape->setMaterial(
Material("Vanadium", PhysicalConstants::getNeutronAtom(23, 0), 0.072)); Material("Vanadium", PhysicalConstants::getNeutronAtom(23, 0), 0.072));
ws->mutableSample().setShape(*sampleShape); ws->mutableSample().setShape(sampleShape);
if (environment == Environment::SamplePlusContainer) { if (environment == Environment::SamplePlusContainer) {
const std::string id("container"); const std::string id("container");
...@@ -52,9 +52,9 @@ void addSample(Mantid::API::MatrixWorkspace_sptr ws, ...@@ -52,9 +52,9 @@ void addSample(Mantid::API::MatrixWorkspace_sptr ws,
const V3D axis(0.0, 1.0, 0.0); const V3D axis(0.0, 1.0, 0.0);
ShapeFactory shapeMaker; ShapeFactory shapeMaker;
auto can = shapeMaker.createShape<Container>( auto can = boost::make_shared<Container>(shapeMaker.createShape(
ComponentCreationHelper::cappedCylinderXML(radius, height, baseCentre, ComponentCreationHelper::cappedCylinderXML(radius, height, baseCentre,
axis, id)); axis, id)));
can->setMaterial(Material("CanMaterial", can->setMaterial(Material("CanMaterial",
PhysicalConstants::getNeutronAtom(26, 0), 0.01)); PhysicalConstants::getNeutronAtom(26, 0), 0.01));
SampleEnvironment *env = new SampleEnvironment("can", can); SampleEnvironment *env = new SampleEnvironment("can", can);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "MantidKernel/make_unique.h" #include "MantidKernel/make_unique.h"
#include "MantidTestHelpers/ComponentCreationHelper.h" #include "MantidTestHelpers/ComponentCreationHelper.h"
#include <boost/make_shared.hpp>
#include <gmock/gmock.h> #include <gmock/gmock.h>
/* /*
...@@ -68,7 +69,7 @@ inline std::string annulusXML(double innerRadius, double outerRadius, ...@@ -68,7 +69,7 @@ inline std::string annulusXML(double innerRadius, double outerRadius,
return os.str(); return os.str();
} }
inline Mantid::Geometry::Object_sptr inline Mantid::Geometry::IObject_sptr
createAnnulus(double innerRadius, double outerRadius, double height, createAnnulus(double innerRadius, double outerRadius, double height,
const Mantid::Kernel::V3D &upAxis) { const Mantid::Kernel::V3D &upAxis) {
using Mantid::Geometry::ShapeFactory; using Mantid::Geometry::ShapeFactory;
...@@ -89,8 +90,8 @@ inline Mantid::API::Sample createSamplePlusContainer() { ...@@ -89,8 +90,8 @@ inline Mantid::API::Sample createSamplePlusContainer() {
const double height(0.05), innerRadius(0.0046), outerRadius(0.005); const double height(0.05), innerRadius(0.0046), outerRadius(0.005);
const V3D centre(0, 0, -0.5 * height), upAxis(0, 0, 1); const V3D centre(0, 0, -0.5 * height), upAxis(0, 0, 1);
// Container // Container
auto can = ShapeFactory().createShape<Container>( auto can = boost::make_shared<Container>(ShapeFactory().createShape(
annulusXML(innerRadius, outerRadius, height, upAxis)); annulusXML(innerRadius, outerRadius, height, upAxis)));
can->setMaterial(Material("Vanadium", getNeutronAtom(23), 0.02)); can->setMaterial(Material("Vanadium", getNeutronAtom(23), 0.02));
auto environment = auto environment =
Mantid::Kernel::make_unique<SampleEnvironment>("Annulus Container", can); Mantid::Kernel::make_unique<SampleEnvironment>("Annulus Container", can);
...@@ -101,7 +102,7 @@ inline Mantid::API::Sample createSamplePlusContainer() { ...@@ -101,7 +102,7 @@ inline Mantid::API::Sample createSamplePlusContainer() {
// Sample object // Sample object
Sample testSample; Sample testSample;
testSample.setShape(*sampleCell); testSample.setShape(sampleCell);
testSample.setEnvironment(environment.release()); testSample.setEnvironment(environment.release());
return testSample; return testSample;
} }
...@@ -110,7 +111,7 @@ inline Mantid::API::Sample createTestSample(TestSampleType sampleType) { ...@@ -110,7 +111,7 @@ inline Mantid::API::Sample createTestSample(TestSampleType sampleType) {
using Mantid::API::Sample; using Mantid::API::Sample;
using Mantid::Kernel::Material; using Mantid::Kernel::Material;
using Mantid::Kernel::V3D; using Mantid::Kernel::V3D;
using Mantid::Geometry::Object_sptr; using Mantid::Geometry::IObject_sptr;
using Mantid::PhysicalConstants::getNeutronAtom; using Mantid::PhysicalConstants::getNeutronAtom;
using namespace Mantid::Geometry; using namespace Mantid::Geometry;
...@@ -119,7 +120,7 @@ inline Mantid::API::Sample createTestSample(TestSampleType sampleType) { ...@@ -119,7 +120,7 @@ inline Mantid::API::Sample createTestSample(TestSampleType sampleType) {
if (sampleType == TestSampleType::SamplePlusContainer) { if (sampleType == TestSampleType::SamplePlusContainer) {
testSample = createSamplePlusContainer(); testSample = createSamplePlusContainer();
} else { } else {
Object_sptr shape; IObject_sptr shape;
if (sampleType == TestSampleType::SolidSphere) { if (sampleType == TestSampleType::SolidSphere) {
shape = ComponentCreationHelper::createSphere(0.1); shape = ComponentCreationHelper::createSphere(0.1);
} else if (sampleType == TestSampleType::Annulus) { } else if (sampleType == TestSampleType::Annulus) {
...@@ -130,7 +131,7 @@ inline Mantid::API::Sample createTestSample(TestSampleType sampleType) { ...@@ -130,7 +131,7 @@ inline Mantid::API::Sample createTestSample(TestSampleType sampleType) {
throw std::invalid_argument("Unknown testing shape type requested"); throw std::invalid_argument("Unknown testing shape type requested");
} }
shape->setMaterial(Material("Vanadium", getNeutronAtom(23), 0.02)); shape->setMaterial(Material("Vanadium", getNeutronAtom(23), 0.02));
testSample.setShape(*shape); testSample.setShape(shape);
} }
return testSample; return testSample;
} }
......
...@@ -89,7 +89,7 @@ public: ...@@ -89,7 +89,7 @@ public:
const V3D center; const V3D center;
RectangularBeamProfile profile(createTestFrame(), center, width, height); RectangularBeamProfile profile(createTestFrame(), center, width, height);
Sample testSample; Sample testSample;
testSample.setShape(*ComponentCreationHelper::createSphere(0.5)); testSample.setShape(ComponentCreationHelper::createSphere(0.5));
auto region = profile.defineActiveRegion(testSample); auto region = profile.defineActiveRegion(testSample);
TS_ASSERT(region.isNonNull()); TS_ASSERT(region.isNonNull());
...@@ -104,7 +104,7 @@ public: ...@@ -104,7 +104,7 @@ public:
const V3D center; const V3D center;
RectangularBeamProfile profile(createTestFrame(), center, width, height); RectangularBeamProfile profile(createTestFrame(), center, width, height);
Sample testSample; Sample testSample;
testSample.setShape(*ComponentCreationHelper::createSphere(0.5)); testSample.setShape(ComponentCreationHelper::createSphere(0.5));
auto region = profile.defineActiveRegion(testSample); auto region = profile.defineActiveRegion(testSample);
TS_ASSERT(region.isNonNull()); TS_ASSERT(region.isNonNull());
......
...@@ -42,8 +42,8 @@ public: ...@@ -42,8 +42,8 @@ public:
double amu = 0.011; double amu = 0.011;
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, smu, 0.0, smu, amu); static_cast<uint16_t>(0), 0.0, 0.0, smu, 0.0, smu, amu);
CSGObject sampleShape; auto sampleShape = boost::make_shared<CSGObject>();
sampleShape.setMaterial(Material("SetInAnvredCorrection", neutron, 1.0)); sampleShape->setMaterial(Material("SetInAnvredCorrection", neutron, 1.0));
ws->mutableSample().setShape(sampleShape); ws->mutableSample().setShape(sampleShape);
API::Run &mrun = ws->mutableRun(); API::Run &mrun = ws->mutableRun();
......
...@@ -40,8 +40,9 @@ public: ...@@ -40,8 +40,9 @@ public:
double amu = 0.011; double amu = 0.011;
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, smu, 0.0, smu, amu); static_cast<uint16_t>(0), 0.0, 0.0, smu, 0.0, smu, amu);
CSGObject sampleShape;
sampleShape.setMaterial(Material("SetInSaveHKLTest", neutron, 1.0)); auto sampleShape = boost::make_shared<CSGObject>();
sampleShape->setMaterial(Material("SetInSaveHKLTest", neutron, 1.0));
ws->mutableSample().setShape(sampleShape); ws->mutableSample().setShape(sampleShape);
API::Run &mrun = ws->mutableRun(); API::Run &mrun = ws->mutableRun();
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <cxxtest/TestSuite.h> #include <cxxtest/TestSuite.h>
#include <fstream> #include <fstream>
#include <Poco/File.h> #include <Poco/File.h>
#include <boost/make_shared.hpp>
using namespace Mantid; using namespace Mantid;
using namespace Mantid::Crystal; using namespace Mantid::Crystal;
...@@ -49,8 +50,8 @@ public: ...@@ -49,8 +50,8 @@ public:
double amu = 0.011; double amu = 0.011;
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, smu, 0.0, smu, amu); static_cast<uint16_t>(0), 0.0, 0.0, smu, 0.0, smu, amu);
CSGObject sampleShape; auto sampleShape = boost::make_shared<CSGObject>();
sampleShape.setMaterial(Material("SetInSaveHKLTest", neutron, 1.0)); sampleShape->setMaterial(Material("SetInSaveHKLTest", neutron, 1.0));
ws->mutableSample().setShape(sampleShape); ws->mutableSample().setShape(sampleShape);
API::Run &mrun = ws->mutableRun(); API::Run &mrun = ws->mutableRun();
......
...@@ -14,7 +14,7 @@ class ISpectrum; ...@@ -14,7 +14,7 @@ class ISpectrum;
} }
namespace Geometry { namespace Geometry {
class CSGObject; class IObject;
} }
namespace CurveFitting { namespace CurveFitting {
...@@ -138,7 +138,7 @@ private: ...@@ -138,7 +138,7 @@ private:
Kernel::V3D m_beamDir; // Directional vector for beam Kernel::V3D m_beamDir; // Directional vector for beam
double m_srcR2; // beam penumbra radius (m) double m_srcR2; // beam penumbra radius (m)
double m_halfSampleHeight, m_halfSampleWidth, m_halfSampleThick; // (m) double m_halfSampleHeight, m_halfSampleWidth, m_halfSampleThick; // (m)
Geometry::CSGObject const *m_sampleShape; // sample shape Geometry::IObject const *m_sampleShape; // sample shape
SampleComptonProperties *m_sampleProps; // description of sample properties SampleComptonProperties *m_sampleProps; // description of sample properties
double m_detHeight, m_detWidth, m_detThick; // (m) double m_detHeight, m_detWidth, m_detThick; // (m)
double m_tmin, m_tmax, m_delt; // min, max & dt TOF value double m_tmin, m_tmax, m_delt; // min, max & dt TOF value
......
...@@ -123,7 +123,7 @@ createFlatPlateSampleWS(const bool detShape = true, ...@@ -123,7 +123,7 @@ createFlatPlateSampleWS(const bool detShape = true,
<< "</cuboid>"; << "</cuboid>";
auto sampleShape = auto sampleShape =
Mantid::Geometry::ShapeFactory().createShape(sampleShapeXML.str()); Mantid::Geometry::ShapeFactory().createShape(sampleShapeXML.str());
testWS->mutableSample().setShape(*sampleShape); testWS->mutableSample().setShape(sampleShape);
return testWS; return testWS;
} }
......
...@@ -567,7 +567,7 @@ private: ...@@ -567,7 +567,7 @@ private:
inst->markAsSamplePos(sample); inst->markAsSamplePos(sample);
// Add a detector // Add a detector
Object_sptr pixelShape = ComponentCreationHelper::createCappedCylinder( auto pixelShape = ComponentCreationHelper::createCappedCylinder(
0.05, 0.02, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube"); 0.05, 0.02, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
Detector *det = Detector *det =
new Detector("pixel-1", 1, pixelShape, new Detector("pixel-1", 1, pixelShape,
......
...@@ -502,7 +502,7 @@ private: ...@@ -502,7 +502,7 @@ private:
inst->markAsSamplePos(sample); inst->markAsSamplePos(sample);
// Add a detector // Add a detector
Object_sptr pixelShape = ComponentCreationHelper::createCappedCylinder( auto pixelShape = ComponentCreationHelper::createCappedCylinder(
0.05, 0.02, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube"); 0.05, 0.02, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
Detector *det = Detector *det =
new Detector("pixel-1", 1, pixelShape, new Detector("pixel-1", 1, pixelShape,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment