VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkDijkstraGraphGeodesicPath.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDijkstraGraphGeodesicPath.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 =========================================================================*/
37 #ifndef __vtkDijkstraGraphGeodesicPath_h
38 #define __vtkDijkstraGraphGeodesicPath_h
39 
40 #include "vtkFiltersModelingModule.h" // For export macro
41 #include "vtkGraphGeodesicPath.h"
42 
44 class vtkIdList;
45 
46 class VTKFILTERSMODELING_EXPORT vtkDijkstraGraphGeodesicPath :
48 {
49 public:
50 
52  static vtkDijkstraGraphGeodesicPath *New();
53 
55 
57  void PrintSelf(ostream& os, vtkIndent indent);
59 
61 
62  vtkGetObjectMacro(IdList, vtkIdList);
64 
66 
68  vtkSetMacro(StopWhenEndReached, int);
69  vtkGetMacro(StopWhenEndReached, int);
70  vtkBooleanMacro(StopWhenEndReached, int);
72 
74 
75  vtkSetMacro(UseScalarWeights, int);
76  vtkGetMacro(UseScalarWeights, int);
77  vtkBooleanMacro(UseScalarWeights, int);
79 
81 
82  vtkSetMacro(RepelPathFromVertices, int);
83  vtkGetMacro(RepelPathFromVertices, int);
84  vtkBooleanMacro(RepelPathFromVertices, int);
86 
88 
89  virtual void SetRepelVertices(vtkPoints*);
90  vtkGetObjectMacro(RepelVertices, vtkPoints);
92 
94  virtual double GetGeodesicLength() { return 0.0; }
95 
97  virtual void GetCumulativeWeights(vtkDoubleArray *weights);
98 
99 protected:
102 
103  virtual int RequestData(vtkInformation *, vtkInformationVector **,
104  vtkInformationVector *);
105 
106  // Build a graph description of the input.
107  virtual void BuildAdjacency( vtkDataSet *inData );
108 
109  vtkTimeStamp AdjacencyBuildTime;
110 
111  // The fixed cost going from vertex u to v.
112  virtual double CalculateStaticEdgeCost( vtkDataSet *inData, vtkIdType u, vtkIdType v);
113 
114  // The cost going from vertex u to v that may depend on one or more vertices
115  //that precede u.
116  virtual double CalculateDynamicEdgeCost( vtkDataSet *, vtkIdType , vtkIdType )
117  { return 0.0; }
118 
119  void Initialize( vtkDataSet *inData );
120 
121  void Reset();
122 
123  // Calculate shortest path from vertex startv to vertex endv.
124  virtual void ShortestPath( vtkDataSet *inData, int startv, int endv );
125 
126  // Relax edge u,v with weight w.
127  void Relax(const int& u, const int& v, const double& w);
128 
129  // Backtrace the shortest path
130  void TraceShortestPath( vtkDataSet* inData, vtkPolyData* outPoly,
131  vtkIdType startv, vtkIdType endv);
132 
133  // The number of vertices.
135 
136  // The vertex ids on the shortest path.
137  vtkIdList *IdList;
138 
139  //Internalized STL containers.
141 
145 
146  vtkPoints* RepelVertices;
147 
148 private:
150  void operator=(const vtkDijkstraGraphGeodesicPath&); // Not implemented.
151 
152 };
153 
154 #endif
155 
Dijkstra algorithm to compute the graph geodesic.
void PrintSelf(ostream &os, vtkIndent indent)
vtkDijkstraGraphInternals * Internals
Helper class due to PIMPL excess.
Abstract base for classes that generate a geodesic path on a graph (mesh).
virtual double CalculateDynamicEdgeCost(vtkDataSet *, vtkIdType, vtkIdType)