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