IFCTerrain Developer Documentation - dd-bim/City2BIM GitHub Wiki
The developer documentation provides important information from the developer's point of view.
In the following the general structure is explained. If you are already familiar with it you can also read about the following topics: Code Structure & Databinding.
For the basic structure, the following figure is intended:
The program flow can be described by nine essential steps.
First of all, a distinction is made in the usage. Here, a decision is made between IFCTerrain GUI and IFCTerrain Command. To use the GUI, the user must provide input. This can be read here: here
To use the Command, the user must provide input data (JSON file). This can be read here: here
The file path: BIMGISInteropLibs/IfcTerrain/
is essential for the control of the entire program flow.
Different classes are stored here:
-
Config.cs
- All essential settings for configuration are made here.
To store for the export of the metadata:
-
configDin18740.cs
- according to DIN 18740-6 -
configDin91391.cs
- according to DIN SPEC 91391-2
Another essential file for successful execution of a conversion is:
BIMGISInteropLibs/IfcTerrain/ConnectionInterface.cs
This is used by both program parts (GUI and Command) to read the input data set and write it as an IFC file.
First, a file reader (depending on the settings in config) reads the file (in its specific format) and prepares it for further processing.
Each reader is stored as "ReaderTerrain.cs" in the folder "BIMGISInteropsLibs" - in the corresponding subfolder.
For the exchange between file reader & IFC writer the class (Result) from is used:
BIMGISInteropLibs/IFCTerrain/Result.cs
This is therefore the most important element for the short data exchange.
Now the corresponding (depending on the settings) IFC - Writer is called.
For more information about IFC-Writers the following page can be used:
here
The IFC Writer creates the desired export file. This step does not fail in most cases. Only if: the file path cannot be accessed (unlikely) or the model is empty.
The program also writes the following files:
-
log file, controlled via:
BimGISInteropsLibs/Logging/LogWriterIfcTerrain.cs
only in IFCTerrain GUI:
-
setting file (*.json; reusable for the use of IFCTerrain Command)
-
metadata json file (if seleceted as as export)
The log file writes (depending on settings) the corresponding events. This can be read: here
The setting file will be exported under the use of IFCTerrain GUI. In the code-behind of the "MainWindow.xaml.cs". A json parser is used here. This also exports (depending on the setting / input) the metadata as another separate JSON file.
In this step (caused by ConnectionInterface.cs) the user gets a feedback about the conversion done.
Hint: This is also done once an error has been caught in the program. (e.g.: TIN is empty after processing via the file readers)