Visualization, Spring'98, Yap
HOMEWORK 3:
AUTOMATIC MODEL GENERATION
FILES
Communication between components is through
the use of files.
-
These files are also our database.
-
All files are in ascii, and human understandable.
- Thus, if your program uses output from the neighborhood
generator, you can initially hand code your own input files.
without waiting for the neighborhood generator to be completed.
- Furthermore, you can modify any computer generated
output files.
-
Comment in a file uses C++ syntax (// for single line
comments, /* ... */ for multiline comments)
-
All white spaces and newlines are equivalent, and
amount to separators of tokens. This means that
you ought to use white space and newlines
to format human readable files!
-
Every data item begins with a tag, which has the form
[tagname]
-
The values associated with a given [tagname]
is everything until the next tag.
-
There are two kinds of values: numerical values
(e.g., 0.0, 345, 21.99) and string values
(e.g., "Street Parameters") which are in double quotes.
-
Each file begins with a type: E.g., in a file containing
the global parameters for a list of streets, the first
item is
[FILETYPE] "Street Parameters"
So "Street Parameters" is the value of the tag [FILETYPE]
-
If a tagged item has vector values, then this is enclosed
in parenthesis, with components separated by commas.
[ORIGIN] (0,0,0)
-
If a tagged item has several components, and each component
has a name, and the component values are written as
comma-separated sequence of equalities:
[BOUNDING BOX] xmin=0, ymin=0,
xmax=1000, ymax=1500,
hmin=0, hmax=200
-
Some tagged items has value that is a sequence of unnamed
values:
[BOUNDING POLYGON] (0,0), (100,0), (200,150),
(200,500), (0,500)
-
The last tag is a file is always [ENDFILE].