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 00057 vtkIdType AddVertex(); 00058 00072 vtkIdType AddVertex(vtkVariantArray *propertyArr); 00073 00074 //BTX 00075 00086 vtkIdType AddVertex(const vtkVariant& pedigreeId); 00087 00092 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v); 00093 00095 00102 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, 00103 vtkVariantArray *propertyArr); 00105 00107 00114 vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, 00115 vtkVariantArray *propertyArr = 0); 00117 00119 00126 vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, 00127 vtkVariantArray *propertyArr = 0); 00129 00131 00137 vtkEdgeType AddEdge(const vtkVariant& u, 00138 const vtkVariant& v, 00139 vtkVariantArray *propertyArr = 0); 00141 00142 //ETX 00143 00147 void LazyAddVertex(); 00148 00157 void LazyAddVertex(vtkVariantArray *propertyArr); 00158 00159 //BTX 00161 00166 void LazyAddVertex(const vtkVariant& pedigreeId); 00167 //ETX 00169 00174 void LazyAddEdge(vtkIdType u, vtkIdType v); 00175 00182 void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr); 00183 00184 //BTX 00186 00193 void LazyAddEdge(const vtkVariant& u, vtkIdType v, 00194 vtkVariantArray *propertyArr = 0); 00196 00198 00205 void LazyAddEdge(vtkIdType u, const vtkVariant& v, 00206 vtkVariantArray *propertyArr = 0); 00208 00210 00216 void LazyAddEdge(const vtkVariant& u, 00217 const vtkVariant& v, 00218 vtkVariantArray *propertyArr = 0); 00219 //ETX 00221 00227 vtkGraphEdge *AddGraphEdge(vtkIdType u, vtkIdType v); 00228 00232 void RemoveVertex(vtkIdType v); 00233 00236 void RemoveEdge(vtkIdType e); 00237 00240 void RemoveVertices(vtkIdTypeArray* arr); 00241 00243 void RemoveEdges(vtkIdTypeArray* arr); 00244 00245 protected: 00246 vtkMutableUndirectedGraph(); 00247 ~vtkMutableUndirectedGraph(); 00248 00250 vtkGraphEdge *GraphEdge; 00251 00252 private: 00253 vtkMutableUndirectedGraph(const vtkMutableUndirectedGraph&); // Not implemented. 00254 void operator=(const vtkMutableUndirectedGraph&); // Not implemented. 00255 }; 00256 00257 #endif