VTK
dox/Common/DataModel/vtkGraphInternals.h
Go to the documentation of this file.
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 "vtkCommonDataModelModule.h" // For export macro
00031 #include "vtkGraph.h"
00032 
00033 #include <vtksys/stl/vector> // STL Header
00034 #include <vtksys/stl/map>    // STL Header
00035 
00036 //----------------------------------------------------------------------------
00037 // class vtkVertexAdjacencyList
00038 //----------------------------------------------------------------------------
00039 //BTX
00040 class vtkVertexAdjacencyList
00041 {
00042 public:
00043   vtksys_stl::vector<vtkInEdgeType> InEdges;
00044   vtksys_stl::vector<vtkOutEdgeType> OutEdges;
00045 };
00046 //ETX
00047 
00048 //----------------------------------------------------------------------------
00049 // class vtkGraphInternals
00050 //----------------------------------------------------------------------------
00051 class VTKCOMMONDATAMODEL_EXPORT vtkGraphInternals : public vtkObject
00052 {
00053 public:
00054   static vtkGraphInternals *New();
00055   //BTX
00056   vtkTypeMacro(vtkGraphInternals, vtkObject);
00057   vtksys_stl::vector<vtkVertexAdjacencyList> Adjacency;
00058   //ETX
00059   vtkIdType NumberOfEdges;
00060 
00061   vtkIdType LastRemoteEdgeId;
00062   vtkIdType LastRemoteEdgeSource;
00063   vtkIdType LastRemoteEdgeTarget;
00064 
00065   // Whether we have used pedigree IDs to refer to the vertices of the
00066   // graph, e.g., to add edges or vertices. In a distributed graph,
00067   // the pedigree-id interface is mutually exclusive with the
00068   // no-argument AddVertex() function in vtkMutableUndirectedGraph and
00069   // vtkMutableDirectedGraph.
00070   bool UsingPedigreeIds;
00071 
00072   //BTX
00074   void RemoveEdgeFromOutList(vtkIdType e, vtksys_stl::vector<vtkOutEdgeType>& outEdges);
00075 
00077   void RemoveEdgeFromInList(vtkIdType e, vtksys_stl::vector<vtkInEdgeType>& inEdges);
00078 
00080   void ReplaceEdgeFromOutList(vtkIdType from, vtkIdType to, vtksys_stl::vector<vtkOutEdgeType>& outEdges);
00081 
00083 
00084   void ReplaceEdgeFromInList(vtkIdType from, vtkIdType to, vtksys_stl::vector<vtkInEdgeType>& inEdges);
00085   //ETX
00087 
00088 protected:
00089   vtkGraphInternals();
00090   ~vtkGraphInternals();
00091 
00092 private:
00093   vtkGraphInternals(const vtkGraphInternals&);  // Not implemented.
00094   void operator=(const vtkGraphInternals&);  // Not implemented.
00095 };
00096 
00097 #endif // __vtkGraphInternals_h
00098 
00099 // VTK-HeaderTest-Exclude: vtkGraphInternals.h