VTK  9.2.5
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 =========================================================================*/
71 #ifndef vtkDijkstraGraphGeodesicPath_h
72 #define vtkDijkstraGraphGeodesicPath_h
73 
74 #include "vtkFiltersModelingModule.h" // For export macro
75 #include "vtkGraphGeodesicPath.h"
76 
78 class vtkIdList;
79 
80 class VTKFILTERSMODELING_EXPORT vtkDijkstraGraphGeodesicPath : public vtkGraphGeodesicPath
81 {
82 public:
87 
89 
93  void PrintSelf(ostream& os, vtkIndent indent) override;
95 
97 
100  vtkGetObjectMacro(IdList, vtkIdList);
102 
104 
108  vtkSetMacro(StopWhenEndReached, vtkTypeBool);
109  vtkGetMacro(StopWhenEndReached, vtkTypeBool);
110  vtkBooleanMacro(StopWhenEndReached, vtkTypeBool);
112 
114 
117  vtkSetMacro(UseScalarWeights, vtkTypeBool);
118  vtkGetMacro(UseScalarWeights, vtkTypeBool);
119  vtkBooleanMacro(UseScalarWeights, vtkTypeBool);
121 
123 
126  vtkSetMacro(RepelPathFromVertices, vtkTypeBool);
127  vtkGetMacro(RepelPathFromVertices, vtkTypeBool);
128  vtkBooleanMacro(RepelPathFromVertices, vtkTypeBool);
130 
132 
135  virtual void SetRepelVertices(vtkPoints*);
136  vtkGetObjectMacro(RepelVertices, vtkPoints);
138 
142  virtual void GetCumulativeWeights(vtkDoubleArray* weights);
143 
144 protected:
147 
149 
150  // Build a graph description of the input.
151  virtual void BuildAdjacency(vtkDataSet* inData);
152 
154 
155  // The fixed cost going from vertex u to v.
156  virtual double CalculateStaticEdgeCost(vtkDataSet* inData, vtkIdType u, vtkIdType v);
157 
158  // The cost going from vertex u to v that may depend on one or more vertices
159  // that precede u.
160  virtual double CalculateDynamicEdgeCost(vtkDataSet*, vtkIdType, vtkIdType) { return 0.0; }
161 
162  void Initialize(vtkDataSet* inData);
163 
164  void Reset();
165 
166  // Calculate shortest path from vertex startv to vertex endv.
167  virtual void ShortestPath(vtkDataSet* inData, int startv, int endv);
168 
169  // Relax edge u,v with weight w.
170  void Relax(const int& u, const int& v, const double& w);
171 
172  // Backtrace the shortest path
174  vtkDataSet* inData, vtkPolyData* outPoly, vtkIdType startv, vtkIdType endv);
175 
176  // The number of vertices.
178 
179  // The vertex ids on the shortest path.
181 
182  // Internalized STL containers.
184 
188 
190 
191 private:
193  void operator=(const vtkDijkstraGraphGeodesicPath&) = delete;
194 };
195 
196 #endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:172
Dijkstra algorithm to compute the graph geodesic.
static vtkDijkstraGraphGeodesicPath * New()
Instantiate the class.
virtual double CalculateDynamicEdgeCost(vtkDataSet *, vtkIdType, vtkIdType)
virtual void SetRepelVertices(vtkPoints *)
Specify vtkPoints to use to repel the path from.
void Initialize(vtkDataSet *inData)
void TraceShortestPath(vtkDataSet *inData, vtkPolyData *outPoly, vtkIdType startv, vtkIdType endv)
virtual void BuildAdjacency(vtkDataSet *inData)
vtkDijkstraGraphInternals * Internals
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for printing and determining type information.
void Relax(const int &u, const int &v, const double &w)
~vtkDijkstraGraphGeodesicPath() override
virtual double CalculateStaticEdgeCost(vtkDataSet *inData, vtkIdType u, vtkIdType v)
virtual void GetCumulativeWeights(vtkDoubleArray *weights)
Fill the array with the cumulative weights.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
virtual void ShortestPath(vtkDataSet *inData, int startv, int endv)
Helper class due to PIMPL excess.
dynamic, self-adjusting array of double
Abstract base for classes that generate a geodesic path on a graph (mesh).
list of point or cell ids
Definition: vtkIdList.h:143
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:149
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
record modification and/or execution time
Definition: vtkTimeStamp.h:55
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332