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 "vtkPolyDataAlgorithm.h"
74 
75 class vtkPriorityQueue;
76 class vtkImageData;
77 class vtkEdgeList;
78 class vtkPoints;
79 
81 {
82 public:
84 
86  void PrintSelf(ostream& os, vtkIndent indent);
88 
90  static vtkProjectedTerrainPath* New();
91 
93 
95  void SetSource(vtkImageData *source);
96  vtkImageData *GetSource();
98 
99 //BTX
100  enum {SIMPLE_PROJECTION=0,NONOCCLUDED_PROJECTION,HUG_PROJECTION};
101 //ETX
102 
104 
110  vtkSetClampMacro(ProjectionMode,int,SIMPLE_PROJECTION,HUG_PROJECTION);
111  vtkGetMacro(ProjectionMode,int);
113  {this->SetProjectionMode(SIMPLE_PROJECTION);}
115  {this->SetProjectionMode(NONOCCLUDED_PROJECTION);}
117  {this->SetProjectionMode(HUG_PROJECTION);}
119 
121 
124  vtkSetMacro(HeightOffset,double);
125  vtkGetMacro(HeightOffset,double);
127 
129 
132  vtkSetClampMacro(HeightTolerance,double,0.0,VTK_LARGE_FLOAT);
133  vtkGetMacro(HeightTolerance,double);
135 
137 
140  vtkSetClampMacro(MaximumNumberOfLines,vtkIdType,1,VTK_LARGE_ID);
141  vtkGetMacro(MaximumNumberOfLines,vtkIdType);
143 
144 protected:
147 
151 
152  // Supporting methods
153  void GetImageIndex(double x[3], double loc[2], int ij[2]);
154  double GetHeight(double loc[2], int ij[2]);
155  void ComputeError(vtkIdType edgeId);
156  void RemoveOcclusions();
157  void HugTerrain();
158  void SplitEdge(vtkIdType eId, double t);
159 
160  //ivars that the API addresses
162  double HeightOffset;
165 
166  //Bookeeping arrays
167  int Dimensions[3];
168  int Extent[6];
169  double Origin[3];
170  double Spacing[3];
174 
175  //Errors above/below terrain. In both instances, negative values are
176  //inserted because the priority queue puts smallest values on top.
177  vtkPriorityQueue *PositiveLineError; //errors above terrain
178  vtkPriorityQueue *NegativeLineError; //errors below terrain
179 
180  //This is a PIMPL'd vector representing edges
181  vtkEdgeList *EdgeList;
182 
183 private:
184  vtkProjectedTerrainPath(const vtkProjectedTerrainPath&); // Not implemented.
185  void operator=(const vtkProjectedTerrainPath&); // Not implemented.
186 
187 };
188 
189 #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:255
an list of ids arranged in priority order
vtkPriorityQueue * NegativeLineError
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:37
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
vtkPriorityQueue * PositiveLineError
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_LARGE_FLOAT
Definition: vtkType.h:149
#define VTK_LARGE_ID
Definition: vtkType.h:257
Store zero or more vtkInformation instances.
#define VTK_HYBRID_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38