VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkMutableUndirectedGraph.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 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00036 #ifndef __vtkMutableUndirectedGraph_h 00037 #define __vtkMutableUndirectedGraph_h 00038 00039 #include "vtkUndirectedGraph.h" 00040 00041 class vtkEdgeListIterator; 00042 class vtkGraphEdge; 00043 00044 class VTK_FILTERING_EXPORT vtkMutableUndirectedGraph : public vtkUndirectedGraph 00045 { 00046 public: 00047 static vtkMutableUndirectedGraph *New(); 00048 vtkTypeMacro(vtkMutableUndirectedGraph, vtkUndirectedGraph); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00050 00060 virtual vtkIdType SetNumberOfVertices( vtkIdType numVerts ); 00061 00068 vtkIdType AddVertex(); 00069 00083 vtkIdType AddVertex(vtkVariantArray *propertyArr); 00084 00095 vtkIdType AddVertex(const vtkVariant& pedigreeId); 00096 00097 //BTX 00102 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v); 00103 00105 00112 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, 00113 vtkVariantArray *propertyArr); 00115 00117 00124 vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, 00125 vtkVariantArray *propertyArr = 0); 00127 00129 00136 vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, 00137 vtkVariantArray *propertyArr = 0); 00139 00141 00147 vtkEdgeType AddEdge(const vtkVariant& u, 00148 const vtkVariant& v, 00149 vtkVariantArray *propertyArr = 0); 00151 00152 //ETX 00153 00157 void LazyAddVertex(); 00158 00167 void LazyAddVertex(vtkVariantArray *propertyArr); 00168 00174 void LazyAddVertex(const vtkVariant& pedigreeId); 00175 00180 void LazyAddEdge(vtkIdType u, vtkIdType v); 00181 00188 void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr); 00189 00191 00198 void LazyAddEdge(const vtkVariant& u, vtkIdType v, 00199 vtkVariantArray *propertyArr = 0); 00201 00203 00210 void LazyAddEdge(vtkIdType u, const vtkVariant& v, 00211 vtkVariantArray *propertyArr = 0); 00213 00215 00221 void LazyAddEdge(const vtkVariant& u, 00222 const vtkVariant& v, 00223 vtkVariantArray *propertyArr = 0); 00225 00231 vtkGraphEdge *AddGraphEdge(vtkIdType u, vtkIdType v); 00232 00236 void RemoveVertex(vtkIdType v); 00237 00240 void RemoveEdge(vtkIdType e); 00241 00244 void RemoveVertices(vtkIdTypeArray* arr); 00245 00247 void RemoveEdges(vtkIdTypeArray* arr); 00248 00249 protected: 00250 vtkMutableUndirectedGraph(); 00251 ~vtkMutableUndirectedGraph(); 00252 00254 vtkGraphEdge *GraphEdge; 00255 00256 private: 00257 vtkMutableUndirectedGraph(const vtkMutableUndirectedGraph&); // Not implemented. 00258 void operator=(const vtkMutableUndirectedGraph&); // Not implemented. 00259 }; 00260 00261 #endif