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 double GetGeodesicLength() { return 0.0; }
00095 
00097   virtual void GetCumulativeWeights(vtkDoubleArray *weights);
00098 
00099 protected:
00100   vtkDijkstraGraphGeodesicPath();
00101   ~vtkDijkstraGraphGeodesicPath();
00102 
00103   virtual int RequestData(vtkInformation *, vtkInformationVector **,
00104                           vtkInformationVector *);
00105 
00106   // Build a graph description of the input.
00107   virtual void BuildAdjacency( vtkDataSet *inData );
00108 
00109   vtkTimeStamp AdjacencyBuildTime;
00110 
00111   // The fixed cost going from vertex u to v.
00112   virtual double CalculateStaticEdgeCost( vtkDataSet *inData, vtkIdType u, vtkIdType v);
00113 
00114   // The cost going from vertex u to v that may depend on one or more vertices
00115   //that precede u.
00116   virtual double CalculateDynamicEdgeCost( vtkDataSet *, vtkIdType , vtkIdType )
00117   { return 0.0; }
00118 
00119   void Initialize( vtkDataSet *inData );
00120 
00121   void Reset();
00122 
00123   // Calculate shortest path from vertex startv to vertex endv.
00124   virtual void ShortestPath( vtkDataSet *inData, int startv, int endv );
00125 
00126   // Relax edge u,v with weight w.
00127   void Relax(const int& u, const int& v, const double& w);
00128 
00129   // Backtrace the shortest path
00130   void TraceShortestPath( vtkDataSet* inData, vtkPolyData* outPoly,
00131                vtkIdType startv, vtkIdType endv);
00132 
00133   // The number of vertices.
00134   int NumberOfVertices;
00135 
00136   // The vertex ids on the shortest path.
00137   vtkIdList *IdList;
00138 
00139   //Internalized STL containers.
00140   vtkDijkstraGraphInternals *Internals;
00141 
00142   int StopWhenEndReached;
00143   int UseScalarWeights;
00144   int RepelPathFromVertices;
00145 
00146   vtkPoints* RepelVertices;
00147 
00148 private:
00149   vtkDijkstraGraphGeodesicPath(const vtkDijkstraGraphGeodesicPath&);  // Not implemented.
00150   void operator=(const vtkDijkstraGraphGeodesicPath&);  // Not implemented.
00151 
00152 };
00153 
00154 #endif
00155