Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
Mantid::Geometry::Container Class Referencefinal

Models a Container is used to hold a sample in the beam. More...

#include <Container.h>

Inheritance diagram for Mantid::Geometry::Container:
Mantid::Geometry::IObject

Public Types

using ShapeArgs = std::unordered_map< std::string, double >
 

Public Member Functions

IObjectclone () const override
 
IObjectcloneWithMaterial (const Kernel::Material &material) const override
 
 Container ()
 
 Container (const Container &container)
 
 Container (const std::string &xml)
 Construct a container providing an XML definition shape. More...
 
 Container (IObject_sptr shape)
 
IObject_sptr createSampleShape (const ShapeArgs &args) const
 Return an object that represents the sample shape from the current definition but override the default values with the given values. More...
 
double distance (const Geometry::Track &t) const override
 
void draw () const override
 
boost::optional< Kernel::V3DgeneratePointInObject (Kernel::PseudoRandomNumberGenerator &rng, const BoundingBox &activeRegion, const size_t i) const override
 
boost::optional< Kernel::V3DgeneratePointInObject (Kernel::PseudoRandomNumberGenerator &rng, const size_t i) const override
 
const BoundingBoxgetBoundingBox () const override
 Return cached value of axis-aligned bounding box. More...
 
void getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) const override
 Calculate (or return cached value of) Axis Aligned Bounding box (DEPRECATED) More...
 
std::shared_ptr< GeometryHandlergetGeometryHandler () const override
 
int getName () const override
 
void GetObjectGeom (detail::ShapeInfo::GeometryShape &type, std::vector< Kernel::V3D > &vectors, double &innerRadius, double &radius, double &height) const override
 
int getPointInObject (Kernel::V3D &point) const override
 
IObject_sptr getSampleShape () const
 
const IObjectgetShape () const
 
const IObject_sptr getShapePtr () const
 
bool hasCustomizableSampleShape () const
 
bool hasFixedSampleShape () const
 
bool hasValidShape () const override
 
const std::string & id () const override
 
void initDraw () const override
 
int interceptSurface (Geometry::Track &t) const override
 
bool isOnSide (const Kernel::V3D &p) const override
 
bool isValid (const Kernel::V3D &p) const override
 
const Kernel::Materialmaterial () const override
 
Containeroperator= (const Container &container)
 
void setID (const std::string &id) override
 Set the ID of the shape, if it is a CSG Object. More...
 
virtual void setMaterial (const Kernel::Material &material) override
 
void setSampleShape (const std::string &sampleShapeXML)
 Set the definition of the sample shape for this can. More...
 
void setSampleShape (IObject_sptr sampleShape)
 
detail::ShapeInfo::GeometryShape shape () const override
 
const detail::ShapeInfoshapeInfo () const override
 
double solidAngle (const Kernel::V3D &observer) const override
 
double solidAngle (const Kernel::V3D &observer, const Kernel::V3D &scaleFactor) const override
 
double volume () const override
 
- Public Member Functions inherited from Mantid::Geometry::IObject
virtual IObjectclone () const =0
 
virtual IObjectcloneWithMaterial (const Kernel::Material &material) const =0
 
virtual double distance (const Geometry::Track &) const =0
 
virtual void draw () const =0
 
virtual boost::optional< Kernel::V3DgeneratePointInObject (Kernel::PseudoRandomNumberGenerator &rng, const BoundingBox &activeRegion, const size_t) const =0
 
virtual boost::optional< Kernel::V3DgeneratePointInObject (Kernel::PseudoRandomNumberGenerator &rng, const size_t) const =0
 
virtual const BoundingBoxgetBoundingBox () const =0
 Return cached value of axis-aligned bounding box. More...
 
virtual void getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) const =0
 Calculate (or return cached value of) Axis Aligned Bounding box (DEPRECATED) More...
 
virtual std::shared_ptr< GeometryHandlergetGeometryHandler () const =0
 
virtual int getName () const =0
 
virtual void GetObjectGeom (detail::ShapeInfo::GeometryShape &type, std::vector< Kernel::V3D > &vectors, double &innerRadius, double &radius, double &height) const =0
 
virtual int getPointInObject (Kernel::V3D &point) const =0
 
virtual bool hasValidShape () const =0
 
virtual const std::string & id () const =0
 
virtual void initDraw () const =0
 
virtual int interceptSurface (Geometry::Track &) const =0
 
virtual bool isFiniteGeometry () const
 
virtual bool isOnSide (const Kernel::V3D &) const =0
 
virtual bool isValid (const Kernel::V3D &) const =0
 
virtual const Kernel::Materialmaterial () const =0
 
virtual void setFiniteGeometryFlag (bool)
 
virtual void setID (const std::string &id)=0
 
virtual void setMaterial (const Kernel::Material &material)=0
 
virtual detail::ShapeInfo::GeometryShape shape () const =0
 
virtual const detail::ShapeInfoshapeInfo () const =0
 
virtual double solidAngle (const Kernel::V3D &observer) const =0
 
virtual double solidAngle (const Kernel::V3D &observer, const Kernel::V3D &scaleFactor) const =0
 
virtual double volume () const =0
 
virtual ~IObject ()=default
 

Private Attributes

IObject_sptr m_sampleShape = nullptr
 
std::string m_sampleShapeXML
 
IObject_sptr m_shape
 

Detailed Description

Models a Container is used to hold a sample in the beam.

It gets most of its functionality from wrapped Geometry::IObject but can also hold a definition of what the sample geometry itself would be. If the sample shape definition is set then we term this a constrained sample geometry.

Definition at line 24 of file Container.h.

Member Typedef Documentation

◆ ShapeArgs

using Mantid::Geometry::Container::ShapeArgs = std::unordered_map<std::string, double>

Definition at line 26 of file Container.h.

Constructor & Destructor Documentation

◆ Container() [1/4]

Mantid::Geometry::Container::Container ( )

Definition at line 55 of file Container.cpp.

◆ Container() [2/4]

Mantid::Geometry::Container::Container ( IObject_sptr  shape)

Definition at line 57 of file Container.cpp.

◆ Container() [3/4]

Mantid::Geometry::Container::Container ( const Container container)

Definition at line 59 of file Container.cpp.

◆ Container() [4/4]

Mantid::Geometry::Container::Container ( const std::string &  xml)

Construct a container providing an XML definition shape.

Parameters
xmlDefinition of the shape in xml

Definition at line 72 of file Container.cpp.

Member Function Documentation

◆ clone()

IObject * Mantid::Geometry::Container::clone ( ) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 49 of file Container.h.

◆ cloneWithMaterial()

IObject * Mantid::Geometry::Container::cloneWithMaterial ( const Kernel::Material material) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 51 of file Container.h.

References Mantid::Geometry::IObject::cloneWithMaterial().

◆ createSampleShape()

IObject_sptr Mantid::Geometry::Container::createSampleShape ( const ShapeArgs args) const

Return an object that represents the sample shape from the current definition but override the default values with the given values.

It throws a std::runtime_error if no sample shape is defined.

Parameters
argsA hash of tag values to use in place of the default
Returns
A pointer to a object modeling the sample shape

Definition at line 93 of file Container.cpp.

References Mantid::Geometry::ShapeFactory::createShape(), hasCustomizableSampleShape(), and m_sampleShapeXML.

◆ distance()

double Mantid::Geometry::Container::distance ( const Geometry::Track t) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 58 of file Container.h.

◆ draw()

void Mantid::Geometry::Container::draw ( ) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 90 of file Container.h.

◆ generatePointInObject() [1/2]

boost::optional< Kernel::V3D > Mantid::Geometry::Container::generatePointInObject ( Kernel::PseudoRandomNumberGenerator rng,
const BoundingBox activeRegion,
const size_t  i 
) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 75 of file Container.h.

◆ generatePointInObject() [2/2]

boost::optional< Kernel::V3D > Mantid::Geometry::Container::generatePointInObject ( Kernel::PseudoRandomNumberGenerator rng,
const size_t  i 
) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 71 of file Container.h.

◆ getBoundingBox() [1/2]

const BoundingBox & Mantid::Geometry::Container::getBoundingBox ( ) const
inlineoverridevirtual

Return cached value of axis-aligned bounding box.

Implements Mantid::Geometry::IObject.

Definition at line 64 of file Container.h.

◆ getBoundingBox() [2/2]

void Mantid::Geometry::Container::getBoundingBox ( double &  xmax,
double &  ymax,
double &  zmax,
double &  xmin,
double &  ymin,
double &  zmin 
) const
inlineoverridevirtual

Calculate (or return cached value of) Axis Aligned Bounding box (DEPRECATED)

Implements Mantid::Geometry::IObject.

Definition at line 65 of file Container.h.

◆ getGeometryHandler()

std::shared_ptr< GeometryHandler > Mantid::Geometry::Container::getGeometryHandler ( ) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 88 of file Container.h.

◆ getName()

int Mantid::Geometry::Container::getName ( ) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 55 of file Container.h.

◆ GetObjectGeom()

void Mantid::Geometry::Container::GetObjectGeom ( detail::ShapeInfo::GeometryShape type,
std::vector< Kernel::V3D > &  vectors,
double &  innerRadius,
double &  radius,
double &  height 
) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 84 of file Container.h.

References height, innerRadius, and radius.

◆ getPointInObject()

int Mantid::Geometry::Container::getPointInObject ( Kernel::V3D point) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 70 of file Container.h.

◆ getSampleShape()

IObject_sptr Mantid::Geometry::Container::getSampleShape ( ) const

Definition at line 119 of file Container.cpp.

References m_sampleShape.

◆ getShape()

const IObject & Mantid::Geometry::Container::getShape ( ) const
inline

Definition at line 42 of file Container.h.

Referenced by export_Container().

◆ getShapePtr()

const IObject_sptr Mantid::Geometry::Container::getShapePtr ( ) const
inline

◆ hasCustomizableSampleShape()

bool Mantid::Geometry::Container::hasCustomizableSampleShape ( ) const
Returns
True if the can contains a definition of the sample shape with dimensions that can be overridden

Definition at line 78 of file Container.cpp.

References m_sampleShapeXML.

Referenced by createSampleShape(), and Mantid::DataHandling::SetSample::setSampleShape().

◆ hasFixedSampleShape()

bool Mantid::Geometry::Container::hasFixedSampleShape ( ) const
Returns
True if the can contains a definition of the sample shape with dimensions that cannot be overridden

Definition at line 84 of file Container.cpp.

References m_sampleShape.

Referenced by Mantid::DataHandling::SetSample::setSampleShape().

◆ hasValidShape()

bool Mantid::Geometry::Container::hasValidShape ( ) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 47 of file Container.h.

◆ id()

const std::string & Mantid::Geometry::Container::id ( ) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 96 of file Container.h.

◆ initDraw()

void Mantid::Geometry::Container::initDraw ( ) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 91 of file Container.h.

◆ interceptSurface()

int Mantid::Geometry::Container::interceptSurface ( Geometry::Track t) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 57 of file Container.h.

◆ isOnSide()

bool Mantid::Geometry::Container::isOnSide ( const Kernel::V3D p) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 46 of file Container.h.

◆ isValid()

bool Mantid::Geometry::Container::isValid ( const Kernel::V3D p) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 45 of file Container.h.

◆ material()

const Kernel::Material & Mantid::Geometry::Container::material ( ) const
inlineoverridevirtual

◆ operator=()

Container & Mantid::Geometry::Container::operator= ( const Container container)

Definition at line 61 of file Container.cpp.

References m_sampleShape, m_sampleShapeXML, and m_shape.

◆ setID()

void Mantid::Geometry::Container::setID ( const std::string &  id)
overridevirtual

Set the ID of the shape, if it is a CSG Object.

Parameters
idID a string identifying to object

Implements Mantid::Geometry::IObject.

Definition at line 145 of file Container.cpp.

References m_shape.

◆ setMaterial()

virtual void Mantid::Geometry::Container::setMaterial ( const Kernel::Material material)
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 94 of file Container.h.

◆ setSampleShape() [1/2]

void Mantid::Geometry::Container::setSampleShape ( const std::string &  sampleShapeXML)

Set the definition of the sample shape for this can.

Parameters
sampleShapeXML

Definition at line 125 of file Container.cpp.

References m_sampleShapeXML.

◆ setSampleShape() [2/2]

void Mantid::Geometry::Container::setSampleShape ( IObject_sptr  sampleShape)
inline

Definition at line 40 of file Container.h.

◆ shape()

detail::ShapeInfo::GeometryShape Mantid::Geometry::Container::shape ( ) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 80 of file Container.h.

◆ shapeInfo()

const detail::ShapeInfo & Mantid::Geometry::Container::shapeInfo ( ) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 82 of file Container.h.

◆ solidAngle() [1/2]

double Mantid::Geometry::Container::solidAngle ( const Kernel::V3D observer) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 59 of file Container.h.

◆ solidAngle() [2/2]

double Mantid::Geometry::Container::solidAngle ( const Kernel::V3D observer,
const Kernel::V3D scaleFactor 
) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 60 of file Container.h.

◆ volume()

double Mantid::Geometry::Container::volume ( ) const
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 63 of file Container.h.

Member Data Documentation

◆ m_sampleShape

IObject_sptr Mantid::Geometry::Container::m_sampleShape = nullptr
private

Definition at line 101 of file Container.h.

Referenced by getSampleShape(), hasFixedSampleShape(), and operator=().

◆ m_sampleShapeXML

std::string Mantid::Geometry::Container::m_sampleShapeXML
private

◆ m_shape

IObject_sptr Mantid::Geometry::Container::m_shape
private

Definition at line 99 of file Container.h.

Referenced by operator=(), and setID().


The documentation for this class was generated from the following files: