12#include "MantidGeometry/DllConfig.h"
27class PseudoRandomNumberGenerator;
38class vtkGeometryCacheReader;
39class vtkGeometryCacheWriter;
67 auto obj = this->clone();
68 obj->setMaterial(material);
77 void setID(
const std::string &
id)
override { m_id = id; }
82 const std::string &
id()
const override {
return m_id; }
84 void setName(
const int objNum) { m_objNum = objNum; }
85 int getName()
const override {
return m_objNum; }
91 bool hasValidShape()
const override;
92 int setObject(
const int objName,
const std::string &lineStr);
93 void procString(
const std::string &lineStr);
94 int hasComplement()
const;
96 int populate(
const std::map<
int, std::shared_ptr<Surface>> &);
97 int createSurfaceList(
const int outFlag = 0);
99 int removeSurface(
const int surfNum);
100 int substituteSurf(
const int surfNum,
const int newSurfNum,
const std::shared_ptr<Surface> &surfPtr);
101 void makeComplement();
102 void convertComplement(
const std::map<int, CSGObject> &);
104 virtual void print()
const;
105 void printTree()
const;
108 bool isValid(
const std::map<int, int> &)
const;
114 std::vector<int> getSurfaceIndex()
const;
116 const std::vector<const Surface *> &
getSurfacePtr()
const {
return m_surList; }
120 std::string cellCompStr()
const;
121 std::string cellStr(
const std::map<int, CSGObject> &)
const;
123 std::string str()
const;
124 void write(std::ostream &)
const;
128 double distance(
const Track &track)
const override;
139 double rayTraceSolidAngle(
const Kernel::V3D &observer)
const;
142 double volume()
const override;
146 void getBoundingBox(
double &xmax,
double &ymax,
double &zmax,
double &xmin,
double &ymin,
147 double &zmin)
const override;
150 const BoundingBox &getBoundingBox()
const override;
152 void defineBoundingBox(
const double &xMax,
const double &yMax,
const double &zMax,
const double &xMin,
153 const double &yMin,
const double &zMin);
155 void setNullBoundingBox();
157 int getPointInObject(
Kernel::V3D &point)
const override;
161 const size_t)
const override;
163 const BoundingBox &activeRegion,
const size_t)
const override;
166 void draw()
const override;
168 void initDraw()
const override;
170 std::shared_ptr<GeometryHandler> getGeometryHandler()
const override;
172 void setGeometryHandler(
const std::shared_ptr<GeometryHandler> &h);
174 void setVtkGeometryCacheWriter(std::shared_ptr<vtkGeometryCacheWriter>);
176 void setVtkGeometryCacheReader(std::shared_ptr<vtkGeometryCacheReader>);
180 double &radius,
double &
height)
const override;
182 std::string getShapeXML()
const;
184 const std::vector<uint32_t> &getTriangleFaces()
const;
185 const std::vector<double> &getTriangleVertices()
const;
188 int procPair(std::string &lineStr, std::map<
int, std::unique_ptr<Rule>> &ruleMap,
int &compUnit)
const;
189 std::unique_ptr<CompGrp> procComp(std::unique_ptr<Rule>)
const;
193 void calcBoundingBoxByRule();
196 void calcBoundingBoxByVertices();
199 void calcBoundingBoxByGeometry();
204 double monteCarloVolume()
const;
206 double singleShotMonteCarloVolume(
const int shotSize,
const size_t seed)
const;
225 friend class GeometryRenderer;
232 void updateGeometryHandler();
233 size_t numberOfTriangles()
const;
234 size_t numberOfVertices()
const;
242 bool m_isFiniteGeometry =
true;
Mantid::Kernel::Quat(ComponentInfo::* rotation)(const size_t) const
double obj
the value of the quadratic function
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
Constructive Solid Geometry object.
void setName(const int objNum)
Set Name.
void setID(const std::string &id) override
int m_objNum
Creation number.
std::shared_ptr< vtkGeometryCacheReader > vtkCacheReader
a pointer to a class for reading from the geometry cache
std::string m_shapeXML
original shape xml used to generate this object.
const std::vector< const Surface * > & getSurfacePtr() const
Get the list of surfaces (const version)
double AABByMin
xmin of Axis aligned bounding box cache
std::vector< const Surface * > m_surList
Full surfaces (make a map.
const Kernel::Matrix< double > & getAppliedRotation() const override
The goniometer rotation baked into this shape, i.e.
double AABBzMin
zmin of Axis Aligned Bounding Box Cache
bool isFiniteGeometry() const override
~CSGObject() override
Destructor.
std::string m_id
Optional string identifier.
std::unique_ptr< Kernel::Material > m_material
material composition
int addSurfString(const std::string &)
Not implemented.
const std::string & id() const override
double AABBzMax
zmax of Axis aligned bounding box cache
double AABBxMin
xmin of Axis aligned bounding box cache
std::shared_ptr< GeometryHandler > m_handler
Geometry Handle for rendering.
const Rule * topRule() const
Return the top rule.
double AABByMax
ymax of Axis aligned bounding box cache
bool bGeometryCaching
Is geometry caching enabled?
int getName() const override
Get Name.
std::shared_ptr< vtkGeometryCacheWriter > vtkCacheWriter
a pointer to a class for writing to the geometry cache
double AABBxMax
xmax of Axis aligned bounding box cache
BoundingBox m_boundingBox
Object's bounding box.
IObject * clone() const override
Clone.
bool boolBounded
flag true if a bounding box exists, either by
IObject * cloneWithMaterial(const Kernel::Material &material) const override
std::vector< const Surface * > & getSurfacePtr()
Get the list of surfaces.
void setAppliedGoniometerRotation(const Kernel::Matrix< double > &rotation)
Record-only: the surfaces are already rotated by the time ShapeFactory calls this.
std::unique_ptr< Rule > m_topRule
Top rule [ Geometric scope of object].
void setFiniteGeometryFlag(bool isFinite) override
Handles rendering of all object Geometry.
IObject : Interface for geometry objects.
Object generation rule tree.
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.