Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Polyhedron.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Polyhedron.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
12 #include "Acts/Geometry/Extent.hpp"
13 
14 #include <cstddef>
15 #include <vector>
16 
17 namespace Acts {
18 
28 struct Polyhedron {
29  using FaceType = std::vector<size_t>;
30 
32  Polyhedron() = default;
33 
40  Polyhedron(const std::vector<Vector3>& verticesIn,
41  const std::vector<FaceType>& facesIn,
42  const std::vector<FaceType>& triangularMeshIn, bool isExact = true)
43  : vertices(verticesIn),
44  faces(facesIn),
45  triangularMesh(triangularMeshIn),
46  exact(isExact) {}
47 
49  std::vector<Vector3> vertices;
50 
54  std::vector<FaceType> faces;
55 
59  std::vector<FaceType> triangularMesh;
60 
62  bool exact = true;
63 
67  void merge(const Polyhedron& other);
68 
72  void move(const Transform3& transform);
73 
81  Extent extent(const Transform3& transform = Transform3::Identity()) const;
82 };
83 } // namespace Acts