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

Handles rendering of all object Geometry. More...

#include <GeometryHandler.h>

Public Member Functions

bool canTriangulate () const
 
std::shared_ptr< GeometryHandlerclone () const
 
 GeometryHandler (const GeometryHandler &handler)
 
 GeometryHandler (const MeshObject &obj)
 
 GeometryHandler (const MeshObject2D &obj)
 
 GeometryHandler (const std::shared_ptr< CSGObject > &obj)
 Constructor. More...
 
 GeometryHandler (CSGObject *obj)
 Constructor. More...
 
 GeometryHandler (IObjComponent *comp)
 Constructor. More...
 
void GetObjectGeom (detail::ShapeInfo::GeometryShape &type, std::vector< Kernel::V3D > &vector, double &innerRadius, double &radius, double &height) const
 return the actual type and points of one of the "standard" objects, cuboid/cone/cyl/sphere More...
 
const std::vector< uint32_t > & getTriangleFaces () const
 Extract the Faces of the triangles. More...
 
const std::vector< double > & getTriangleVertices () const
 Extract the vertices of the triangles. More...
 
bool hasShapeInfo () const
 
void initialize () const
 Prepare/Initialize Object/ObjComponent to be rendered. More...
 
size_t numberOfPoints () const
 get the number of points or vertices More...
 
size_t numberOfTriangles () const
 get the number of triangles More...
 
GeometryHandleroperator= (const MeshObject &obj)
 
GeometryHandleroperator= (const MeshObject2D &obj)
 
GeometryHandleroperator= (GeometryHandler handler)
 
void render () const
 Render Object or ObjComponent. More...
 
void setGeometryCache (size_t nPts, size_t nFaces, std::vector< double > &&pts, std::vector< uint32_t > &&faces)
 Sets the geometry cache using the triangulation information provided. More...
 
void setShapeInfo (detail::ShapeInfo &&shapeInfo)
 
const detail::ShapeInfoshapeInfo () const
 
 ~GeometryHandler ()
 Destructor. More...
 

Protected Attributes

CSGObjectm_csgObj = nullptr
 Object that uses this geometry handler. More...
 
IObjComponentm_objComp = nullptr
 ObjComponent that uses this geometry handler. More...
 
std::shared_ptr< detail::ShapeInfom_shapeInfo
 
std::unique_ptr< detail::GeometryTriangulatorm_triangulator
 

Static Private Attributes

static Kernel::LoggerPLog
 The official logger. More...
 

Detailed Description

Handles rendering of all object Geometry.

Author
Lamar Moore
Date
December 2017

Handles the rendering of all geometry types in Mantid.

Definition at line 57 of file GeometryHandler.h.

Constructor & Destructor Documentation

◆ GeometryHandler() [1/6]

Mantid::Geometry::GeometryHandler::GeometryHandler ( IObjComponent comp)

Constructor.

Definition at line 19 of file GeometryHandler.cpp.

◆ GeometryHandler() [2/6]

Mantid::Geometry::GeometryHandler::GeometryHandler ( const std::shared_ptr< CSGObject > &  obj)

Constructor.

Definition at line 21 of file GeometryHandler.cpp.

◆ GeometryHandler() [3/6]

Mantid::Geometry::GeometryHandler::GeometryHandler ( CSGObject obj)

Constructor.

Definition at line 24 of file GeometryHandler.cpp.

◆ GeometryHandler() [4/6]

Mantid::Geometry::GeometryHandler::GeometryHandler ( const MeshObject obj)

Definition at line 27 of file GeometryHandler.cpp.

References obj.

◆ GeometryHandler() [5/6]

Mantid::Geometry::GeometryHandler::GeometryHandler ( const MeshObject2D obj)

Definition at line 34 of file GeometryHandler.cpp.

References obj.

◆ GeometryHandler() [6/6]

Mantid::Geometry::GeometryHandler::GeometryHandler ( const GeometryHandler handler)

Definition at line 41 of file GeometryHandler.cpp.

References m_csgObj, m_objComp, m_shapeInfo, and m_triangulator.

◆ ~GeometryHandler()

Mantid::Geometry::GeometryHandler::~GeometryHandler ( )
default

Destructor.

Member Function Documentation

◆ canTriangulate()

bool Mantid::Geometry::GeometryHandler::canTriangulate ( ) const
inline

◆ clone()

std::shared_ptr< GeometryHandler > Mantid::Geometry::GeometryHandler::clone ( ) const

Definition at line 64 of file GeometryHandler.cpp.

◆ GetObjectGeom()

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

return the actual type and points of one of the "standard" objects, cuboid/cone/cyl/sphere

Definition at line 114 of file GeometryHandler.cpp.

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

◆ getTriangleFaces()

const std::vector< uint32_t > & Mantid::Geometry::GeometryHandler::getTriangleFaces ( ) const

Extract the Faces of the triangles.

Definition at line 100 of file GeometryHandler.cpp.

References canTriangulate(), and m_triangulator.

◆ getTriangleVertices()

const std::vector< double > & Mantid::Geometry::GeometryHandler::getTriangleVertices ( ) const

Extract the vertices of the triangles.

Definition at line 93 of file GeometryHandler.cpp.

References canTriangulate(), and m_triangulator.

◆ hasShapeInfo()

bool Mantid::Geometry::GeometryHandler::hasShapeInfo ( ) const
inline

Definition at line 86 of file GeometryHandler.h.

◆ initialize()

void Mantid::Geometry::GeometryHandler::initialize ( ) const

◆ numberOfPoints()

size_t Mantid::Geometry::GeometryHandler::numberOfPoints ( ) const

get the number of points or vertices

Definition at line 87 of file GeometryHandler.cpp.

References canTriangulate(), and m_triangulator.

◆ numberOfTriangles()

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

get the number of triangles

Definition at line 81 of file GeometryHandler.cpp.

References canTriangulate(), and m_triangulator.

◆ operator=() [1/3]

GeometryHandler & Mantid::Geometry::GeometryHandler::operator= ( const MeshObject obj)

◆ operator=() [2/3]

GeometryHandler & Mantid::Geometry::GeometryHandler::operator= ( const MeshObject2D obj)

◆ operator=() [3/3]

GeometryHandler & Mantid::Geometry::GeometryHandler::operator= ( GeometryHandler  handler)

Definition at line 53 of file GeometryHandler.cpp.

References m_csgObj, m_objComp, m_shapeInfo, and m_triangulator.

◆ render()

void Mantid::Geometry::GeometryHandler::render ( ) const

◆ setGeometryCache()

void Mantid::Geometry::GeometryHandler::setGeometryCache ( size_t  nPts,
size_t  nFaces,
std::vector< double > &&  pts,
std::vector< uint32_t > &&  faces 
)

Sets the geometry cache using the triangulation information provided.

Definition at line 107 of file GeometryHandler.cpp.

References canTriangulate(), and m_triangulator.

◆ setShapeInfo()

void Mantid::Geometry::GeometryHandler::setShapeInfo ( detail::ShapeInfo &&  shapeInfo)

Definition at line 121 of file GeometryHandler.cpp.

References m_shapeInfo, m_triangulator, and shapeInfo().

◆ shapeInfo()

const detail::ShapeInfo & Mantid::Geometry::GeometryHandler::shapeInfo ( ) const
inline

Definition at line 87 of file GeometryHandler.h.

Referenced by setShapeInfo().

Member Data Documentation

◆ m_csgObj

CSGObject* Mantid::Geometry::GeometryHandler::m_csgObj = nullptr
protected

Object that uses this geometry handler.

Definition at line 65 of file GeometryHandler.h.

Referenced by GeometryHandler(), initialize(), and operator=().

◆ m_objComp

IObjComponent* Mantid::Geometry::GeometryHandler::m_objComp = nullptr
protected

ObjComponent that uses this geometry handler.

Definition at line 64 of file GeometryHandler.h.

Referenced by GeometryHandler(), operator=(), and render().

◆ m_shapeInfo

std::shared_ptr<detail::ShapeInfo> Mantid::Geometry::GeometryHandler::m_shapeInfo
protected

Definition at line 62 of file GeometryHandler.h.

Referenced by GeometryHandler(), GetObjectGeom(), operator=(), render(), and setShapeInfo().

◆ m_triangulator

std::unique_ptr<detail::GeometryTriangulator> Mantid::Geometry::GeometryHandler::m_triangulator
protected

◆ PLog

Kernel::Logger& Mantid::Geometry::GeometryHandler::PLog
staticprivate

The official logger.

Definition at line 59 of file GeometryHandler.h.


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