Representation of a region of space diced into voxels. More...
#include <PhotonVoxels.h>
Classes | |
struct | NeiInfo |
Public Member Functions | |
PhotonVoxelDef ()=default | |
PhotonVoxelDef (double xMin, double xMax, int xN, double yMin, double yMax, int yN, double zMin, double zMax, int zN) | |
template<typename Point = DefaultPoint> | |
decltype(auto) | GetRegionLowerCorner () const |
Returns the volume vertex (type Point ) with the lowest coordinates. More... | |
template<typename Point = DefaultPoint> | |
decltype(auto) | GetRegionUpperCorner () const |
Returns the volume vertex (type Point ) with the highest coordinates. More... | |
std::array< unsigned int, 3U > | GetSteps () const |
Returns the number of voxels along each of the three dimensions. More... | |
template<typename Vector = DefaultVector> | |
Vector | GetVoxelSize () const |
Returns a vector describing the span of a single voxel in x, y an z [cm]. More... | |
template<typename Vector = DefaultVector, typename Point = DefaultPoint> | |
Vector | GetVolumeSize () const |
Returns a vector describing the full span in x, y an z [cm]. More... | |
unsigned int | GetNVoxels () const |
Returns the total number of voxels in the volume. More... | |
template<typename Point > | |
int | GetVoxelID (Point const &p) const |
Returns the ID of the voxel containing p , or -1 if none. More... | |
int | GetVoxelID (double const *) const |
bool | IsLegalVoxelID (int) const |
template<typename Point > | |
std::optional< std::array< NeiInfo, 8U > > | GetNeighboringVoxelIDs (Point const &v) const |
Returns IDs of the eight neighboring voxels around v . More... | |
PhotonVoxel | GetPhotonVoxel (int ID) const |
std::array< int, 3U > | GetVoxelCoords (int ID) const |
bool | isInside (geo::Point_t const &p) const |
Returns whether point p is inside the region (upper border excluded). More... | |
bool | operator== (const PhotonVoxelDef &rhs) const |
bool | operator!= (const PhotonVoxelDef &rhs) const |
template<typename Point > | |
std::optional< std::array< sim::PhotonVoxelDef::NeiInfo, 8U > > | GetNeighboringVoxelIDs (Point const &v) const |
Private Types | |
using | DefaultPoint = geo::Point_t |
using | DefaultVector = geo::Vector_t |
Private Member Functions | |
int | GetVoxelIDImpl (geo::Point_t const &p) const |
std::optional< std::array< NeiInfo, 8U > > | GetNeighboringVoxelIDsImpl (geo::Point_t const &v) const |
std::array< double, 3U > | GetVoxelStepCoordsUnchecked (geo::Point_t const &p) const |
Returns the coordinates of the cvoxel containing p in step units. More... | |
bool | isInsideImpl (geo::Point_t const &point) const |
Returns whether the specified point is within the volume. More... | |
Static Private Member Functions | |
static bool | isInsideVolume (geo::Point_t const &point, geo::Point_t const &lower, geo::Point_t const &upper) |
static bool | isInsideRange (double value, double lower, double upper) |
Private Attributes | |
geo::Point_t | fLowerCorner |
geo::Point_t | fUpperCorner |
unsigned int | fxSteps = 1U |
unsigned int | fySteps = 1U |
unsigned int | fzSteps = 1U |
Representation of a region of space diced into voxels.
Definition at line 58 of file PhotonVoxels.h.
|
private |
Definition at line 59 of file PhotonVoxels.h.
|
private |
Definition at line 60 of file PhotonVoxels.h.
|
default |
sim::PhotonVoxelDef::PhotonVoxelDef | ( | double | xMin, |
double | xMax, | ||
int | xN, | ||
double | yMin, | ||
double | yMax, | ||
int | yN, | ||
double | zMin, | ||
double | zMax, | ||
int | zN | ||
) |
Definition at line 22 of file PhotonVoxels.cxx.
std::optional<std::array<NeiInfo, 8U> > sim::PhotonVoxelDef::GetNeighboringVoxelIDs | ( | Point const & | v | ) | const |
Returns IDs of the eight neighboring voxels around v
.
v | location within the mapped volume |
If v
is not inside the mapped volume, no list is returned (the optional return value evaluates to false
). Otherwise, each of the eight voxels with the center closest to v
are returned, each with a weight proportional to the distance of v
from that center.
std::optional<std::array<sim::PhotonVoxelDef::NeiInfo, 8U> > sim::PhotonVoxelDef::GetNeighboringVoxelIDs | ( | Point const & | v | ) | const |
Definition at line 242 of file PhotonVoxels.h.
|
private |
Definition at line 72 of file PhotonVoxels.cxx.
unsigned int sim::PhotonVoxelDef::GetNVoxels | ( | ) | const |
PhotonVoxel sim::PhotonVoxelDef::GetPhotonVoxel | ( | int | ID | ) | const |
Definition at line 139 of file PhotonVoxels.cxx.
decltype(auto) sim::PhotonVoxelDef::GetRegionLowerCorner | ( | ) | const |
Returns the volume vertex (type Point
) with the lowest coordinates.
decltype(auto) sim::PhotonVoxelDef::GetRegionUpperCorner | ( | ) | const |
Returns the volume vertex (type Point
) with the highest coordinates.
std::array< unsigned int, 3U > sim::PhotonVoxelDef::GetSteps | ( | ) | const |
Returns the number of voxels along each of the three dimensions.
Definition at line 40 of file PhotonVoxels.cxx.
|
inline |
Returns a vector describing the full span in x, y an z [cm].
Definition at line 98 of file PhotonVoxels.h.
std::array< int, 3U > sim::PhotonVoxelDef::GetVoxelCoords | ( | int | ID | ) | const |
Definition at line 168 of file PhotonVoxels.cxx.
int sim::PhotonVoxelDef::GetVoxelID | ( | Point const & | p | ) | const |
Returns the ID of the voxel containing p
, or -1
if none.
Definition at line 234 of file PhotonVoxels.h.
int sim::PhotonVoxelDef::GetVoxelID | ( | double const * | Position | ) | const |
Definition at line 65 of file PhotonVoxels.cxx.
|
private |
Definition at line 195 of file PhotonVoxels.cxx.
Vector sim::PhotonVoxelDef::GetVoxelSize | ( | ) | const |
Returns a vector describing the span of a single voxel in x, y an z [cm].
Definition at line 224 of file PhotonVoxels.h.
|
private |
Returns the coordinates of the cvoxel containing p
in step units.
Definition at line 180 of file PhotonVoxels.cxx.
|
inline |
Returns whether point p
is inside the region (upper border excluded).
Definition at line 139 of file PhotonVoxels.h.
|
inlineprivate |
Returns whether the specified point is within the volume.
Definition at line 161 of file PhotonVoxels.h.
|
staticprivate |
Definition at line 223 of file PhotonVoxels.cxx.
|
staticprivate |
Definition at line 213 of file PhotonVoxels.cxx.
bool sim::PhotonVoxelDef::IsLegalVoxelID | ( | int | ID | ) | const |
Definition at line 162 of file PhotonVoxels.cxx.
|
inline |
Definition at line 146 of file PhotonVoxels.h.
bool sim::PhotonVoxelDef::operator== | ( | const PhotonVoxelDef & | rhs | ) | const |
Definition at line 49 of file PhotonVoxels.cxx.
|
private |
Definition at line 62 of file PhotonVoxels.h.
|
private |
Definition at line 63 of file PhotonVoxels.h.
|
private |
Definition at line 64 of file PhotonVoxels.h.
|
private |
Definition at line 65 of file PhotonVoxels.h.
|
private |
Definition at line 66 of file PhotonVoxels.h.