vtkGeoTerrain2D.h 3.28 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkGeoTerrain2D.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.

=========================================================================*/
/*-------------------------------------------------------------------------
  Copyright 2008 Sandia Corporation.
  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
  the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
20 21 22 23 24 25 26 27 28 29 30 31
/**
 * @class   vtkGeoTerrain2D
 * @brief   A 2D terrain model for the globe.
 *
 *
 * vtkGeoTerrain2D contains a multi-resolution tree of geometry representing
 * the globe. It uses a vtkGeoSource subclass to generate the terrain, such
 * as vtkGeoProjectionSource. This source must be set before using the
 * terrain in a vtkGeoView2D. The terrain also contains an AddActors()
 * method which updates the set of actors representing the globe given the
 * current camera position.
*/
32

33 34
#ifndef vtkGeoTerrain2D_h
#define vtkGeoTerrain2D_h
35

36
#include "vtkGeovisCoreModule.h" // For export macro
37
#include "vtkGeoTerrain.h"
38

39
class vtkAbstractTransform;
40 41 42 43 44 45 46
class vtkAssembly;
class vtkCollection;
class vtkGeoImageRepresentation;
class vtkGeoSource;
class vtkGeoTerrainNode;
class vtkRenderer;

Sankhesh Jhaveri's avatar
Sankhesh Jhaveri committed
47
#if !defined(VTK_LEGACY_REMOVE)
48
class VTKGEOVISCORE_EXPORT vtkGeoTerrain2D : public vtkGeoTerrain
49 50 51
{
public:
  static vtkGeoTerrain2D *New();
52
  vtkTypeMacro(vtkGeoTerrain2D,vtkGeoTerrain);
53
  void PrintSelf(ostream& os, vtkIndent indent) override;
54

55 56 57 58 59
  //@{
  /**
   * The maximum size of a single texel in pixels.
   * Images will be refined if a texel becomes larger than the tolerance.
   */
60 61
  vtkSetMacro(TextureTolerance, double);
  vtkGetMacro(TextureTolerance, double);
62
  //@}
63

64 65 66 67 68
  //@{
  /**
   * The maximum allowed deviation of geometry in pixels.
   * Geometry will be refined if the deviation is larger than the tolerance.
   */
69 70
  vtkSetMacro(LocationTolerance, double);
  vtkGetMacro(LocationTolerance, double);
71
  //@}
72

73 74 75
  /**
   * Return the projection transformation used by this 2D terrain.
   */
76 77
  virtual vtkAbstractTransform* GetTransform();

78 79
protected:
  vtkGeoTerrain2D();
80
  ~vtkGeoTerrain2D() override;
81 82 83 84

  double LocationTolerance;
  double TextureTolerance;

85 86 87
  /**
   * AddActors() calls this to setup parameters for evaluating nodes.
   */
88
  void InitializeNodeAnalysis(vtkRenderer* ren) override;
89

90 91 92 93
  /**
   * AddActors() calls this to determine if a node is in the current
   * viewport.
   */
94
  bool NodeInViewport(vtkGeoTerrainNode* node) override;
95

96 97 98 99
  /**
   * AddActors() calls to to evaluate whether a node should be
   * refined (1), coarsened (-1), or remain at the same level (0).
   */
100
  int EvaluateNode(vtkGeoTerrainNode* node) override;
101 102 103

  double CameraBounds[4];
  double PixelSize;
104 105

private:
106 107
  vtkGeoTerrain2D(const vtkGeoTerrain2D&) = delete;
  void operator=(const vtkGeoTerrain2D&) = delete;
108 109
};

Sankhesh Jhaveri's avatar
Sankhesh Jhaveri committed
110
#endif //VTK_LEGACY_REMOVE
111
#endif