VTK  9.2.6
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 =========================================================================*/
42 #ifndef vtkDijkstraGraphGeodesicPath_h
43 #define vtkDijkstraGraphGeodesicPath_h
44 
45 #include "vtkFiltersModelingModule.h" // For export macro
46 #include "vtkGraphGeodesicPath.h"
47 
49 class vtkIdList;
50 
51 class VTKFILTERSMODELING_EXPORT vtkDijkstraGraphGeodesicPath : public vtkGraphGeodesicPath
52 {
53 public:
58 
60 
64  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
68 
71  vtkGetObjectMacro(IdList, vtkIdList);
73 
75 
79  vtkSetMacro(StopWhenEndReached, vtkTypeBool);
80  vtkGetMacro(StopWhenEndReached, vtkTypeBool);
81  vtkBooleanMacro(StopWhenEndReached, vtkTypeBool);
83 
85 
88  vtkSetMacro(UseScalarWeights, vtkTypeBool);
89  vtkGetMacro(UseScalarWeights, vtkTypeBool);
90  vtkBooleanMacro(UseScalarWeights, vtkTypeBool);
92 
94 
97  vtkSetMacro(RepelPathFromVertices, vtkTypeBool);
98  vtkGetMacro(RepelPathFromVertices, vtkTypeBool);
99  vtkBooleanMacro(RepelPathFromVertices, vtkTypeBool);
101 
103 
106  virtual void SetRepelVertices(vtkPoints*);
107  vtkGetObjectMacro(RepelVertices, vtkPoints);
109 
113  virtual void GetCumulativeWeights(vtkDoubleArray* weights);
114 
115 protected:
117  ~vtkDijkstraGraphGeodesicPath() override;
118 
120 
121  // Build a graph description of the input.
122  virtual void BuildAdjacency(vtkDataSet* inData);
123 
125 
126  // The fixed cost going from vertex u to v.
127  virtual double CalculateStaticEdgeCost(vtkDataSet* inData, vtkIdType u, vtkIdType v);
128 
129  // The cost going from vertex u to v that may depend on one or more vertices
130  // that precede u.
131  virtual double CalculateDynamicEdgeCost(vtkDataSet*, vtkIdType, vtkIdType) { return 0.0; }
132 
133  void Initialize(vtkDataSet* inData);
134 
135  void Reset();
136 
137  // Calculate shortest path from vertex startv to vertex endv.
138  virtual void ShortestPath(vtkDataSet* inData, int startv, int endv);
139 
140  // Relax edge u,v with weight w.
141  void Relax(const int& u, const int& v, const double& w);
142 
143  // Backtrace the shortest path
144  void TraceShortestPath(
145  vtkDataSet* inData, vtkPolyData* outPoly, vtkIdType startv, vtkIdType endv);
146 
147  // The number of vertices.
149 
150  // The vertex ids on the shortest path.
152 
153  // Internalized STL containers.
155 
159 
161 
162 private:
164  void operator=(const vtkDijkstraGraphGeodesicPath&) = delete;
165 };
166 
167 #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:62
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
record modification and/or execution time
Definition: vtkTimeStamp.h:35
int vtkIdType
Definition: vtkType.h:332
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
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:39
vtkDijkstraGraphInternals * Internals
Helper class due to PIMPL excess.
list of point or cell ids
Definition: vtkIdList.h:33
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:39