Package svs_simulation :: Package terrain :: Module base_classes :: Class Terrain
[show private | hide private]
[frames | no frames]

Class Terrain

GenericTerrainObject --+
                       |
                      Terrain

Known Subclasses:
TerrainProxy, TerrainProxy

Provides overall management of terrain partitions.

Every terrain should contain at least one partition.
Method Summary
  __init__(self)
  addLinkPath(self, linkPath)
Adds linkpath to terrain, if the path has not been mapped to specific structures it attempts to do this.
  addPartition(self, partition)
Adds a new partition to the terrain.
  addPath(self, path)
Adds a path to the terrain.
  addSimObjectToStructure(self, simObject, structureName)
Adds sim object to partition with specified name.
  addStructure(self, structure, partitionName)
Adds structure to partition with specified name.
  addTerrainNavigationNode(self, x, y)
Adds and returns new node to high-level navigation graph.
  createPartitionFromName(self, partitionName, bounds)
Create a new partition to the terrain with the speficied name.
  createSimObjectFromName(self, objectName, objectClass, structureName, vertices)
Creates structure to partition with specified name and eother wall or floorplane components.
  createStructureFromName(self, structureName, partitionName)
Creates structure in specified partition with specified name and either wall or floorplane components.
  decode(self, data)
Creates terrain from encoded data.
  decodePartitions(self, data)
Creates partitions from encoded data.
  decodePaths(self, data)
Creates paths from encoded data.
dict encode(self, partitions, structures, objects, agents)
Returns encoded model of self.
  encodeForProxy(self)
Returns simplified encoding of self, suitable for use by proxies.
dict encodePartitions(self, structures, objects, agents)
Returns encoded model of partitions.
dict encodePaths(self)
Returns encoded model of paths.
  getAllLinkPaths(self)
Returns a list of all resolved linkpaths for terrain.
  getAllPaths(self)
Returns a list of all paths for terrain.
  getBoundsMaxX(self)
Returns maximum x coordinate from bounds.
  getBoundsMaxY(self)
Returns maximum y coordinate from bounds.
  getBoundsMinX(self)
Returns minimum x coordinate from bounds.
  getBoundsMinY(self)
Returns minimum y coordinate from bounds.
  getPartition(self, partitionName)
Returns partition mathcing specified name.
  getPartitionAtPoint(self, x, y)
Returns partition containing specified coordinates.
  getPath(self, name, start, destination)
Retrieves path from path store.
  getStructureContainingPoint(self, x, y)
Returns the structure within which the specified coordinates are located.
  linkTerrainNavigationNodes(self, nodeList)
Creates edges between list of navigation nodes.
  prepareToRun(self)
Ensures that all necessary data is setup for terrain, makes sure linkpaths are resilved, etc.
  removeTerrainNavigationNode(self, node)
Removes node from high-level navigation graph.
  resolveBounds(self)
Checks the bounds of the terrain match its contents.
  setBoundsMaxX(self, newvalue)
Returns maximum x coordinate from bounds.
  setBoundsMaxY(self, newvalue)
Returns maximum y coordinate from bounds.
  setBoundsMinX(self, newvalue)
Sets minimum x coordinate from bounds.
  setBoundsMinY(self, newvalue)
Returns minimum y coordinate from bounds.
  setup(self, name, bounds, spaceX, spaceY, margin)
    Inherited from GenericTerrainObject
  addEntity(self, entity)
Adds entity to terrain object.
  addGraph(self, graphName, graph)
Adds new graph to object.
  containsPoint(self, x, y)
Tests if specified coordinates are present in area.
  getGraph(self, graphName)
Returns named graph.
  removeEntity(self, entity)
Adds entity to terrain object.
  update(self, simTime)
Updates self in response to simulation time.

Method Details

addLinkPath(self, linkPath)

Adds linkpath to terrain, if the path has not been mapped to specific structures it attempts to do this.

addPartition(self, partition)

Adds a new partition to the terrain.

addPath(self, path)

Adds a path to the terrain.

addSimObjectToStructure(self, simObject, structureName)

Adds sim object to partition with specified name.

If the partition does not exist it is created. If no partition is specified, it is ignored.

addStructure(self, structure, partitionName)

Adds structure to partition with specified name.

If the partition does not exist it is created. If no partition is specified, it is ignored.

addTerrainNavigationNode(self, x, y)

Adds and returns new node to high-level navigation graph.

This also sets the partition and structure that the node is within.

createPartitionFromName(self, partitionName, bounds=None)

Create a new partition to the terrain with the speficied name.

If a partition with the same name already exists, this is returned in its place.

createSimObjectFromName(self, objectName, objectClass, structureName, vertices)

Creates structure to partition with specified name and eother wall or floorplane components.

If the partition does not exist it is created. If no partition is specified, it is ignored.

createStructureFromName(self, structureName, partitionName)

Creates structure in specified partition with specified name and either wall or floorplane components.

If the partition does not exist it is created. If no partition is specified, it is ignored.

decode(self, data)

Creates terrain from encoded data.

@type data:dict

decodePartitions(self, data)

Creates partitions from encoded data.

@type data:dict

decodePaths(self, data)

Creates paths from encoded data.

@type data:dict

encode(self, partitions=True, structures=True, objects=True, agents=False)

Returns encoded model of self.
Returns:
dict

encodeForProxy(self)

Returns simplified encoding of self, suitable for use by proxies.

This includes the basic terrain data and the names, but none of the data of its partitions.

encodePartitions(self, structures=True, objects=True, agents=False)

Returns encoded model of partitions.
Returns:
dict

encodePaths(self)

Returns encoded model of paths.
Returns:
dict

getAllLinkPaths(self)

Returns a list of all resolved linkpaths for terrain.

getAllPaths(self)

Returns a list of all paths for terrain.

getBoundsMaxX(self)

Returns maximum x coordinate from bounds.
Overrides:
svs_simulation.terrain.util_classes.GenericTerrainObject.getBoundsMaxX

getBoundsMaxY(self)

Returns maximum y coordinate from bounds.
Overrides:
svs_simulation.terrain.util_classes.GenericTerrainObject.getBoundsMaxY

getBoundsMinX(self)

Returns minimum x coordinate from bounds.
Overrides:
svs_simulation.terrain.util_classes.GenericTerrainObject.getBoundsMinX

getBoundsMinY(self)

Returns minimum y coordinate from bounds.
Overrides:
svs_simulation.terrain.util_classes.GenericTerrainObject.getBoundsMinY

getPartition(self, partitionName)

Returns partition mathcing specified name.

Returns None if not found.

getPartitionAtPoint(self, x, y)

Returns partition containing specified coordinates.

Returns None if not found.

getPath(self, name=None, start=None, destination=None)

Retrieves path from path store.

getStructureContainingPoint(self, x, y)

Returns the structure within which the specified coordinates are located.

linkTerrainNavigationNodes(self, nodeList)

Creates edges between list of navigation nodes.

prepareToRun(self)

Ensures that all necessary data is setup for terrain, makes sure linkpaths are resilved, etc.

removeTerrainNavigationNode(self, node)

Removes node from high-level navigation graph.

resolveBounds(self)

Checks the bounds of the terrain match its contents.

setBoundsMaxX(self, newvalue)

Returns maximum x coordinate from bounds.

setBoundsMaxY(self, newvalue)

Returns maximum y coordinate from bounds.

setBoundsMinX(self, newvalue)

Sets minimum x coordinate from bounds.

setBoundsMinY(self, newvalue)

Returns minimum y coordinate from bounds.

Generated by Epydoc 2.1 on Thu Oct 20 15:30:28 2005 http://epydoc.sf.net