VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkMutableDirectedGraph.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 -------------------------------------------------------------------------*/ 00040 #ifndef __vtkMutableDirectedGraph_h 00041 #define __vtkMutableDirectedGraph_h 00042 00043 #include "vtkDirectedGraph.h" 00044 00045 class vtkEdgeListIterator; 00046 class vtkGraphEdge; 00047 class vtkVariant; 00048 00049 class VTK_FILTERING_EXPORT vtkMutableDirectedGraph : public vtkDirectedGraph 00050 { 00051 public: 00052 static vtkMutableDirectedGraph *New(); 00053 vtkTypeMacro(vtkMutableDirectedGraph, vtkDirectedGraph); 00054 void PrintSelf(ostream& os, vtkIndent indent); 00055 00064 virtual vtkIdType SetNumberOfVertices( vtkIdType numVerts ); 00065 00072 vtkIdType AddVertex(); 00073 00087 vtkIdType AddVertex(vtkVariantArray *propertyArr); 00088 00099 vtkIdType AddVertex(const vtkVariant& pedigreeId); 00100 00101 //BTX 00103 00107 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v); 00108 //ETX 00110 00111 //BTX 00113 00120 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, 00121 vtkVariantArray *propertyArr); 00122 //ETX 00124 00125 //BTX 00127 00134 vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, 00135 vtkVariantArray *propertyArr = 0); 00137 00139 00146 vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, 00147 vtkVariantArray *propertyArr = 0); 00149 00151 00157 vtkEdgeType AddEdge(const vtkVariant& u, 00158 const vtkVariant& v, 00159 vtkVariantArray *propertyArr = 0); 00160 //ETX 00162 00166 void LazyAddVertex(); 00167 00176 void LazyAddVertex(vtkVariantArray *propertyArr); 00177 00183 void LazyAddVertex(const vtkVariant& pedigreeId); 00184 00191 void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr = 0); 00192 00194 00201 void LazyAddEdge(const vtkVariant& u, vtkIdType v, 00202 vtkVariantArray *propertyArr = 0); 00204 00206 00212 void LazyAddEdge(vtkIdType u, const vtkVariant& v, 00213 vtkVariantArray *propertyArr = 0); 00215 00217 00223 void LazyAddEdge(const vtkVariant& u, 00224 const vtkVariant& v, 00225 vtkVariantArray *propertyArr = 0); 00227 00233 vtkGraphEdge *AddGraphEdge(vtkIdType u, vtkIdType v); 00234 00236 00242 vtkIdType AddChild(vtkIdType parent, 00243 vtkVariantArray *propertyArr); 00244 vtkIdType AddChild(vtkIdType parent) 00245 { return this->AddChild(parent, 0); } 00247 00251 void RemoveVertex(vtkIdType v); 00252 00255 void RemoveEdge(vtkIdType e); 00256 00259 void RemoveVertices(vtkIdTypeArray* arr); 00260 00262 void RemoveEdges(vtkIdTypeArray* arr); 00263 00264 protected: 00265 vtkMutableDirectedGraph(); 00266 ~vtkMutableDirectedGraph(); 00267 00269 vtkGraphEdge *GraphEdge; 00270 00271 private: 00272 vtkMutableDirectedGraph(const vtkMutableDirectedGraph&); // Not implemented. 00273 void operator=(const vtkMutableDirectedGraph&); // Not implemented. 00274 }; 00275 00276 #endif