Mantid
Loading...
Searching...
No Matches
Enumerations | Functions
Mantid::Geometry::ComponentHelper Namespace Reference

A set of helper functions for dealing with components, i.e. More...

Enumerations

enum  TransformType { Absolute = 0 , Relative = 1 }
 Specifies how a transformation should be interpreted. More...
 

Functions

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 can extract a valid L1 and L2 distance for unit calculations. More...
 
MANTID_GEOMETRY_DLL std::shared_ptr< Geometry::CSGObjectcreateSphere (double radius, const V3D &centre, const std::string &id)
 Create a sphere object. More...
 
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::string sphereXML (double radius, const Kernel::V3D &centre, const std::string &id)
 Return the XML for a sphere. More...
 

Detailed Description

A set of helper functions for dealing with components, i.e.

movement, rotation that require interaction with the ParameterMap.

Enumeration Type Documentation

◆ TransformType

Specifies how a transformation should be interpreted.

Enumerator
Absolute 

The value is the absolute new value.

Relative 

The transformation given is relative to the original value.

Definition at line 34 of file ComponentHelper.h.

Function Documentation

◆ createMinimalInstrument()

Geometry::Instrument_sptr Mantid::Geometry::ComponentHelper::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 can extract a valid L1 and L2 distance for unit calculations.

Beam direction is along X, Up direction is Y

Parameters
sourcePos: V3D position
samplePos: V3D sample position
detectorPos: V3D detector position
Returns
Instrument generated.

Definition at line 33 of file ComponentHelper.cpp.

References createSphere(), Mantid::Geometry::Left, Mantid::Geometry::Component::setPos(), Mantid::Geometry::ObjComponent::setShape(), Mantid::Geometry::X, and Mantid::Geometry::Y.

◆ createSphere()

std::shared_ptr< CSGObject > Mantid::Geometry::ComponentHelper::createSphere ( double  radius,
const Kernel::V3D centre,
const std::string &  id 
)

Create a sphere object.

Definition at line 100 of file ComponentHelper.cpp.

References Mantid::Geometry::ShapeFactory::createShape(), radius, and sphereXML().

Referenced by createMinimalInstrument(), and createVirtualInstrument().

◆ createVirtualInstrument()

Geometry::Instrument_sptr Mantid::Geometry::ComponentHelper::createVirtualInstrument ( Kernel::V3D  sourcePos,
Kernel::V3D  samplePos,
const std::vector< Kernel::V3D > &  vecdetpos,
const std::vector< detid_t > &  vecdetid 
)

◆ sphereXML()

std::string Mantid::Geometry::ComponentHelper::sphereXML ( double  radius,
const Kernel::V3D centre,
const std::string &  id 
)

Return the XML for a sphere.

Definition at line 108 of file ComponentHelper.cpp.

References radius, Mantid::Kernel::V3D::X(), Mantid::Kernel::V3D::Y(), and Mantid::Kernel::V3D::Z().

Referenced by createSphere().