VTK  9.0.2
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 =========================================================================*/
68 #ifndef vtkProjectedTerrainPath_h
69 #define vtkProjectedTerrainPath_h
70 
71 #include "vtkFiltersHybridModule.h" // For export macro
72 #include "vtkPolyDataAlgorithm.h"
73 
74 class vtkPriorityQueue;
75 class vtkImageData;
76 class vtkEdgeList;
77 class vtkPoints;
78 
79 class VTKFILTERSHYBRID_EXPORT vtkProjectedTerrainPath : public vtkPolyDataAlgorithm
80 {
81 public:
83 
87  void PrintSelf(ostream& os, vtkIndent indent) override;
89 
94 
96 
105 
111 
112  enum
113  {
114  SIMPLE_PROJECTION = 0,
116  HUG_PROJECTION
117  };
118 
120 
128  vtkSetClampMacro(ProjectionMode, int, SIMPLE_PROJECTION, HUG_PROJECTION);
129  vtkGetMacro(ProjectionMode, int);
130  void SetProjectionModeToSimple() { this->SetProjectionMode(SIMPLE_PROJECTION); }
131  void SetProjectionModeToNonOccluded() { this->SetProjectionMode(NONOCCLUDED_PROJECTION); }
132  void SetProjectionModeToHug() { this->SetProjectionMode(HUG_PROJECTION); }
134 
136 
141  vtkSetMacro(HeightOffset, double);
142  vtkGetMacro(HeightOffset, double);
144 
146 
151  vtkSetClampMacro(HeightTolerance, double, 0.0, VTK_FLOAT_MAX);
152  vtkGetMacro(HeightTolerance, double);
154 
156 
161  vtkSetClampMacro(MaximumNumberOfLines, vtkIdType, 1, VTK_ID_MAX);
162  vtkGetMacro(MaximumNumberOfLines, vtkIdType);
164 
165 protected:
168 
171 
172  // Supporting methods
173  void GetImageIndex(double x[3], double loc[2], int ij[2]);
174  double GetHeight(double loc[2], int ij[2]);
175  void ComputeError(vtkIdType edgeId);
177  void HugTerrain();
178  void SplitEdge(vtkIdType eId, double t);
179 
180  // ivars that the API addresses
182  double HeightOffset;
185 
186  // Bookkeeping arrays
187  int Dimensions[3];
188  int Extent[6];
189  double Origin[3];
190  double Spacing[3];
194 
195  // Errors above/below terrain. In both instances, negative values are
196  // inserted because the priority queue puts smallest values on top.
197  vtkPriorityQueue* PositiveLineError; // errors above terrain
198  vtkPriorityQueue* NegativeLineError; // errors below terrain
199 
200  // This is a PIMPL'd vector representing edges
201  vtkEdgeList* EdgeList;
202 
203 private:
205  void operator=(const vtkProjectedTerrainPath&) = delete;
206 };
207 
208 #endif
Proxy object to connect input/output ports.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:34
Superclass for algorithms that produce only polydata as output.
a list of ids arranged in priority order
project a polyline onto a terrain
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
~vtkProjectedTerrainPath() override
void SetSourceData(vtkImageData *source)
Specify the second input (the terrain) onto which the polyline(s) should be projected.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
double GetHeight(double loc[2], int ij[2])
static vtkProjectedTerrainPath * New()
Instantiate the class.
void ComputeError(vtkIdType edgeId)
vtkPriorityQueue * PositiveLineError
void SplitEdge(vtkIdType eId, double t)
vtkImageData * GetSource()
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Specify the second input (the terrain) onto which the polyline(s) should be projected.
void GetImageIndex(double x[3], double loc[2], int ij[2])
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPriorityQueue * NegativeLineError
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
int vtkIdType
Definition: vtkType.h:338
#define VTK_ID_MAX
Definition: vtkType.h:342
#define VTK_FLOAT_MAX
Definition: vtkType.h:163