VTK
dox/Filters/Modeling/vtkDijkstraGraphGeodesicPath.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkDijkstraGraphGeodesicPath.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00037 #ifndef __vtkDijkstraGraphGeodesicPath_h
00038 #define __vtkDijkstraGraphGeodesicPath_h
00039 
00040 #include "vtkFiltersModelingModule.h" // For export macro
00041 #include "vtkGraphGeodesicPath.h"
00042 
00043 class vtkDijkstraGraphInternals;
00044 class vtkIdList;
00045 
00046 class VTKFILTERSMODELING_EXPORT vtkDijkstraGraphGeodesicPath :
00047                            public vtkGraphGeodesicPath
00048 {
00049 public:
00050 
00052   static vtkDijkstraGraphGeodesicPath *New();
00053 
00055 
00056   vtkTypeMacro(vtkDijkstraGraphGeodesicPath,vtkGraphGeodesicPath);
00057   void PrintSelf(ostream& os, vtkIndent indent);
00059 
00061 
00062   vtkGetObjectMacro(IdList, vtkIdList);
00064 
00066 
00068   vtkSetMacro(StopWhenEndReached, int);
00069   vtkGetMacro(StopWhenEndReached, int);
00070   vtkBooleanMacro(StopWhenEndReached, int);
00072 
00074 
00075   vtkSetMacro(UseScalarWeights, int);
00076   vtkGetMacro(UseScalarWeights, int);
00077   vtkBooleanMacro(UseScalarWeights, int);
00079 
00081 
00082   vtkSetMacro(RepelPathFromVertices, int);
00083   vtkGetMacro(RepelPathFromVertices, int);
00084   vtkBooleanMacro(RepelPathFromVertices, int);
00086 
00088 
00089   virtual void SetRepelVertices(vtkPoints*);
00090   vtkGetObjectMacro(RepelVertices, vtkPoints);
00092 
00094   virtual void GetCumulativeWeights(vtkDoubleArray *weights);
00095 
00096 protected:
00097   vtkDijkstraGraphGeodesicPath();
00098   ~vtkDijkstraGraphGeodesicPath();
00099 
00100   virtual int RequestData(vtkInformation *, vtkInformationVector **,
00101                           vtkInformationVector *);
00102 
00103   // Build a graph description of the input.
00104   virtual void BuildAdjacency( vtkDataSet *inData );
00105 
00106   vtkTimeStamp AdjacencyBuildTime;
00107 
00108   // The fixed cost going from vertex u to v.
00109   virtual double CalculateStaticEdgeCost( vtkDataSet *inData, vtkIdType u, vtkIdType v);
00110 
00111   // The cost going from vertex u to v that may depend on one or more vertices
00112   //that precede u.
00113   virtual double CalculateDynamicEdgeCost( vtkDataSet *, vtkIdType , vtkIdType )
00114   { return 0.0; }
00115 
00116   void Initialize( vtkDataSet *inData );
00117 
00118   void Reset();
00119 
00120   // Calculate shortest path from vertex startv to vertex endv.
00121   virtual void ShortestPath( vtkDataSet *inData, int startv, int endv );
00122 
00123   // Relax edge u,v with weight w.
00124   void Relax(const int& u, const int& v, const double& w);
00125 
00126   // Backtrace the shortest path
00127   void TraceShortestPath( vtkDataSet* inData, vtkPolyData* outPoly,
00128                vtkIdType startv, vtkIdType endv);
00129 
00130   // The number of vertices.
00131   int NumberOfVertices;
00132 
00133   // The vertex ids on the shortest path.
00134   vtkIdList *IdList;
00135 
00136   //Internalized STL containers.
00137   vtkDijkstraGraphInternals *Internals;
00138 
00139   int StopWhenEndReached;
00140   int UseScalarWeights;
00141   int RepelPathFromVertices;
00142 
00143   vtkPoints* RepelVertices;
00144 
00145 private:
00146   vtkDijkstraGraphGeodesicPath(const vtkDijkstraGraphGeodesicPath&);  // Not implemented.
00147   void operator=(const vtkDijkstraGraphGeodesicPath&);  // Not implemented.
00148 
00149 };
00150 
00151 #endif
00152