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 "vtkCommonDataModelModule.h" // For export macro 00040 #include "vtkUndirectedGraph.h" 00041 00042 class vtkEdgeListIterator; 00043 class vtkGraphEdge; 00044 00045 class VTKCOMMONDATAMODEL_EXPORT vtkMutableUndirectedGraph : public vtkUndirectedGraph 00046 { 00047 public: 00048 static vtkMutableUndirectedGraph *New(); 00049 vtkTypeMacro(vtkMutableUndirectedGraph, vtkUndirectedGraph); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00051 00061 virtual vtkIdType SetNumberOfVertices( vtkIdType numVerts ); 00062 00069 vtkIdType AddVertex(); 00070 00084 vtkIdType AddVertex(vtkVariantArray *propertyArr); 00085 00096 vtkIdType AddVertex(const vtkVariant& pedigreeId); 00097 00098 //BTX 00103 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v); 00104 00106 00113 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, 00114 vtkVariantArray *propertyArr); 00116 00118 00125 vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, 00126 vtkVariantArray *propertyArr = 0); 00128 00130 00137 vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, 00138 vtkVariantArray *propertyArr = 0); 00140 00142 00148 vtkEdgeType AddEdge(const vtkVariant& u, 00149 const vtkVariant& v, 00150 vtkVariantArray *propertyArr = 0); 00152 00153 //ETX 00154 00158 void LazyAddVertex(); 00159 00168 void LazyAddVertex(vtkVariantArray *propertyArr); 00169 00175 void LazyAddVertex(const vtkVariant& pedigreeId); 00176 00181 void LazyAddEdge(vtkIdType u, vtkIdType v); 00182 00189 void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr); 00190 00192 00199 void LazyAddEdge(const vtkVariant& u, vtkIdType v, 00200 vtkVariantArray *propertyArr = 0); 00202 00204 00211 void LazyAddEdge(vtkIdType u, const vtkVariant& v, 00212 vtkVariantArray *propertyArr = 0); 00214 00216 00222 void LazyAddEdge(const vtkVariant& u, 00223 const vtkVariant& v, 00224 vtkVariantArray *propertyArr = 0); 00226 00232 vtkGraphEdge *AddGraphEdge(vtkIdType u, vtkIdType v); 00233 00237 void RemoveVertex(vtkIdType v); 00238 00241 void RemoveEdge(vtkIdType e); 00242 00245 void RemoveVertices(vtkIdTypeArray* arr); 00246 00248 void RemoveEdges(vtkIdTypeArray* arr); 00249 00250 protected: 00251 vtkMutableUndirectedGraph(); 00252 ~vtkMutableUndirectedGraph(); 00253 00255 vtkGraphEdge *GraphEdge; 00256 00257 private: 00258 vtkMutableUndirectedGraph(const vtkMutableUndirectedGraph&); // Not implemented. 00259 void operator=(const vtkMutableUndirectedGraph&); // Not implemented. 00260 }; 00261 00262 #endif