VCityTeam / 3DUSE

Other
5 stars 5 forks source link

Provide a plugin tutorial structure (FloodAR as archetype) #36

Open EricBoix opened 7 years ago

EricBoix commented 7 years ago

Issue by frogsapo Tuesday Apr 19, 2016 at 14:33 GMT Originally opened as https://github.com/MEPP-team/VCity/issues/99


Pre-requisite: issue #96

A plugin is a GUI oriented type of wrapping of an underlying process. A process (an algorithm taking an in memory data structure and processing it to yield a resulting in memory data structure) can also be wrapped in a main() function to be used from the command line or in a scripting language (e.g. Python) to be composed with other processes in a programmatic manner.

This multi-usage (multi-wrapping) strategy requires some technical organization:

The demand: provide a first reference example of such an process/wrappers organization to be used as reference example.

EricBoix commented 7 years ago

Comment by frogsapo Tuesday Apr 19, 2016 at 15:13 GMT


We shall consider the upcoming FloodAR plugin as example.

Context elements:

the ARC/Info ascii grid format (to be placed somewhere in VCity documentation)

FloodAR treatment pipeline

  1. Tile the ASC inputs (both water and terrain)
    • Code: ascCut.Cpp
    • Limitations:
      • this code blends the tile processing per se with the writing (to files) of the process results.
      • Additionally the code writes all the tiles at once (i.e. it is not modular enough to be called for producing a single tile)
      • although the MNT class provides a writer, ascCut.Cpp provides its own one
  2. Tile the textures (orthophoto)
    • Code: cutPicture() global function (within the FloodAR Plugin)
    • Limitations:
      • Code is QT dependent because it uses QT to read and write pictures
      • cutPicture() misses a destination directory argument
      • cutPicture() hardwires it knowledge of the file hierarchy (refer to issue 90)
  3. Blend ASC with textures (at tile scale) to obtain CityGML
    • Code: FloodARTools.Cxx
    • Algorithm: for each tile
      • read ASC and convert it to CityGML with src/libCityGML/improt/ImporterASC.cpp
      • "point" (refer to file located in Appearance sub-directory) the CityGML to the orthophoto corresponding tile
      • write the resulting CityGML to a file
  4. Use ShapeExtrusion process to extrude buildings
  5. Do some stuff concerning OBJ files (ask FloodAR author)

Work to do

Stage 1: processify ASC tiling

Stage 2: same thing (mutatis mutandis) with the texture tiling

What will remain to do