File: BooleanStruct.h

package info (click to toggle)
vecgeom 1.2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 23,928 kB
  • sloc: cpp: 88,717; ansic: 6,894; python: 1,035; sh: 582; sql: 538; makefile: 29
file content (37 lines) | stat: -rw-r--r-- 1,095 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef VECGEOM_VOLUMES_BOOLEANSTRUCT_H_
#define VECGEOM_VOLUMES_BOOLEANSTRUCT_H_
#include "VecGeom/base/Global.h"

namespace vecgeom {

// Declare types shared by cxx and cuda.
enum BooleanOperation { kUnion, kIntersection, kSubtraction };

inline namespace VECGEOM_IMPL_NAMESPACE {

/**
 * A class representing a simple UNPLACED boolean volume A-B
 * It takes two template arguments:
 * 1.: the mother (or left) volume A in unplaced form
 * 2.: the (or right) volume B in placed form, acting on A with a boolean operation;
 * the placement is with respect to the left volume
 */
struct BooleanStruct {
  VPlacedVolume const *fLeftVolume;
  VPlacedVolume const *fRightVolume;
  BooleanOperation const fOp;
  mutable Precision fCapacity    = -1;
  mutable Precision fSurfaceArea = -1;

  VECCORE_ATT_HOST_DEVICE
  BooleanStruct(BooleanOperation op, VPlacedVolume const *left, VPlacedVolume const *right)
      : fLeftVolume(left), fRightVolume(right), fOp(op)
  {
  }
}; // End struct

} // namespace VECGEOM_IMPL_NAMESPACE

} // namespace vecgeom

#endif /* VECGEOM_VOLUMES_BOOLEANSTRUCT_H_ */