My Project
Public Types | Public Member Functions | List of all members
ParaTerrain::CTerrainRegions Class Reference

the editable terrain regions associated with a terrain tile. More...

#include <TerrainRegions.h>

Public Types

typedef std::map< string, CRegionLayer * > RegionLayer_Map_Type
 

Public Member Functions

void SetSize (float fWidth, float fHeight)
 set the region size in meters. More...
 
DWORD GetValue (const string &sLayerName, float x, float y)
 get value of a given region layer
 
DWORD GetValue (CRegionLayer *pLayer, float x, float y)
 get value of a given region layer
 
void LoadRegion (const string &sLayerName, const char *filename)
 Load a given region from file. More...
 
CRegionLayerGetRegion (const string &sLayerName)
 get a region layer object by its name, in case we want to access to low level functins. More...
 
RegionLayer_Map_Type & GetLayers ()
 get the layers map. More...
 
int GetNumOfRegions ()
 get number terrain regions
 
void SetCurrentRegionIndex (int nRegion)
 set terrain region index, so that we can later call GetCurrentRegionName() and GetCurrentRegionFilepath(), to access region properties.
 
int GetCurrentRegionIndex ()
 Get terrain region index, so that we can later call GetCurrentRegionName() and GetCurrentRegionFilepath(), to access region properties. More...
 
void SetCurrentRegionName (const string &name)
 set the currently selected region name. More...
 
const string & GetCurrentRegionName ()
 get the currently selected region name. More...
 
void SetCurrentRegionFilepath (const string &filename)
 set the current region file path. More...
 
const string & GetCurrentRegionFilepath ()
 get the current region file path. More...
 

Detailed Description

the editable terrain regions associated with a terrain tile.

This can be used for marking sound regions, walkable area regions, vegation regions, atomosphere regions, game zones, etc.

Member Function Documentation

§ GetCurrentRegionFilepath()

const string & CTerrainRegions::GetCurrentRegionFilepath ( )

get the current region file path.

§ GetCurrentRegionIndex()

int CTerrainRegions::GetCurrentRegionIndex ( )

Get terrain region index, so that we can later call GetCurrentRegionName() and GetCurrentRegionFilepath(), to access region properties.

-1 if nothing is selected.

§ GetCurrentRegionName()

const string & CTerrainRegions::GetCurrentRegionName ( )

get the currently selected region name.

§ GetLayers()

RegionLayer_Map_Type& ParaTerrain::CTerrainRegions::GetLayers ( )
inline

get the layers map.

§ GetRegion()

CRegionLayer * CTerrainRegions::GetRegion ( const string &  sLayerName)

get a region layer object by its name, in case we want to access to low level functins.

return NULL if it does not exist.

§ LoadRegion()

void CTerrainRegions::LoadRegion ( const string &  sLayerName,
const char *  filename 
)

Load a given region from file.

If a region already exit, we will ignore.

§ SetCurrentRegionFilepath()

void CTerrainRegions::SetCurrentRegionFilepath ( const string &  filename)

set the current region file path.

§ SetCurrentRegionName()

void CTerrainRegions::SetCurrentRegionName ( const string &  name)

set the currently selected region name.

The current region Index is changed to the current selected one or -1 if invalid. please note that: this does not create the region layer

§ SetSize()

void CTerrainRegions::SetSize ( float  fWidth,
float  fHeight 
)

set the region size in meters.


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