Commit fba206e9 authored by mantid-builder's avatar mantid-builder Committed by Karl Palmen
Browse files

clang-format PR21245 d546b53b

parent d546b53b
......@@ -114,11 +114,11 @@ protected:
*/
virtual void initialiseCachedDistances() = 0;
API::MatrixWorkspace_sptr m_inputWS; ///< A pointer to the input workspace
API::MatrixWorkspace_sptr m_inputWS; ///< A pointer to the input workspace
const Geometry::CSGObject *m_sampleObject; ///< Local cache of sample object.
Kernel::V3D m_beamDirection; ///< The direction of the beam.
std::vector<double> m_L1s, ///< Cached L1 distances
m_elementVolumes; ///< Cached element volumes
Kernel::V3D m_beamDirection; ///< The direction of the beam.
std::vector<double> m_L1s, ///< Cached L1 distances
m_elementVolumes; ///< Cached element volumes
std::vector<Kernel::V3D> m_elementPositions; ///< Cached element positions
size_t m_numVolumeElements; ///< The number of volume elements
double m_sampleVolume; ///< The total volume of the sample
......
......@@ -115,7 +115,8 @@ private:
const Geometry::ParameterMap *paraMap;
/// A lookup of previously seen shape objects used to save calculation time as
/// most detectors have the same shape
std::map<const Geometry::IObject *, std::pair<double, Kernel::V3D>> shapeCache;
std::map<const Geometry::IObject *, std::pair<double, Kernel::V3D>>
shapeCache;
/// Sample position
Kernel::V3D samplePos;
/// The spectra numbers that were skipped
......
......@@ -98,11 +98,11 @@ public:
int version() const override { return (1); }
protected:
API::MatrixWorkspace_sptr m_inputWS; ///< A pointer to the input workspace
API::MatrixWorkspace_sptr m_inputWS; ///< A pointer to the input workspace
const Geometry::CSGObject *m_sampleObject; ///< Local cache of sample object.
Kernel::V3D m_beamDirection; ///< The direction of the beam.
std::vector<double> m_L1s, ///< Cached L1 distances
m_elementVolumes; ///< Cached element volumes
Kernel::V3D m_beamDirection; ///< The direction of the beam.
std::vector<double> m_L1s, ///< Cached L1 distances
m_elementVolumes; ///< Cached element volumes
std::vector<Kernel::V3D> m_elementPositions; ///< Cached element positions
size_t m_numVolumeElements; ///< The number of volume elements
double m_sampleVolume; ///< The total volume of the sample
......
......@@ -125,8 +125,9 @@ Geometry::CSGObject AnyShapeAbsorption::constructGaugeVolume() {
"the input workspace");
// Retrieve and create the gauge volume shape
boost::shared_ptr<const Geometry::CSGObject> volume = ShapeFactory().createShape(
m_inputWS->run().getProperty("GaugeVolume")->value());
boost::shared_ptr<const Geometry::CSGObject> volume =
ShapeFactory().createShape(
m_inputWS->run().getProperty("GaugeVolume")->value());
// Although DefineGaugeVolume algorithm will have checked validity of XML, do
// so again here
if (!(volume->topRule()) && volume->getSurfacePtr().empty()) {
......
......@@ -280,10 +280,10 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det,
detAxis = Kernel::V3D(0, 1, 0);
// assume radii in z and x and the axis is in the y
PARALLEL_CRITICAL(deteff_shapecachea) {
this->shapeCache.insert(
std::pair<const Geometry::IObject *, std::pair<double, Kernel::V3D>>(
shape_sptr.get(),
std::pair<double, Kernel::V3D>(detRadius, detAxis)));
this->shapeCache.insert(std::pair<const Geometry::IObject *,
std::pair<double, Kernel::V3D>>(
shape_sptr.get(),
std::pair<double, Kernel::V3D>(detRadius, detAxis)));
}
return;
}
......@@ -295,10 +295,10 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det,
// assume that y and z are radii of the cylinder's circular cross-section
// and the axis is perpendicular, in the x direction
PARALLEL_CRITICAL(deteff_shapecacheb) {
this->shapeCache.insert(
std::pair<const Geometry::IObject *, std::pair<double, Kernel::V3D>>(
shape_sptr.get(),
std::pair<double, Kernel::V3D>(detRadius, detAxis)));
this->shapeCache.insert(std::pair<const Geometry::IObject *,
std::pair<double, Kernel::V3D>>(
shape_sptr.get(),
std::pair<double, Kernel::V3D>(detRadius, detAxis)));
}
return;
}
......@@ -307,10 +307,10 @@ void He3TubeEfficiency::getDetectorGeometry(const Geometry::IDetector &det,
detRadius = xDist / 2.0;
detAxis = Kernel::V3D(0, 0, 1);
PARALLEL_CRITICAL(deteff_shapecachec) {
this->shapeCache.insert(
std::pair<const Geometry::IObject *, std::pair<double, Kernel::V3D>>(
shape_sptr.get(),
std::pair<double, Kernel::V3D>(detRadius, detAxis)));
this->shapeCache.insert(std::pair<const Geometry::IObject *,
std::pair<double, Kernel::V3D>>(
shape_sptr.get(),
std::pair<double, Kernel::V3D>(detRadius, detAxis)));
}
return;
}
......
......@@ -138,8 +138,8 @@ private:
Kernel::V3D m_beamDir; // Directional vector for beam
double m_srcR2; // beam penumbra radius (m)
double m_halfSampleHeight, m_halfSampleWidth, m_halfSampleThick; // (m)
Geometry::CSGObject const *m_sampleShape; // sample shape
SampleComptonProperties *m_sampleProps; // description of sample properties
Geometry::CSGObject const *m_sampleShape; // sample shape
SampleComptonProperties *m_sampleProps; // description of sample properties
double m_detHeight, m_detWidth, m_detThick; // (m)
double m_tmin, m_tmax, m_delt; // min, max & dt TOF value
double m_foilRes; // resolution in energy of foil
......
......@@ -15,7 +15,7 @@ class V3D;
}
namespace Geometry {
//class BoundingBox;
// class BoundingBox;
class IComponent;
class IObject;
}
......
......@@ -359,7 +359,8 @@ 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::IObject>> mapTypeNameToShape;
std::map<std::string, boost::shared_ptr<Geometry::IObject>>
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.
......
......@@ -80,7 +80,7 @@ public:
void setID(const std::string &id) { m_id = id; }
inline const std::string &id() const { return m_id; }
void setName(const int nx) override { ObjNum = nx; } ///< Set Name
void setName(const int nx) override { ObjNum = nx; } ///< Set Name
int getName() const override { return ObjNum; } ///< Get Name
void setMaterial(const Kernel::Material &material) override;
......@@ -106,7 +106,8 @@ public:
virtual void print() const;
void printTree() const;
bool isValid(const Kernel::V3D &) const override; ///< Check if a point is valid
bool
isValid(const Kernel::V3D &) const override; ///< Check if a point is valid
bool isValid(const std::map<int, int> &)
const; ///< Check if a set of surfaces are valid.
bool isOnSide(const Kernel::V3D &) const override;
......@@ -114,7 +115,9 @@ public:
std::vector<int> getSurfaceIndex() const;
/// Get the list of surfaces (const version)
const std::vector<const Surface *> &getSurfacePtr() const { return m_SurList; }
const std::vector<const Surface *> &getSurfacePtr() const {
return m_SurList;
}
/// Get the list of surfaces
std::vector<const Surface *> &getSurfacePtr() { return m_SurList; }
......@@ -176,9 +179,11 @@ public:
void setGeometryHandler(boost::shared_ptr<GeometryHandler> h);
/// set vtkGeometryCache writer
void setVtkGeometryCacheWriter(boost::shared_ptr<vtkGeometryCacheWriter>) override;
void setVtkGeometryCacheWriter(
boost::shared_ptr<vtkGeometryCacheWriter>) override;
/// set vtkGeometryCache reader
void setVtkGeometryCacheReader(boost::shared_ptr<vtkGeometryCacheReader>) override;
void setVtkGeometryCacheReader(
boost::shared_ptr<vtkGeometryCacheReader>) override;
void GetObjectGeom(int &type, std::vector<Kernel::V3D> &vectors,
double &myradius, double &myheight) const override;
/// Getter for the shape xml
......@@ -261,8 +266,8 @@ private:
std::unique_ptr<Kernel::Material> m_material;
protected:
std::vector<const Surface *>
m_SurList; ///< Full surfaces (make a map including complementary object ?)
std::vector<const Surface *> m_SurList; ///< Full surfaces (make a map
///including complementary object ?)
};
/// Typdef for a shared pointer
......
......@@ -51,49 +51,48 @@ class vtkGeometryCacheWriter;
/**
* Interface for Geometry Objects
*/
class MANTID_GEOMETRY_DLL IObject {
public:
virtual bool isValid(const Kernel::V3D &) const = 0;
virtual bool isOnSide(const Kernel::V3D &) const = 0;
virtual bool hasValidShape() const = 0;
virtual int setObject(const int ON, const std::string &Ln) = 0;
virtual int populate(const std::map<int, boost::shared_ptr<Surface>> &) = 0;
virtual int getName() const = 0;
virtual void setName(const int nx) = 0;
virtual int interceptSurface(Geometry::Track &) const = 0;
// Solid angle
virtual double solidAngle(const Kernel::V3D &observer) const = 0;
// Solid angle with a scaling of the object
virtual double solidAngle(const Kernel::V3D &observer,
const Kernel::V3D &scaleFactor) const = 0;
/// Return cached value of axis-aligned bounding box
virtual const BoundingBox &getBoundingBox() const = 0;
virtual int getPointInObject(Kernel::V3D &point) const = 0;
virtual void GetObjectGeom(int &type, std::vector<Kernel::V3D> &vectors,
double &myradius, double &myheight) const = 0;
virtual boost::shared_ptr<GeometryHandler> getGeometryHandler() = 0;
// Rendering
virtual void draw() const = 0;
virtual void initDraw() const = 0;
//VTK cache
virtual void setVtkGeometryCacheReader(boost::shared_ptr<vtkGeometryCacheReader>) = 0;
virtual void setVtkGeometryCacheWriter(boost::shared_ptr<vtkGeometryCacheWriter>) = 0;
virtual void setMaterial(const Kernel::Material &material) = 0;
virtual const Kernel::Material material() const = 0 ;
};
/// Typdef for a shared pointer
typedef boost::shared_ptr<IObject> IObject_sptr;
/// Typdef for a shared pointer to a const object
typedef boost::shared_ptr<const IObject> IObject_const_sptr;
class MANTID_GEOMETRY_DLL IObject {
public:
virtual bool isValid(const Kernel::V3D &) const = 0;
virtual bool isOnSide(const Kernel::V3D &) const = 0;
virtual bool hasValidShape() const = 0;
virtual int setObject(const int ON, const std::string &Ln) = 0;
virtual int populate(const std::map<int, boost::shared_ptr<Surface>> &) = 0;
virtual int getName() const = 0;
virtual void setName(const int nx) = 0;
virtual int interceptSurface(Geometry::Track &) const = 0;
// Solid angle
virtual double solidAngle(const Kernel::V3D &observer) const = 0;
// Solid angle with a scaling of the object
virtual double solidAngle(const Kernel::V3D &observer,
const Kernel::V3D &scaleFactor) const = 0;
/// Return cached value of axis-aligned bounding box
virtual const BoundingBox &getBoundingBox() const = 0;
virtual int getPointInObject(Kernel::V3D &point) const = 0;
virtual void GetObjectGeom(int &type, std::vector<Kernel::V3D> &vectors,
double &myradius, double &myheight) const = 0;
virtual boost::shared_ptr<GeometryHandler> getGeometryHandler() = 0;
// Rendering
virtual void draw() const = 0;
virtual void initDraw() const = 0;
// VTK cache
virtual void
setVtkGeometryCacheReader(boost::shared_ptr<vtkGeometryCacheReader>) = 0;
virtual void
setVtkGeometryCacheWriter(boost::shared_ptr<vtkGeometryCacheWriter>) = 0;
virtual void setMaterial(const Kernel::Material &material) = 0;
virtual const Kernel::Material material() const = 0;
};
/// Typdef for a shared pointer
typedef boost::shared_ptr<IObject> IObject_sptr;
/// Typdef for a shared pointer to a const object
typedef boost::shared_ptr<const IObject> IObject_const_sptr;
} // namespace Geometry
} // namespace Mantid
......
......@@ -297,7 +297,7 @@ Care must be taken to avoid a cyclic loop
class MANTID_GEOMETRY_DLL CompObj : public Rule {
private:
int objN; ///< Object number
int objN; ///< Object number
CSGObject *key; ///< Object Pointer
CompObj *doClone() const override;
......@@ -323,7 +323,7 @@ public:
} ///< Always returns true (1)
void setObjN(const int Ky); ///< set object Number
void setObj(CSGObject *); ///< 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
......
......@@ -90,9 +90,9 @@ public:
bool addTypeTag = true);
boost::shared_ptr<CSGObject> createHexahedralShape(double xlb, double xlf,
double xrf, double xrb,
double ylb, double ylf,
double yrf, double yrb);
double xrf, double xrb,
double ylb, double ylf,
double yrf, double yrb);
private:
std::string parseSphere(Poco::XML::Element *pElem,
......@@ -154,7 +154,8 @@ 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<CSGObject>);
void createGeometryHandler(Poco::XML::Element *,
boost::shared_ptr<CSGObject>);
};
} // namespace Geometry
......
......@@ -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 IObject *object; ///< The object that was intersected
const IObject *object; ///< The object that was intersected
ComponentID componentID; ///< ComponentID of the intersected component
//@}
};
......@@ -104,7 +104,8 @@ 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 CSGObject &obj,
const double distFromStartOfTrack,
const CSGObject &obj,
const ComponentID compID = nullptr)
: directionFlag(flag), endPoint(end), distFromStart(distFromStartOfTrack),
object(&obj), componentID(compID) {}
......@@ -130,7 +131,7 @@ struct IntersectionPoint {
int directionFlag; ///< Directional flag
Kernel::V3D endPoint; ///< Point
double distFromStart; ///< Total distance from track begin
const CSGObject *object; ///< The object that was intersected
const CSGObject *object; ///< The object that was intersected
ComponentID componentID; ///< Unique component ID
//@}
};
......
......@@ -42,7 +42,7 @@ namespace Geometry {
class CSGObject;
class MANTID_GEOMETRY_DLL CacheGeometryGenerator {
private:
CSGObject *Obj; ///< Input Object
CSGObject *Obj; ///< Input Object
int mNoOfVertices; ///< number of vertices
int mNoOfTriangles; ///< number of triangles
double *mPoints; ///<double array or points
......
......@@ -56,7 +56,7 @@ private:
Triangulator; ///< Geometry generator to triangulate Object
public:
CacheGeometryHandler(IObjComponent *comp); ///< Constructor
CacheGeometryHandler(IObjComponent *comp); ///< Constructor
CacheGeometryHandler(boost::shared_ptr<CSGObject> obj); ///< Constructor
CacheGeometryHandler(CSGObject *obj); ///< Constructor
boost::shared_ptr<GeometryHandler> clone() const override;
......
......@@ -49,12 +49,12 @@ private:
protected:
IObjComponent *ObjComp; ///< ObjComponent that uses this geometry handler
CSGObject *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(IObjComponent *comp); ///< Constructor
GeometryHandler(boost::shared_ptr<CSGObject> obj); ///<Constructor
GeometryHandler(CSGObject *obj); ///<Constructor
virtual boost::shared_ptr<GeometryHandler>
......@@ -66,11 +66,12 @@ public:
/// geometry
/// handler for
/// ObjComponent
virtual GeometryHandler *
createInstance(boost::shared_ptr<CSGObject>) = 0; ///< Create an instance of
virtual GeometryHandler *createInstance(
boost::shared_ptr<CSGObject>) = 0; ///< Create an instance of
/// concrete geometry
/// handler for Object
virtual GeometryHandler *createInstance(CSGObject *) = 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
......
......@@ -71,7 +71,7 @@ private:
type; ///< the type of the geometry eg CUBOID,CYLINDER,CONE,SPHERE
public:
GluGeometryHandler(const GluGeometryHandler &other);
GluGeometryHandler(IObjComponent *comp); ///< Constructor
GluGeometryHandler(IObjComponent *comp); ///< Constructor
GluGeometryHandler(boost::shared_ptr<CSGObject> obj); ///< Constructor
GluGeometryHandler(CSGObject *obj); ///< Constructor
boost::shared_ptr<GeometryHandler> clone() const override;
......
......@@ -54,7 +54,7 @@ class Torus;
*/
class MANTID_GEOMETRY_DLL OCGeometryGenerator {
private:
const CSGObject *Obj; ///< Input Object
const CSGObject *Obj; ///< Input Object
TopoDS_Shape *ObjSurface; ///< Storage for the output surface
/// Analyze the object
void AnalyzeObject();
......
......@@ -55,7 +55,7 @@ private:
OCGeometryGenerator *
Triangulator; ///< Geometry generator to triangulate Object
public:
OCGeometryHandler(IObjComponent *comp); ///< Constructor
OCGeometryHandler(IObjComponent *comp); ///< Constructor
OCGeometryHandler(boost::shared_ptr<CSGObject> obj); ///< Constructor
OCGeometryHandler(CSGObject *obj); ///< Constructor
boost::shared_ptr<GeometryHandler>
......
......@@ -58,7 +58,7 @@ private:
public:
vtkGeometryCacheReader(std::string filename);
~vtkGeometryCacheReader();
~vtkGeometryCacheReader();
void readCacheForObject(IObject *obj);
};
......
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