VTK  9.3.1
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
30 #ifndef vtkDijkstraGraphGeodesicPath_h
31 #define vtkDijkstraGraphGeodesicPath_h
32 
33 #include "vtkFiltersModelingModule.h" // For export macro
34 #include "vtkGraphGeodesicPath.h"
35 
36 VTK_ABI_NAMESPACE_BEGIN
38 class vtkIdList;
39 
40 class VTKFILTERSMODELING_EXPORT vtkDijkstraGraphGeodesicPath : public vtkGraphGeodesicPath
41 {
42 public:
47 
49 
53  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
57 
60  vtkGetObjectMacro(IdList, vtkIdList);
62 
64 
68  vtkSetMacro(StopWhenEndReached, vtkTypeBool);
69  vtkGetMacro(StopWhenEndReached, vtkTypeBool);
70  vtkBooleanMacro(StopWhenEndReached, vtkTypeBool);
72 
74 
77  vtkSetMacro(UseScalarWeights, vtkTypeBool);
78  vtkGetMacro(UseScalarWeights, vtkTypeBool);
79  vtkBooleanMacro(UseScalarWeights, vtkTypeBool);
81 
83 
86  vtkSetMacro(RepelPathFromVertices, vtkTypeBool);
87  vtkGetMacro(RepelPathFromVertices, vtkTypeBool);
88  vtkBooleanMacro(RepelPathFromVertices, vtkTypeBool);
90 
92 
95  virtual void SetRepelVertices(vtkPoints*);
96  vtkGetObjectMacro(RepelVertices, vtkPoints);
98 
102  virtual void GetCumulativeWeights(vtkDoubleArray* weights);
103 
104 protected:
106  ~vtkDijkstraGraphGeodesicPath() override;
107 
109 
110  // Build a graph description of the input.
111  virtual void BuildAdjacency(vtkDataSet* inData);
112 
114 
115  // The fixed cost going from vertex u to v.
116  virtual double CalculateStaticEdgeCost(vtkDataSet* inData, vtkIdType u, vtkIdType v);
117 
118  // The cost going from vertex u to v that may depend on one or more vertices
119  // that precede u.
120  virtual double CalculateDynamicEdgeCost(vtkDataSet*, vtkIdType, vtkIdType) { return 0.0; }
121 
122  void Initialize(vtkDataSet* inData);
123 
124  void Reset();
125 
126  // Calculate shortest path from vertex startv to vertex endv.
127  virtual void ShortestPath(vtkDataSet* inData, int startv, int endv);
128 
129  // Relax edge u,v with weight w.
130  void Relax(const int& u, const int& v, const double& w);
131 
132  // Backtrace the shortest path
133  void TraceShortestPath(
134  vtkDataSet* inData, vtkPolyData* outPoly, vtkIdType startv, vtkIdType endv);
135 
136  // The number of vertices.
138 
139  // The vertex ids on the shortest path.
141 
142  // Internalized STL containers.
144 
148 
150 
151 private:
153  void operator=(const vtkDijkstraGraphGeodesicPath&) = delete;
154 };
155 
156 VTK_ABI_NAMESPACE_END
157 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for printing and determining type information.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
record modification and/or execution time
Definition: vtkTimeStamp.h:24
int vtkIdType
Definition: vtkType.h:315
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Dijkstra algorithm to compute the graph geodesic.
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkDijkstraGraphInternals * Internals
Helper class due to PIMPL excess.
list of point or cell ids
Definition: vtkIdList.h:22
Abstract base for classes that generate a geodesic path on a graph (mesh).
virtual double CalculateDynamicEdgeCost(vtkDataSet *, vtkIdType, vtkIdType)
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:28