VTK  9.2.6
vtkProjectedTerrainPath.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkProjectedTerrainPath.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
71 #ifndef vtkProjectedTerrainPath_h
72 #define vtkProjectedTerrainPath_h
73 
74 #include "vtkFiltersHybridModule.h" // For export macro
75 #include "vtkPolyDataAlgorithm.h"
76 
77 class vtkPriorityQueue;
78 class vtkImageData;
79 class vtkEdgeList;
80 class vtkPoints;
81 
82 class VTKFILTERSHYBRID_EXPORT vtkProjectedTerrainPath : public vtkPolyDataAlgorithm
83 {
84 public:
86 
90  void PrintSelf(ostream& os, vtkIndent indent) override;
92 
96  static vtkProjectedTerrainPath* New();
97 
99 
105  void SetSourceData(vtkImageData* source);
106  vtkImageData* GetSource();
108 
113  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
114 
115  enum
116  {
117  SIMPLE_PROJECTION = 0,
119  HUG_PROJECTION
120  };
121 
123 
131  vtkSetClampMacro(ProjectionMode, int, SIMPLE_PROJECTION, HUG_PROJECTION);
132  vtkGetMacro(ProjectionMode, int);
133  void SetProjectionModeToSimple() { this->SetProjectionMode(SIMPLE_PROJECTION); }
134  void SetProjectionModeToNonOccluded() { this->SetProjectionMode(NONOCCLUDED_PROJECTION); }
135  void SetProjectionModeToHug() { this->SetProjectionMode(HUG_PROJECTION); }
137 
139 
144  vtkSetMacro(HeightOffset, double);
145  vtkGetMacro(HeightOffset, double);
147 
149 
154  vtkSetClampMacro(HeightTolerance, double, 0.0, VTK_FLOAT_MAX);
155  vtkGetMacro(HeightTolerance, double);
157 
159 
164  vtkSetClampMacro(MaximumNumberOfLines, vtkIdType, 1, VTK_ID_MAX);
165  vtkGetMacro(MaximumNumberOfLines, vtkIdType);
167 
168 protected:
170  ~vtkProjectedTerrainPath() override;
171 
173  int FillInputPortInformation(int port, vtkInformation* info) override;
174 
175  // Supporting methods
176  void GetImageIndex(double x[3], double loc[2], int ij[2]);
177  double GetHeight(double loc[2], int ij[2]);
178  void ComputeError(vtkIdType edgeId);
179  void RemoveOcclusions();
180  void HugTerrain();
181  void SplitEdge(vtkIdType eId, double t);
182 
183  // ivars that the API addresses
185  double HeightOffset;
188 
189  // Bookkeeping arrays
190  int Dimensions[3];
191  int Extent[6];
192  double Origin[3];
193  double Spacing[3];
197 
198  // Errors above/below terrain. In both instances, negative values are
199  // inserted because the priority queue puts smallest values on top.
200  vtkPriorityQueue* PositiveLineError; // errors above terrain
201  vtkPriorityQueue* NegativeLineError; // errors below terrain
202 
203  // This is a PIMPL'd vector representing edges
204  vtkEdgeList* EdgeList;
205 
206 private:
208  void operator=(const vtkProjectedTerrainPath&) = delete;
209 };
210 
211 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
project a polyline onto a terrain
int vtkIdType
Definition: vtkType.h:332
void SetProjectionModeToSimple()
Determine how to control the projection process.
Proxy object to connect input/output ports.
a list of ids arranged in priority order
vtkPriorityQueue * NegativeLineError
static vtkPolyDataAlgorithm * New()
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
void SetProjectionModeToNonOccluded()
Determine how to control the projection process.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkPriorityQueue * PositiveLineError
#define VTK_ID_MAX
Definition: vtkType.h:336
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetProjectionModeToHug()
Determine how to control the projection process.