37 instrument->setReferenceFrame(
44 instrument->add(source);
45 instrument->markAsSource(source);
50 instrument->add(sample);
51 instrument->markAsSamplePos(sample);
58 instrument->markAsDetector(det);
64 const std::vector<Kernel::V3D> &vecdetpos,
65 const std::vector<detid_t> &vecdetid) {
67 instrument->setReferenceFrame(
74 instrument->add(source);
75 instrument->markAsSource(source);
80 instrument->add(sample);
81 instrument->markAsSamplePos(sample);
84 size_t numdets = vecdetpos.size();
85 for (
size_t i = 0; i < numdets; ++i) {
91 instrument->markAsDetector(det);
109 std::ostringstream xml;
110 xml <<
"<sphere id=\"" <<
id <<
"\">"
111 <<
"<centre x=\"" <<
centre.X() <<
"\" y=\"" <<
centre.Y() <<
"\" z=\"" <<
centre.Z() <<
"\" />"
112 <<
"<radius val=\"" << radius <<
"\" />"
Component is a wrapper for a Component which can modify some of its parameters, e....
void setPos(double, double, double) override
Set the IComponent position, x, y, z respective to parent (if present)
This class represents a detector - i.e.
Object Component class, this class brings together the physical attributes of the component to the po...
void setShape(std::shared_ptr< const IObject > newShape)
Set a new shape on the component void setShape(std::shared_ptr<const IObject> newShape);.
Class originally intended to be used with the DataHandling 'LoadInstrument' algorithm.
std::shared_ptr< CSGObject > createShape(Poco::XML::Element *pElem)
Creates a geometric object from a DOM-element-node pointing to an element whose child nodes contain t...
A set of helper functions for dealing with components, i.e.
MANTID_GEOMETRY_DLL Geometry::Instrument_sptr createVirtualInstrument(Kernel::V3D sourcePos, Kernel::V3D samplePos, const std::vector< Kernel::V3D > &vecdetpos, const std::vector< detid_t > &vecdetid)
MANTID_GEOMETRY_DLL std::shared_ptr< Geometry::CSGObject > createSphere(double radius, const Kernel::V3D ¢re, const std::string &id)
Create a sphere object.
MANTID_GEOMETRY_DLL Geometry::Instrument_sptr createMinimalInstrument(const Mantid::Kernel::V3D &sourcePos, const Mantid::Kernel::V3D &samplePos, const Mantid::Kernel::V3D &detectorPos)
createOneDetectorInstrument, creates the most simple possible definition of an instrument in which we...
MANTID_GEOMETRY_DLL std::string sphereXML(double radius, const Kernel::V3D ¢re, const std::string &id)
Return the XML for a sphere.
std::shared_ptr< Instrument > Instrument_sptr
Shared pointer to an instrument object.