Commit 400df480 authored by Karl Palmen's avatar Karl Palmen
Browse files

Rename Geometry::Object class to Geometry::CSGObject re #12827



The files are yet to be renamed

Signed-off-by: default avatarKarl Palmen <karl.palmen@stfc.ac.uk>
parent a2d24486
......@@ -246,8 +246,8 @@ protected:
void initDraw() const override {}
/// Returns the shape of the Object
const boost::shared_ptr<const Object> shape() const override {
return boost::shared_ptr<const Object>();
const boost::shared_ptr<const CSGObject> shape() const override {
return boost::shared_ptr<const CSGObject>();
}
/// Returns the material of the Object
const Kernel::Material material() const override;
......
......@@ -26,7 +26,7 @@ class ICompAssembly;
class IComponent;
class Instrument;
class ObjComponent;
class Object;
class CSGObject;
class ShapeFactory;
/** Creates an instrument data from a XML instrument description file
......@@ -359,7 +359,7 @@ private:
*/
std::map<std::string, bool> isTypeAssembly;
/// map which maps the type name to a shared pointer to a geometric shape
std::map<std::string, boost::shared_ptr<Geometry::Object>> mapTypeNameToShape;
std::map<std::string, boost::shared_ptr<Geometry::CSGObject>> mapTypeNameToShape;
/// Container to hold all detectors and monitors added to the instrument. Used
/// for 'facing' these to component specified under \<defaults\>. NOTE: Seems
/// unused, ever.
......
......@@ -24,7 +24,7 @@ class IComponent;
class IDetector;
class IObjComponent;
class Instrument;
class Object;
class CSGObject;
class ParameterMap;
class RectangularDetector;
......@@ -124,11 +124,11 @@ private:
int64_t m_sampleIndex = -1;
/// Null shared (empty shape)
boost::shared_ptr<const Mantid::Geometry::Object> m_nullShape;
boost::shared_ptr<const Mantid::Geometry::CSGObject> m_nullShape;
/// Shapes stored in fly-weight fashion
boost::shared_ptr<
std::vector<boost::shared_ptr<const Mantid::Geometry::Object>>> m_shapes;
std::vector<boost::shared_ptr<const Mantid::Geometry::CSGObject>>> m_shapes;
/// Scale factors
boost::shared_ptr<std::vector<Eigen::Vector3d>> m_scaleFactors;
......
......@@ -93,8 +93,8 @@ public:
Kernel::V3D getPos() const override;
//! Set the outline of the assembly
boost::shared_ptr<Object> createOutline();
void setOutline(boost::shared_ptr<const Object> obj);
boost::shared_ptr<CSGObject> createOutline();
void setOutline(boost::shared_ptr<const CSGObject> obj);
/** Test the intersection of the ray with the children of the component
* assembly */
......
......@@ -58,7 +58,7 @@ public:
// probably add others)
explicit ObjComponent(const std::string &name, IComponent *parent = nullptr);
explicit ObjComponent(const std::string &name,
boost::shared_ptr<const Object> shape,
boost::shared_ptr<const CSGObject> shape,
IComponent *parent = nullptr);
/** Virtual Copy Constructor
......@@ -89,9 +89,9 @@ public:
void initDraw() const override;
/// Return the shape of the component
const boost::shared_ptr<const Object> shape() const override;
const boost::shared_ptr<const CSGObject> shape() const override;
/// Set a new shape on the component
void setShape(boost::shared_ptr<const Object> newShape);
void setShape(boost::shared_ptr<const CSGObject> newShape);
/// Return the material this component is made from
const Kernel::Material material() const override;
......@@ -103,7 +103,7 @@ protected:
// Made a pointer to a const object. Since this is a shared object we
// shouldn't be
// exposing non-const methods of Object through this class.
boost::shared_ptr<const Object> m_shape;
boost::shared_ptr<const CSGObject> m_shape;
const Kernel::V3D factorOutComponentPosition(const Kernel::V3D &point) const;
const Kernel::V3D takeOutRotation(Kernel::V3D point) const;
......
......@@ -65,7 +65,7 @@ public:
static bool compareName(const std::string &proposedMatch);
/// Create all the detector pixels of this rectangular detector.
void initialize(boost::shared_ptr<Object> shape, int xpixels, double xstart,
void initialize(boost::shared_ptr<CSGObject> shape, int xpixels, double xstart,
double xstep, int ypixels, double ystart, double ystep,
int idstart, bool idfillbyfirst_y, int idstepbyrow,
int idstep = 1);
......@@ -151,7 +151,7 @@ public:
void initDraw() const override;
/// Returns the shape of the Object
const boost::shared_ptr<const Object> shape() const override;
const boost::shared_ptr<const CSGObject> shape() const override;
/// Returns the material of the detector
const Kernel::Material material() const override;
......@@ -192,7 +192,7 @@ private:
unsigned int m_textureID;
/// Pointer to the shape of the pixels in this detector array.
boost::shared_ptr<Object> mShape;
boost::shared_ptr<CSGObject> mShape;
/// minimum detector id
int m_minDetId;
/// maximum detector id
......
......@@ -50,7 +50,7 @@ public:
std::string type() const override { return "RectangularDetectorPixel"; }
RectangularDetectorPixel(const std::string &name, int id,
boost::shared_ptr<Object> shape, IComponent *parent,
boost::shared_ptr<CSGObject> shape, IComponent *parent,
RectangularDetector *panel, size_t row, size_t col);
RectangularDetectorPixel();
......
......@@ -139,7 +139,7 @@ public:
void initDraw() const override;
/// Returns the shape of the Object
const boost::shared_ptr<const Object> shape() const override;
const boost::shared_ptr<const CSGObject> shape() const override;
/// Returns the material of the detector
const Kernel::Material material() const override;
......
......@@ -60,18 +60,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_GEOMETRY_DLL Object {
class MANTID_GEOMETRY_DLL CSGObject {
public:
/// Default constructor
Object();
CSGObject();
/// Constructor providing shape xml.
Object(const std::string &shapeXML);
CSGObject(const std::string &shapeXML);
/// Copy constructor
Object(const Object &);
CSGObject(const CSGObject &);
/// Assignment operator
Object &operator=(const Object &);
CSGObject &operator=(const CSGObject &);
/// Destructor
virtual ~Object();
virtual ~CSGObject();
/// Return the top rule
const Rule *topRule() const { return TopRule.get(); }
......@@ -99,7 +99,7 @@ public:
int substituteSurf(const int SurfN, const int NsurfN,
const boost::shared_ptr<Surface> &SPtr);
void makeComplement();
void convertComplement(const std::map<int, Object> &);
void convertComplement(const std::map<int, CSGObject> &);
virtual void print() const;
void printTree() const;
......@@ -117,7 +117,7 @@ public:
std::vector<const Surface *> &getSurfacePtr() { return SurList; }
std::string cellCompStr() const;
std::string cellStr(const std::map<int, Object> &) const;
std::string cellStr(const std::map<int, CSGObject> &) const;
std::string str() const;
void write(std::ostream &) const; ///< MCNPX output
......@@ -264,9 +264,9 @@ protected:
};
/// Typdef for a shared pointer
typedef boost::shared_ptr<Object> Object_sptr;
typedef boost::shared_ptr<CSGObject> Object_sptr;
/// Typdef for a shared pointer to a const object
typedef boost::shared_ptr<const Object> Object_const_sptr;
typedef boost::shared_ptr<const CSGObject> Object_const_sptr;
} // NAMESPACE Geometry
} // NAMESPACE Mantid
......
......@@ -10,7 +10,7 @@ namespace Mantid {
namespace Geometry {
class Object;
class CSGObject;
class Surface;
/**
......@@ -298,7 +298,7 @@ Care must be taken to avoid a cyclic loop
class MANTID_GEOMETRY_DLL CompObj : public Rule {
private:
int objN; ///< Object number
Object *key; ///< Object Pointer
CSGObject *key; ///< Object Pointer
CompObj *doClone() const override;
protected:
......@@ -323,14 +323,14 @@ public:
} ///< Always returns true (1)
void setObjN(const int Ky); ///< set object Number
void setObj(Object *); ///< Set a Object state
void setObj(CSGObject *); ///< Set a Object state
bool isValid(const Kernel::V3D &) const override;
bool isValid(const std::map<int, int> &) const override;
/// Get object number of component
int getObjN() const { return objN; }
int simplify() override;
Object *getObj() const { return key; } ///< Get Object Ptr
CSGObject *getObj() const { return key; } ///< Get Object Ptr
std::string display() const override;
std::string displayAddress() const override;
void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin,
......
......@@ -26,7 +26,7 @@ namespace Mantid {
namespace Geometry {
class Surface;
class Object;
class CSGObject;
struct CuboidCorners {
Kernel::V3D lfb;
......@@ -83,13 +83,13 @@ File change history is stored at: <https://github.com/mantidproject/mantid>
*/
class MANTID_GEOMETRY_DLL ShapeFactory {
public:
template <typename ObjectType = Object>
template <typename ObjectType = CSGObject>
boost::shared_ptr<ObjectType> createShape(Poco::XML::Element *pElem);
template <typename ObjectType = Object>
template <typename ObjectType = CSGObject>
boost::shared_ptr<ObjectType> createShape(std::string shapeXML,
bool addTypeTag = true);
boost::shared_ptr<Object> createHexahedralShape(double xlb, double xlf,
boost::shared_ptr<CSGObject> createHexahedralShape(double xlb, double xlf,
double xrf, double xrb,
double ylb, double ylf,
double yrf, double yrb);
......@@ -154,7 +154,7 @@ private:
const std::string &name);
double getDoubleAttribute(Poco::XML::Element *pElem, const std::string &name);
Kernel::V3D parsePosition(Poco::XML::Element *pElem);
void createGeometryHandler(Poco::XML::Element *, boost::shared_ptr<Object>);
void createGeometryHandler(Poco::XML::Element *, boost::shared_ptr<CSGObject>);
};
} // namespace Geometry
......
......@@ -58,7 +58,7 @@ struct MANTID_GEOMETRY_DLL Link {
* hit. (Default=NULL)
*/
inline Link(const Kernel::V3D &entry, const Kernel::V3D &exit,
const double totalDistance, const Object &obj,
const double totalDistance, const CSGObject &obj,
const ComponentID compID = nullptr)
: entryPoint(entry), exitPoint(exit), distFromStart(totalDistance),
distInsideObject(entryPoint.distance(exitPoint)), object(&obj),
......@@ -78,7 +78,7 @@ struct MANTID_GEOMETRY_DLL Link {
Kernel::V3D exitPoint; ///< Exit point
double distFromStart; ///< Total distance from track beginning
double distInsideObject; ///< Total distance covered inside object
const Object *object; ///< The object that was intersected
const CSGObject *object; ///< The object that was intersected
ComponentID componentID; ///< ComponentID of the intersected component
//@}
};
......@@ -104,7 +104,7 @@ struct IntersectionPoint {
* @param obj :: A reference to the object that was intersected
*/
inline IntersectionPoint(const int flag, const Kernel::V3D &end,
const double distFromStartOfTrack, const Object &obj,
const double distFromStartOfTrack, const CSGObject &obj,
const ComponentID compID = nullptr)
: directionFlag(flag), endPoint(end), distFromStart(distFromStartOfTrack),
object(&obj), componentID(compID) {}
......@@ -130,7 +130,7 @@ struct IntersectionPoint {
int directionFlag; ///< Directional flag
Kernel::V3D endPoint; ///< Point
double distFromStart; ///< Total distance from track begin
const Object *object; ///< The object that was intersected
const CSGObject *object; ///< The object that was intersected
ComponentID componentID; ///< Unique component ID
//@}
};
......@@ -153,10 +153,10 @@ public:
Track(const Kernel::V3D &startPt, const Kernel::V3D &unitVector);
/// Adds a point of intersection to the track
void addPoint(const int directionFlag, const Kernel::V3D &endPoint,
const Object &obj, const ComponentID compID = nullptr);
const CSGObject &obj, const ComponentID compID = nullptr);
/// Adds a link to the track
int addLink(const Kernel::V3D &firstPoint, const Kernel::V3D &secondPoint,
const double distanceAlongTrack, const Object &obj,
const double distanceAlongTrack, const CSGObject &obj,
const ComponentID compID = nullptr);
/// Remove touching Links that have identical components
void removeCojoins();
......
......@@ -49,7 +49,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
*/
class ObjComponent;
class Object;
class CSGObject;
class MANTID_GEOMETRY_DLL BitmapGeometryHandler : public GeometryHandler {
private:
static Kernel::Logger &PLog; ///< The official logger
......@@ -71,9 +71,9 @@ public:
BitmapGeometryHandler *createInstance(
IObjComponent *) override; ///< Create an instance of concrete geometry
/// handler for ObjComponent
BitmapGeometryHandler *createInstance(boost::shared_ptr<Object>)
BitmapGeometryHandler *createInstance(boost::shared_ptr<CSGObject>)
override; ///< Create an instance of concrete geometry handler for Object
GeometryHandler *createInstance(Object *)
GeometryHandler *createInstance(CSGObject *)
override; ///< Create an instance of concrete geometry handler for Object
void Triangulate() override; ///< Triangulate the Object
void Render() override; ///< Render Object or ObjComponent
......
......@@ -39,16 +39,16 @@ namespace Geometry {
File change history is stored at: <https://github.com/mantidproject/mantid>
*/
class Object;
class CSGObject;
class MANTID_GEOMETRY_DLL CacheGeometryGenerator {
private:
Object *Obj; ///< Input Object
CSGObject *Obj; ///< Input Object
int mNoOfVertices; ///< number of vertices
int mNoOfTriangles; ///< number of triangles
double *mPoints; ///<double array or points
int *mFaces; ///< Integer array of faces
public:
CacheGeometryGenerator(Object *obj);
CacheGeometryGenerator(CSGObject *obj);
~CacheGeometryGenerator();
/// Generate the trangles
void Generate();
......
......@@ -14,7 +14,7 @@ class GeometryHandler;
class CacheGeometryRenderer;
class CacheGeometryGenerator;
class IObjComponent;
class Object;
class CSGObject;
/**
\class CacheGeometryHandler
......@@ -57,13 +57,13 @@ private:
public:
CacheGeometryHandler(IObjComponent *comp); ///< Constructor
CacheGeometryHandler(boost::shared_ptr<Object> obj); ///< Constructor
CacheGeometryHandler(Object *obj); ///< Constructor
CacheGeometryHandler(boost::shared_ptr<CSGObject> obj); ///< Constructor
CacheGeometryHandler(CSGObject *obj); ///< Constructor
boost::shared_ptr<GeometryHandler> clone() const override;
~CacheGeometryHandler() override; ///< Destructor
GeometryHandler *createInstance(IObjComponent *comp) override;
GeometryHandler *createInstance(boost::shared_ptr<Object> obj) override;
GeometryHandler *createInstance(Object *obj) override;
GeometryHandler *createInstance(boost::shared_ptr<CSGObject> obj) override;
GeometryHandler *createInstance(CSGObject *obj) override;
void Triangulate() override;
void Render() override;
......
......@@ -12,7 +12,7 @@ namespace Mantid {
namespace Geometry {
class IObjComponent;
class ObjComponent;
class Object;
class CSGObject;
/**
\class GeometryHandler
......@@ -49,14 +49,14 @@ private:
protected:
IObjComponent *ObjComp; ///< ObjComponent that uses this geometry handler
Object *Obj; ///< Object that uses this geometry handler
CSGObject *Obj; ///< Object that uses this geometry handler
bool boolTriangulated; ///< state of the geometry triangulation
bool
boolIsInitialized; ///< state of the geometry initialization for rendering
public:
GeometryHandler(IObjComponent *comp); ///< Constructor
GeometryHandler(boost::shared_ptr<Object> obj); ///<Constructor
GeometryHandler(Object *obj); ///<Constructor
GeometryHandler(boost::shared_ptr<CSGObject> obj); ///<Constructor
GeometryHandler(CSGObject *obj); ///<Constructor
virtual boost::shared_ptr<GeometryHandler>
clone() const = 0; ///< Virtual copy constructor
virtual ~GeometryHandler();
......@@ -67,10 +67,10 @@ public:
/// handler for
/// ObjComponent
virtual GeometryHandler *
createInstance(boost::shared_ptr<Object>) = 0; ///< Create an instance of
createInstance(boost::shared_ptr<CSGObject>) = 0; ///< Create an instance of
/// concrete geometry
/// handler for Object
virtual GeometryHandler *createInstance(Object *) = 0; ///< Create an instance
virtual GeometryHandler *createInstance(CSGObject *) = 0; ///< Create an instance
/// of concrete geometry
/// handler for Object
virtual void Triangulate() = 0; ///< Triangulate the Object
......
......@@ -12,7 +12,7 @@ namespace Geometry {
class GeometryHandler;
class GluGeometryRenderer;
class IObjComponent;
class Object;
class CSGObject;
/**
\class GluGeometryHandler
\brief Place holder for geometry triangulation and rendering with special
......@@ -72,13 +72,13 @@ private:
public:
GluGeometryHandler(const GluGeometryHandler &other);
GluGeometryHandler(IObjComponent *comp); ///< Constructor
GluGeometryHandler(boost::shared_ptr<Object> obj); ///< Constructor
GluGeometryHandler(Object *obj); ///< Constructor
GluGeometryHandler(boost::shared_ptr<CSGObject> obj); ///< Constructor
GluGeometryHandler(CSGObject *obj); ///< Constructor
boost::shared_ptr<GeometryHandler> clone() const override;
~GluGeometryHandler() override; ///< Destructor
GeometryHandler *createInstance(IObjComponent *comp) override;
GeometryHandler *createInstance(boost::shared_ptr<Object> obj) override;
GeometryHandler *createInstance(Object *) override;
GeometryHandler *createInstance(boost::shared_ptr<CSGObject> obj) override;
GeometryHandler *createInstance(CSGObject *) override;
/// sets the geometry handler for a cuboid
void setCuboid(const Kernel::V3D &, const Kernel::V3D &, const Kernel::V3D &,
const Kernel::V3D &);
......
......@@ -7,7 +7,7 @@ class TopoDS_Shape;
namespace Mantid {
namespace Geometry {
class Object;
class CSGObject;
class Intersection;
class Union;
class SurfPoint;
......@@ -54,13 +54,13 @@ class Torus;
*/
class MANTID_GEOMETRY_DLL OCGeometryGenerator {
private:
const Object *Obj; ///< Input Object
const CSGObject *Obj; ///< Input Object
TopoDS_Shape *ObjSurface; ///< Storage for the output surface
/// Analyze the object
void AnalyzeObject();
public:
OCGeometryGenerator(const Object *obj);
OCGeometryGenerator(const CSGObject *obj);
~OCGeometryGenerator();
void Generate();
TopoDS_Shape *getObjectSurface();
......
......@@ -10,7 +10,7 @@ class GeometryHandler;
class OCGeometryRenderer;
class OCGeometryGenerator;
class IObjComponent;
class Object;
class CSGObject;
/**
\class OCGeometryHandler
\brief Place holder for OpenCascade library geometry triangulation and
......@@ -56,14 +56,14 @@ private:
Triangulator; ///< Geometry generator to triangulate Object
public:
OCGeometryHandler(IObjComponent *comp); ///< Constructor
OCGeometryHandler(boost::shared_ptr<Object> obj); ///< Constructor
OCGeometryHandler(Object *obj); ///< Constructor
OCGeometryHandler(boost::shared_ptr<CSGObject> obj); ///< Constructor
OCGeometryHandler(CSGObject *obj); ///< Constructor
boost::shared_ptr<GeometryHandler>
clone() const override; ///< Virtual copy constructor
~OCGeometryHandler() override; ///< Destructor
GeometryHandler *createInstance(IObjComponent *comp) override;
GeometryHandler *createInstance(boost::shared_ptr<Object> obj) override;
GeometryHandler *createInstance(Object *) override;
GeometryHandler *createInstance(boost::shared_ptr<CSGObject> obj) override;
GeometryHandler *createInstance(CSGObject *) override;
void Triangulate() override;
void Render() override;
void Initialize() override;
......
......@@ -44,7 +44,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
*/
class ObjComponent;
class Object;
class CSGObject;
class MANTID_GEOMETRY_DLL StructuredGeometryHandler : public GeometryHandler {
private:
static Kernel::Logger &PLog; ///< The official logger
......@@ -61,9 +61,9 @@ public:
StructuredGeometryHandler *createInstance(
IObjComponent *) override; ///< Create an instance of concrete geometry
/// handler for ObjComponent
StructuredGeometryHandler *createInstance(boost::shared_ptr<Object>)
StructuredGeometryHandler *createInstance(boost::shared_ptr<CSGObject>)
override; ///< Create an instance of concrete geometry handler for Object
GeometryHandler *createInstance(Object *)
GeometryHandler *createInstance(CSGObject *)
override; ///< Create an instance of concrete geometry handler for Object
void Triangulate() override; ///< Triangulate the Object
void Render() override; ///< Render Object or ObjComponent
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment