Class Index | File Index

Classes


Class URBGEN.Generator


Defined in: UrbGen.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Represents a generator.
Field Summary
Field Attributes Field Name and Description
 
This generator's minimum block size.
 
This generator's current builder.
 
This generator's current city.
 
This generator's city's depth.
 
The polygon's of this generator's current city.
 
This generator's city's width.
 
This generator's director.
 
This generator's global angle.
 
This generator's horizontal builder.
 
This generator's local grid threshold.
 
This generator's plot builder.
 
This generator's random number generator.
 
This generator's random number seed.
 
This generator's regularity1, used to determine start point of new roads.
 
This generator's regularity2, used to determine end point of new roads.
 
This generator's city's street width.
 
This generator's through road snap distance.
 
This generator's vertical builder.
Method Summary
Method Attributes Method Name and Description
 
Builds a 3D geometry for this generator's current city.
 
generate(cityParams)
Generates a city.
 
Returns this generator's current city parameters.
 
getThreeJSGeometry(poly, shape)
Returns a THREE.Shape representing the specified poly.
 
init()
Initializes this generator.
 
Returns a string containing vertex and face data in the Wavefront.OBJ file format.
 
Returns a string containing the parameters used to generate this generator's current city.
 
prepare(poly)
Prepares to process a polygon by loading the appropriate Builder.
 
Processes a polygon.
 
Recursively processes an array of polygons.
 
setParams(cityParams)
Sets this generator's parameters.
Class Detail
URBGEN.Generator()
Represents a generator.
Field Detail
{number} blockSize
This generator's minimum block size.

{URBGEN.Builder} builder
This generator's current builder.

{URBGEN.Ciy} city
This generator's current city.

{number} cityDepth
This generator's city's depth.

{URBGEN.Poly[]} cityPolys
The polygon's of this generator's current city.

{number} cityWidth
This generator's city's width.

{URBGEN.Director} director
This generator's director.

{number} globalAngle
This generator's global angle.

{URBGEN.Builder.HorizontalBuilder} horizontalBuilder
This generator's horizontal builder.

{number} localGrids
This generator's local grid threshold.

{URBGEN.Builder.PlotBuilder} plotBuilder
This generator's plot builder.

{URBGEN.Math.Random} random
This generator's random number generator.

{number} randomSeed
This generator's random number seed.

{number} regularity1
This generator's regularity1, used to determine start point of new roads.

{number} regularity2
This generator's regularity2, used to determine end point of new roads.

{number} streetWidth
This generator's city's street width.

{number} throughRoads
This generator's through road snap distance.

{URBGEN.Builder.VerticalBuilder} verticalBuilder
This generator's vertical builder.
Method Detail
buildGeometry()
Builds a 3D geometry for this generator's current city.

{URBGEN.City} generate(cityParams)
Generates a city.
Parameters:
{Object} cityParams
- The parameters that should be used to generate the city.
Returns:
{URBGEN.City} The generated city.

{Object} getParams()
Returns this generator's current city parameters.
Returns:
{Object} The parameters.

{THREE.Shape} getThreeJSGeometry(poly, shape)
Returns a THREE.Shape representing the specified poly.
Parameters:
{URBGEN.Poly} poly
- The poly providing the coordinates.
{THREE.Shape} shape
- The shape to have its coordinates set.
Returns:
{THREE.Shape} The shape with coordinates set.

init()
Initializes this generator.
Throws:
{URBGEN.Exception.InvalidParamException}

{string} OBJData()
Returns a string containing vertex and face data in the Wavefront.OBJ file format. The geometry returned represents bounding boxes for each plot in this generator's current city.
Returns:
{string} The OBJ data for this generator's current city.

{string} paramData()
Returns a string containing the parameters used to generate this generator's current city.
Returns:
{string} The parameters used to generate this generator's current city.

prepare(poly)
Prepares to process a polygon by loading the appropriate Builder.
Parameters:
{URBGEN.Poly} poly
- The polygon being prepared for.

{URBGEN.Poly[]} processPoly(poly)
Processes a polygon. If a polygon cannot be processed, it is returned.
Parameters:
{URBGEN.Poly} poly
- The polygon to process.
Returns:
{URBGEN.Poly[]} The new polygons, or the original poly.

{URBGEN.Poly[]} processPolyRecursively(polys)
Recursively processes an array of polygons.
Parameters:
{URBGEN.Point[]} polys
- The array of polygons to be processed.
Returns:
{URBGEN.Poly[]} The new polygons.

setParams(cityParams)
Sets this generator's parameters. If any paramaters in the cityParmas object are undefined, sets those parameters to random values.
Parameters:
{Object} cityParams
- The paramters this generator should use to generate a city.

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Sep 04 2014 11:25:30 GMT+0100 (BST)