proland::TerrainQuad Class Reference
[terrain]

A quad in a terrain quadtree. More...

#include <TerrainQuad.h>

List of all members.

Public Member Functions

 TerrainQuad (TerrainNode *owner, const TerrainQuad *parent, int tx, int ty, double ox, double oy, double l, float zmin, float zmax)
 Creates a new TerrainQuad.
virtual ~TerrainQuad ()
 Deletes this TerrainQuad.
TerrainNodegetOwner ()
 Returns the TerrainNode to which the terrain quadtree belongs.
bool isLeaf () const
 Returns true if this quad is not subdivided.
int getSize () const
 Returns the number of quads in the tree below this quad.
int getDepth () const
 Returns the depth of the tree below this quad.
void update ()
 Subdivides or unsubdivides this quad based on the current viewer distance to this quad, relatively to its size.

Public Attributes

const TerrainQuadparent
 The parent quad of this quad.
const int level
 The level of this quad in the quadtree (0 for the root).
const int tx
 The logical x coordinate of this quad (between 0 and 2^level).
const int ty
 The logical y coordinate of this quad (between 0 and 2^level).
const double ox
 The physical x coordinate of the lower left corner of this quad (in local space).
const double oy
 The physical y coordinate of the lower left corner of this quad (in local space).
const double l
 The physical size of this quad (in local space).
float zmin
 The minimum terrain elevation inside this quad.
float zmax
 The maximum terrain elevation inside this quad.
ptr< TerrainQuadchildren [4]
 The four subquads of this quad.
SceneManager::visibility visible
 The visibility of the bounding box of this quad from the current viewer position.
bool occluded
 True if the bounding box of this quad is occluded by the bounding boxes of the quads in front of it.
bool drawable
 True if the quad is invisible, or if all its associated tiles are produced and available in cache (this may not be the case if the asynchronous mode is used in a TileSampler).

Private Member Functions

void subdivide ()
 Creates the four subquads of this quad.

Private Attributes

TerrainNodeowner
 The TerrainNode to which this terrain quadtree belongs.

Detailed Description

A quad in a terrain quadtree.

The quadtree is subdivided based only on the current viewer position. All quads are subdivided if they meet the subdivision criterion, even if they are outside the view frustum. The quad visibility is stored in visible. It can be used in TileSampler to decide whether or not data must be produced for invisible tiles (we recall that the terrain quadtree itself does not store any terrain data).

Authors:
Eric Bruneton, Antoine Begault, Guillaume Piolat

Constructor & Destructor Documentation

proland::TerrainQuad::TerrainQuad ( TerrainNode owner,
const TerrainQuad parent,
int  tx,
int  ty,
double  ox,
double  oy,
double  l,
float  zmin,
float  zmax 
)

Creates a new TerrainQuad.

Parameters:
owner the TerrainNode to which the terrain quadtree belongs.
parent the parent quad of this quad.
tx the logical x coordinate of this quad.
ty the logical y coordinate of this quad.
ox the physical x coordinate of the lower left corner of this quad.
oy the physical y coordinate of the lower left corner of this quad.
l the physical size of this quad.
zmin the minimum terrain elevation inside this quad.
zmax the maximum terrain elevation inside this quad.
virtual proland::TerrainQuad::~TerrainQuad (  )  [virtual]

Deletes this TerrainQuad.


Member Function Documentation

int proland::TerrainQuad::getDepth (  )  const

Returns the depth of the tree below this quad.

TerrainNode* proland::TerrainQuad::getOwner (  ) 

Returns the TerrainNode to which the terrain quadtree belongs.

int proland::TerrainQuad::getSize (  )  const

Returns the number of quads in the tree below this quad.

bool proland::TerrainQuad::isLeaf (  )  const

Returns true if this quad is not subdivided.

void proland::TerrainQuad::subdivide (  )  [private]

Creates the four subquads of this quad.

void proland::TerrainQuad::update (  ) 

Subdivides or unsubdivides this quad based on the current viewer distance to this quad, relatively to its size.

This method uses the current viewer position provided by the TerrainNode to which this quadtree belongs.


Member Data Documentation

The four subquads of this quad.

If this quad is not subdivided, the four values are NULL. The subquads are stored in the following order: bottomleft, bottomright, topleft, topright.

True if the quad is invisible, or if all its associated tiles are produced and available in cache (this may not be the case if the asynchronous mode is used in a TileSampler).

The physical size of this quad (in local space).

The level of this quad in the quadtree (0 for the root).

True if the bounding box of this quad is occluded by the bounding boxes of the quads in front of it.

The TerrainNode to which this terrain quadtree belongs.

The physical x coordinate of the lower left corner of this quad (in local space).

The physical y coordinate of the lower left corner of this quad (in local space).

The parent quad of this quad.

The logical x coordinate of this quad (between 0 and 2^level).

The logical y coordinate of this quad (between 0 and 2^level).

SceneManager::visibility proland::TerrainQuad::visible

The visibility of the bounding box of this quad from the current viewer position.

The bounding box is computed using zmin and zmax, which must therefore be up to date to get a correct culling of quads out of the view frustum. This visibility only takes frustum culling into account.

The maximum terrain elevation inside this quad.

This field must be updated manually by users (the TileSamplerZ class can do this for you).

The minimum terrain elevation inside this quad.

This field must be updated manually by users (the TileSamplerZ class can do this for you).


Generated on Sat May 12 09:41:38 2012 for proland by  doxygen 1.6.1