Maria GDK 5.0.0.738
Documentation of native code in develop branch
Loading...
Searching...
No Matches
Maria3D::QuadTile Class Reference

#include <M3DQuadTile.h>

Public Member Functions

 QuadTile (const QuadCoo &quad_coo)
 
 QuadTile (QuadTile *parent, int child_dir)
 
const QuadTilegetParent () const
 Return the parent of this quad tile.
 
QuadTileparent ()
 
const QuadTilegetChild (int i) const
 Return the child tile with index i.
 
QuadTilechild (int i)
 Return the child tile with index i.
 
int getTreeLevel () const
 
int getChildDir () const
 
const STK::Vector3dgetOrigin () const
 
bool calcBounds ()
 
double getMaxAngularRadius () const
 
const QuadCoogetQuadCoo () 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
 
QuadTilefindChildXY (Maria::WebMercator::IntCoord x, Maria::WebMercator::IntCoord y)
 
QuadTilefindTileXY (Maria::WebMercator::IntCoord x, Maria::WebMercator::IntCoord y, int level)
 
QuadTilefindTileLatLon (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::Vector3dgetCenter () const
 
double getRadius () const
 
void clearChildren ()
 Delete all child tiles.
 

Protected Attributes

QuadTilechildren_ [4]
 
QuadTileparent_
 
unsigned short child_dir_
 
QuadCoo quad_coo_
 
std::shared_ptr< GeometryDatageometry_data_
 
std::shared_ptr< MapTextureDatatexture_data_
 
std::shared_ptr< TextureDatanormal_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.
 

Detailed Description

SngQuadTile - Short description. Detailed description.

See also
Class1

Constructor & Destructor Documentation

◆ QuadTile() [1/2]

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() [2/2]

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.

Member Function Documentation

◆ calcBounds()

bool QuadTile::calcBounds ( )

Calculate bounding sphere from parent data.

◆ calcElevationXY()

double QuadTile::calcElevationXY ( Maria::WebMercator::IntCoord  x,
Maria::WebMercator::IntCoord  y 
) const

Calculate elevation for a given X,Y coordinate.

◆ calcTextureTransform()

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:

  • X = translate in X-direction.
  • Y = translate in Y-direction.
  • Z = scale in X-direction.
  • W = scale in Y-direction.

◆ findTileLatLon()

QuadTile * Maria3D::QuadTile::findTileLatLon ( double  lat,
double  lon,
int  level 
)
inline

Find a tile at a given lat, lon position and a specific level.

◆ findTileXY()

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.

◆ getCenter()

const STK::Vector3d & Maria3D::QuadTile::getCenter ( ) const
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.

◆ getChildDir()

int Maria3D::QuadTile::getChildDir ( ) const
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.

◆ getOrigin()

const STK::Vector3d & Maria3D::QuadTile::getOrigin ( ) const
inline

Return the tile origin. The tile origin is given in geocentrical XYZ-coordinates (meters).

◆ getQuadId()

Maria::TileId Maria3D::QuadTile::getQuadId ( ) const
inline

Get unique id for this tile. The Quad tile ID is a 64-bits integer that is globally unique for this tile.

◆ getRadius()

double Maria3D::QuadTile::getRadius ( ) const
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.

◆ getTreeLevel()

int Maria3D::QuadTile::getTreeLevel ( ) const
inline

Return quadtree level. The quadtree level increases with depth, so that level 0 is the root.

◆ split()

void Maria3D::QuadTile::split ( )
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.


The documentation for this class was generated from the following files: