00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00037 #ifndef __vtkDijkstraGraphGeodesicPath_h
00038 #define __vtkDijkstraGraphGeodesicPath_h
00039
00040 #include "vtkGraphGeodesicPath.h"
00041
00042 class vtkDoubleArray;
00043 class vtkIntArray;
00044 class vtkIdList;
00045 class vtkFloatArray;
00046
00047 class VTK_GRAPHICS_EXPORT vtkDijkstraGraphGeodesicPath :
00048 public vtkGraphGeodesicPath
00049 {
00050 public:
00051
00053 static vtkDijkstraGraphGeodesicPath *New();
00054
00056
00057 vtkTypeRevisionMacro(vtkDijkstraGraphGeodesicPath,vtkGraphGeodesicPath);
00058 void PrintSelf(ostream& os, vtkIndent indent);
00060
00062
00063 vtkGetObjectMacro(IdList, vtkIdList);
00065
00067
00068 vtkGetObjectMacro(d, vtkFloatArray);
00070
00072
00074 vtkSetMacro(StopWhenEndReached, int);
00075 vtkGetMacro(StopWhenEndReached, int);
00076 vtkBooleanMacro(StopWhenEndReached, int);
00078
00080
00081 vtkSetMacro(UseScalarWeights, int);
00082 vtkGetMacro(UseScalarWeights, int);
00083 vtkBooleanMacro(UseScalarWeights, int);
00085
00087 virtual double GetGeodesicLength() { return 0.0; }
00088
00089 protected:
00090 vtkDijkstraGraphGeodesicPath();
00091 ~vtkDijkstraGraphGeodesicPath();
00092
00093 virtual int RequestData(vtkInformation *, vtkInformationVector **,
00094 vtkInformationVector *);
00095
00096
00097 void BuildAdjacency(vtkPolyData *pd);
00098
00099 void DeleteAdjacency();
00100
00101 vtkTimeStamp AdjacencyBuildTime;
00102
00103
00104
00105
00106 double CalculateEdgeCost(vtkPolyData *pd, vtkIdType u, vtkIdType v);
00107
00108 void Initialize();
00109
00110 void Reset();
00111
00112
00113 void Heapify(int i);
00114
00115
00116 void HeapInsert(int v);
00117
00118
00119 int HeapExtractMin();
00120
00121
00122 void HeapDecreaseKey(int v);
00123
00124 void InitSingleSource(int startv);
00125
00126
00127 void ShortestPath(int startv, int endv);
00128
00129
00130 void Relax(int u, int v, double w);
00131
00132
00133 void TraceShortestPath(vtkPolyData *inPd, vtkPolyData *outPd,
00134 vtkIdType startv, vtkIdType endv);
00135
00136
00137 int NumberOfVertices;
00138
00139
00140 vtkFloatArray *d;
00141
00142
00143 vtkIntArray *pre;
00144
00145
00146
00147 vtkIntArray *f;
00148
00149
00150
00151 vtkIntArray *s;
00152
00153
00154 vtkIntArray *Heap;
00155
00156
00157 int HeapSize;
00158
00159
00160 vtkIntArray *p;
00161
00162
00163 vtkIdList *IdList;
00164
00165
00166 vtkIdList **Adjacency;
00167
00168 int StopWhenEndReached;
00169
00170 int UseScalarWeights;
00171
00172
00173 int AdjacencyGraphSize;
00174
00175 private:
00176 vtkDijkstraGraphGeodesicPath(const vtkDijkstraGraphGeodesicPath&);
00177 void operator=(const vtkDijkstraGraphGeodesicPath&);
00178
00179 };
00180
00181 #endif
00182