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

ShapeFactory returns IObject. Re #12827

parent 12593ae3
......@@ -342,7 +342,7 @@ public:
obj_str << "<radius val=\"0.1\" />";
obj_str << "<height val=\"0.2\" />";
obj_str << "</cylinder>";
boost::shared_ptr<CSGObject> s =
auto s =
Mantid::Geometry::ShapeFactory().createShape(obj_str.str());
ObjCompAssembly bank("BankName");
......@@ -379,7 +379,7 @@ public:
obj_str << "<radius val=\"0.1\" />";
obj_str << "<height val=\"0.2\" />";
obj_str << "</segmented-cylinder>";
boost::shared_ptr<CSGObject> s =
auto s =
Mantid::Geometry::ShapeFactory().createShape(obj_str.str());
ObjCompAssembly bank("BankName");
......
......@@ -86,7 +86,7 @@ public:
}
void testFullConstructor() {
boost::shared_ptr<Geometry::CSGObject> cuboidShape =
auto cuboidShape =
ComponentCreationHelper::createCuboid(0.5);
RectangularDetector *det = new RectangularDetector("MyRectangle");
......@@ -202,7 +202,7 @@ public:
* resizes it.
*/
void testResizingParameter() {
boost::shared_ptr<Geometry::CSGObject> cuboidShape =
auto cuboidShape =
ComponentCreationHelper::createCuboid(0.5);
RectangularDetector *det = new RectangularDetector("MyRectangle");
......
......@@ -7,6 +7,7 @@
#include "MantidGeometry/Objects/ShapeFactory.h"
#include "MantidKernel/make_unique.h"
#include <boost/make_shared.hpp>
#include "MantidTestHelpers/ComponentCreationHelper.h"
using Mantid::Geometry::SampleEnvironmentFactory;
......@@ -91,11 +92,11 @@ private:
using namespace Mantid::Kernel;
ShapeFactory factory;
auto small = factory.createShape<Container>(
ComponentCreationHelper::sphereXML(0.004, V3D(), "sp-1"));
auto small = boost::make_shared<Container>(factory.createShape(
ComponentCreationHelper::sphereXML(0.004, V3D(), "sp-1")));
small->setID("8mm");
auto large = factory.createShape<Container>(
ComponentCreationHelper::sphereXML(0.005, V3D(), "sp-2"));
auto large = boost::make_shared<Container>(factory.createShape(
ComponentCreationHelper::sphereXML(0.005, V3D(), "sp-2")));
large->setID("10mm");
// Prepare a sample environment spec
......
......@@ -56,11 +56,11 @@ public:
using Mantid::Kernel::V3D;
ShapeFactory factory;
auto small = factory.createShape<Container>(
ComponentCreationHelper::sphereXML(0.004, V3D(), "sp-1"));
auto small = boost::make_shared<Container>(factory.createShape(
ComponentCreationHelper::sphereXML(0.004, V3D(), "sp-1")));
small->setID("8mm");
auto large = factory.createShape<Container>(
ComponentCreationHelper::sphereXML(0.005, V3D(), "sp-2"));
auto large = boost::make_shared<Container>(factory.createShape(
ComponentCreationHelper::sphereXML(0.005, V3D(), "sp-2")));
large->setID("10mm");
SampleEnvironmentSpec spec("CRYO-001");
......
......@@ -186,8 +186,8 @@ private:
// at centre
ShapeFactory factory;
auto can = factory.createShape<Container>(
ComponentCreationHelper::sphereXML(0.01, V3D(0, 0, 0), "sp-1"));
auto can = boost::make_shared<Container>(factory.createShape(
ComponentCreationHelper::sphereXML(0.01, V3D(0, 0, 0), "sp-1")));
can->setID("8mm");
auto kit = boost::make_shared<SampleEnvironment>("TestKit", can);
// before sample
......
......@@ -33,7 +33,7 @@ public:
xmlShape += "</cuboid> ";
xmlShape += "<algebra val=\"shape\" /> ";
boost::shared_ptr<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr = sFactory.createShape(xmlShape);
auto 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<CSGObject> shape_sptr = getObject(xmlShape);
auto 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<CSGObject> shape_sptr =
auto 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<CSGObject> shape_sptr =
auto 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<CSGObject> shape_sptr =
auto shape_sptr =
getObject(xmlShape); // should return empty object
TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 1)));
}
boost::shared_ptr<CSGObject> getObject(std::string xmlShape) {
IObject_sptr 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<CSGObject> shape_sptr = sFactory.createShape(pRootElem);
auto shape_sptr = sFactory.createShape(pRootElem);
return shape_sptr;
}
......
......@@ -116,7 +116,7 @@ public:
}
void testFullConstructor() {
boost::shared_ptr<Geometry::CSGObject> cuboidShape =
auto cuboidShape =
ComponentCreationHelper::createCuboid(0.5);
StructuredDetector *det = new StructuredDetector("MyStructuredDetector");
......@@ -155,7 +155,7 @@ public:
}
void testIncorrectVertexArraySize() {
boost::shared_ptr<Geometry::CSGObject> cuboidShape =
auto cuboidShape =
ComponentCreationHelper::createCuboid(0.5);
StructuredDetector *det = new StructuredDetector("MyStructuredDetector");
......
......@@ -200,7 +200,7 @@ private:
"frame"));
Detector *det1 = new Detector("det1", g_test_id, instrument.get());
if (addDetShape == WithDetShape) {
Object_sptr shape = ComponentCreationHelper::createCappedCylinder(
auto shape = ComponentCreationHelper::createCappedCylinder(
0.012, 0.01, detPos, V3D(0, 1, 0), "cyl");
det1->setShape(shape);
}
......@@ -216,9 +216,9 @@ private:
ObjComponent *samplePos = new ObjComponent("samplePos");
instrument->add(samplePos);
instrument->markAsSamplePos(samplePos);
Object_sptr sampleShape =
auto sampleShape =
ComponentCreationHelper::createCuboid(0.1, 0.2, 0.3);
m_expt->mutableSample().setShape(*sampleShape);
m_expt->mutableSample().setShape(sampleShape);
if (addChopper == WithChopper) {
ObjComponent *chopper = new ObjComponent("firstChopperPos");
......@@ -230,7 +230,7 @@ private:
if (addAperture == WithAperture) {
ObjComponent *aperture = new ObjComponent("aperture");
aperture->setPos(m_aperturePos);
Object_sptr shape =
auto shape =
ComponentCreationHelper::createCuboid(0.04, 0.025, 0.05);
aperture->setShape(shape);
instrument->add(aperture);
......
......@@ -47,7 +47,7 @@ private:
"frame"));
Detector *det1 = new Detector("det1", 1, instrument.get());
const V3D detPos(1, 1, 1);
Object_sptr shape = ComponentCreationHelper::createCappedCylinder(
auto shape = ComponentCreationHelper::createCappedCylinder(
0.012, 0.01, detPos, V3D(0, 1, 0), "cyl");
det1->setShape(shape);
instrument->add(det1);
......
......@@ -151,7 +151,7 @@ private:
ObjComponent *aperture = new ObjComponent("aperture");
aperture->setPos(V3D(0.0, 0.0, -10.01));
Object_sptr shape =
auto shape =
ComponentCreationHelper::createCuboid(0.047, 0.047, 0.001);
aperture->setShape(shape);
instrument->add(aperture);
......
......@@ -108,9 +108,9 @@ private:
expt->setModeratorModel(sourceDescr);
// Sample size
Mantid::Geometry::Object_sptr sampleShape =
auto sampleShape =
ComponentCreationHelper::createCuboid(0.04, 0.025, 0.05);
expt->mutableSample().setShape(*sampleShape);
expt->mutableSample().setShape(sampleShape);
// OrientedLattice
OrientedLattice *latticeRotation = new OrientedLattice;
......@@ -139,7 +139,7 @@ private:
ObjComponent *aperture = new ObjComponent("aperture");
aperture->setPos(V3D(0.0, 0.0, -10.01));
Object_sptr shape =
auto shape =
ComponentCreationHelper::createCuboid(0.047, 0.047, 0.001);
aperture->setShape(shape);
instrument->add(aperture);
......
......@@ -71,7 +71,7 @@ std::string cappedCylinderXML(double radius, double height,
/**
* Create a capped cylinder object
*/
Mantid::Geometry::Object_sptr
Mantid::Geometry::IObject_sptr
createCappedCylinder(double radius, double height,
const Mantid::Kernel::V3D &baseCentre,
const Mantid::Kernel::V3D &axis, const std::string &id);
......@@ -83,12 +83,12 @@ std::string sphereXML(double radius, const Mantid::Kernel::V3D &centre,
/**
* Create a sphere object
*/
Mantid::Geometry::Object_sptr
Mantid::Geometry::IObject_sptr
createSphere(double radius,
const Mantid::Kernel::V3D &centre = Mantid::Kernel::V3D(),
const std::string &id = "sp-1");
/** Create a cuboid shape for your pixels */
Mantid::Geometry::Object_sptr createCuboid(double x_side_length,
Mantid::Geometry::IObject_sptr createCuboid(double x_side_length,
double y_side_length = -1.0,
double z_side_length = -1.0);
/**
......@@ -104,7 +104,7 @@ Mantid::Geometry::ObjComponent *createSingleObjectComponent();
* Create a hollow shell, i.e. the intersection of two spheres or radius r1 and
* r2
*/
Mantid::Geometry::Object_sptr
Mantid::Geometry::IObject_sptr
createHollowShell(double innerRadius, double outerRadius,
const Mantid::Kernel::V3D &centre = Mantid::Kernel::V3D());
/**
......
......@@ -59,7 +59,7 @@ std::string cappedCylinderXML(double radius, double height,
/**
* Create a capped cylinder object
*/
Object_sptr createCappedCylinder(double radius, double height,
IObject_sptr createCappedCylinder(double radius, double height,
const V3D &baseCentre, const V3D &axis,
const std::string &id) {
return ShapeFactory().createShape(
......@@ -84,7 +84,7 @@ std::string sphereXML(double radius, const V3D &centre, const std::string &id) {
/**
* Create a sphere object
*/
Object_sptr createSphere(double radius, const V3D &centre,
IObject_sptr createSphere(double radius, const V3D &centre,
const std::string &id) {
ShapeFactory shapeMaker;
return shapeMaker.createShape(sphereXML(radius, centre, id));
......@@ -92,7 +92,7 @@ Object_sptr createSphere(double radius, const V3D &centre,
//----------------------------------------------------------------------------------------------
/** Create a cuboid shape for your pixels */
Object_sptr createCuboid(double x_side_length, double y_side_length,
IObject_sptr createCuboid(double x_side_length, double y_side_length,
double z_side_length) {
double szX = x_side_length;
double szY = (y_side_length == -1.0 ? szX : y_side_length);
......@@ -111,7 +111,7 @@ Object_sptr createCuboid(double x_side_length, double y_side_length,
std::string xmlCuboidShape(xmlShapeStream.str());
ShapeFactory shapeCreator;
Object_sptr cuboidShape = shapeCreator.createShape(xmlCuboidShape);
auto cuboidShape = shapeCreator.createShape(xmlCuboidShape);
return cuboidShape;
}
......@@ -123,7 +123,7 @@ boost::shared_ptr<CompAssembly> createTestAssemblyOfFourCylinders() {
boost::shared_ptr<CompAssembly> bank =
boost::make_shared<CompAssembly>("BankName");
// One object
Object_sptr pixelShape = ComponentCreationHelper::createCappedCylinder(
auto pixelShape = ComponentCreationHelper::createCappedCylinder(
0.5, 1.5, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
// Four object components
for (size_t i = 1; i < 5; ++i) {
......@@ -139,7 +139,7 @@ boost::shared_ptr<CompAssembly> createTestAssemblyOfFourCylinders() {
* Create an object component that has a defined shape
*/
ObjComponent *createSingleObjectComponent() {
Object_sptr pixelShape = ComponentCreationHelper::createCappedCylinder(
auto pixelShape = ComponentCreationHelper::createCappedCylinder(
0.5, 1.5, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
return new ObjComponent("pixel", pixelShape);
}
......@@ -148,7 +148,7 @@ ObjComponent *createSingleObjectComponent() {
* Create a hollow shell, i.e. the intersection of two spheres or radius r1 and
* r2
*/
Object_sptr createHollowShell(double innerRadius, double outerRadius,
IObject_sptr createHollowShell(double innerRadius, double outerRadius,
const V3D &centre) {
std::string wholeXML = sphereXML(innerRadius, centre, "inner") + "\n" +
sphereXML(outerRadius, centre, "outer") + "\n" +
......@@ -167,7 +167,7 @@ createDetectorGroupWith5CylindricalDetectors() {
const int ndets = 5;
std::vector<boost::shared_ptr<const IDetector>> groupMembers(ndets);
// One object
Object_sptr detShape = ComponentCreationHelper::createCappedCylinder(
auto detShape = ComponentCreationHelper::createCappedCylinder(
0.5, 1.5, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
for (int i = 0; i < ndets; ++i) {
std::ostringstream os;
......@@ -190,7 +190,7 @@ createDetectorGroupWithNCylindricalDetectorsWithGaps(unsigned int nDet,
std::vector<boost::shared_ptr<const IDetector>> groupMembers(nDet);
// One object
Object_sptr detShape = ComponentCreationHelper::createCappedCylinder(
auto detShape = ComponentCreationHelper::createCappedCylinder(
0.5, 1.5, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
for (unsigned int i = 0; i < nDet; ++i) {
std::ostringstream os;
......@@ -210,7 +210,7 @@ createVectorOfCylindricalDetectors(const double R_min, const double R_max,
// One object
double R0 = 0.5;
double h = 1.5;
Object_sptr detShape = ComponentCreationHelper::createCappedCylinder(
auto detShape = ComponentCreationHelper::createCappedCylinder(
R0, h, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
int NY = int(ceil(2 * R_max / h) + 1);
......@@ -266,7 +266,7 @@ Instrument_sptr createTestInstrumentCylindrical(
auto testInst = boost::make_shared<Instrument>("basic");
// One object
Object_sptr pixelShape = ComponentCreationHelper::createCappedCylinder(
auto pixelShape = ComponentCreationHelper::createCappedCylinder(
cylRadius, cylHeight, V3D(0.0, -cylHeight / 2.0, 0.0), V3D(0., 1.0, 0.),
"pixel-shape");
......@@ -307,7 +307,7 @@ Instrument_sptr createTestInstrumentCylindrical(
testInst->markAsSource(source);
// Define a sample as a simple sphere
Object_sptr sampleSphere =
auto sampleSphere =
createSphere(0.001, V3D(0.0, 0.0, 0.0), "sample-shape");
ObjComponent *sample =
new ObjComponent("sample", sampleSphere, testInst.get());
......@@ -369,7 +369,7 @@ createCylInstrumentWithDetInGivenPositions(const std::vector<double> &L2,
cylHeight = 2 * L2_min * sin(dPol_min * 0.5);
// One object
Object_sptr pixelShape = ComponentCreationHelper::createCappedCylinder(
auto pixelShape = ComponentCreationHelper::createCappedCylinder(
cylRadius, cylHeight, V3D(0.0, -cylHeight / 2.0, 0.0), V3D(0., 1.0, 0.),
"pixel-shape");
// Just increment pixel ID's
......@@ -399,7 +399,7 @@ createCylInstrumentWithDetInGivenPositions(const std::vector<double> &L2,
testInst->markAsSource(source);
// Define a sample as a simple sphere
Object_sptr sampleSphere =
auto sampleSphere =
createSphere(cylRadius, V3D(0.0, 0.0, 0.0), "sample-shape");
ObjComponent *sample =
new ObjComponent("sample", sampleSphere, testInst.get());
......@@ -419,7 +419,7 @@ void addRectangularBank(Instrument &testInstrument, int idStart, int pixels,
const double cylRadius(pixelSpacing / 2);
const double cylHeight(0.0002);
// One object
Object_sptr pixelShape = ComponentCreationHelper::createCappedCylinder(
auto pixelShape = ComponentCreationHelper::createCappedCylinder(
cylRadius, cylHeight, V3D(0.0, -cylHeight / 2.0, 0.0), V3D(0., 1.0, 0.),
"pixel-shape");
......@@ -479,7 +479,7 @@ Instrument_sptr createTestInstrumentRectangular(int num_banks, int pixels,
testInst->markAsSource(source);
// Define a sample as a simple sphere
Object_sptr sampleSphere =
auto sampleSphere =
createSphere(0.001, V3D(0.0, 0.0, 0.0), "sample-shape");
ObjComponent *sample =
new ObjComponent("sample", sampleSphere, testInst.get());
......@@ -510,7 +510,7 @@ Instrument_sptr createTestInstrumentRectangular2(int num_banks, int pixels,
const double cylRadius(pixelSpacing / 2);
const double cylHeight(0.0002);
// One object
Object_sptr pixelShape = ComponentCreationHelper::createCappedCylinder(
auto pixelShape = ComponentCreationHelper::createCappedCylinder(
cylRadius, cylHeight, V3D(0.0, -cylHeight / 2.0, 0.0), V3D(0., 1.0, 0.),
"pixel-shape");
......@@ -549,7 +549,7 @@ Instrument_sptr createTestInstrumentRectangular2(int num_banks, int pixels,
testInst->markAsSource(source);