File indexing completed on 2025-03-13 09:29:33
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef TUNPLACEDBOOLEANMINUSVOLUME_H_
0009 #define TUNPLACEDBOOLEANMINUSVOLUME_H_
0010
0011 #include "VecGeom/base/Cuda.h"
0012 #include "VecGeom/base/Global.h"
0013 #include "VecGeom/base/AlignedBase.h"
0014 #include "VecGeom/base/Vector3D.h"
0015 #include "VecGeom/volumes/UnplacedVolume.h"
0016
0017
0018 namespace VECGEOM_NAMESPACE {
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 typedef VPlacedVolume LeftUnplacedVolume_t;
0039 typedef VPlacedVolume RightPlacedVolume_t;
0040 class TUnplacedBooleanMinusVolume : public VUnplacedVolume, public AlignedBase {
0041
0042 public:
0043 VPlacedVolume const *fLeftVolume;
0044 VPlacedVolume const *fRightVolume;
0045
0046
0047
0048 public:
0049
0050 TUnplacedBooleanMinusVolume(LeftUnplacedVolume_t const *left, RightPlacedVolume_t const *right)
0051 : fLeftVolume(left), fRightVolume(right)
0052 {
0053 }
0054
0055 typedef LeftUnplacedVolume_t LeftType;
0056 typedef RightPlacedVolume_t RightType;
0057
0058 virtual int MemorySize() const { return sizeof(*this); }
0059
0060 #ifdef VECGEOM_CUDA_INTERFACE
0061 virtual VUnplacedVolume *CopyToGpu() const;
0062 virtual VUnplacedVolume *CopyToGpu(VUnplacedVolume *const gpu_ptr) const;
0063 #endif
0064
0065 VECCORE_ATT_HOST_DEVICE
0066 VECGEOM_FORCE_INLINE
0067 Precision Capacity() const
0068 {
0069
0070 return 0.;
0071 }
0072
0073 VECCORE_ATT_HOST_DEVICE
0074 VECGEOM_FORCE_INLINE
0075 Precision SurfaceArea() const
0076 {
0077
0078 return 0.;
0079 }
0080
0081 VECCORE_ATT_HOST_DEVICE
0082 void Extent(Vector3D<Precision> &, Vector3D<Precision> &) const {
0083
0084 };
0085
0086 VECCORE_ATT_HOST_DEVICE
0087 virtual void Print() const {};
0088
0089 virtual void Print(std::ostream &os) const {};
0090
0091 #ifndef VECCORE_CUDA
0092 template <typename LeftUnplacedVolume_t, typename RightPlacedVolume_t, TranslationCode trans_code,
0093 RotationCode rot_code>
0094 static VPlacedVolume *Create(LogicalVolume const *const logical_volume, Transformation3D const *const transformation,
0095 VPlacedVolume *const placement = NULL)
0096 {
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106 }
0107
0108 static VPlacedVolume *CreateSpecializedVolume(LogicalVolume const *const volume,
0109 Transformation3D const *const transformation,
0110 const TranslationCode trans_code, const RotationCode rot_code,
0111 VPlacedVolume *const placement = NULL)
0112 {
0113
0114
0115
0116
0117
0118 }
0119
0120 #else
0121 template <TranslationCode trans_code, RotationCode rot_code>
0122 VECCORE_ATT_DEVICE
0123 static VPlacedVolume *Create(LogicalVolume const *const logical_volume, Transformation3D const *const transformation,
0124 const int id, VPlacedVolume *const placement = NULL);
0125
0126 VECCORE_ATT_DEVICE static VPlacedVolume *CreateSpecializedVolume(LogicalVolume const *const volume,
0127 Transformation3D const *const transformation,
0128 const TranslationCode trans_code,
0129 const RotationCode rot_code, const int id,
0130 VPlacedVolume *const placement = NULL);
0131 #endif
0132
0133 private:
0134 #ifndef VECCORE_CUDA
0135 virtual VPlacedVolume *SpecializedVolume(LogicalVolume const *const volume,
0136 Transformation3D const *const transformation,
0137 const TranslationCode trans_code, const RotationCode rot_code,
0138 VPlacedVolume *const placement = NULL) const
0139 {
0140 return CreateSpecializedVolume(volume, transformation, trans_code, rot_code, placement);
0141 }
0142 #else
0143 VECCORE_ATT_DEVICE virtual VPlacedVolume *SpecializedVolume(LogicalVolume const *const volume,
0144 Transformation3D const *const transformation,
0145 const TranslationCode trans_code,
0146 const RotationCode rot_code, const int id,
0147 VPlacedVolume *const placement = NULL) const
0148 {
0149 return CreateSpecializedVolume(volume, transformation, trans_code, rot_code, id, placement);
0150 }
0151 #endif
0152
0153 };
0154
0155 }
0156
0157 #endif