next up previous contents
Next: Initialization Dataflow Up: Program Execution & Data Previous: The .slf File
Go to: SmartForest Home Printer-friendly: sf-impl.pdf


The .stnd File

The .stnd file contains additional information for the stands global variable. Recall that most of the data in the stands variable is populated using the data read from the .slf file. The data from the .slf file does not flow to the stands variable until after the .stnd file is parsed in F_LoadStandData even though the .slf file was previously parsed. This section only describes the data that populates the stands variable from the .stnd file. For more information on how the data from the .slf file populates the stands variable, see Section 4.2.4.

The first data in the .stnd file populates several fields of the stnd variable. These fields comprise the header of the .stnd file:

Never Data Field Purpose
Used Type Name  
  int nCols The number of columns in the .stnd file.
  int nRows The number of rows in the .stnd file.
  int xllCorner The x-component of the south-west corner.
  int yllCorner The y-component of the south-west corner.
  int cellSize The width and height of each grid. The value is often 30. (Meters)
  int noDataVal The value used to represent ``No Data''

The remainder of the .stnd file contains stand identifiers in a DEM_ROW $\times$ DEM_COL matrix. As each stand identifier is read from the file, this parser determines if there is an entry in the stands array for this stand identifier already. If so, that entry's num_grids integer counter is incremented. If not, an entry in the stands array is created, the id for that entry is set to the stand identifier read from the file and the num_grids integer counter becomes 1. Thus, for each stand identifier, there is exactly one entry in the stands array for that stand identifier.

After the entries are created for each stand identifier and the count of the number of times each stand identifier is found in the .stnd file is set in the num_grids field, the data read from the .slf file then flows into the corresponding entries of the stands array.

At this point, the only field in the stands array that has not yet been created is the tree_array_p field. This field is set in the gen_tree_list function that is called when the trees are drawn to the screen, when the information dialog box is displayed (see Section 4.1.10) or when texture mapping is performed.


next up previous contents
Next: Initialization Dataflow Up: Program Execution & Data Previous: The .slf File
Matthew S. Davis
2002-08-07