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 =========================================================================*/
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) VTK_OVERRIDE;
89 
93  static vtkProjectedTerrainPath* New();
94 
96 
102  void SetSourceData(vtkImageData *source);
103  vtkImageData *GetSource();
105 
110  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
111 
112  enum {SIMPLE_PROJECTION=0,NONOCCLUDED_PROJECTION,HUG_PROJECTION};
113 
115 
123  vtkSetClampMacro(ProjectionMode,int,SIMPLE_PROJECTION,HUG_PROJECTION);
124  vtkGetMacro(ProjectionMode,int);
126  {this->SetProjectionMode(SIMPLE_PROJECTION);}
128  {this->SetProjectionMode(NONOCCLUDED_PROJECTION);}
130  {this->SetProjectionMode(HUG_PROJECTION);}
132 
134 
139  vtkSetMacro(HeightOffset,double);
140  vtkGetMacro(HeightOffset,double);
142 
144 
149  vtkSetClampMacro(HeightTolerance,double,0.0,VTK_FLOAT_MAX);
150  vtkGetMacro(HeightTolerance,double);
152 
154 
159  vtkSetClampMacro(MaximumNumberOfLines,vtkIdType,1,VTK_ID_MAX);
160  vtkGetMacro(MaximumNumberOfLines,vtkIdType);
162 
163 protected:
165  ~vtkProjectedTerrainPath() VTK_OVERRIDE;
166 
168  vtkInformationVector *) VTK_OVERRIDE;
169  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
170 
171  // Supporting methods
172  void GetImageIndex(double x[3], double loc[2], int ij[2]);
173  double GetHeight(double loc[2], int ij[2]);
174  void ComputeError(vtkIdType edgeId);
175  void RemoveOcclusions();
176  void HugTerrain();
177  void SplitEdge(vtkIdType eId, double t);
178 
179  //ivars that the API addresses
181  double HeightOffset;
184 
185  //Bookeeping arrays
186  int Dimensions[3];
187  int Extent[6];
188  double Origin[3];
189  double Spacing[3];
193 
194  //Errors above/below terrain. In both instances, negative values are
195  //inserted because the priority queue puts smallest values on top.
196  vtkPriorityQueue *PositiveLineError; //errors above terrain
197  vtkPriorityQueue *NegativeLineError; //errors below terrain
198 
199  //This is a PIMPL'd vector representing edges
200  vtkEdgeList *EdgeList;
201 
202 private:
203  vtkProjectedTerrainPath(const vtkProjectedTerrainPath&) VTK_DELETE_FUNCTION;
204  void operator=(const vtkProjectedTerrainPath&) VTK_DELETE_FUNCTION;
205 
206 };
207 
208 #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:345
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:165
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
void SetProjectionModeToNonOccluded()
Determine how to control the projection process.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkPriorityQueue * PositiveLineError
boost::graph_traits< vtkGraph *>::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_ID_MAX
Definition: vtkType.h:349
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:33
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.