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; }
78 const std::string &
id()
const override {
return m_id; }
80 void setName(
const int objNum) { m_objNum = objNum; }
81 int getName()
const override {
return m_objNum; }
87 bool hasValidShape()
const override;
88 int setObject(
const int objName,
const std::string &lineStr);
89 void procString(
const std::string &lineStr);
90 int hasComplement()
const;
92 int populate(
const std::map<
int, std::shared_ptr<Surface>> &);
93 int createSurfaceList(
const int outFlag = 0);
95 int removeSurface(
const int surfNum);
96 int substituteSurf(
const int surfNum,
const int newSurfNum,
const std::shared_ptr<Surface> &surfPtr);
97 void makeComplement();
98 void convertComplement(
const std::map<int, CSGObject> &);
100 virtual void print()
const;
101 void printTree()
const;
104 bool isValid(
const std::map<int, int> &)
const;
110 std::vector<int> getSurfaceIndex()
const;
112 const std::vector<const Surface *> &
getSurfacePtr()
const {
return m_surList; }
116 std::string cellCompStr()
const;
117 std::string cellStr(
const std::map<int, CSGObject> &)
const;
119 std::string str()
const;
120 void write(std::ostream &)
const;
124 double distance(
const Track &track)
const override;
135 double rayTraceSolidAngle(
const Kernel::V3D &observer)
const;
138 double volume()
const override;
142 void getBoundingBox(
double &xmax,
double &ymax,
double &zmax,
double &xmin,
double &ymin,
143 double &zmin)
const override;
146 const BoundingBox &getBoundingBox()
const override;
148 void defineBoundingBox(
const double &xMax,
const double &yMax,
const double &zMax,
const double &xMin,
149 const double &yMin,
const double &zMin);
151 void setNullBoundingBox();
153 int getPointInObject(
Kernel::V3D &point)
const override;
157 const size_t)
const override;
159 const BoundingBox &activeRegion,
const size_t)
const override;
162 void draw()
const override;
164 void initDraw()
const override;
166 std::shared_ptr<GeometryHandler> getGeometryHandler()
const override;
168 void setGeometryHandler(
const std::shared_ptr<GeometryHandler> &h);
170 void setVtkGeometryCacheWriter(std::shared_ptr<vtkGeometryCacheWriter>);
172 void setVtkGeometryCacheReader(std::shared_ptr<vtkGeometryCacheReader>);
176 double &radius,
double &
height)
const override;
178 std::string getShapeXML()
const;
181 int procPair(std::string &lineStr, std::map<
int, std::unique_ptr<Rule>> &ruleMap,
int &compUnit)
const;
182 std::unique_ptr<CompGrp> procComp(std::unique_ptr<Rule>)
const;
186 void calcBoundingBoxByRule();
189 void calcBoundingBoxByVertices();
192 void calcBoundingBoxByGeometry();
197 double monteCarloVolume()
const;
199 double singleShotMonteCarloVolume(
const int shotSize,
const size_t seed)
const;
218 friend class GeometryRenderer;
225 void updateGeometryHandler();
226 size_t numberOfTriangles()
const;
227 size_t numberOfVertices()
const;
229 const std::vector<uint32_t> &getTriangleFaces()
const;
230 const std::vector<double> &getTriangleVertices()
const;
238 bool m_isFiniteGeometry =
true;
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.
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.
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.