These pages are auto-generated from self-documenting comments embedded in class files.
For more information on breve and steve, refer to the breve homepage.

## Abstract : PatchGrid

This class is included as part of the file PatchGrid.tz.
To use this class in a simulation, include the line "@use PatchGrid."

### Class description:

> PatchGrid is a class which allows you to create "patches". A Patch is a non-physical object which is associated with a specific area in the 3D world. This allows you to associate information or actions with specific areas in space, such as the presence of a chemical or nutrient at that area.

> Use init-with to create a PatchGrid.

### Class methods:

> - disable-smooth-drawing
> - disable-volumetric-drawing
> - enable-smooth-drawing
> - enable-volumetric-drawing
> - get-location
> - get-patch
> - get-patch-at
> - get-patch-size
> - get-patches
> - get-x-count
> - get-y-count
> - get-z-count
> - init-with

`disable-smooth-drawing`

> Disables smooth drawing for this PatchGrid. This is the default. See enable-smooth-drawing for details on smooth drawing.

`disable-volumetric-drawing`

> Disables volumetric drawing for this PatchGrid. The grid is drawn as individual cubes. This technique may produce better results visually, but is far slower than the volumetric rendering. See enable-volumetric-drawing for more details.

`enable-smooth-drawing`

> Enables smooth drawing for this PatchGrid. When smooth drawing is enabled, colors are blended smoothly between patches. Smooth drawing is disabled by default.

> Smooth drawing is desirable when a PatchGrid's colors display continuous gradients as with chemicals or temperature, but is undesirable when dealing with discrete states, as in cellular automata simulations.

> The method disable-smooth-drawing can be used to disable smooth drawing.

`enable-volumetric-drawing`

> Enables texture drawing for this PatchGrid. This is the default. With volumetric rendering, the grid is drawn as a series of overlapping textured planes. The rendering is fast, but the overlapping planes may leave some visual artifacts. To revert to the older style of cube rendering, see the method disable-volumetric-drawing.

`get-location`

> returns the center of the grid.

`get-patch at-location theLocation (vector)`

> Returns the Patch in which theLocation resides. Make sure you test for the validity of the returned object, since it is possible that there is no patch at the specified location.

`get-patch-at x xind (int) y yind (int) z zind (int)`

> Returns the patch object associated with the specified indices. Note that this method may return a NULL object in the case that the indices given are out of bounds.

`get-patch-size`

> Returns the vector size of a single patch.

`get-patches`

> Returns a list of all patch objects.

`get-x-count`

> If the grid is initialized, returns the size of the grid on the X-axis.

`get-y-count`

> If the grid is initialized, returns the size of the grid on the Y-axis.

`get-z-count`

> If the grid is initialized, returns the size of the grid on the Z-axis.

`init-with x-count x (int) y-count y (int) z-count z (int) location center = (0, 0, 0) (vector) patch-size pSize = (1, 1, 1) (vector) patch-class patchclass = "Patch" (string)`

> Creates a PatchGrid centered at center, in which each Patch is a member of patchclass and is the size pSize and in which the total grid dimensions are x by y by z.

> Bear in mind that this will create a large number of objects: x * y * z. If you have an iterate method in your patch-class, then this can amount to a great deal of computation which can slow down your simulation.

Documentation created Fri Aug 8 15:16:49 2008