13#include "MantidGeometry/DllConfig.h"
27class PseudoRandomNumberGenerator;
38class vtkGeometryCacheReader;
39class vtkGeometryCacheWriter;
67 IObject *
clone()
const override {
return cloneWithMaterial(m_material); }
69 auto *copy =
new MeshObject(m_triangles, m_vertices, material);
72 copy->m_appliedRotation = m_appliedRotation;
76 void setID(
const std::string &
id)
override { m_id = id; }
77 const std::string &
id()
const override {
return m_id; }
79 int getName()
const override {
return 0; }
85 bool hasValidShape()
const override;
93 double distance(
const Track &track)
const override;
101 double volume()
const override;
105 void getBoundingBox(
double &xmax,
double &ymax,
double &zmax,
double &xmin,
double &ymin,
106 double &zmin)
const override;
109 const BoundingBox &getBoundingBox()
const override;
112 int getPointInObject(
Kernel::V3D &point)
const override;
116 const size_t)
const override;
118 const BoundingBox &activeRegion,
const size_t)
const override;
121 void draw()
const override;
123 void initDraw()
const override;
125 std::shared_ptr<GeometryHandler> getGeometryHandler()
const override;
127 void setGeometryHandler(
const std::shared_ptr<GeometryHandler> &h);
133 double &radius,
double &
height)
const override;
136 size_t numberOfVertices()
const;
137 std::vector<double> getVertices()
const;
138 const std::vector<Kernel::V3D> &getV3Ds()
const;
139 size_t numberOfTriangles()
const;
140 const std::vector<uint32_t> &getTriangles()
const;
151 void scale(
const double scaleFactor);
152 void updateGeometryHandler();
155 void saveNexus(Nexus::File *file,
const std::string &
group)
const;
157 static std::shared_ptr<MeshObject> loadNexus(Nexus::File *file,
const std::string &
group,
164 std::vector<Kernel::V3D> &intersectionPoints,
165 std::vector<Mantid::Geometry::TrackDirection> &entryExitFlags)
const;
176 const double M_TOLERANCE = 0.000001;
std::map< DeltaEMode::Type, std::string > index
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
IObject : Interface for geometry objects.
Kernel::Material m_material
material composition
std::shared_ptr< vtkGeometryCacheWriter > m_vtk_cache_writer
a pointer to a class for writing to the geometry cache
MeshObject(const MeshObject &)=delete
Copy constructor.
std::vector< Kernel::V3D > m_vertices
void setID(const std::string &id) override
std::vector< uint32_t > m_triangles
Contents Triangles are specified by indices into a list of vertices.
IObject * clone() const override
Clone.
std::shared_ptr< GeometryHandler > m_handler
Geometry Handle for rendering.
const Kernel::Matrix< double > & getAppliedRotation() const override
The goniometer rotation baked into this shape, i.e.
IObject * cloneWithMaterial(const Kernel::Material &material) const override
std::string m_id
string to return as ID
const std::string & id() const override
BoundingBox m_boundingBox
Cache for object's bounding box.
MeshObject & operator=(const MeshObject &)=delete
Assignment operator.
int getName() const override
~MeshObject() override=default
Destructor.
std::shared_ptr< vtkGeometryCacheReader > m_vtk_cache_reader
a pointer to a class for reading from the geometry cache
Defines a track as a start point and a direction.
A material is defined as being composed of a given element, defined as a PhysicalConstants::NeutronAt...
Defines a 1D pseudo-random number generator, i.e.
Helper class which provides the Collimation Length for SANS instruments.