VTK  9.3.0
vtkDijkstraGraphGeodesicPath.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
39 #ifndef vtkDijkstraGraphGeodesicPath_h
40 #define vtkDijkstraGraphGeodesicPath_h
41 
42 #include "vtkFiltersModelingModule.h" // For export macro
43 #include "vtkGraphGeodesicPath.h"
44 
45 VTK_ABI_NAMESPACE_BEGIN
47 class vtkIdList;
48 
49 class VTKFILTERSMODELING_EXPORT vtkDijkstraGraphGeodesicPath : public vtkGraphGeodesicPath
50 {
51 public:
56 
58 
62  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
66 
69  vtkGetObjectMacro(IdList, vtkIdList);
71 
73 
77  vtkSetMacro(StopWhenEndReached, vtkTypeBool);
78  vtkGetMacro(StopWhenEndReached, vtkTypeBool);
79  vtkBooleanMacro(StopWhenEndReached, vtkTypeBool);
81 
83 
86  vtkSetMacro(UseScalarWeights, vtkTypeBool);
87  vtkGetMacro(UseScalarWeights, vtkTypeBool);
88  vtkBooleanMacro(UseScalarWeights, vtkTypeBool);
90 
92 
95  vtkSetMacro(RepelPathFromVertices, vtkTypeBool);
96  vtkGetMacro(RepelPathFromVertices, vtkTypeBool);
97  vtkBooleanMacro(RepelPathFromVertices, vtkTypeBool);
99 
101 
104  virtual void SetRepelVertices(vtkPoints*);
105  vtkGetObjectMacro(RepelVertices, vtkPoints);
107 
111  virtual void GetCumulativeWeights(vtkDoubleArray* weights);
112 
113 protected:
116 
118 
119  // Build a graph description of the input.
120  virtual void BuildAdjacency(vtkDataSet* inData);
121 
123 
124  // The fixed cost going from vertex u to v.
125  virtual double CalculateStaticEdgeCost(vtkDataSet* inData, vtkIdType u, vtkIdType v);
126 
127  // The cost going from vertex u to v that may depend on one or more vertices
128  // that precede u.
129  virtual double CalculateDynamicEdgeCost(vtkDataSet*, vtkIdType, vtkIdType) { return 0.0; }
130 
131  void Initialize(vtkDataSet* inData);
132 
133  void Reset();
134 
135  // Calculate shortest path from vertex startv to vertex endv.
136  virtual void ShortestPath(vtkDataSet* inData, int startv, int endv);
137 
138  // Relax edge u,v with weight w.
139  void Relax(const int& u, const int& v, const double& w);
140 
141  // Backtrace the shortest path
143  vtkDataSet* inData, vtkPolyData* outPoly, vtkIdType startv, vtkIdType endv);
144 
145  // The number of vertices.
147 
148  // The vertex ids on the shortest path.
150 
151  // Internalized STL containers.
153 
157 
159 
160 private:
162  void operator=(const vtkDijkstraGraphGeodesicPath&) = delete;
163 };
164 
165 VTK_ABI_NAMESPACE_END
166 #endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
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:32
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:38
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
record modification and/or execution time
Definition: vtkTimeStamp.h:34
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315