IPyramidBase
Description
- Derived from
- Extended by
-
IPyramid
PyramidBase abstract
Non-generic base interface for classes that represent a pyramid of tile data.
A tile pyramid is organized as a cubemap, where each cubemap face defines as quad-tree. The quad-tree nodes each hold a single data tile. The data type of tiles is defined by the TData
parameter of the IPyramid interface.
The topmost level (level index 0) contains only a single data tile: +---------------+ | | | | +---> tileX | | | | | | | | V | | tileY | | +---------------+ According to quad-tree semantics, each data tile is split into four children: +-------+-------+ | | | | | | +---> tileX | | | | +-------+-------+ | | | | V | | | tileY | | | +-------+-------+ This is done until the bottommost level (level count, minus one) is reached: +---+---+---+---+ | | | | | +---+---+---+---+ +---> tileX | | | | | | +---+---+---+---+ | | | | | | V +---+---+---+---+ tileY | | | | | +---+---+---+---+
Tile pyramids can be sparse, i.e. some tiles can be void (see TileDataResult.Void). The pyramid flags (see Flags, PyramidFlags.Opaque) define how void tiles shall be handled during rendering.
+-------+-------+ +---+---+---+---+ | | | | | | | X | | | | +---+---+---+---+ | | | | | | | | +-------+-------+ +---+---+---+---+ X := void tiles | | | | X | X | | | | X | | +---+---+---+---+ | | | | X | X | | | +-------+-------+ +---+---+---+---+
Tile pyramids come in two flavours:
-
projected (MapInfo.Type is MapType.Rect)
-
unprojected (MapInfo.Type is MapType.Cube)
The geo-reference raster of a pyramid (IGeorefInfo.Georef and IMapInfo.Map) always spans the maximum possible pyramid level (see MappingUtil.MaxSize), independent of the actual pyramid size (see FullSize), assuming a tile pad of zero (see TilePad):
(0|0) : raster coordinates of top-left corner of top-left tile, on any level. (m|m) : raster coordinates of bottom-right corner of bottom-right tile, on any level.
where m
is MappingUtil.MaxSize. This means that the geo-reference raster has PixelCoverage.PixelIsPoint semantics.
Public / Methods
HasTileData
3 overloads
Collects the regions on the bottom-most level where data content is available.
Checks if there is any data content available for the given map tile (i.e. TileDataResult.Ok).
Checks if there is any data content available for the given map tile (i.e. TileDataResult.Ok).
Public / Attributes
OnUpdated
Event for listening to updates made to this pixel pyramid.
This event will be fired by the thread that performs the map update.
TilePad
The pad width of this cube pyramid.
Tile padding is used to avoid color bleeding that will occur when texture samples are filtered at the edge of a pyramid tile (assuming tiles are stored in some kind of texture atlas). The tile pad width gives the number of safety pixels at the border that are borrowed from neighbouring pyramid tiles:
8x8 tile, with a pad of 2: 0 1 2 3 4 5 6 7 +---+---+---+---+---+---+---+---+ 0 |###|###|###|###|###|###|###|###| +---+---+---+---+---+---+---+---+ 1 |###|###|###|###|###|###|###|###| +---+--(X)--+---+---+--(X)--+---+ 2 |###|###| | | | |###|###| +---+---+---+---+---+---+---+---+ 3 |###|###| | | | |###|###| +---+---+---+---+---+---+---+---+ 4 |###|###| | | | |###|###| +---+---+---+---+---+---+---+---+ 5 |###|###| | | | |###|###| +---+--(X)--+---+---+--(X)--+---+ 6 |###|###|###|###|###|###|###|###| +---+---+---+---+---+---+---+---+ 7 |###|###|###|###|###|###|###|###| +---+---+---+---+---+---+---+---+
The point coordinates marked with (X)
will be mapped to the corner vertices of each terrain mesh sector. Only the effective region of a padded tile (i.e. the square surrounded by (X)
) contains actual data. The padded pixels are sampled from neighbouring source tiles and carry redundant information.
Extensions
ValidCoords
2 overloads
Checks if the given pyramid coordinates are valid for this IPyramid object.
Checks if the given pyramid coordinates are valid for this IPyramidBase object.