VTK  9.7.20260907
vtkGraphGeodesicPath.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
11
12#ifndef vtkGraphGeodesicPath_h
13#define vtkGraphGeodesicPath_h
14
15#include "vtkFiltersModelingModule.h" // For export macro
16#include "vtkGeodesicPath.h"
17
18VTK_ABI_NAMESPACE_BEGIN
20class vtkIdList;
21
22class VTKFILTERSMODELING_EXPORT vtkGraphGeodesicPath : public vtkGeodesicPath
23{
24public:
26
30 void PrintSelf(ostream& os, vtkIndent indent) override;
32
37
41 vtkGetObjectMacro(IdList, vtkIdList);
42
44
53
55
58 vtkGetMacro(StartVertex, vtkIdType);
59 vtkSetMacro(StartVertex, vtkIdType);
61
63
66 vtkGetMacro(EndVertex, vtkIdType);
67 vtkSetMacro(EndVertex, vtkIdType);
69
71
78 vtkBooleanMacro(UseScalarWeights, vtkTypeBool);
80
82
90
92
96 vtkGetObjectMacro(RepelVertices, vtkPoints);
98
100
106 void SetProcessedFieldArrayName(const std::string& name);
107 vtkGetMacro(ProcessedFieldArrayName, const std::string&);
109
110protected:
113
117 virtual void GetNodeFromIndex(vtkDataSet* inData, vtkIdType u, double pt[3]);
118
123
127 virtual void DiscardRepelVertices(vtkDataSet* inData, int startv, int endv);
128
132 virtual void BuildAdjacency(vtkDataSet* inData) = 0;
133
137 virtual double CalculateStaticEdgeCost(vtkDataSet* inData, vtkIdType u, vtkIdType v) = 0;
138
143 virtual double CalculateDynamicEdgeCost(vtkDataSet*, vtkIdType, vtkIdType) { return 0.0; }
144
148 virtual void ShortestPath(vtkDataSet* inData, int startv, int endv);
149
153 void Initialize(vtkDataSet* inData);
154
158 void Reset();
159
163 void Relax(int u, int v, double w);
164
169 vtkDataSet* inData, vtkPolyData* outPoly, vtkIdType startv, vtkIdType endv);
170
173
175
176 // The vertex ids on the shortest path.
178
179 // Internalized STL containers.
180 std::unique_ptr<vtkDijkstraGraphInternals> Internals;
181
185
187
189
192
193private:
195 void operator=(const vtkGraphGeodesicPath&) = delete;
196};
197
198VTK_ABI_NAMESPACE_END
199#endif
abstract class to specify dataset behavior
Definition vtkDataSet.h:165
Helper class due to PIMPL excess.
dynamic, self-adjusting array of double
void SetRepelVertices(vtkPoints *)
Specify vtkPoints to use to repel the path from.
virtual vtkIdType GetNumberOfNodes(vtkDataSet *inData)
Helper to get the number of nodes in the graph.
void Reset()
Reset the main internal structures for shortest path computation.
void Initialize(vtkDataSet *inData)
Initialize the main internal structures for shortest path computation.
~vtkGraphGeodesicPath() override
void GetCumulativeWeights(vtkDoubleArray *weights)
Fill the array with the cumulative weights.
virtual double CalculateDynamicEdgeCost(vtkDataSet *, vtkIdType, vtkIdType)
Computes the dynamic cost cost going from vertex u to v, that may depend on one or more vertices that...
virtual double CalculateStaticEdgeCost(vtkDataSet *inData, vtkIdType u, vtkIdType v)=0
Computes the fixed cost going from vertex u to v.
virtual void GetNodeFromIndex(vtkDataSet *inData, vtkIdType u, double pt[3])
Helper to get the node (point or cell) position from its index.
void Relax(int u, int v, double w)
Relax edge u,v with weight w.
void SetUseScalarWeights(vtkTypeBool)
Use scalar values in the edge weight.
virtual void DiscardRepelVertices(vtkDataSet *inData, int startv, int endv)
Helper to discard repelled vertices from the shortest path computation.
virtual void ShortestPath(vtkDataSet *inData, int startv, int endv)
Actual computation of the shortest path from vertex startv to endv.
std::unique_ptr< vtkDijkstraGraphInternals > Internals
void SetProcessedFieldArrayName(const std::string &name)
Set/Get the name of the input array used for the edge weights.
virtual void BuildAdjacency(vtkDataSet *inData)=0
Builds a graph description of the input.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for printing and determining type information.
void TraceShortestPath(vtkDataSet *inData, vtkPolyData *outPoly, vtkIdType startv, vtkIdType endv)
Backtrace the shortest path.
list of point or cell ids
Definition vtkIdList.h:135
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 3D points
Definition vtkPoints.h:140
concrete dataset represents vertices, lines, polygons, and triangle strips
record modification and/or execution time
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:363