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
30#ifndef vtkDijkstraGraphGeodesicPath_h
31#define vtkDijkstraGraphGeodesicPath_h
32
33#include "vtkFiltersModelingModule.h" // For export macro
35
36VTK_ABI_NAMESPACE_BEGIN
38class vtkIdList;
39
40class VTKFILTERSMODELING_EXPORT vtkDijkstraGraphGeodesicPath : public vtkGraphGeodesicPath
41{
42public:
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
96 vtkGetObjectMacro(RepelVertices, vtkPoints);
98
102 virtual void GetCumulativeWeights(vtkDoubleArray* weights);
103
104protected:
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.
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
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
151private:
153 void operator=(const vtkDijkstraGraphGeodesicPath&) = delete;
154};
155
156VTK_ABI_NAMESPACE_END
157#endif
abstract class to specify dataset behavior
Definition vtkDataSet.h:53
Dijkstra algorithm to compute the graph geodesic.
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)
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.
static vtkDijkstraGraphGeodesicPath * New()
Instantiate the class.
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:23
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition vtkPoints.h:29
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:80
record modification and/or execution time
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315