TerrainView Configuration Files

Parent Previous Next

A TerrainView™ scene configuration is stored as a TVC file, holding only the properties of the scene and all objects in the scene. Files that were loaded into the scene are not saved in the TVC file, only a reference to these files (the filename) is stored.

This way, the TVC stays small, can be loaded quickly, can be stored independent of the data and the user can replace external files without changing the TVC. This is useful if, for example, the 3D models of a whole city with some thousand buildings are replaced by other 3D models with better textures.


The drawback of this method is of course, that a whole bunch of files must be moved if the scene has to be visualized on a different computer. The references to the external files must be stored as relative paths to allow the user the freedom where to put his data.

How TerrainView™ handles it

The relative paths are computed when the scene is saved as a TVC file. If an external file is located on a different drive than the working directory, no relative path can be computed. Then the reference to this file is stored as an absolute path and an error message is displayed. This error message can be interpreted as a warning because the absolute path is stored in the TVC and might work, as long as that specific file exists.



When loading a scene from a TVC, TerrainView™ checks if the working directory is accessible. If it is accessible, the external files are assumed to be located relative to that directory, according to their relative paths. The files stored with absolute paths are assumed to be still located where they once were upon saving the scene. If one of the external files cannot be loaded, an error message is displayed and the scene might be missing an object. If the working directory is not accessible, then TerrainView™ will ask for it and the user can specify a (new) working directory.

If for some reason the working directory has to be changed retrospectively, this can be done by either modifying it in the “Scene Settings” dialog or simply by saving the scene to a TVC again with the new working directory. Changing the working directory in the “Scene Settings” dialog has no immediate effect, the working directory proposed by the “Save As” dialog will just be different.

Proper use of working directories

There are two basic methods to use working directories: “One for All” and “One for Each”.



One for All

One for Each

?

The working directory is the same for all configurations.

The data for all configurations is stored somewhere on the same drive as the working directory. Typically, all data for a configuration is stored in the same (sub-)directory.

The working directory is different for all configurations and points to the location where the particular configuration data is stored.

+

Very simple when moving configurations (see below).

Configurations are independent, can be stored on different drives.

-

The configuration data for all configurations must be on the same drive.

More complicated when moving configuration (see below).

Moving a configuration

As mentioned earlier, the place where the TVC itself resides does not matter. It will probably be located in the users configuration directory.

All external files of a configuration must be copied to the target location and the working directory must be changed. The new files will be stored relative to the new working directory (with the same relation, i.e. same kind of “relative”) where the new working directory can be an arbitrary path and must be the same for all files of course.

The one rule to follow can be formulated as:

For each file, the relative path from the working directory to the file must remain the same.


Here are two examples to illustrate:


A configuration with absolute paths for external files can only be moved if the absolute paths are still accessible after the data is copied. This will be the case if some files are located on a network drive and the configuration is moved inside the same local area network (and the network drive is accessible from everywhere in the LAN of course).

Now there can be two possible scenarios after copying the files:

The old working directory is still accessible:

The old working directory must be temporarily renamed (or the drive disconnected)

The TVC can be opened with TerrainView™ now

A new working directory will be asked

The new working directory can be entered

The TVC can be saved with the new working directory

The old working directory can be renamed again (or the drive can be reconnected)


The old working directory is not accessible:

The TVC can be opened with TerrainView™ directly

A new working directory will be asked

The new working directory can be entered

The TVC can be saved with the new working directory

Conclusion

Most problems when moving a configuration arise because the user does not know what the old and new working directories are. The new working directory can be chosen arbitrarily, but it has to be chosen BEFORE the data is copied. Using the “One for All” method to select the working directory makes it very easy to move a configuration: the data can be copied quite straightforward and the working directories are clearly defined.

The key to success is to keep the one rule about working directories in mind: For each file, the relative path from the working directory to the file must remain the same.