Mantid
Loading...
Searching...
No Matches
GeometryTriangulator.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "MantidGeometry/DllConfig.h"
10#include <memory>
11#include <vector>
12
13class TopoDS_Shape;
14
15namespace Mantid {
16namespace Geometry {
17class CSGObject;
18class RenderingMesh;
19
20namespace detail {
21
25class MANTID_GEOMETRY_DLL GeometryTriangulator {
26private:
28 size_t m_nFaces = 0;
29 size_t m_nPoints = 0;
30 std::vector<double> m_points;
31 std::vector<uint32_t> m_faces;
32 const CSGObject *m_csgObj = nullptr;
33 std::unique_ptr<RenderingMesh> m_meshObj;
34 void checkTriangulated();
35
36public:
37 GeometryTriangulator(const CSGObject *obj = nullptr);
38 GeometryTriangulator(std::unique_ptr<RenderingMesh> obj);
42 void triangulate();
43 void generateMesh();
44 void setGeometryCache(size_t nPoints, size_t nFaces, std::vector<double> &&points, std::vector<uint32_t> &&faces);
46 size_t numTriangleFaces();
48 size_t numTriangleVertices();
51 const std::vector<double> &getTriangleVertices();
54 const std::vector<uint32_t> &getTriangleFaces();
55#ifdef ENABLE_OPENCASCADE
56private:
57 std::unique_ptr<TopoDS_Shape> m_objSurface;
60 void OCAnalyzeObject();
61 size_t numPoints() const;
62 size_t numFaces() const;
63 void setupPoints();
64 void setupFaces();
65
66public:
68 bool hasOCSurface() const;
69 const TopoDS_Shape &getOCSurface();
70#endif
71};
72} // namespace detail
73} // namespace Geometry
74} // namespace Mantid
double obj
the value of the quadratic function
Constructive Solid Geometry object.
Definition: CSGObject.h:51
GeometryTriangulator : Triangulates object surfaces.
GeometryTriangulator & operator=(const GeometryTriangulator &)=delete
std::vector< double > m_points
double array or points
GeometryTriangulator(const GeometryTriangulator &)=delete
std::vector< uint32_t > m_faces
Integer array of faces.
Helper class which provides the Collimation Length for SANS instruments.