![]() |
Maria GDK 5.0.0.738
Documentation of native code in develop branch
|
#include <M3DQuadTile.h>
Public Member Functions | |
QuadTile (const QuadCoo &quad_coo) | |
QuadTile (QuadTile *parent, int child_dir) | |
const QuadTile * | getParent () const |
Return the parent of this quad tile. | |
QuadTile * | parent () |
const QuadTile * | getChild (int i) const |
Return the child tile with index i. | |
QuadTile * | child (int i) |
Return the child tile with index i. | |
int | getTreeLevel () const |
int | getChildDir () const |
const STK::Vector3d & | getOrigin () const |
bool | calcBounds () |
double | getMaxAngularRadius () const |
const QuadCoo & | getQuadCoo () const |
Get the quadtree coordinate set. | |
double | getMinLatitude () const |
Get minimum latitude (in degrees) of the tile. | |
double | getMinLongitude () const |
Get minimum longitude (in degrees) of the tile. | |
double | getMaxLatitude () const |
Get maximum latitude (in degrees) of the tile. | |
double | getMaxLongitude () const |
Get maximum longitude (in degrees) of the tile. | |
bool | isInside (double lat, double lon) const |
Returns true if the given latitude and longitude is inside the tile. | |
const std::shared_ptr< GeometryData > & | getGeometryData () const |
void | setGeometryData (const std::shared_ptr< GeometryData > &data) |
const std::shared_ptr< MapTextureData > & | getTextureData () const |
void | setTextureData (const std::shared_ptr< MapTextureData > &texture_data) |
const std::shared_ptr< TextureData > & | getNormalMapData () const |
void | setNormalMapData (const std::shared_ptr< TextureData > &normal_map_data) |
Maria::TileId | getQuadId () const |
QuadTile * | findChildXY (Maria::WebMercator::IntCoord x, Maria::WebMercator::IntCoord y) |
QuadTile * | findTileXY (Maria::WebMercator::IntCoord x, Maria::WebMercator::IntCoord y, int level) |
QuadTile * | findTileLatLon (double lat, double lon, int level) |
void | split () |
void | calcTextureTransform (const QuadTile *tex_tile, STK::Vector4f &xfm) |
double | calcElevationXY (Maria::WebMercator::IntCoord x, Maria::WebMercator::IntCoord y) const |
const STK::Vector3d & | getCenter () const |
double | getRadius () const |
void | clearChildren () |
Delete all child tiles. | |
Protected Attributes | |
QuadTile * | children_ [4] |
QuadTile * | parent_ |
unsigned short | child_dir_ |
QuadCoo | quad_coo_ |
std::shared_ptr< GeometryData > | geometry_data_ |
std::shared_ptr< MapTextureData > | texture_data_ |
std::shared_ptr< TextureData > | normal_map_data_ |
STK::Vector3d | origin_ |
Local geocentric origin. Vertex data are relative to this. | |
STK::Vector3d | _center |
Global geocentric center point. | |
double | _radius |
Bounding sphere radius. | |
SngQuadTile - Short description. Detailed description.
QuadTile::QuadTile | ( | const QuadCoo & | quad_coo | ) |
Root tile constructor. This constructor is used to create one of the six root tiles. It must be initialized with the correct integer coordinate limits and quad tile ID.
QuadTile::QuadTile | ( | QuadTile * | parent, |
int | child_dir | ||
) |
Child tile constructor. Construct a child tile in the quadtree. The tile will be inserted into the parent's child array at the index given by child_dir.
bool QuadTile::calcBounds | ( | ) |
Calculate bounding sphere from parent data.
double QuadTile::calcElevationXY | ( | Maria::WebMercator::IntCoord | x, |
Maria::WebMercator::IntCoord | y | ||
) | const |
Calculate elevation for a given X,Y coordinate.
void QuadTile::calcTextureTransform | ( | const QuadTile * | tex_tile, |
STK::Vector4f & | xfm | ||
) |
Calculate a transformation the given texture tile. This method calculates the scale and translation factors for applying the texture from the given tile to this tile when rendering. The texture tile must be on a lower or equal level to this tile. The transform is stored in the 4-vector xfm as follows:
|
inline |
Find a tile at a given lat, lon position and a specific level.
QuadTile * QuadTile::findTileXY | ( | Maria::WebMercator::IntCoord | x, |
Maria::WebMercator::IntCoord | y, | ||
int | level | ||
) |
Find a tile at a given x, y position and a specific level.
|
inline |
Get geocentric center coordinate, based on actual vertex data. This method requires that calcBounds() has been called, and that the parent vertex data have been loaded.
|
inline |
Return child direction of this tile. Returns the index in the parent's child array for this tile. The index is in the range 0 .. 3 according to the Sng::ChildDir enum.
|
inline |
Return the tile origin. The tile origin is given in geocentrical XYZ-coordinates (meters).
|
inline |
Get unique id for this tile. The Quad tile ID is a 64-bits integer that is globally unique for this tile.
|
inline |
Get bounding radius, based on actual vertex data. This method requires that calcBounds() has been called, and that the parent vertex data have been loaded.
|
inline |
Return quadtree level. The quadtree level increases with depth, so that level 0 is the root.
|
inline |
Split the tile in four. This method will create the four child tiles for this quad tile if they are not already created. No data loading is performed at this point, only quadtree structure.