Commit cf55d9f2 authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Apply clang format patch. Re #12827

parent 81c5b9af
......@@ -244,7 +244,8 @@ void AbsorptionCorrection::retrieveBaseProperties() {
static_cast<uint16_t>(0), 0.0, 0.0, sigma_s, 0.0,
sigma_s, sigma_atten);
auto shape = boost::shared_ptr<IObject>(m_inputWS->sample().getShape().clone());
auto shape =
boost::shared_ptr<IObject>(m_inputWS->sample().getShape().clone());
shape->setMaterial(Material("SetInAbsorptionCorrection", neutron, rho));
m_inputWS->mutableSample().setShape(shape);
}
......
......@@ -43,7 +43,8 @@ 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.
auto integrationVolume = boost::shared_ptr<const IObject>(m_sampleObject->clone());
auto integrationVolume =
boost::shared_ptr<const IObject>(m_sampleObject->clone());
if (m_inputWS->run().hasProperty("GaugeVolume")) {
integrationVolume = constructGaugeVolume();
}
......@@ -120,7 +121,8 @@ void AnyShapeAbsorption::initialiseCachedDistances() {
YSliceThickness * ZSliceThickness;
}
boost::shared_ptr<const Geometry::IObject> AnyShapeAbsorption::constructGaugeVolume() {
boost::shared_ptr<const Geometry::IObject>
AnyShapeAbsorption::constructGaugeVolume() {
g_log.information("Calculating scattering within the gauge volume defined on "
"the input workspace");
......
......@@ -504,9 +504,9 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
const double cylRadius(pixelSpacing / 2);
const double cylHeight(0.0002);
// One object
auto pixelShape = createCappedCylinder(
cylRadius, cylHeight, V3D(0.0, -cylHeight / 2.0, 0.0), V3D(0., 1.0, 0.),
"pixel-shape");
auto pixelShape = createCappedCylinder(cylRadius, cylHeight,
V3D(0.0, -cylHeight / 2.0, 0.0),
V3D(0., 1.0, 0.), "pixel-shape");
for (int banknum = 1; banknum <= numBanks; banknum++) {
// Make a new bank
......@@ -577,8 +577,7 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
testInst->add(chopper);
// Define a sample as a simple sphere
auto sampleSphere =
createSphere(0.001, V3D(0.0, 0.0, 0.0), "sample-shape");
auto sampleSphere = createSphere(0.001, V3D(0.0, 0.0, 0.0), "sample-shape");
ObjComponent *sample =
new ObjComponent("sample", sampleSphere, testInst.get());
testInst->setPos(0.0, 0.0, 0.0);
......@@ -592,10 +591,8 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
/**
* Create a capped cylinder object
*/
IObject_sptr CreateSampleWorkspace::createCappedCylinder(double radius,
double height,
const V3D &baseCentre,
const V3D &axis,
IObject_sptr CreateSampleWorkspace::createCappedCylinder(
double radius, double height, const V3D &baseCentre, const V3D &axis,
const std::string &id) {
std::ostringstream xml;
xml << "<cylinder id=\"" << id << "\">"
......
......@@ -167,7 +167,8 @@ 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);
auto shape = boost::shared_ptr<IObject>(m_inputWS->sample().getShape().clone());
auto shape =
boost::shared_ptr<IObject>(m_inputWS->sample().getShape().clone());
shape->setMaterial(Material("SetInSphericalAbsorption", neutron, rho));
m_inputWS->mutableSample().setShape(shape);
}
......
......@@ -40,8 +40,8 @@ double attenuation(double rho, double sigma, double length) {
MCInteractionVolume::MCInteractionVolume(
const API::Sample &sample, const Geometry::BoundingBox &activeRegion,
const size_t maxScatterAttempts)
: m_sample(sample.getShape().clone()), m_env(nullptr), m_activeRegion(activeRegion),
m_maxScatterAttempts(maxScatterAttempts) {
: m_sample(sample.getShape().clone()), m_env(nullptr),
m_activeRegion(activeRegion), m_maxScatterAttempts(maxScatterAttempts) {
if (!m_sample->hasValidShape()) {
throw std::invalid_argument(
"MCInteractionVolume() - Sample shape does not have a valid shape.");
......
......@@ -124,7 +124,8 @@ 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);
auto shape = boost::shared_ptr<IObject>(m_inputWS->sample().getShape().clone());
auto shape =
boost::shared_ptr<IObject>(m_inputWS->sample().getShape().clone());
shape->setMaterial(Material("SetInSphericalAbsorption", neutron, rho));
m_inputWS->mutableSample().setShape(shape);
}
......
......@@ -682,8 +682,7 @@ private:
// Geometry::ReferenceFrame(Geometry::PointingAlong::Y,Geometry::X,Geometry::Left,"")));
const double pixelRadius(0.05);
auto pixelShape =
ComponentCreationHelper::createCappedCylinder(
auto pixelShape = ComponentCreationHelper::createCappedCylinder(
pixelRadius, 0.02, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
const double detXPos(5.0);
......
......@@ -43,7 +43,8 @@ public:
auto canShape = ComponentCreationHelper::cappedCylinderXML(
0.5, 1.5, V3D(0.0, 0.0, 0.0), V3D(0., 1.0, 0.), "tube");
SampleEnvironment *kit = new SampleEnvironment(
envName, boost::make_shared<Container>(ShapeFactory().createShape(canShape)));
envName,
boost::make_shared<Container>(ShapeFactory().createShape(canShape)));
sample.setEnvironment(kit);
OrientedLattice *latt = new OrientedLattice(1.0, 2.0, 3.0, 90, 90, 90);
sample.setOrientedLattice(latt);
......
......@@ -96,8 +96,7 @@ public:
testWS->getAxis(0)->unit() =
Mantid::Kernel::UnitFactory::Instance().create("Wavelength");
// Define a sample shape
auto sampleShape =
ComponentCreationHelper::createCuboid(0.025, 0.03, 0.02);
auto sampleShape = ComponentCreationHelper::createCuboid(0.025, 0.03, 0.02);
testWS->mutableSample().setShape(sampleShape);
TS_ASSERT_THROWS_NOTHING(
......
......@@ -121,8 +121,7 @@ private:
// convert into a Geometry object
bool addTypeTag = true;
auto shape =
ShapeFactory().createShape(xmlShape, addTypeTag);
auto shape = ShapeFactory().createShape(xmlShape, addTypeTag);
boost::shared_ptr<Instrument> instrument = boost::make_shared<Instrument>();
const int ndets(2);
......
......@@ -52,9 +52,9 @@ void addSample(Mantid::API::MatrixWorkspace_sptr ws,
const V3D axis(0.0, 1.0, 0.0);
ShapeFactory shapeMaker;
auto can = boost::make_shared<Container>(shapeMaker.createShape(
ComponentCreationHelper::cappedCylinderXML(radius, height, baseCentre,
axis, id)));
auto can = boost::make_shared<Container>(
shapeMaker.createShape(ComponentCreationHelper::cappedCylinderXML(
radius, height, baseCentre, axis, id)));
can->setMaterial(Material("CanMaterial",
PhysicalConstants::getNeutronAtom(26, 0), 0.01));
SampleEnvironment *env = new SampleEnvironment("can", can);
......
......@@ -359,7 +359,8 @@ 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);
auto shape = boost::shared_ptr<IObject>(m_inputWS->sample().getShape().clone());
auto shape =
boost::shared_ptr<IObject>(m_inputWS->sample().getShape().clone());
shape->setMaterial(Material("SetInAnvredCorrection", neutron, 1.0));
m_inputWS->mutableSample().setShape(shape);
}
......
......@@ -258,7 +258,8 @@ 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);
auto shape = boost::shared_ptr<IObject>(peaksW->sample().getShape().clone());
auto shape =
boost::shared_ptr<IObject>(peaksW->sample().getShape().clone());
shape->setMaterial(Material("SetInSaveHKL", neutron, 1.0));
peaksW->mutableSample().setShape(shape);
}
......
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