VTK
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 {SIMPLE_PROJECTION=0,NONOCCLUDED_PROJECTION,HUG_PROJECTION};
116 
118 
126  vtkSetClampMacro(ProjectionMode,int,SIMPLE_PROJECTION,HUG_PROJECTION);
127  vtkGetMacro(ProjectionMode,int);
129  {this->SetProjectionMode(SIMPLE_PROJECTION);}
131  {this->SetProjectionMode(NONOCCLUDED_PROJECTION);}
133  {this->SetProjectionMode(HUG_PROJECTION);}
135 
137 
142  vtkSetMacro(HeightOffset,double);
143  vtkGetMacro(HeightOffset,double);
145 
147 
152  vtkSetClampMacro(HeightTolerance,double,0.0,VTK_FLOAT_MAX);
153  vtkGetMacro(HeightTolerance,double);
155 
157 
162  vtkSetClampMacro(MaximumNumberOfLines,vtkIdType,1,VTK_ID_MAX);
163  vtkGetMacro(MaximumNumberOfLines,vtkIdType);
165 
166 protected:
168  ~vtkProjectedTerrainPath() override;
169 
171  vtkInformationVector *) override;
172  int FillInputPortInformation(int port, vtkInformation *info) override;
173 
174  // Supporting methods
175  void GetImageIndex(double x[3], double loc[2], int ij[2]);
176  double GetHeight(double loc[2], int ij[2]);
177  void ComputeError(vtkIdType edgeId);
178  void RemoveOcclusions();
179  void HugTerrain();
180  void SplitEdge(vtkIdType eId, double t);
181 
182  //ivars that the API addresses
184  double HeightOffset;
187 
188  //Bookkeeping arrays
189  int Dimensions[3];
190  int Extent[6];
191  double Origin[3];
192  double Spacing[3];
196 
197  //Errors above/below terrain. In both instances, negative values are
198  //inserted because the priority queue puts smallest values on top.
199  vtkPriorityQueue *PositiveLineError; //errors above terrain
200  vtkPriorityQueue *NegativeLineError; //errors below terrain
201 
202  //This is a PIMPL'd vector representing edges
203  vtkEdgeList *EdgeList;
204 
205 private:
207  void operator=(const vtkProjectedTerrainPath&) = delete;
208 
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:347
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:167
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:45
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
void SetProjectionModeToNonOccluded()
Determine how to control the projection process.
vtkPriorityQueue * PositiveLineError
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_ID_MAX
Definition: vtkType.h:351
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.