00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGraphInternals.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 =========================================================================*/ 00015 /*---------------------------------------------------------------------------- 00016 Copyright (c) Sandia Corporation 00017 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. 00018 ----------------------------------------------------------------------------*/ 00027 #ifndef __vtkGraphInternals_h 00028 #define __vtkGraphInternals_h 00029 00030 #include "vtkGraph.h" 00031 00032 #include <vtksys/stl/vector> // STL Header 00033 #include <vtksys/stl/map> // STL Header 00034 00035 //---------------------------------------------------------------------------- 00036 // class vtkVertexAdjacencyList 00037 //---------------------------------------------------------------------------- 00038 //BTX 00039 class vtkVertexAdjacencyList 00040 { 00041 public: 00042 vtksys_stl::vector<vtkInEdgeType> InEdges; 00043 vtksys_stl::vector<vtkOutEdgeType> OutEdges; 00044 }; 00045 //ETX 00046 00047 //---------------------------------------------------------------------------- 00048 // class vtkGraphInternals 00049 //---------------------------------------------------------------------------- 00050 class VTK_FILTERING_EXPORT vtkGraphInternals : public vtkObject 00051 { 00052 public: 00053 static vtkGraphInternals *New(); 00054 //BTX 00055 vtkTypeMacro(vtkGraphInternals, vtkObject); 00056 vtksys_stl::vector<vtkVertexAdjacencyList> Adjacency; 00057 //ETX 00058 vtkIdType NumberOfEdges; 00059 00060 vtkIdType LastRemoteEdgeId; 00061 vtkIdType LastRemoteEdgeSource; 00062 vtkIdType LastRemoteEdgeTarget; 00063 00064 // Whether we have used pedigree IDs to refer to the vertices of the 00065 // graph, e.g., to add edges or vertices. In a distributed graph, 00066 // the pedigree-id interface is mutually exclusive with the 00067 // no-argument AddVertex() function in vtkMutableUndirectedGraph and 00068 // vtkMutableDirectedGraph. 00069 bool UsingPedigreeIds; 00070 00071 //BTX 00073 void RemoveEdgeFromOutList(vtkIdType e, vtksys_stl::vector<vtkOutEdgeType>& outEdges); 00074 00076 void RemoveEdgeFromInList(vtkIdType e, vtksys_stl::vector<vtkInEdgeType>& inEdges); 00077 00079 void ReplaceEdgeFromOutList(vtkIdType from, vtkIdType to, vtksys_stl::vector<vtkOutEdgeType>& outEdges); 00080 00082 00083 void ReplaceEdgeFromInList(vtkIdType from, vtkIdType to, vtksys_stl::vector<vtkInEdgeType>& inEdges); 00084 //ETX 00086 00087 protected: 00088 vtkGraphInternals(); 00089 ~vtkGraphInternals(); 00090 00091 private: 00092 vtkGraphInternals(const vtkGraphInternals&); // Not implemented. 00093 void operator=(const vtkGraphInternals&); // Not implemented. 00094 }; 00095 00096 #endif // __vtkGraphInternals_h 00097