00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00070 #ifndef __vtkProjectedTerrainPath_h
00071 #define __vtkProjectedTerrainPath_h
00072
00073 #include "vtkPolyDataAlgorithm.h"
00074
00075 class vtkPriorityQueue;
00076 class vtkImageData;
00077 class vtkEdgeList;
00078 class vtkPoints;
00079
00080 class VTK_HYBRID_EXPORT vtkProjectedTerrainPath : public vtkPolyDataAlgorithm
00081 {
00082 public:
00084
00085 vtkTypeMacro(vtkProjectedTerrainPath,vtkPolyDataAlgorithm);
00086 void PrintSelf(ostream& os, vtkIndent indent);
00088
00090 static vtkProjectedTerrainPath* New();
00091
00093
00095 void SetSource(vtkImageData *source);
00096 vtkImageData *GetSource();
00098
00099
00100 enum {SIMPLE_PROJECTION=0,NONOCCLUDED_PROJECTION,HUG_PROJECTION};
00101
00102
00104
00110 vtkSetClampMacro(ProjectionMode,int,SIMPLE_PROJECTION,HUG_PROJECTION);
00111 vtkGetMacro(ProjectionMode,int);
00112 void SetProjectionModeToSimple()
00113 {this->SetProjectionMode(SIMPLE_PROJECTION);}
00114 void SetProjectionModeToNonOccluded()
00115 {this->SetProjectionMode(NONOCCLUDED_PROJECTION);}
00116 void SetProjectionModeToHug()
00117 {this->SetProjectionMode(HUG_PROJECTION);}
00119
00121
00124 vtkSetMacro(HeightOffset,double);
00125 vtkGetMacro(HeightOffset,double);
00127
00129
00132 vtkSetClampMacro(HeightTolerance,double,0.0,VTK_LARGE_FLOAT);
00133 vtkGetMacro(HeightTolerance,double);
00135
00137
00140 vtkSetClampMacro(MaximumNumberOfLines,vtkIdType,1,VTK_LARGE_ID);
00141 vtkGetMacro(MaximumNumberOfLines,vtkIdType);
00143
00144 protected:
00145 vtkProjectedTerrainPath();
00146 ~vtkProjectedTerrainPath();
00147
00148 virtual int RequestData(vtkInformation *, vtkInformationVector **,
00149 vtkInformationVector *);
00150 virtual int FillInputPortInformation(int port, vtkInformation *info);
00151
00152
00153 void GetImageIndex(double x[3], double loc[2], int ij[2]);
00154 double GetHeight(double loc[2], int ij[2]);
00155 void ComputeError(vtkIdType edgeId);
00156 void RemoveOcclusions();
00157 void HugTerrain();
00158 void SplitEdge(vtkIdType eId, double t);
00159
00160
00161 int ProjectionMode;
00162 double HeightOffset;
00163 double HeightTolerance;
00164 vtkIdType MaximumNumberOfLines;
00165
00166
00167 int Dimensions[3];
00168 int Extent[6];
00169 double Origin[3];
00170 double Spacing[3];
00171 vtkDataArray *Heights;
00172 vtkPoints *Points;
00173 vtkIdType NumLines;
00174
00175
00176
00177 vtkPriorityQueue *PositiveLineError;
00178 vtkPriorityQueue *NegativeLineError;
00179
00180
00181 vtkEdgeList *EdgeList;
00182
00183 private:
00184 vtkProjectedTerrainPath(const vtkProjectedTerrainPath&);
00185 void operator=(const vtkProjectedTerrainPath&);
00186
00187 };
00188
00189 #endif