VTK  9.0.1
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 =========================================================================*/
39 #ifndef vtkDijkstraGraphGeodesicPath_h
40 #define vtkDijkstraGraphGeodesicPath_h
41 
42 #include "vtkFiltersModelingModule.h" // For export macro
43 #include "vtkGraphGeodesicPath.h"
44 
46 class vtkIdList;
47 
48 class VTKFILTERSMODELING_EXPORT vtkDijkstraGraphGeodesicPath : public vtkGraphGeodesicPath
49 {
50 public:
55 
57 
61  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
65 
68  vtkGetObjectMacro(IdList, vtkIdList);
70 
72 
76  vtkSetMacro(StopWhenEndReached, vtkTypeBool);
77  vtkGetMacro(StopWhenEndReached, vtkTypeBool);
78  vtkBooleanMacro(StopWhenEndReached, vtkTypeBool);
80 
82 
85  vtkSetMacro(UseScalarWeights, vtkTypeBool);
86  vtkGetMacro(UseScalarWeights, vtkTypeBool);
87  vtkBooleanMacro(UseScalarWeights, vtkTypeBool);
89 
91 
94  vtkSetMacro(RepelPathFromVertices, vtkTypeBool);
95  vtkGetMacro(RepelPathFromVertices, vtkTypeBool);
96  vtkBooleanMacro(RepelPathFromVertices, vtkTypeBool);
98 
100 
103  virtual void SetRepelVertices(vtkPoints*);
104  vtkGetObjectMacro(RepelVertices, vtkPoints);
106 
110  virtual void GetCumulativeWeights(vtkDoubleArray* weights);
111 
112 protected:
114  ~vtkDijkstraGraphGeodesicPath() override;
115 
117 
118  // Build a graph description of the input.
119  virtual void BuildAdjacency(vtkDataSet* inData);
120 
122 
123  // The fixed cost going from vertex u to v.
124  virtual double CalculateStaticEdgeCost(vtkDataSet* inData, vtkIdType u, vtkIdType v);
125 
126  // The cost going from vertex u to v that may depend on one or more vertices
127  // that precede u.
128  virtual double CalculateDynamicEdgeCost(vtkDataSet*, vtkIdType, vtkIdType) { return 0.0; }
129 
130  void Initialize(vtkDataSet* inData);
131 
132  void Reset();
133 
134  // Calculate shortest path from vertex startv to vertex endv.
135  virtual void ShortestPath(vtkDataSet* inData, int startv, int endv);
136 
137  // Relax edge u,v with weight w.
138  void Relax(const int& u, const int& v, const double& w);
139 
140  // Backtrace the shortest path
141  void TraceShortestPath(
142  vtkDataSet* inData, vtkPolyData* outPoly, vtkIdType startv, vtkIdType endv);
143 
144  // The number of vertices.
146 
147  // The vertex ids on the shortest path.
149 
150  // Internalized STL containers.
152 
156 
158 
159 private:
161  void operator=(const vtkDijkstraGraphGeodesicPath&) = delete;
162 };
163 
164 #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:56
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
record modification and/or execution time
Definition: vtkTimeStamp.h:32
int vtkIdType
Definition: vtkType.h:338
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
Dijkstra algorithm to compute the graph geodesic.
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkDijkstraGraphInternals * Internals
Helper class due to PIMPL excess.
list of point or cell ids
Definition: vtkIdList.h:30
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:33