12#include "MantidGeometry/DllConfig.h"
18#include <boost/optional.hpp>
27class PseudoRandomNumberGenerator;
38class vtkGeometryCacheReader;
39class vtkGeometryCacheWriter;
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 int procString(
const std::string &lineStr);
90 int complementaryObject(
const int cellNum,
91 std::string &lineStr);
92 int hasComplement()
const;
94 int populate(
const std::map<
int, std::shared_ptr<Surface>> &);
95 int createSurfaceList(
const int outFlag = 0);
97 int removeSurface(
const int surfNum);
98 int substituteSurf(
const int surfNum,
const int newSurfNum,
const std::shared_ptr<Surface> &surfPtr);
99 void makeComplement();
100 void convertComplement(
const std::map<int, CSGObject> &);
102 virtual void print()
const;
103 void printTree()
const;
106 bool isValid(
const std::map<int, int> &)
const;
112 std::vector<int> getSurfaceIndex()
const;
114 const std::vector<const Surface *> &
getSurfacePtr()
const {
return m_surList; }
118 std::string cellCompStr()
const;
119 std::string cellStr(
const std::map<int, CSGObject> &)
const;
121 std::string str()
const;
122 void write(std::ostream &)
const;
126 double distance(
const Track &track)
const override;
129 double solidAngle(
const Kernel::V3D &observer)
const override;
133 double triangulatedSolidAngle(
const Kernel::V3D &observer)
const;
137 double rayTraceSolidAngle(
const Kernel::V3D &observer)
const;
140 double volume()
const override;
144 void getBoundingBox(
double &xmax,
double &ymax,
double &zmax,
double &xmin,
double &ymin,
145 double &zmin)
const override;
148 const BoundingBox &getBoundingBox()
const override;
150 void defineBoundingBox(
const double &xMax,
const double &yMax,
const double &zMax,
const double &xMin,
151 const double &yMin,
const double &zMin);
153 void setNullBoundingBox();
155 int getPointInObject(
Kernel::V3D &point)
const override;
159 const size_t)
const override;
161 const BoundingBox &activeRegion,
const size_t)
const override;
164 void draw()
const override;
166 void initDraw()
const override;
168 std::shared_ptr<GeometryHandler> getGeometryHandler()
const override;
170 void setGeometryHandler(
const std::shared_ptr<GeometryHandler> &h);
173 void setVtkGeometryCacheWriter(std::shared_ptr<vtkGeometryCacheWriter>);
175 void setVtkGeometryCacheReader(std::shared_ptr<vtkGeometryCacheReader>);
181 std::string getShapeXML()
const;
184 int procPair(std::string &lineStr, std::map<
int, std::unique_ptr<Rule>> &ruleMap,
int &compUnit)
const;
185 std::unique_ptr<CompGrp> procComp(std::unique_ptr<Rule>)
const;
189 void calcBoundingBoxByRule();
192 void calcBoundingBoxByVertices();
195 void calcBoundingBoxByGeometry();
200 double monteCarloVolume()
const;
202 double singleShotMonteCarloVolume(
const int shotSize,
const size_t seed)
const;
221 friend class GeometryRenderer;
228 void updateGeometryHandler();
229 size_t numberOfTriangles()
const;
230 size_t numberOfVertices()
const;
232 const std::vector<uint32_t> &getTriangleFaces()
const;
233 const std::vector<double> &getTriangleVertices()
const;
241 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.