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 00062 vtkIdType AddVertex(); 00063 00077 vtkIdType AddVertex(vtkVariantArray *propertyArr); 00078 00079 //BTX 00081 00091 vtkIdType AddVertex(const vtkVariant& pedigreeId); 00092 //ETX 00094 00099 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v); 00100 //ETX 00101 00103 00110 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, 00111 vtkVariantArray *propertyArr); 00113 //ETX 00114 00115 //BTX 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); 00150 //ETX 00152 00156 void LazyAddVertex(); 00157 00166 void LazyAddVertex(vtkVariantArray *propertyArr); 00167 00168 //BTX 00174 void LazyAddVertex(const vtkVariant& pedigreeId); 00175 00182 void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr = 0); 00183 00185 00192 void LazyAddEdge(const vtkVariant& u, vtkIdType v, 00193 vtkVariantArray *propertyArr = 0); 00195 00197 00203 void LazyAddEdge(vtkIdType u, const vtkVariant& v, 00204 vtkVariantArray *propertyArr = 0); 00206 00208 00214 void LazyAddEdge(const vtkVariant& u, 00215 const vtkVariant& v, 00216 vtkVariantArray *propertyArr = 0); 00217 //ETX 00219 00225 vtkGraphEdge *AddGraphEdge(vtkIdType u, vtkIdType v); 00226 00228 00234 vtkIdType AddChild(vtkIdType parent, 00235 vtkVariantArray *propertyArr); 00236 vtkIdType AddChild(vtkIdType parent) 00237 { return this->AddChild(parent, 0); } 00239 00243 void RemoveVertex(vtkIdType v); 00244 00247 void RemoveEdge(vtkIdType e); 00248 00251 void RemoveVertices(vtkIdTypeArray* arr); 00252 00254 void RemoveEdges(vtkIdTypeArray* arr); 00255 00256 protected: 00257 vtkMutableDirectedGraph(); 00258 ~vtkMutableDirectedGraph(); 00259 00261 vtkGraphEdge *GraphEdge; 00262 00263 private: 00264 vtkMutableDirectedGraph(const vtkMutableDirectedGraph&); // Not implemented. 00265 void operator=(const vtkMutableDirectedGraph&); // Not implemented. 00266 }; 00267 00268 #endif