#include <pagedterraintile.h>
Public Member Functions | |
| void | SetGeoCoordinates (const GeoCoordinates &cs) |
| Sets the origin with which this tile maps to. | |
| const GeoCoordinates & | GetGeoCoordinates () const |
| Gets this tile's coordinate system. | |
| void | SetHeightField (HeightField *hf) |
| Sets the heightfield that maps to this terrain tile. | |
| const HeightField * | GetHeightField () const |
| Gets the heightfield currently assigned to this terrain tile. | |
| void | SetBaseTextureImage (osg::Image *image) |
| Sets the base texture for this terrain tile. | |
| osg::Image * | GetBaseTextureImage () |
| Gets the image currently being used by this tile as its base texture. | |
| virtual void | WriteToCache () |
| This method provides the paged tile with an opportunity to cache any data that it wants to retrieve later. | |
| virtual void | ReadFromCache () |
| This method provides the paged tile with an opportunity to restore any data that was previously cached. | |
| const std::string & | GetCachePath () const |
| Gets the cache path assigned to this tile. | |
| bool | IsCachingEnabled () const |
| Gets the status of this tile's caching. | |
| void | SetUpdateCache (bool flag) |
| Sets whether or not the cache needs to be updated to reflect the current state of the tile. | |
| bool | GetUpdateCache () const |
| Gets whether or not this tile's cache is out of sync with its data. | |
| const Terrain * | GetParentTerrain () const |
| Gets the terrain that created this terrain tile and therefore owns it. | |
| Terrain * | GetParentTerrain () |
| Gets the terrain that created this terrain tile and therefore owns it. | |
Protected Member Functions | |
| PagedTerrainTile (Terrain *terrain) | |
| Constructs a terrain tile. | |
| virtual | ~PagedTerrainTile () |
| Destroys the terrain tile. | |
| void | SetCachePath (const std::string &path) |
| Sets the cache path for this tile. | |
Friends | |
| class | PagedTerrainTileFactory |
| Allow the factory and terrain to have access to this class. | |
| class | Terrain |
Instances of this class are the atomic data elements the terrain manages when navigating through its data. Paging and disk caching (if enabled) is handled transparently when needed by the terrain and it provides, by default, access to its heightfield, base texture, and other fundamental data structures. Although this base class has many features, application dependent data and behavior can still be added to this base tile through subclasses.
| dtTerrain::PagedTerrainTile::PagedTerrainTile | ( | Terrain * | terrain | ) | [protected] |
Constructs a terrain tile.
Note, the constrmUpdateCacheuctor is protected as to enforce the use of the terrain class in order to create a new tile.
| dtTerrain::PagedTerrainTile::~PagedTerrainTile | ( | ) | [protected, virtual] |
Destroys the terrain tile.
Since most internal data is managed by smart pointers, this method does practically nothing.
| void dtTerrain::PagedTerrainTile::SetGeoCoordinates | ( | const GeoCoordinates & | cs | ) | [inline] |
Sets the origin with which this tile maps to.
| cs | The coordinate system containing this tile's origin. |
| const GeoCoordinates& dtTerrain::PagedTerrainTile::GetGeoCoordinates | ( | ) | const [inline] |
Gets this tile's coordinate system.
| void dtTerrain::PagedTerrainTile::SetHeightField | ( | HeightField * | hf | ) | [inline] |
Sets the heightfield that maps to this terrain tile.
| hf | The new heightfield. |
| const HeightField* dtTerrain::PagedTerrainTile::GetHeightField | ( | ) | const [inline] |
Gets the heightfield currently assigned to this terrain tile.
| void dtTerrain::PagedTerrainTile::SetBaseTextureImage | ( | osg::Image * | image | ) | [inline] |
Sets the base texture for this terrain tile.
The base texture will be draped over the tile when it is rendered.
| image | The image to use as the base texure of this tile. |
| osg::Image* dtTerrain::PagedTerrainTile::GetBaseTextureImage | ( | ) | [inline] |
Gets the image currently being used by this tile as its base texture.
| void dtTerrain::PagedTerrainTile::WriteToCache | ( | ) | [virtual] |
This method provides the paged tile with an opportunity to cache any data that it wants to retrieve later.
Any errors should be tracked by throwing exceptions.
| void dtTerrain::PagedTerrainTile::ReadFromCache | ( | ) | [virtual] |
This method provides the paged tile with an opportunity to restore any data that was previously cached.
Any errors should be tracked by throwing exceptions.
| const std::string& dtTerrain::PagedTerrainTile::GetCachePath | ( | ) | const [inline] |
Gets the cache path assigned to this tile.
| bool dtTerrain::PagedTerrainTile::IsCachingEnabled | ( | ) | const [inline] |
Gets the status of this tile's caching.
| void dtTerrain::PagedTerrainTile::SetUpdateCache | ( | bool | flag | ) | [inline] |
Sets whether or not the cache needs to be updated to reflect the current state of the tile.
This should be set to true when new data is set or added to the tile that needs to be cached.
| flag | True if the cache should be updated, false otherwise. |
| bool dtTerrain::PagedTerrainTile::GetUpdateCache | ( | ) | const [inline] |
Gets whether or not this tile's cache is out of sync with its data.
| const Terrain* dtTerrain::PagedTerrainTile::GetParentTerrain | ( | ) | const [inline] |
Gets the terrain that created this terrain tile and therefore owns it.
| Terrain* dtTerrain::PagedTerrainTile::GetParentTerrain | ( | ) | [inline] |
Gets the terrain that created this terrain tile and therefore owns it.
| void dtTerrain::PagedTerrainTile::SetCachePath | ( | const std::string & | path | ) | [protected] |
Sets the cache path for this tile.
Any data corresponding to this tile can be cached by terrain readers and renderers when needed.
| path | The path assigned to this tile. |
friend class PagedTerrainTileFactory [friend] |
Allow the factory and terrain to have access to this class.
friend class Terrain [friend] |