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 =========================================================================*/
70 #ifndef vtkProjectedTerrainPath_h
71 #define vtkProjectedTerrainPath_h
72 
73 #include "vtkFiltersHybridModule.h" // For export macro
74 #include "vtkPolyDataAlgorithm.h"
75 
76 class vtkPriorityQueue;
77 class vtkImageData;
78 class vtkEdgeList;
79 class vtkPoints;
80 
82 {
83 public:
85 
87  void PrintSelf(ostream& os, vtkIndent indent);
89 
91  static vtkProjectedTerrainPath* New();
92 
94 
98  void SetSourceData(vtkImageData *source);
99  vtkImageData *GetSource();
101 
104  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
105 
106 //BTX
107  enum {SIMPLE_PROJECTION=0,NONOCCLUDED_PROJECTION,HUG_PROJECTION};
108 //ETX
109 
111 
117  vtkSetClampMacro(ProjectionMode,int,SIMPLE_PROJECTION,HUG_PROJECTION);
118  vtkGetMacro(ProjectionMode,int);
120  {this->SetProjectionMode(SIMPLE_PROJECTION);}
122  {this->SetProjectionMode(NONOCCLUDED_PROJECTION);}
124  {this->SetProjectionMode(HUG_PROJECTION);}
126 
128 
131  vtkSetMacro(HeightOffset,double);
132  vtkGetMacro(HeightOffset,double);
134 
136 
139  vtkSetClampMacro(HeightTolerance,double,0.0,VTK_FLOAT_MAX);
140  vtkGetMacro(HeightTolerance,double);
142 
144 
147  vtkSetClampMacro(MaximumNumberOfLines,vtkIdType,1,VTK_ID_MAX);
148  vtkGetMacro(MaximumNumberOfLines,vtkIdType);
150 
151 protected:
154 
158 
159  // Supporting methods
160  void GetImageIndex(double x[3], double loc[2], int ij[2]);
161  double GetHeight(double loc[2], int ij[2]);
162  void ComputeError(vtkIdType edgeId);
163  void RemoveOcclusions();
164  void HugTerrain();
165  void SplitEdge(vtkIdType eId, double t);
166 
167  //ivars that the API addresses
169  double HeightOffset;
172 
173  //Bookeeping arrays
174  int Dimensions[3];
175  int Extent[6];
176  double Origin[3];
177  double Spacing[3];
181 
182  //Errors above/below terrain. In both instances, negative values are
183  //inserted because the priority queue puts smallest values on top.
184  vtkPriorityQueue *PositiveLineError; //errors above terrain
185  vtkPriorityQueue *NegativeLineError; //errors below terrain
186 
187  //This is a PIMPL'd vector representing edges
188  vtkEdgeList *EdgeList;
189 
190 private:
191  vtkProjectedTerrainPath(const vtkProjectedTerrainPath&); // Not implemented.
192  void operator=(const vtkProjectedTerrainPath&); // Not implemented.
193 
194 };
195 
196 #endif
virtual int FillInputPortInformation(int port, vtkInformation *info)
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
project a polyline onto a terrain
int vtkIdType
Definition: vtkType.h:247
Proxy object to connect input/output ports.
a list of ids arranged in priority order
vtkPriorityQueue * NegativeLineError
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_FLOAT_MAX
Definition: vtkType.h:138
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKFILTERSHYBRID_EXPORT
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkPriorityQueue * PositiveLineError
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_ID_MAX
Definition: vtkType.h:251
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:38