#include <terraindecorationlayer.h>

Public Member Functions | |
| TerrainDecorationLayer (const std::string &name="TerrainDecorationLayer") | |
| Constructs a new terrain decoration layer. | |
| virtual osg::Node * | GetOSGNode ()=0 |
| This method returns the root scene node of the decoration layer scene graph. | |
| virtual void | OnLoadTerrainTile (PagedTerrainTile &tile)=0 |
| This method is called when the parent terrain needs to load a tile. | |
| virtual void | OnUnloadTerrainTile (PagedTerrainTile &tile) |
| This method is called when the parent terrain wishes to unload a terrain tile from its list of resident tiles. | |
| virtual void | OnTerrainTileResident (PagedTerrainTile &tile) |
| This method is called when a tile has been completely loaded by the terrain reader, terrain renderer, and all decorator layers. | |
| bool | IsVisible () const |
| Checks to see if this decoration layer is visible in the scene. | |
| void | SetVisible (bool show) |
| Sets the view status of this decoration layer. | |
| dtTerrain::Terrain * | GetParentTerrain () |
| Gets the terrain object that currently owns this reader. | |
| const dtTerrain::Terrain * | GetParentTerrain () const |
| Gets a read-only terrain object that currently owns this reader. | |
Protected Member Functions | |
| virtual | ~TerrainDecorationLayer () |
| Destroys this decoration layer. | |
Friends | |
| class | Terrain |
| Allow the terrain to have access to this class. | |
It provides the interface for providing layers of decorations on the terrain from trees and shrubs to roads and buildings. Note that any number of these layers may be added to the terrain so one may create many layers each loading or manipulating an entirely different data set for that particular layer.
| dtTerrain::TerrainDecorationLayer::TerrainDecorationLayer | ( | const std::string & | name = "TerrainDecorationLayer" |
) |
Constructs a new terrain decoration layer.
| dtTerrain::TerrainDecorationLayer::~TerrainDecorationLayer | ( | ) | [protected, virtual] |
Destroys this decoration layer.
| virtual osg::Node* dtTerrain::TerrainDecorationLayer::GetOSGNode | ( | ) | [pure virtual] |
This method returns the root scene node of the decoration layer scene graph.
This node then gets added as a child to its parent terrain.
Implemented in dtTerrain::ColorMapDecorator, dtTerrain::GeoTiffDecorator, and dtTerrain::VegetationDecorator.
| virtual void dtTerrain::TerrainDecorationLayer::OnLoadTerrainTile | ( | PagedTerrainTile & | tile | ) | [pure virtual] |
This method is called when the parent terrain needs to load a tile.
| tile | The new tile. The loader should populate the fields of the tile as appropriate. |
At this point, the terrain tiles have had a chance to load data from their cache. Therefore, readers implementing this method may want to check the status of a tile's data before loading since it may have been retrieved from the cache.
Resources may be looked up using the parent terrain's resource path list. In most cases, the terrain will be made aware of any resource locations its readers may need.
Implemented in dtTerrain::ColorMapDecorator, dtTerrain::GeoTiffDecorator, and dtTerrain::VegetationDecorator.
| virtual void dtTerrain::TerrainDecorationLayer::OnUnloadTerrainTile | ( | PagedTerrainTile & | tile | ) | [inline, virtual] |
This method is called when the parent terrain wishes to unload a terrain tile from its list of resident tiles.
| tile | The tile being unloaded. |
The default implementation does nothing as most renderers will probably only process data and have no need to respond to this method, however, it is available if needed. Also note, that the tile itself is responsible for caching its data, however, any data a renderer wishes to control may be cached in this method.
Reimplemented in dtTerrain::VegetationDecorator.
| virtual void dtTerrain::TerrainDecorationLayer::OnTerrainTileResident | ( | PagedTerrainTile & | tile | ) | [inline, virtual] |
This method is called when a tile has been completely loaded by the terrain reader, terrain renderer, and all decorator layers.
This is useful if certain operations need to be performed on a tile that is dependent on the tile being fully loaded by all terrain components.
| The | tile that was just loaded. |
Reimplemented in dtTerrain::VegetationDecorator.
| bool dtTerrain::TerrainDecorationLayer::IsVisible | ( | ) | const [inline] |
Checks to see if this decoration layer is visible in the scene.
| void dtTerrain::TerrainDecorationLayer::SetVisible | ( | bool | show | ) |
Sets the view status of this decoration layer.
If set to false, it will not show up on the terrain.
| show | If true, the decoration layer will be visible. |
| dtTerrain::Terrain* dtTerrain::TerrainDecorationLayer::GetParentTerrain | ( | ) | [inline] |
Gets the terrain object that currently owns this reader.
| const dtTerrain::Terrain* dtTerrain::TerrainDecorationLayer::GetParentTerrain | ( | ) | const [inline] |
Gets a read-only terrain object that currently owns this reader.
friend class Terrain [friend] |
Allow the terrain to have access to this class.