AcresRegionCropData.h#
Acres/Source/Acres/AcresRegionCropData.h Generated
FRegionCropRun#
One run of adjacent crop patches on a lattice row: columns [Begin, End) of row Row, all in field Field.
FRegionCropChunk#
The runs of one ground chunk (Col, Row: first survey cell, as FRegionStreamingChunk).
FRegionCropData#
Baked occupancy of the standing crops outside the original tile (DriveRegion/crops.bin, written by Tools/ACRE/Map/regional_crops.py). Engine-free; immutable after Load and Bind, so workers can read it.
Coordinates are world metres, X east, Y south. Patch (I, J) of the one global lattice has its centre at ((I + 0.5) * PitchX, (J + 0.5) * PitchY) and the footprint PitchX x PitchY (1.52 m x 1.0 m, a tile patch). A patch belongs to the ground chunk that holds its centre. The data holds no crush, harvest or growth state.
Each patch has a stable ordinal: its position in the file. The runs are in file order and the patches of a run are in column order, so the ordinal of patch I of a run is the number of patches in all earlier runs plus I - Begin. Per-patch state (the crushed samples) is kept by its user, sparsely, under this ordinal.
FRegionCropData::Load#
Parse and check crops.bin. A failed load leaves the object unchanged.
FRegionCropData::Bind#
Check that the chunk table is the streaming policy's chunk list, in its order, and that every patch centre lies in its chunk. Keeps the chunk rectangles for ForEachNear and the chunk grid for ChunkAt and ForEachInBox.
FRegionCropData::FieldKinds#
Crop kind (AcresCrops: 0 corn, 1 soybean) of each field index.
FRegionCropData::RunFirstOrdinals#
Ordinal of the first patch of each run (see the class comment), in run order.
FRegionCropData::PatchAt#
The patch of an ordinal: its lattice position and field index. False for an ordinal the file does not have.
FRegionCropData::ChunkAt#
Index of the chunk that holds a point, from the chunk grid in constant time. -1: no chunk there (the original tile, outside the region) or not bound.
FRegionCropData::SourceSha1#
SHA-1 of the region.bin the bake used, upper-case hex (the identity ground_assets.json also carries).
FRegionCropData::PatchHash#
Position hash of a patch (SplitMix64 finaliser), for the choice of a mesh sample. The same patch gets the same value in every run and on every revisit.
FRegionCropData::Mix#
One step of an order-dependent 64-bit digest (rotate, xor, multiply), for the expanded instances of a chunk.
FRegionCropData::ForEachInChunk#
Visit(I, J, Kind) for every patch of a chunk, in row then column order.
FRegionCropData::ForEachNear#
Visit(I, J, Kind) for every patch whose centre is within RadiusM of (X, Y). Needs Bind.
FRegionCropData::ForEachInBox#
Visit(Ordinal, I, J, Field) for every patch with I0 <= I <= I1 and J0 <= J <= J1 (Field: the field index of its run). Only the chunks the box touches are read, each with one search for its first row. Needs Bind.