Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Geometry::MeshObject Class Reference

Triangular Mesh Object. More...

#include <MeshObject.h>

Inheritance diagram for Mantid::Geometry::MeshObject:
Mantid::Geometry::IObject

Public Member Functions

int calcValidType (const Kernel::V3D &Pt, const Kernel::V3D &uVec) const
 Calculate if a point PT is a valid point on the track. More...
 
IObjectclone () const override
 Clone. More...
 
IObjectcloneWithMaterial (const Kernel::Material &material) const override
 
double distance (const Track &track) const override
 Compute the distance to the first point of intersection with the surface. More...
 
void draw () const override
 Draws the Object using geometry handler, If the handler is not set then this function does nothing. More...
 
boost::optional< Kernel::V3DgeneratePointInObject (Kernel::PseudoRandomNumberGenerator &rng, const BoundingBox &activeRegion, const size_t) const override
 Generate a random point within the object that is also bound by the activeRegion box. More...
 
boost::optional< Kernel::V3DgeneratePointInObject (Kernel::PseudoRandomNumberGenerator &rng, const size_t) const override
 Select a random point within the object. More...
 
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
 Returns the geometry handler. More...
 
int getName () const override
 
void GetObjectGeom (detail::ShapeInfo::GeometryShape &type, std::vector< Kernel::V3D > &vectors, double &innerRadius, double &radius, double &height) const override
 get info on standard shapes (none for Mesh Object) More...
 
int getPointInObject (Kernel::V3D &point) const override
 Try to find a point that lies within (or on) the object. More...
 
std::vector< uint32_t > getTriangles () const
 get faces More...
 
const std::vector< Kernel::V3D > & getV3Ds () const
 get vertices in V3D form More...
 
std::vector< double > getVertices () const
 get vertices More...
 
bool hasValidShape () const override
 Return whether this object has a valid shape. More...
 
const std::string & id () const override
 
void initDraw () const override
 Initializes/prepares the object to be rendered, this will generate geometry for object, If the handler is not set then this function does nothing. More...
 
int interceptSurface (Geometry::Track &) const override
 Given a track, fill the track with valid section. More...
 
bool isOnSide (const Kernel::V3D &) const override
 Determines wither point is on the surface. More...
 
bool isValid (const Kernel::V3D &) const override
 Check if a point is inside. More...
 
const Kernel::Materialmaterial () const override
 
 MeshObject (const MeshObject &)=delete
 Copy constructor. More...
 
 MeshObject (std::vector< uint32_t > &&faces, std::vector< Kernel::V3D > &&vertices, const Kernel::Material &&material)
 Constructor. More...
 
 MeshObject (std::vector< uint32_t > faces, std::vector< Kernel::V3D > vertices, const Kernel::Material &material)
 Constructor. More...
 
void multiply (const Kernel::Matrix< double > &)
 Transform the mesh (scale, translate, rotate) according to the supplied transformation matrix. More...
 
size_t numberOfTriangles () const
 Output functions for rendering, may also be used internally. More...
 
size_t numberOfVertices () const
 Read access to mesh object for rendering. More...
 
MeshObjectoperator= (const MeshObject &)=delete
 Assignment operator. More...
 
void rotate (const Kernel::Matrix< double > &)
 Rotate the mesh according to the supplied rotation matrix. More...
 
void scale (const double scaleFactor)
 Scale the mesh according to the supplied scale factor. More...
 
void setGeometryHandler (const std::shared_ptr< GeometryHandler > &h)
 Set Geometry Handler. More...
 
void setID (const std::string &id) override
 
void setMaterial (const Kernel::Material &material) override
 
detail::ShapeInfo::GeometryShape shape () const override
 
const detail::ShapeInfoshapeInfo () const override
 
double solidAngle (const Kernel::V3D &observer) const override
 Find solid angle of object wrt the observer. More...
 
double solidAngle (const Kernel::V3D &observer, const Kernel::V3D &scaleFactor) const override
 Find solid angle of object wrt the observer with a scaleFactor for the object. More...
 
void translate (const Kernel::V3D &)
 Translate the mesh according to the supplied x, y, z vector. More...
 
void updateGeometryHandler ()
 Updates the geometry handler if needed. More...
 
double volume () const override
 Calculates the volume of this object. More...
 
virtual ~MeshObject ()=default
 Destructor. More...
 
- 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 Member Functions

void getIntersections (const Kernel::V3D &start, const Kernel::V3D &direction, std::vector< Kernel::V3D > &intersectionPoints, std::vector< Mantid::Geometry::TrackDirection > &entryExitFlags) const
 Get intersections. More...
 
bool getTriangle (const size_t index, Kernel::V3D &v1, Kernel::V3D &v2, Kernel::V3D &v3) const
 Get triangle. More...
 
void initialize ()
 
bool searchForObject (Kernel::V3D &point) const
 Search object for valid point. More...
 

Private Attributes

BoundingBox m_boundingBox
 Cache for object's bounding box. More...
 
std::shared_ptr< GeometryHandlerm_handler
 Geometry Handle for rendering. More...
 
std::string m_id
 string to return as ID More...
 
Kernel::Material m_material
 material composition More...
 
std::string m_string
 
const double M_TOLERANCE = 0.000001
 Tolerence distance. More...
 
std::vector< uint32_t > m_triangles
 Contents Triangles are specified by indices into a list of vertices. More...
 
std::vector< Kernel::V3Dm_vertices
 
std::shared_ptr< vtkGeometryCacheReaderm_vtk_cache_reader
 a pointer to a class for reading from the geometry cache More...
 
std::shared_ptr< vtkGeometryCacheWriterm_vtk_cache_writer
 a pointer to a class for writing to the geometry cache More...
 

Detailed Description

Triangular Mesh Object.

Version
1.0
Date
Dec 2017
Author
Karl Palmen

Mesh Object of Triangles assumed to form one or more non-intersecting closed surfaces enclosing separate volumes. The number of vertices is limited to 2^32 based on index type. For 2D Meshes see Mesh2DObject

Definition at line 50 of file MeshObject.h.

Constructor & Destructor Documentation

◆ MeshObject() [1/3]

Mantid::Geometry::MeshObject::MeshObject ( std::vector< uint32_t >  faces,
std::vector< Kernel::V3D vertices,
const Kernel::Material material 
)

Constructor.

Definition at line 23 of file MeshObject.cpp.

References initialize().

◆ MeshObject() [2/3]

Mantid::Geometry::MeshObject::MeshObject ( std::vector< uint32_t > &&  faces,
std::vector< Kernel::V3D > &&  vertices,
const Kernel::Material &&  material 
)

Constructor.

Definition at line 30 of file MeshObject.cpp.

References initialize().

◆ MeshObject() [3/3]

Mantid::Geometry::MeshObject::MeshObject ( const MeshObject )
delete

Copy constructor.

◆ ~MeshObject()

virtual Mantid::Geometry::MeshObject::~MeshObject ( )
virtualdefault

Destructor.

Member Function Documentation

◆ calcValidType()

int Mantid::Geometry::MeshObject::calcValidType ( const Kernel::V3D point,
const Kernel::V3D uVec 
) const

Calculate if a point PT is a valid point on the track.

Parameters
point:: Point to calculate from.
uVec:: Unit vector of the track
Return values
0:: Not valid / double valid
1:: Entry point
-1:: Exit Point

Definition at line 240 of file MeshObject.cpp.

References isValid(), and Mantid::Kernel::Tolerance.

◆ clone()

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

Clone.

Implements Mantid::Geometry::IObject.

Definition at line 64 of file MeshObject.h.

◆ cloneWithMaterial()

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

Implements Mantid::Geometry::IObject.

Definition at line 65 of file MeshObject.h.

◆ distance()

double Mantid::Geometry::MeshObject::distance ( const Track track) const
overridevirtual

Compute the distance to the first point of intersection with the surface.

Parameters
trackTrack defining start/direction
Returns
The distance to the object
Exceptions
std::runtime_errorif no intersection was found

Implements Mantid::Geometry::IObject.

Definition at line 176 of file MeshObject.cpp.

References Mantid::Geometry::Track::direction(), Mantid::Kernel::V3D::distance(), getTriangle(), Mantid::Geometry::intersection(), Mantid::Geometry::MeshObjectCommon::rayIntersectsTriangle(), and Mantid::Geometry::Track::startPoint().

◆ draw()

void Mantid::Geometry::MeshObject::draw ( ) const
overridevirtual

Draws the Object using geometry handler, If the handler is not set then this function does nothing.

Implements Mantid::Geometry::IObject.

Definition at line 444 of file MeshObject.cpp.

References m_handler.

◆ generatePointInObject() [1/2]

boost::optional< Kernel::V3D > Mantid::Geometry::MeshObject::generatePointInObject ( Kernel::PseudoRandomNumberGenerator rng,
const BoundingBox activeRegion,
const size_t  maxAttempts 
) const
overridevirtual

Generate a random point within the object that is also bound by the activeRegion box.

Parameters
rngA reference to a PseudoRandomNumberGenerator where nextValue should return a flat random number between 0.0 & 1.0
activeRegionRestrict point generation to this sub-region of the object
maxAttemptsThe maximum number of attempts at generating a point
Returns
The generated point

Implements Mantid::Geometry::IObject.

Definition at line 397 of file MeshObject.cpp.

References Mantid::Geometry::RandomPoint::bounded().

◆ generatePointInObject() [2/2]

boost::optional< Kernel::V3D > Mantid::Geometry::MeshObject::generatePointInObject ( Kernel::PseudoRandomNumberGenerator rng,
const size_t  maxAttempts 
) const
overridevirtual

Select a random point within the object.

Generate a random point within the object.

The method simply generates a point within the bounding box and tests if this is a valid point within the object: if so the point is return otherwise a new point is selected.

Parameters
rngA reference to a PseudoRandomNumberGenerator where nextValue should return a flat random number between 0.0 & 1.0
maxAttemptsThe maximum number of attempts at generating a point
Returns
The generated point

Implements Mantid::Geometry::IObject.

Definition at line 377 of file MeshObject.cpp.

References generatePointInObject(), and getBoundingBox().

Referenced by generatePointInObject().

◆ getBoundingBox() [1/2]

const BoundingBox & Mantid::Geometry::MeshObject::getBoundingBox ( ) const
overridevirtual

Return cached value of axis-aligned bounding box.

Returns an axis-aligned bounding box that will fit the shape.

Returns
A reference to a bounding box for this shape.

Implements Mantid::Geometry::IObject.

Definition at line 343 of file MeshObject.cpp.

References Mantid::Geometry::MeshObjectCommon::getBoundingBox(), m_boundingBox, and m_vertices.

Referenced by generatePointInObject(), getPointInObject(), interceptSurface(), isOnSide(), isValid(), and volume().

◆ getBoundingBox() [2/2]

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

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

Takes input axis aligned bounding box max and min points and calculates the bounding box for the object and returns them back in max and min points.

Parameters
xmax:: Maximum value for the bounding box in x direction
ymax:: Maximum value for the bounding box in y direction
zmax:: Maximum value for the bounding box in z direction
xmin:: Minimum value for the bounding box in x direction
ymin:: Minimum value for the bounding box in y direction
zmin:: Minimum value for the bounding box in z direction

Implements Mantid::Geometry::IObject.

Definition at line 263 of file MeshObject.cpp.

References Mantid::Geometry::MeshObjectCommon::getBoundingBox(), m_boundingBox, and m_vertices.

◆ getGeometryHandler()

std::shared_ptr< GeometryHandler > Mantid::Geometry::MeshObject::getGeometryHandler ( ) const
overridevirtual

Returns the geometry handler.

Implements Mantid::Geometry::IObject.

Definition at line 466 of file MeshObject.cpp.

References m_handler.

◆ getIntersections()

void Mantid::Geometry::MeshObject::getIntersections ( const Kernel::V3D start,
const Kernel::V3D direction,
std::vector< Kernel::V3D > &  intersectionPoints,
std::vector< Mantid::Geometry::TrackDirection > &  entryExitFlags 
) const
private

Get intersections.

Get intersection points and their in out directions on the given ray.

Parameters
start:: Start point of ray
direction:: Direction of ray
intersectionPoints:: Intersection points (not sorted)
entryExitFlags:: +1 ray enters -1 ray exits at corresponding point

Definition at line 198 of file MeshObject.cpp.

References getTriangle(), Mantid::Geometry::intersection(), and Mantid::Geometry::MeshObjectCommon::rayIntersectsTriangle().

Referenced by interceptSurface(), isOnSide(), and isValid().

◆ getName()

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

Implements Mantid::Geometry::IObject.

Definition at line 72 of file MeshObject.h.

◆ GetObjectGeom()

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

get info on standard shapes (none for Mesh Object)

Implements Mantid::Geometry::IObject.

Definition at line 565 of file MeshObject.cpp.

References height, innerRadius, m_handler, Mantid::Geometry::detail::ShapeInfo::NOSHAPE, and radius.

◆ getPointInObject()

int Mantid::Geometry::MeshObject::getPointInObject ( Kernel::V3D point) const
overridevirtual

Try to find a point that lies within (or on) the object.

Parameters
[out]point:: on exit set to the point value, if found
Returns
1 if point found, 0 otherwise

Implements Mantid::Geometry::IObject.

Definition at line 352 of file MeshObject.cpp.

References Mantid::Geometry::BoundingBox::centrePoint(), getBoundingBox(), Mantid::Geometry::BoundingBox::isNonNull(), and searchForObject().

◆ getTriangle()

bool Mantid::Geometry::MeshObject::getTriangle ( const size_t  index,
Kernel::V3D v1,
Kernel::V3D v2,
Kernel::V3D v3 
) const
private

Get triangle.

Definition at line 221 of file MeshObject.cpp.

References index, m_triangles, and m_vertices.

Referenced by distance(), getIntersections(), solidAngle(), and volume().

◆ getTriangles()

std::vector< uint32_t > Mantid::Geometry::MeshObject::getTriangles ( ) const

◆ getV3Ds()

const std::vector< Kernel::V3D > & Mantid::Geometry::MeshObject::getV3Ds ( ) const

◆ getVertices()

std::vector< double > Mantid::Geometry::MeshObject::getVertices ( ) const

get vertices

Definition at line 549 of file MeshObject.cpp.

References Mantid::Geometry::MeshObjectCommon::getVertices(), and m_vertices.

◆ hasValidShape()

bool Mantid::Geometry::MeshObject::hasValidShape ( ) const
overridevirtual

Return whether this object has a valid shape.

Returns whether this object has a valid shape.

Returns
True if the entire MeshObject may enclose one or more volumes.

Implements Mantid::Geometry::IObject.

Definition at line 60 of file MeshObject.cpp.

References numberOfTriangles(), and numberOfVertices().

Referenced by Mantid::DataHandling::SaveSampleEnvironmentAndShape::exec().

◆ id()

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

◆ initDraw()

void Mantid::Geometry::MeshObject::initDraw ( ) const
overridevirtual

Initializes/prepares the object to be rendered, this will generate geometry for object, If the handler is not set then this function does nothing.

Implements Mantid::Geometry::IObject.

Definition at line 456 of file MeshObject.cpp.

References m_handler.

◆ initialize()

void Mantid::Geometry::MeshObject::initialize ( )
private

Definition at line 39 of file MeshObject.cpp.

References Mantid::Geometry::MeshObjectCommon::checkVertexLimit(), m_handler, and m_vertices.

Referenced by MeshObject().

◆ interceptSurface()

int Mantid::Geometry::MeshObject::interceptSurface ( Geometry::Track UT) const
overridevirtual

◆ isOnSide()

bool Mantid::Geometry::MeshObject::isOnSide ( const Kernel::V3D point) const
overridevirtual

Determines wither point is on the surface.

Parameters
point:: Point to check
Returns
true if the point is on the surface

Implements Mantid::Geometry::IObject.

Definition at line 112 of file MeshObject.cpp.

References getBoundingBox(), getIntersections(), and Mantid::Geometry::BoundingBox::isPointInside().

◆ isValid()

bool Mantid::Geometry::MeshObject::isValid ( const Kernel::V3D point) const
overridevirtual

Check if a point is inside.

Determines whether point is within the object or on the surface.

Parameters
point:: Point to be tested
Returns
true if point is within object or on surface

Implements Mantid::Geometry::IObject.

Definition at line 71 of file MeshObject.cpp.

References Mantid::Kernel::V3D::distance(), getBoundingBox(), getIntersections(), Mantid::Geometry::BoundingBox::isPointInside(), and Mantid::Geometry::LEAVING.

Referenced by calcValidType(), and searchForObject().

◆ material()

const Kernel::Material & Mantid::Geometry::MeshObject::material ( ) const
overridevirtual
Returns
The Material that the object is composed from

Implements Mantid::Geometry::IObject.

Definition at line 48 of file MeshObject.cpp.

References m_material.

Referenced by setMaterial(), and Mantid::DataHandling::Mantid3MFFileIO::writeMeshObject().

◆ multiply()

void Mantid::Geometry::MeshObject::multiply ( const Kernel::Matrix< double > &  matrix)

Transform the mesh (scale, translate, rotate) according to the supplied transformation matrix.

Parameters
matrix4 x 4 transformation matrix

Definition at line 504 of file MeshObject.cpp.

References m_vertices, Mantid::Kernel::Matrix< T >::multiplyPoint(), Mantid::Kernel::Matrix< T >::numCols(), and Mantid::Kernel::Matrix< T >::numRows().

◆ numberOfTriangles()

size_t Mantid::Geometry::MeshObject::numberOfTriangles ( ) const

Output functions for rendering, may also be used internally.

Definition at line 534 of file MeshObject.cpp.

References m_triangles.

Referenced by Mantid::DataHandling::SaveSampleEnvironmentAndShape::exec(), hasValidShape(), and Mantid::DataHandling::Mantid3MFFileIO::writeMeshObject().

◆ numberOfVertices()

size_t Mantid::Geometry::MeshObject::numberOfVertices ( ) const

Read access to mesh object for rendering.

get number of points

Definition at line 544 of file MeshObject.cpp.

References m_vertices.

Referenced by Mantid::DataHandling::SaveSampleEnvironmentAndShape::exec(), hasValidShape(), and Mantid::DataHandling::SaveSampleEnvironmentAndShape::mergeSampleEnvironmentIntoSingleMesh().

◆ operator=()

MeshObject & Mantid::Geometry::MeshObject::operator= ( const MeshObject )
delete

Assignment operator.

◆ rotate()

void Mantid::Geometry::MeshObject::rotate ( const Kernel::Matrix< double > &  rotationMatrix)

Rotate the mesh according to the supplied rotation matrix.

Parameters
rotationMatrixRotation matrix to be applied

Definition at line 476 of file MeshObject.cpp.

References m_vertices.

◆ scale()

void Mantid::Geometry::MeshObject::scale ( const double  scaleFactor)

Scale the mesh according to the supplied scale factor.

Parameters
scaleFactorScale factor

Definition at line 494 of file MeshObject.cpp.

References m_vertices.

◆ searchForObject()

bool Mantid::Geometry::MeshObject::searchForObject ( Kernel::V3D point) const
private

Search object for valid point.

Try to find a point that lies within (or on) the object, given a seed point.

Parameters
point:: on entry the seed point, on exit point in object, if found
Returns
true if point found

Definition at line 411 of file MeshObject.cpp.

References Mantid::Geometry::Track::cbegin(), interceptSurface(), and isValid().

Referenced by getPointInObject().

◆ setGeometryHandler()

void Mantid::Geometry::MeshObject::setGeometryHandler ( const std::shared_ptr< GeometryHandler > &  h)

Set Geometry Handler.

Set the geometry handler for Object.

Parameters
[in]his pointer to the geometry handler. don't delete this pointer in the calling function.

Definition at line 434 of file MeshObject.cpp.

References m_handler.

◆ setID()

void Mantid::Geometry::MeshObject::setID ( const std::string &  id)
inlineoverridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 69 of file MeshObject.h.

◆ setMaterial()

void Mantid::Geometry::MeshObject::setMaterial ( const Kernel::Material material)
overridevirtual
Parameters
material:: material that is being set for the object

Implements Mantid::Geometry::IObject.

Definition at line 53 of file MeshObject.cpp.

References m_material, and material().

◆ shape()

detail::ShapeInfo::GeometryShape Mantid::Geometry::MeshObject::shape ( ) const
overridevirtual

◆ shapeInfo()

const detail::ShapeInfo & Mantid::Geometry::MeshObject::shapeInfo ( ) const
overridevirtual

Implements Mantid::Geometry::IObject.

Definition at line 558 of file MeshObject.cpp.

◆ solidAngle() [1/2]

double Mantid::Geometry::MeshObject::solidAngle ( const Kernel::V3D observer) const
overridevirtual

Find solid angle of object wrt the observer.

Parameters
observer:: point to measure solid angle from
Returns
:: estimate of solid angle of object.

Implements Mantid::Geometry::IObject.

Definition at line 273 of file MeshObject.cpp.

References getTriangle(), and Mantid::Geometry::MeshObjectCommon::getTriangleSolidAngle().

Referenced by solidAngle().

◆ solidAngle() [2/2]

double Mantid::Geometry::MeshObject::solidAngle ( const Kernel::V3D observer,
const Kernel::V3D scaleFactor 
) const
overridevirtual

Find solid angle of object wrt the observer with a scaleFactor for the object.

Parameters
observer:: point to measure solid angle from
scaleFactor:: Kernel::V3D giving scaling of the object
Returns
:: estimate of solid angle of object.

Implements Mantid::Geometry::IObject.

Definition at line 301 of file MeshObject.cpp.

References m_material, m_triangles, m_vertices, and solidAngle().

◆ translate()

void Mantid::Geometry::MeshObject::translate ( const Kernel::V3D translationVector)

Translate the mesh according to the supplied x, y, z vector.

Parameters
translationVectorTranslation vector to be applied

Definition at line 485 of file MeshObject.cpp.

References m_vertices.

◆ updateGeometryHandler()

void Mantid::Geometry::MeshObject::updateGeometryHandler ( )

Updates the geometry handler if needed.

Definition at line 527 of file MeshObject.cpp.

◆ volume()

double Mantid::Geometry::MeshObject::volume ( ) const
overridevirtual

Member Data Documentation

◆ m_boundingBox

BoundingBox Mantid::Geometry::MeshObject::m_boundingBox
mutableprivate

Cache for object's bounding box.

Definition at line 154 of file MeshObject.h.

Referenced by getBoundingBox().

◆ m_handler

std::shared_ptr<GeometryHandler> Mantid::Geometry::MeshObject::m_handler
private

Geometry Handle for rendering.

Definition at line 160 of file MeshObject.h.

Referenced by draw(), getGeometryHandler(), GetObjectGeom(), initDraw(), initialize(), and setGeometryHandler().

◆ m_id

std::string Mantid::Geometry::MeshObject::m_id
private

string to return as ID

Definition at line 166 of file MeshObject.h.

◆ m_material

Kernel::Material Mantid::Geometry::MeshObject::m_material
private

material composition

Definition at line 178 of file MeshObject.h.

Referenced by material(), setMaterial(), and solidAngle().

◆ m_string

std::string Mantid::Geometry::MeshObject::m_string
private

Definition at line 163 of file MeshObject.h.

◆ M_TOLERANCE

const double Mantid::Geometry::MeshObject::M_TOLERANCE = 0.000001
private

Tolerence distance.

Definition at line 157 of file MeshObject.h.

◆ m_triangles

std::vector<uint32_t> Mantid::Geometry::MeshObject::m_triangles
private

Contents Triangles are specified by indices into a list of vertices.

Definition at line 175 of file MeshObject.h.

Referenced by getTriangle(), getTriangles(), numberOfTriangles(), and solidAngle().

◆ m_vertices

std::vector<Kernel::V3D> Mantid::Geometry::MeshObject::m_vertices
private

◆ m_vtk_cache_reader

std::shared_ptr<vtkGeometryCacheReader> Mantid::Geometry::MeshObject::m_vtk_cache_reader
private

a pointer to a class for reading from the geometry cache

Definition at line 169 of file MeshObject.h.

◆ m_vtk_cache_writer

std::shared_ptr<vtkGeometryCacheWriter> Mantid::Geometry::MeshObject::m_vtk_cache_writer
private

a pointer to a class for writing to the geometry cache

Definition at line 171 of file MeshObject.h.


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