Commit 8c0deff4 authored by Lamar Moore's avatar Lamar Moore
Browse files

remove shape handline from GluGeometryHandler in ShapeInfo re #21248

parent 7453eee5
......@@ -112,6 +112,7 @@ set ( SRC_FILES
src/Rendering/CacheGeometryHandler.cpp
src/Rendering/GeometryHandler.cpp
src/Rendering/Renderer.cpp
src/Rendering/ShapeInfo.cpp
src/Rendering/GluGeometryHandler.cpp
src/Rendering/StructuredGeometryHandler.cpp
src/Rendering/vtkGeometryCacheReader.cpp
......@@ -273,6 +274,7 @@ set ( INC_FILES
inc/MantidGeometry/Rendering/CacheGeometryHandler.h
inc/MantidGeometry/Rendering/GeometryHandler.h
inc/MantidGeometry/Rendering/Renderer.h
inc/MantidGeometry/Rendering/ShapeInfo.h
inc/MantidGeometry/Rendering/GluGeometryHandler.h
inc/MantidGeometry/Rendering/OCGeometryHandler.h
inc/MantidGeometry/Rendering/OpenGL_Headers.h
......
......@@ -250,6 +250,7 @@ private:
/// Geometry Handle for rendering
boost::shared_ptr<GeometryHandler> m_handler;
friend class CacheGeometryHandler;
friend class GeometryRenderer;
/// Is geometry caching enabled?
bool bGeometryCaching;
/// a pointer to a class for reading from the geometry cache
......
......@@ -63,9 +63,10 @@ public:
const std::vector<int> &getTriangleFaces();
#ifdef ENABLE_OPENCASCADE
private:
TopoDS_Shape *m_objSurface; ///< Storage for the output surface
/// Analyze the object
/// OpenCascade analysis of object surface
std::unique_ptr<TopoDS_Shape>
m_objSurface; ///< Storage for the output surface
/// Analyze the object
/// OpenCascade analysis of object surface
void OCAnalyzeObject();
size_t numPoints() const;
size_t numFaces() const;
......@@ -74,7 +75,7 @@ private:
public:
/// Return OpenCascade surface.
TopoDS_Shape *getOCSurface();
const TopoDS_Shape &getOCSurface();
#endif
};
} // namespace detail
......
......@@ -3,6 +3,7 @@
#include "MantidGeometry/DllConfig.h"
#include "MantidGeometry/Rendering/GeometryHandler.h"
#include "MantidGeometry/Rendering/ShapeInfo.h"
namespace Mantid {
namespace Kernel {
......@@ -45,27 +46,13 @@ class CSGObject;
File change history is stored at: <https://github.com/mantidproject/mantid>
*/
class MANTID_GEOMETRY_DLL GluGeometryHandler : public GeometryHandler {
public:
/// the type of the geometry eg CUBOID,CYLINDER,CONE,SPHERE
enum class GeometryType {
NOSHAPE = 0,
CUBOID, ///< CUBOID
HEXAHEDRON, ///< HEXAHEDRON
SPHERE, ///< SPHERE
CYLINDER, ///< CYLINDER
CONE, ///< CONE
SEGMENTED_CYLINDER ///< Cylinder with 1 or more segments (along the axis).
/// Sizes of segments are important.
};
private:
static Kernel::Logger &PLog; ///< The official logger
/// Object/ObjComponent
std::vector<Kernel::V3D> m_points;
double radius; ///<Radius for the sphere, cone and cylinder
double height; ///<height for cone and cylinder;
GeometryType
type; ///< the type of the geometry eg CUBOID,CYLINDER,CONE,SPHERE
detail::ShapeInfo m_shapeInfo;
public:
GluGeometryHandler(const GluGeometryHandler &other);
GluGeometryHandler(IObjComponent *comp); ///< Constructor
......@@ -77,22 +64,7 @@ public:
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 &);
/// sets the geometry handler for a hexahedron
void setHexahedron(const Kernel::V3D &, const Kernel::V3D &,
const Kernel::V3D &, const Kernel::V3D &,
const Kernel::V3D &, const Kernel::V3D &,
const Kernel::V3D &, const Kernel::V3D &);
/// sets the geometry handler for a cone
void setSphere(const Kernel::V3D &, double);
/// sets the geometry handler for a cylinder
void setCylinder(const Kernel::V3D &, const Kernel::V3D &, double, double);
/// sets the geometry handler for a cone
void setCone(const Kernel::V3D &, const Kernel::V3D &, double, double);
/// sets the geometry handler for a segmented cylinder
void setSegmentedCylinder(const Kernel::V3D &, const Kernel::V3D &, double,
double);
void setShapeInfo(detail::ShapeInfo &&shapeInfo);
void Triangulate() override;
void Render() override;
void Initialize() override;
......
......@@ -45,6 +45,8 @@ class IObjComponent;
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
namespace detail {
class ShapeInfo;
class MANTID_GEOMETRY_DLL Renderer {
public:
enum class RenderMode { Basic, Volumetric };
......@@ -59,67 +61,44 @@ public:
template <typename... Args> void render(Args &&... args) const &;
/// Render IObjComponent
void renderIObjComponent(IObjComponent *objComp,
void renderIObjComponent(const IObjComponent &objComp,
RenderMode mode = RenderMode::Basic) const;
/// Render Traingulated Surface
void renderTriangulated(detail::GeometryTriangulator &triangulator,
RenderMode mode = RenderMode::Basic) const;
/// Render OpenCascade Shape
void renderOpenCascade(TopoDS_Shape *objSurf,
RenderMode mode = RenderMode::Basic) const;
/// Renders a sphere, cuboid, hexahedron, cone or cylinder
void renderShape(const ShapeInfo &shapeInfo) const;
/// Renders a Bitmap (used for rendering RectangularDetector)
void renderBitmap(const RectangularDetector &rectDet,
RenderMode mode = RenderMode::Basic) const;
/// Renders structured geometry (used for rendering StructuredDetector)
void renderStructured(const StructuredDetector &structDet,
RenderMode mode = RenderMode::Basic) const;
private:
mutable RenderMode m_renderMode;
/// Renders a sphere
void renderSphere(const Kernel::V3D &center, double radius,
RenderMode mode = RenderMode::Basic) const;
void doRenderSphere(const ShapeInfo &shapeInfo) const;
/// Renders a cuboid
void renderCuboid(const Kernel::V3D &Point1, const Kernel::V3D &Point2,
const Kernel::V3D &Point3, const Kernel::V3D &Point4,
RenderMode mode = RenderMode::Basic) const;
void doRenderCuboid(const ShapeInfo &shapeInfo) const;
/// Renders a Hexahedron from the input values
void renderHexahedron(const std::vector<Kernel::V3D> &points,
RenderMode mode = RenderMode::Basic) const;
void doRenderHexahedron(const ShapeInfo &shapeInfo) const;
/// Renders a Cone from the input values
void renderCone(const Kernel::V3D &center, const Kernel::V3D &axis,
double radius, double height,
RenderMode mode = RenderMode::Basic) const;
void doRenderCone(const ShapeInfo &shapeInfo) const;
/// Renders a Cylinder/Segmented cylinder from the input values
void renderCylinder(const Kernel::V3D &center, const Kernel::V3D &axis,
double radius, double height, bool segmented = false,
RenderMode mode = RenderMode::Basic) const;
/// Renders a Bitmap (used for rendering RectangularDetector)
void renderBitmap(const RectangularDetector *rectDet,
RenderMode mode = RenderMode::Basic) const;
/// Renders structured geometry (used for rendering StructuredDetector)
void renderStructured(const StructuredDetector *structDet,
RenderMode mode = RenderMode::Basic) const;
private:
mutable RenderMode m_renderMode;
void doRenderCylinder(const ShapeInfo &shapeInfo) const;
// general geometry
/// Render IObjComponent
void doRender(IObjComponent *ObjComp) const;
void doRender(const IObjComponent &ObjComp) const;
/// Render Traingulated Surface
void doRender(GeometryTriangulator &triangulator) const;
#ifdef ENABLE_OPENCASCADE
/// Render OpenCascade Shape
void doRender(TopoDS_Shape *ObjSurf) const;
// shapes
/// Renders a sphere
void doRender(const Kernel::V3D &center, double radius) const;
/// Renders a cuboid
void doRender(const Kernel::V3D &Point1, const Kernel::V3D &Point2,
const Kernel::V3D &Point3, const Kernel::V3D &Point4) const;
/// Renders a Hexahedron from the input values
void doRender(const std::vector<Kernel::V3D> &points) const;
/// Renders a Cone from the input values
void doRender(const Kernel::V3D &center, const Kernel::V3D &axis,
double radius, double height) const;
/// Renders a Cylinder/Segmented cylinder from the input values
void doRender(const Kernel::V3D &center, const Kernel::V3D &axis,
double radius, double height, bool segmented) const;
void doRender(const TopoDS_Shape &ObjSurf) const;
#endif
/// Renders a Bitmap (used for rendering RectangularDetector)
void doRender(const RectangularDetector *rectDet) const;
void doRender(const RectangularDetector &rectDet) const;
/// Renders structured geometry (used for rendering StructuredDetector)
void doRender(const StructuredDetector *structDet) const;
void doRender(const StructuredDetector &structDet) const;
};
template <typename... Args>
......
#ifndef MANTID_GEOMETRY_SHAPEINFO_H_
#define MANTID_GEOMETRY_SHAPEINFO_H_
#include "MantidGeometry/DllConfig.h"
#include <vector>
namespace Mantid {
namespace Kernel {
class V3D;
}
namespace Geometry {
class RectangularDetector;
class StructuredDetector;
class IObjComponent;
/** ShapeInfo : Stored Object related shape information for rendering.
Copyright &copy; 2017 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
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>
*/
namespace detail {
class MANTID_GEOMETRY_DLL ShapeInfo {
public:
enum class GeometryShape {
NOSHAPE = 0,
CUBOID, ///< CUBOID
HEXAHEDRON, ///< HEXAHEDRON
SPHERE, ///< SPHERE
CYLINDER, ///< CYLINDER
CONE, ///< CONE
SEGMENTED_CYLINDER ///< Cylinder with 1 or more segments (along the axis).
/// Sizes of segments are important.
};
private:
std::vector<Kernel::V3D> m_points;
double m_radius; ///< Radius for the sphere, cone and cylinder
double m_height; ///< height for cone and cylinder;
GeometryShape m_shape;
public:
ShapeInfo();
ShapeInfo(const ShapeInfo &) = default;
const std::vector<Kernel::V3D> &points() const;
double radius() const;
double height() const;
GeometryShape shape() const;
void getObjectGeometry(int &myshape, std::vector<Kernel::V3D> &points,
double &myradius, double &myheight) const;
/// sets the geometry handler for a cuboid
void setCuboid(const Kernel::V3D &, const Kernel::V3D &, const Kernel::V3D &,
const Kernel::V3D &);
/// sets the geometry handler for a hexahedron
void setHexahedron(const Kernel::V3D &, const Kernel::V3D &,
const Kernel::V3D &, const Kernel::V3D &,
const Kernel::V3D &, const Kernel::V3D &,
const Kernel::V3D &, const Kernel::V3D &);
/// sets the geometry handler for a cone
void setSphere(const Kernel::V3D &, double);
/// sets the geometry handler for a cylinder
void setCylinder(const Kernel::V3D &, const Kernel::V3D &, double, double);
/// sets the geometry handler for a cone
void setCone(const Kernel::V3D &, const Kernel::V3D &, double, double);
/// sets the geometry handler for a segmented cylinder
void setSegmentedCylinder(const Kernel::V3D &, const Kernel::V3D &, double,
double);
};
} // namespace detail
} // namespace Geometry
} // namespace Mantid
#endif /* MANTID_GEOMETRY_SHAPEINFO_H_ */
\ No newline at end of file
......@@ -1015,21 +1015,21 @@ double CSGObject::triangleSolidAngle(const V3D &observer) const {
this->GetObjectGeom(type, geometry_vectors, radius, height);
auto nTri = this->numberOfTriangles();
// Cylinders are by far the most frequently used
GluGeometryHandler::GeometryType gluType =
static_cast<GluGeometryHandler::GeometryType>(type);
detail::ShapeInfo::GeometryShape gluType =
static_cast<detail::ShapeInfo::GeometryShape>(type);
switch (gluType) {
case GluGeometryHandler::GeometryType::CUBOID:
case detail::ShapeInfo::GeometryShape::CUBOID:
return CuboidSolidAngle(observer, geometry_vectors);
break;
case GluGeometryHandler::GeometryType::SPHERE:
case detail::ShapeInfo::GeometryShape::SPHERE:
return SphereSolidAngle(observer, geometry_vectors, radius);
break;
case GluGeometryHandler::GeometryType::CYLINDER:
case detail::ShapeInfo::GeometryShape::CYLINDER:
return CylinderSolidAngle(observer, geometry_vectors[0],
geometry_vectors[1], radius, height);
break;
case GluGeometryHandler::GeometryType::CONE:
case detail::ShapeInfo::GeometryShape::CONE:
return ConeSolidAngle(observer, geometry_vectors[0], geometry_vectors[1],
radius, height);
break;
......@@ -1101,16 +1101,16 @@ double CSGObject::triangleSolidAngle(const V3D &observer,
int type;
std::vector<Kernel::V3D> vectors;
this->GetObjectGeom(type, vectors, radius, height);
GluGeometryHandler::GeometryType gluType =
static_cast<GluGeometryHandler::GeometryType>(type);
detail::ShapeInfo::GeometryShape gluType =
static_cast<detail::ShapeInfo::GeometryShape>(type);
switch (gluType) {
case GluGeometryHandler::GeometryType::CUBOID:
case detail::ShapeInfo::GeometryShape::CUBOID:
for (auto &vector : vectors)
vector *= scaleFactor;
return CuboidSolidAngle(observer, vectors);
break;
case GluGeometryHandler::GeometryType::SPHERE:
case detail::ShapeInfo::GeometryShape::SPHERE:
return SphereSolidAngle(observer, vectors, radius);
break;
default:
......@@ -1496,10 +1496,10 @@ double CSGObject::volume() const {
double radius;
std::vector<Kernel::V3D> vectors;
this->GetObjectGeom(type, vectors, radius, height);
GluGeometryHandler::GeometryType gluType =
static_cast<GluGeometryHandler::GeometryType>(type);
detail::ShapeInfo::GeometryShape gluType =
static_cast<detail::ShapeInfo::GeometryShape>(type);
switch (gluType) {
case GluGeometryHandler::GeometryType::CUBOID: {
case detail::ShapeInfo::GeometryShape::CUBOID: {
// Here, the volume is calculated by the triangular method.
// We use one of the vertices (vectors[0]) as the reference
// point.
......@@ -1529,9 +1529,9 @@ double CSGObject::volume() const {
volume += brt.scalar_prod(brb.cross_prod(blb));
return volume / 6;
}
case GluGeometryHandler::GeometryType::SPHERE:
case detail::ShapeInfo::GeometryShape::SPHERE:
return 4.0 / 3.0 * M_PI * radius * radius * radius;
case GluGeometryHandler::GeometryType::CYLINDER:
case detail::ShapeInfo::GeometryShape::CYLINDER:
return M_PI * radius * radius * height;
default:
// Fall back to Monte Carlo method.
......@@ -1768,12 +1768,12 @@ void CSGObject::calcBoundingBoxByGeometry() {
// Will only work for shapes handled by GluGeometryHandler
m_handler->GetObjectGeom(type, vectors, radius, height);
GluGeometryHandler::GeometryType gluType =
static_cast<GluGeometryHandler::GeometryType>(type);
detail::ShapeInfo::GeometryShape gluType =
static_cast<detail::ShapeInfo::GeometryShape>(type);
// Type of shape is given as a simple integer
switch (gluType) {
case GluGeometryHandler::GeometryType::CUBOID: {
case detail::ShapeInfo::GeometryShape::CUBOID: {
// Points as defined in IDF XML
auto &lfb = vectors[0]; // Left-Front-Bottom
auto &lft = vectors[1]; // Left-Front-Top
......@@ -1806,7 +1806,7 @@ void CSGObject::calcBoundingBoxByGeometry() {
maxZ = std::max(maxZ, vector.Z());
}
} break;
case GluGeometryHandler::GeometryType::HEXAHEDRON: {
case detail::ShapeInfo::GeometryShape::HEXAHEDRON: {
// These will be replaced by more realistic values in the loop below
minX = minY = minZ = std::numeric_limits<decltype(minZ)>::max();
maxX = maxY = maxZ = -std::numeric_limits<decltype(maxZ)>::max();
......@@ -1821,8 +1821,8 @@ void CSGObject::calcBoundingBoxByGeometry() {
maxZ = std::max(maxZ, vector.Z());
}
} break;
case GluGeometryHandler::GeometryType::CYLINDER:
case GluGeometryHandler::GeometryType::SEGMENTED_CYLINDER: {
case detail::ShapeInfo::GeometryShape::CYLINDER:
case detail::ShapeInfo::GeometryShape::SEGMENTED_CYLINDER: {
// Center-point of base and normalized axis based on IDF XML
auto &base = vectors[0];
auto &axis = vectors[1];
......@@ -1845,7 +1845,7 @@ void CSGObject::calcBoundingBoxByGeometry() {
maxZ = std::max(base.Z(), top.Z()) + rz;
} break;
case GluGeometryHandler::GeometryType::CONE: {
case detail::ShapeInfo::GeometryShape::CONE: {
auto &tip = vectors[0]; // Tip-point of cone
auto &axis = vectors[1]; // Normalized axis
auto base = tip + (axis * height); // Center of base
......
......@@ -6,6 +6,7 @@
#include "MantidGeometry/Objects/CSGObject.h"
#include "MantidGeometry/Objects/ShapeFactory.h"
#include "MantidGeometry/Rendering/GluGeometryHandler.h"
#include "MantidGeometry/Rendering/ShapeInfo.h"
#include "MantidGeometry/Surfaces/Cone.h"
#include "MantidGeometry/Surfaces/Cylinder.h"
#include "MantidGeometry/Surfaces/Plane.h"
......@@ -1407,11 +1408,12 @@ ShapeFactory::createHexahedralShape(double xlb, double xlf, double xrf,
shape->populate(prim);
auto handler = boost::make_shared<GluGeometryHandler>(shape);
detail::ShapeInfo shapeInfo;
shape->setGeometryHandler(handler);
handler->setHexahedron(hex.lbb, hex.lfb, hex.rfb, hex.rbb, hex.lbt, hex.lft,
shapeInfo.setHexahedron(hex.lbb, hex.lfb, hex.rfb, hex.rbb, hex.lbt, hex.lft,
hex.rft, hex.rbt);
handler->setShapeInfo(std::move(shapeInfo));
shape->defineBoundingBox(std::max(xrb, xrf), yrf, ZDEPTH, std::min(xlf, xlb),
ylb, 0);
......@@ -1424,14 +1426,15 @@ void ShapeFactory::createGeometryHandler(Poco::XML::Element *pElem,
boost::shared_ptr<CSGObject> Obj) {
auto geomHandler = boost::make_shared<GluGeometryHandler>(Obj);
detail::ShapeInfo shapeInfo;
Obj->setGeometryHandler(geomHandler);
if (pElem->tagName() == "cuboid") {
auto corners = parseCuboid(pElem);
geomHandler->setCuboid(corners.lfb, corners.lft, corners.lbb, corners.rfb);
shapeInfo.setCuboid(corners.lfb, corners.lft, corners.lbb, corners.rfb);
} else if (pElem->tagName() == "hexahedron") {
auto corners = parseHexahedron(pElem);
geomHandler->setHexahedron(corners.lbb, corners.lfb, corners.rfb,
shapeInfo.setHexahedron(corners.lbb, corners.lfb, corners.rfb,
corners.rbb, corners.lbt, corners.lft,
corners.rft, corners.rbt);
} else if (pElem->tagName() == "sphere") {
......@@ -1440,7 +1443,7 @@ void ShapeFactory::createGeometryHandler(Poco::XML::Element *pElem,
V3D centre;
if (pElemCentre)
centre = parsePosition(pElemCentre);
geomHandler->setSphere(centre, std::stod(pElemRadius->getAttribute("val")));
shapeInfo.setSphere(centre, std::stod(pElemRadius->getAttribute("val")));
} else if (pElem->tagName() == "cylinder") {
Element *pElemCentre = getShapeElement(pElem, "centre-of-bottom-base");
Element *pElemAxis = getShapeElement(pElem, "axis");
......@@ -1448,7 +1451,7 @@ void ShapeFactory::createGeometryHandler(Poco::XML::Element *pElem,
Element *pElemHeight = getShapeElement(pElem, "height");
V3D normVec = parsePosition(pElemAxis);
normVec.normalize();
geomHandler->setCylinder(parsePosition(pElemCentre), normVec,
shapeInfo.setCylinder(parsePosition(pElemCentre), normVec,
std::stod(pElemRadius->getAttribute("val")),
std::stod(pElemHeight->getAttribute("val")));
} else if (pElem->tagName() == "segmented-cylinder") {
......@@ -1458,7 +1461,7 @@ void ShapeFactory::createGeometryHandler(Poco::XML::Element *pElem,
Element *pElemHeight = getShapeElement(pElem, "height");
V3D normVec = parsePosition(pElemAxis);
normVec.normalize();
geomHandler->setSegmentedCylinder(
shapeInfo.setSegmentedCylinder(
parsePosition(pElemCentre), normVec,
std::stod(pElemRadius->getAttribute("val")),
std::stod(pElemHeight->getAttribute("val")));
......@@ -1473,8 +1476,10 @@ void ShapeFactory::createGeometryHandler(Poco::XML::Element *pElem,
double height = std::stod(pElemHeight->getAttribute("val"));
double radius =
height * tan(M_PI * std::stod(pElemAngle->getAttribute("val")) / 180.0);
geomHandler->setCone(parsePosition(pElemTipPoint), normVec, radius, height);
shapeInfo.setCone(parsePosition(pElemTipPoint), normVec, radius, height);
}
geomHandler->setShapeInfo(std::move(shapeInfo));
}
} // namespace Geometry
......
......@@ -58,7 +58,7 @@ void BitmapGeometryHandler::Triangulate() {
//----------------------------------------------------------------------------------------------
///< Render Object or ObjComponent
void BitmapGeometryHandler::Render() {
m_renderer.render(m_rectDet);
m_renderer.render(*m_rectDet);
}
//----------------------------------------------------------------------------------------------
......
......@@ -77,7 +77,7 @@ void CacheGeometryHandler::Render() {
Triangulate();
m_renderer.renderTriangulated(*m_triangulator);
} else if (ObjComp != nullptr) {
m_renderer.render(ObjComp);
m_renderer.render(*ObjComp);
}
}
......@@ -88,7 +88,7 @@ void CacheGeometryHandler::Initialize() {
Triangulate();
m_renderer.renderTriangulated(*m_triangulator);
} else if (ObjComp != nullptr) {
m_renderer.render(ObjComp);
m_renderer.render(*ObjComp);
}
}
......
......@@ -76,9 +76,9 @@ void GeometryTriangulator::triangulate() {
#ifdef ENABLE_OPENCASCADE
/// Return OpenCascade surface.
TopoDS_Shape *GeometryTriangulator::getOCSurface() {
const TopoDS_Shape &GeometryTriangulator::getOCSurface() {
checkTriangulated();
return m_objSurface;
return *m_objSurface;
}
#endif
......@@ -119,13 +119,13 @@ void GeometryTriangulator::OCAnalyzeObject() {
// Get the top rule tree in Obj
const Rule *top = m_obj->topRule();
if (top == nullptr) {
m_objSurface = new TopoDS_Shape();
m_objSurface.reset(new TopoDS_Shape());
return;
}
// Traverse through Rule
TopoDS_Shape Result = const_cast<Rule *>(top)->analyze();
try {
m_objSurface = new TopoDS_Shape(Result);
m_objSurface.reset(new TopoDS_Shape(Result));
BRepMesh_IncrementalMesh(Result, 0.001);
} catch (StdFail_NotDone &) {
g_log.error("Cannot build the geometry. Check the geometry definition");
......
......@@ -9,22 +9,20 @@
namespace Mantid {
namespace Geometry {
using Kernel::V3D;
using namespace detail;
GluGeometryHandler::GluGeometryHandler(IObjComponent *comp)
: GeometryHandler(comp), radius(0.0), height(0.0),
type(GeometryType::NOSHAPE) {}
: GeometryHandler(comp), radius(0.0), height(0.0){}
GluGeometryHandler::GluGeometryHandler(boost::shared_ptr<CSGObject> obj)
: GeometryHandler(std::move(obj)), radius(0.0), height(0.0),
type(GeometryType::NOSHAPE) {}
: GeometryHandler(std::move(obj)), radius(0.0), height(0.0) {}
GluGeometryHandler::GluGeometryHandler(CSGObject *obj)
: GeometryHandler(obj), radius(0.0), height(0.0),
type(GeometryType::NOSHAPE) {}
: GeometryHandler(obj), radius(0.0), height(0.0) {}
GluGeometryHandler::GluGeometryHandler(const GluGeometryHandler &other)
: GeometryHandler(other), m_points(other.m_points), radius(other.radius),
height(other.height), type(other.type) {
height(other.height), m_shapeInfo(other.m_shapeInfo) {
}