#include <Snapshot.hpp>
Public Member Functions | |
Snapshot () | |
virtual | ~Snapshot () |
double | age (int m) const |
double | age (Position bfr) const |
double | currentMass (int m) const |
double | currentMass (Position bfr) const |
virtual double | density (int m) const =0 |
virtual double | density (Position bfr) const =0 |
virtual Box | extent () const =0 |
virtual Position | generatePosition () const =0 |
virtual Position | generatePosition (int m) const =0 |
virtual void | getEntities (EntityCollection &entities, Position bfr) const =0 |
virtual void | getEntities (EntityCollection &entities, Position bfr, Direction bfk) const =0 |
bool | hasAge () const |
bool | hasCurrentMass () const |
bool | hasInitialMass () const |
bool | hasMagneticField () const |
bool | hasMetallicity () const |
bool | hasParameters () const |
bool | hasTemperature () const |
bool | hasVelocity () const |
bool | hasVelocityDispersion () const |
bool | holdsNumber () const |
void | importBox () |
void | importCurrentMass () |
void | importMagneticField () |
void | importMass () |
void | importMassDensity () |
void | importMetallicity () |
void | importNumber () |
void | importNumberDensity () |
void | importParameters (const vector< SnapshotParameter > ¶meters) |
void | importPosition () |
void | importSize () |
void | importTemperature () |
void | importVelocity () |
void | importVelocityDispersion () |
double | initialMass (int m) const |
double | initialMass (Position bfr) const |
Vec | magneticField (int m) const |
Vec | magneticField (Position bfr) const |
virtual double | mass () const =0 |
double | metallicity (int m) const |
double | metallicity (Position bfr) const |
virtual int | numEntities () const =0 |
void | open (const SimulationItem *item, string filename, string description) |
void | parameters (int m, Array ¶ms) const |
void | parameters (Position bfr, Array ¶ms) const |
virtual Position | position (int m) const =0 |
virtual void | readAndClose () |
void | setMassDensityPolicy (double multiplier, double maxTemperature, bool useMetallicity) |
void | setNeedGetEntities () |
double | SigmaX () const |
double | SigmaY () const |
double | SigmaZ () const |
double | temperature (int m) const |
double | temperature (Position bfr) const |
void | useColumns (string columns) |
Vec | velocity (int m) const |
Vec | velocity (Position bfr) const |
double | velocityDispersion (int m) const |
double | velocityDispersion (Position bfr) const |
double | volume () const |
virtual double | volume (int m) const =0 |
Protected Member Functions | |
int | ageIndex () const |
int | boxIndex () const |
int | currentMassIndex () const |
int | densityIndex () const |
bool | hasMassDensityPolicy () const |
TextInFile * | infile () |
int | initialMassIndex () const |
Log * | log () const |
void | logMassStatistics (int numIgnored, double totalOriginalMass, double totalMetallicMass, double totalEffectiveMass) |
int | magneticFieldIndex () const |
int | massIndex () const |
double | maxTemperature () const |
int | metallicityIndex () const |
double | multiplier () const |
virtual int | nearestEntity (Position bfr) const =0 |
bool | needGetEntities () const |
int | numParameters () const |
int | parametersIndex () const |
int | positionIndex () const |
virtual const Array & | properties (int m) const =0 |
Random * | random () const |
void | setContext (const SimulationItem *item) |
int | sizeIndex () const |
int | temperatureIndex () const |
Units * | units () const |
bool | useMetallicity () const |
bool | useTemperatureCutoff () const |
int | velocityDispersionIndex () const |
int | velocityIndex () const |
Private Attributes | |
int | _ageIndex |
int | _boxIndex |
int | _currentMassIndex |
int | _densityIndex |
bool | _hasDensityPolicy |
bool | _holdsNumber |
TextInFile * | _infile |
int | _initialMassIndex |
Log * | _log |
int | _magneticFieldIndex |
int | _massIndex |
double | _maxTemperature |
int | _metallicityIndex |
double | _multiplier |
bool | _needGetEntities |
int | _nextIndex |
int | _numParameters |
int | _parametersIndex |
int | _positionIndex |
Random * | _random |
int | _sizeIndex |
int | _temperatureIndex |
Units * | _units |
bool | _useMetallicity |
int | _velocityDispersionIndex |
int | _velocityIndex |
Snapshot is an abstract base class for representing snapshot data that is imported from a column text file and is used to define the properties of primary sources or transfer media. This base class offers facilities to handle the input options, such as determining which columns are to be imported from the text file, and defines a common interface for all snapshot types, for example to obtain the density at a given position. The actual implementation must be provided in a derived class for each snapshot type.
Some snapshot types use smoothed particles and some use spatial cells as their basic constituents. To avoid mentioning both, we use the generic term entity for referring to either particles or cells.
A Snapshot instance must be initialized using the following strict calling sequence; calling any of the getters before the initialization sequence has completed results in undefined behavior:
The functions for extracting information from a snapshot once it is loaded are thread-safe. However, the functions for configuring options and reading the snapshot file are not thread-safe; they must be called from a single thread (for each snapshot object).
Snapshot::Snapshot | ( | ) |
The default constructor initializes the snapshot in an invalid state; see the description of the required calling sequence in the class header.
|
virtual |
The destructor deletes the input file object, if it would still be present. The fact that the destructor is virtual ensures that derived classes can be propertly destructed through a pointer to this base class.
double Snapshot::age | ( | int | m | ) | const |
This function returns the age of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the age is not being imported, or the index is out of range, the behavior is undefined.
double Snapshot::age | ( | Position | bfr | ) | const |
This function returns the age of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If the age is not being imported, the behavior is undefined.
|
inlineprotected |
This function returns the column index of the age field, or -1 if this is not being imported, for use by subclasses.
|
inlineprotected |
This function returns the column index of the first box field, or -1 if this is not being imported, for use by subclasses.
double Snapshot::currentMass | ( | int | m | ) | const |
This function returns the current mass of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the current mass is not being imported, or the index is out of range, the behavior is undefined.
double Snapshot::currentMass | ( | Position | bfr | ) | const |
This function returns the current mass of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If the current mass is not being imported, the behavior is undefined.
|
inlineprotected |
This function returns the column index of the current mass field, or -1 if this is not being imported, for use by subclasses.
|
pure virtual |
This function returns the mass or number density for the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the index is out of range, if no density policy has been set, or no mass/density information is being imported, the behavior is undefined.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
pure virtual |
This function returns the mass or number density represented by the snapshot at a given point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
inlineprotected |
This function returns the column index of the density field, or -1 if this is not being imported, for use by subclasses.
|
pure virtual |
This function returns the extent of the complete spatial domain of the snapshot as a box lined up with the coordinate axes.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
pure virtual |
This function returns a random position within the spatial domain of the snapshot, drawn from the mass density distribution represented by the snapshot. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
pure virtual |
This function returns a random position within the entity with index \(0\le m \le N_\mathrm{ent}-1\), drawn from an appropriate probability distribution depending on the snapshot type (e.g. uniform for cells, and some smoothing kernel for particles). If the index is out of range, the behavior is undefined.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
pure virtual |
This function replaces the contents of the specified entity collection by the set of entities that overlap the specified point \({\bf{r}}\), with their corresponding weights. If the point is outside the domain or otherwise does not overlap any entity, the collection will be empty.
For a cell-based snapshot, the function returns the cell containing the given point, if any. The weight is set to 1. For a particle-based snapshot, the function returns all particles with a smoothing kernel that overlaps the given point. The weight of a particle is given by the particle's smoothing kernel value at the given point.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
pure virtual |
This function replaces the contents of the specified entity collection by the set of entities that overlap the specified path with starting point \({\bf{r}}\) and direction \({\bf{k}}\), with their corresponding weights. If the path does not overlap any entity, the collection will be empty.
For a cell-based snapshot, the weight of a cell is given by the length of the path segment inside the cell. For a particle-based snapshot, the weight of a particle is given by the effective length seen by the path as it crosses the particle's smoothing kernel.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
inline |
This function returns true if the age is being imported, and false otherwise.
|
inline |
This function returns true if the current mass is being imported, and false otherwise.
|
inline |
This function returns true if the initial mass is being imported, and false otherwise.
|
inline |
This function returns true if the magnetic field is being imported, and false otherwise.
|
inlineprotected |
This function returns true if the user configured the mass or mass density policy and false otherwise, for use by subclasses.
|
inline |
This function returns true if the metallicity is being imported, and false otherwise.
|
inline |
This function returns true if parameters are being imported (i.e. if the number of imported parameters is nonzero), and false otherwise.
|
inline |
This function returns true if the temperature is being imported, and false otherwise.
|
inline |
This function returns true if the velocity is being imported, and false otherwise.
|
inline |
This function returns true if the velocity dispersion is being imported, and false otherwise.
|
inline |
This function returns true if the snapshot holds number (density) values, and false if it holds mass (density) values (or if no mass or density column is being imported).
void Snapshot::importBox | ( | ) |
This function configures the snapshot to import a cuboid lined up with the coordinate axes, defined by six components (xmin,ymin,zmin,xmax,ymax,zmax). The default unit is pc.
void Snapshot::importCurrentMass | ( | ) |
This function configures the snapshot to import the current mass (for use by sources). Not to be confused with the initial mass, which is often requested by single stellar population SED families. The default unit is Msun.
void Snapshot::importMagneticField | ( | ) |
This function configures the snapshot to import a magnetic field vector with three components (x,y,z). The default unit is \(\mu \mathrm{G}\).
void Snapshot::importMass | ( | ) |
This function configures the snapshot to import a mass, i.e. mass density integrated over volume (for use by media). The default unit is Msun. It is allowed to combine the importMassDensity() and importMass() options, supporting special use cases where the volume of the entity cannot be derived otherwise. However, combining the "mass" family functions with the "number" family functions is prohibited and leads to undefined behavior.
void Snapshot::importMassDensity | ( | ) |
This function configures the snapshot to import a mass density per unit of volume (for use by media). The default unit is Msun/pc3. It is allowed to combine the importMassDensity() and importMass() options, supporting special use cases where the volume of the entity cannot be derived otherwise. However, combining the "mass" family functions with the "number" family functions is prohibited and leads to undefined behavior.
void Snapshot::importMetallicity | ( | ) |
This function configures the snapshot to import a (dimensionless) metallicity fraction.
void Snapshot::importNumber | ( | ) |
This function configures the snapshot to import a number, i.e. number density integrated over volume (for use by media). The default unit is 1. It is allowed to combine the importNumberDensity() and importNumber() options, supporting special use cases where the volume of the entity cannot be derived otherwise. However, combining the "mass" family functions with the "number" family functions is prohibited and leads to undefined behavior.
void Snapshot::importNumberDensity | ( | ) |
This function configures the snapshot to import a number density per unit of volume (for use by media). The default unit is 1/cm3. It is allowed to combine the importNumberDensity() and importNumber() options, supporting special use cases where the volume of the entity cannot be derived otherwise. However, combining the "mass" family functions with the "number" family functions is prohibited and leads to undefined behavior.
void Snapshot::importParameters | ( | const vector< SnapshotParameter > & | parameters | ) |
This function configures the snapshot to import a sequence of parameters as described by the specified list of SnapshotParameter metadata objects.
void Snapshot::importPosition | ( | ) |
This function configures the snapshot to import a spatial position with three components (x,y,z). The default unit is pc.
void Snapshot::importSize | ( | ) |
This function configures the snapshot to import a spatial radial size. The default unit is pc.
void Snapshot::importTemperature | ( | ) |
This function configures the snapshot to import a temperature. The default unit is K.
void Snapshot::importVelocity | ( | ) |
This function configures the snapshot to import a velocity with three components (x,y,z). The default unit is km/s.
void Snapshot::importVelocityDispersion | ( | ) |
This function configures the snapshot to import a single velocity dispersion value, specifying a random offset to the bulk velocity with a spherically symmetric Gaussian distribution. The default unit is km/s.
|
inlineprotected |
This function returns a pointer to the input file object. It is intended for use in subclasses.
double Snapshot::initialMass | ( | int | m | ) | const |
This function returns the initial mass of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the initial mass is not being imported, or the index is out of range, the behavior is undefined.
double Snapshot::initialMass | ( | Position | bfr | ) | const |
This function returns the initial mass of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If the initial mass is not being imported, the behavior is undefined.
|
inlineprotected |
This function returns the column index of the initial mass field, or -1 if this is not being imported, for use by subclasses.
|
inlineprotected |
This function returns a pointer to an appropriate log object. It is intended for use in subclasses.
|
protected |
This function issues log messages with statistics on the imported masses. It is implemented here for use by subclasses.
Vec Snapshot::magneticField | ( | int | m | ) | const |
This function returns the magnetic field vector of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the magnetic field is not being imported, or the index is out of range, the behavior is undefined.
This function returns the magnetic field vector of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns a zero magnetic field. If the magnetic field is not being imported, the behavior is undefined.
|
inlineprotected |
This function returns the column index of the first magnetic field field, or -1 if this is not being imported, for use by subclasses.
|
pure virtual |
This function returns the total mass or number represented by the snapshot, which is equivalent to the mass or number density integrated over the complete spatial domain. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
inlineprotected |
This function returns the column index of the mass field, or -1 if this is not being imported, for use by subclasses.
|
inlineprotected |
This function returns the maximum temperature configured by the user for an entity to have mass, or zero if the user did not configure the mass or mass density policy, for use by subclasses.
double Snapshot::metallicity | ( | int | m | ) | const |
This function returns the metallicity of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the metallicity is not being imported, or the index is out of range, the behavior is undefined.
double Snapshot::metallicity | ( | Position | bfr | ) | const |
This function returns the metallicity of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If the metallicity is not being imported, the behavior is undefined.
|
inlineprotected |
This function returns the column index of the metallicity field, or -1 if this is not being imported, for use by subclasses.
|
inlineprotected |
This function returns the mass or mass density multiplier configured by the user, or zero if the user did not configure the mass or mass density policy, for use by subclasses.
|
protectedpure virtual |
This function returns the index \(0\le m \le N_\mathrm{ent}-1\) for the entity at or nearest to the specified point \({\bf{r}}\), or -1 if the point is outside the domain or if there are no entities in the snapshot. For a cell-based snapshot, the function returns the index of the cell containing the given point. For a particle-based snapshot, the function returns the index of the particle whose center is nearest to the given point.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
inlineprotected |
This function returns true if one of the getEntities() functions may be called during the simulation, implying that the snapshot must prebuild the required search data structures. Returns false otherwise. For use by subclasses.
|
pure virtual |
This function returns the number of entities \(N_\mathrm{ent}\) in the snapshot.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
inlineprotected |
This function returns the number of parameters being imported (which may be zero).
void Snapshot::open | ( | const SimulationItem * | item, |
string | filename, | ||
string | description | ||
) |
This function creates an input file object corresponding to the specified file and opens it for reading; if the file can't be opened, a FatalError is thrown. It must be called before invoking any of the configuration functions(). This function takes several arguments: (1) item specifies a simulation item in the hierarchy of the caller (usually the caller itself) used to retrieve context such as an appropriate logger; (2) filename specifies the name of the file, including filename extension but excluding path and simulation prefix; (3) description describes the contents of the file for use in the log message issued after the file is successfully opened.
void Snapshot::parameters | ( | int | m, |
Array & | params | ||
) | const |
This function stores the parameters of the entity with index \(0\le m \le N_\mathrm{ent}-1\) into the given array. If parameters are not being imported, or the index is out of range, the behavior is undefined.
This function stores the parameters of the entity nearest to (or at) the specified point \({\bf{r}}\) into the given array. If the point is outside the domain, the function returns the appropriate number of zero parameter values. If parameters are not being imported, the behavior is undefined.
|
inlineprotected |
This function returns the column index of the first field in the parameter list, or -1 if this is not being imported, for use by subclasses.
|
pure virtual |
This function returns a characteristic position for the entity with index \(0\le m \le N_\mathrm{ent}-1\). Such a position is always available for all snapshot types, regardless of whether a position is explicitly being imported or not. If the index is out of range, the behavior is undefined.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
inlineprotected |
This function returns the column index of the first position field, or -1 if this is not being imported, for use by subclasses.
|
protectedpure virtual |
This function returns a reference to an array containing the imported properties (in column order) for the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the index is out of range, the behavior is undefined.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
inlineprotected |
This function returns a pointer to an appropriate random generator. It is intended for use in subclasses.
|
virtual |
This function reads the snapshot data from the input file, honoring the options set through the configuration functions, stores the data for later use, and closes the file.
The implementation in this base class simply closes the file and deletes the corresponding file object. Subclasses must override the function to actually read the data and then call the implementation in this base class.
Reimplemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.
|
protected |
This function retrieves the relevant simulation hierarchy context (such as an appropriate logger) from the specified simulation item (usually the caller itself). It is intended for use in subclasses that support use cases where the open() function is never invoked.
void Snapshot::setMassDensityPolicy | ( | double | multiplier, |
double | maxTemperature, | ||
bool | useMetallicity | ||
) |
This function sets the policy for calculating the mass or mass density at a given spatial position in the snapshot. If the policy is not set during configuration, or if neither of the importMass() and importDensity() functions was invoked, attempting to obtain mass or mass density values results in undefined behavior.
If the policy is set during configuration, the argument values determine the heuristic for calculating the mass or density for each entity:
void Snapshot::setNeedGetEntities | ( | ) |
This function notifies the snapshot that one of the getEntities() functions may be called during the simulation, implying that the snapshot must prebuild the required search data structures.
double Snapshot::SigmaX | ( | ) | const |
This function returns the X-axis surface density of the density distribution represented by the snapshot, defined as the integration of the density along the entire X-axis,
\[ \Sigma_X = \int_{x_\text{min}}^{x_\text{max}} \rho(x,0,0)\, {\text{d}}x.\]
This integral is calculated numerically using 10000 samples along the X-axis. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.
double Snapshot::SigmaY | ( | ) | const |
This function returns the Y-axis surface density of the density distribution represented by the snapshot, defined as the integration of the density along the entire Y-axis,
\[ \Sigma_Y = \int_{y_\text{min}}^{y_\text{max}} \rho(0,y,0)\, {\text{d}}y.\]
This integral is calculated numerically using 10000 samples along the Y-axis. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.
double Snapshot::SigmaZ | ( | ) | const |
This function returns the Z-axis surface density of the density distribution represented by the snapshot, defined as the integration of the density along the entire Z-axis,
\[ \Sigma_Z = \int_{z_\text{min}}^{z_\text{max}} \rho(0,0,z)\, {\text{d}}z.\]
This integral is calculated numerically using 10000 samples along the Z-axis. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.
|
inlineprotected |
This function returns the column index of the size field, or -1 if this is not being imported, for use by subclasses.
double Snapshot::temperature | ( | int | m | ) | const |
This function returns the temperature of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the temperature is not being imported, or the index is out of range, the behavior is undefined.
double Snapshot::temperature | ( | Position | bfr | ) | const |
This function returns the temperature of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If the temperature is not being imported, the behavior is undefined.
|
inlineprotected |
This function returns the column index of the temperature field, or -1 if this is not being imported, for use by subclasses.
|
inlineprotected |
This function returns a pointer to an appropriate units object. It is intended for use in subclasses.
void Snapshot::useColumns | ( | string | columns | ) |
This function specifies a mapping (defined by the columns argument) between the "physical" columns in the file being imported (defined by the column information in the file header) and the required "logical" columns (defined by calling the other configuration functions). For information on the syntax and semantics of the columns string contents, refer to the description of the TextInFile::useColumns() function.
This function can be called with a non-empty columns string at most once for each snapshot, and such invocation should occur before the first invocation of any other configuration function. Calling this function with an empty columns string is equivalent to not calling it at all.
|
inlineprotected |
This function returns true if the user configured the mass or mass density policy with a request to use the metallicity, and the metallicity field is being imported. Returns false otherwise. For use by subclasses.
|
inlineprotected |
This function returns true if the user configured the mass or mass density policy with a nonzero maximum temperature and the temperature field is being imported. Returns false otherwise. For use by subclasses.
Vec Snapshot::velocity | ( | int | m | ) | const |
This function returns the velocity of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the velocity is not being imported, or the index is out of range, the behavior is undefined.
This function returns the velocity of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero velocity. If the velocity is not being imported, the behavior is undefined.
double Snapshot::velocityDispersion | ( | int | m | ) | const |
This function returns the velocity dispersion of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the velocity dispersion is not being imported, or the index is out of range, the behavior is undefined.
double Snapshot::velocityDispersion | ( | Position | bfr | ) | const |
This function returns the velocity dispersion of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero dispersion. If the velocity dispersion is not being imported, the behavior is undefined.
|
inlineprotected |
This function returns the column index of the velocity dispersion field, or -1 if this is not being imported, for use by subclasses.
|
inlineprotected |
This function returns the column index of the first velocity field, or -1 if this is not being imported, for use by subclasses.
double Snapshot::volume | ( | ) | const |
This function returns the volume of the complete domain of the snapshot, taken to be a box lined up with the coordinate axes.
|
pure virtual |
This function returns the volume of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the index is out of range, if no density policy has been set, or no mass/density information is being imported, the behavior is undefined.
Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.