vtkCityGMLReader.h 3.33 KB
Newer Older
Dan Lipsa's avatar
Dan Lipsa committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkCityGMLReader.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
/**
 * @class   vtkCityGMLReader
 * @brief   read CityGML data file
 *
*/

#ifndef vtkCityGMLReader_h
#define vtkCityGMLReader_h

#include "vtkIOCityGMLModule.h" // For export macro
#include "vtkMultiBlockDataSetAlgorithm.h"

/**
 * @class   vtkCityGMLReader
 * @brief   reads CityGML files
 *
 * vtkCityGMLReader is a reader for CityGML .gml files. The output is
 * a multiblock dataset. We read objects at level of detail (LOD)
 * specified (default is 3).

 * The leafs of the multiblock dataset (which are polygonal datasets)
 * have a field array with one element called "gml_id" which
 * coresponds to the gml:id for gml:TriangulatedSurface,
 * gml:MultiSurface or gml:CompositeSurface in the CityGML file. If
 * the poly dataset has a texture, we specify this with a point array
 * called "tcoords" and a field array with one element called
 * "texture_uri" containing the path to the texture file. If the poly
 * dataset has a app::X3DMaterial we store two fields arrays with 3
 * components and 1 tuple: "diffuse_color" and "specular_color" and
 * one field array with 1 component and 1 tuple: "transparency".

 * Top level children of the multiblock dataset have a field array
 * with one element called "element" which contains the CityGML
 * element name for example: dem:ReliefFeature, wtr:WaterBody,
 * grp::CityObjectGroup (forest), veg:SolitaryVegetationObject,
 * brid:Bridge, run:Tunel, tran:Railway, tran:Road, bldg:Building,
 * gen:GenericCityObject, luse:LandUse
*/
class VTKIOCITYGML_EXPORT vtkCityGMLReader : public vtkMultiBlockDataSetAlgorithm
{
public:
  static vtkCityGMLReader *New();
  vtkTypeMacro(vtkCityGMLReader,vtkMultiBlockDataSetAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent) override;

  //@{
  /**
   * Specify file name of the CityGML data file to read.
   */
  vtkSetStringMacro(FileName);
  vtkGetStringMacro(FileName);
  //@}

  //@{
  /**
   * Specify the level of detail (LOD) to read. Valid values are from 0 (least detailed)
   * through 4 (most detailed), default value is 3.
   */
  vtkSetClampMacro(LOD, int, 0, 4);
  vtkGetMacro(LOD, int);
  //@}


  //@{
  /**
   * Certain input files use app:transparency as opacity. Set this field true
   * to show that correctly. The default is false.
   */
  vtkSetMacro(UseTransparencyAsOpacity, int);
  vtkGetMacro(UseTransparencyAsOpacity, int);
  vtkBooleanMacro(UseTransparencyAsOpacity, int);
  //@}

protected:
  vtkCityGMLReader();
  ~vtkCityGMLReader() override;

  int RequestData(vtkInformation *, vtkInformationVector **,
                  vtkInformationVector *) override;


  char *FileName;
  int LOD;
  int UseTransparencyAsOpacity;

private:
  vtkCityGMLReader(const vtkCityGMLReader&) = delete;
  void operator=(const vtkCityGMLReader&) = delete;

  class Implementation;
  Implementation* Impl;
};

#endif