File indexing completed on 2025-01-18 10:14:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef VECGEOM_VOLUMES_SOLIDMESH_H_
0011 #define VECGEOM_VOLUMES_SOLIDMESH_H_
0012
0013 #include "VecGeom/base/Utils3D.h"
0014
0015 namespace vecgeom {
0016 inline namespace VECGEOM_IMPL_NAMESPACE {
0017
0018 class SolidMesh {
0019 private:
0020 Utils3D::Polyhedron fMesh;
0021
0022 public:
0023
0024 Utils3D::Polyhedron const &GetMesh() { return fMesh; }
0025
0026
0027 Utils3D::vector_t<Utils3D::Vec_t> const &GetVertices() { return fMesh.fVert; }
0028
0029
0030 Utils3D::vector_t<Utils3D::Polygon> const &GetPolygons() { return fMesh.fPolys; }
0031
0032
0033 void SetPolygons(const Utils3D::Polygon polys[], size_t n) { fMesh.fPolys.assign(polys, polys + n); }
0034
0035
0036 void SetVertices(const Utils3D::Vec_t vertices[], size_t n) { fMesh.fVert.assign(vertices, vertices + n); }
0037
0038
0039 void ResetMesh(size_t nvert, size_t nPoly) { fMesh.Reset(nvert, nPoly); }
0040
0041
0042 void ApplyTransformation(const Transformation3D &trans);
0043
0044
0045 void TransformVertices(const Transformation3D &trans);
0046
0047
0048 bool AddPolygon(size_t n, Utils3D::vector_t<size_t> const &indices, bool convex)
0049 {
0050 Utils3D::Polygon poly{n, fMesh.fVert, indices, convex};
0051 if (!poly.fValid) return false;
0052
0053 fMesh.AddPolygon(poly, false);
0054 return true;
0055 }
0056 };
0057 }
0058 }
0059
0060 #endif