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 "vtkCommonDataModelModule.h" // For export macro 00044 #include "vtkDirectedGraph.h" 00045 00046 class vtkEdgeListIterator; 00047 class vtkGraphEdge; 00048 class vtkVariant; 00049 00050 class VTKCOMMONDATAMODEL_EXPORT vtkMutableDirectedGraph : public vtkDirectedGraph 00051 { 00052 public: 00053 static vtkMutableDirectedGraph *New(); 00054 vtkTypeMacro(vtkMutableDirectedGraph, vtkDirectedGraph); 00055 void PrintSelf(ostream& os, vtkIndent indent); 00056 00065 virtual vtkIdType SetNumberOfVertices( vtkIdType numVerts ); 00066 00073 vtkIdType AddVertex(); 00074 00088 vtkIdType AddVertex(vtkVariantArray *propertyArr); 00089 00100 vtkIdType AddVertex(const vtkVariant& pedigreeId); 00101 00102 //BTX 00104 00108 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v); 00109 //ETX 00111 00112 //BTX 00114 00121 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v, 00122 vtkVariantArray *propertyArr); 00123 //ETX 00125 00126 //BTX 00128 00135 vtkEdgeType AddEdge(const vtkVariant& u, vtkIdType v, 00136 vtkVariantArray *propertyArr = 0); 00138 00140 00147 vtkEdgeType AddEdge(vtkIdType u, const vtkVariant& v, 00148 vtkVariantArray *propertyArr = 0); 00150 00152 00158 vtkEdgeType AddEdge(const vtkVariant& u, 00159 const vtkVariant& v, 00160 vtkVariantArray *propertyArr = 0); 00161 //ETX 00163 00167 void LazyAddVertex(); 00168 00177 void LazyAddVertex(vtkVariantArray *propertyArr); 00178 00184 void LazyAddVertex(const vtkVariant& pedigreeId); 00185 00192 void LazyAddEdge(vtkIdType u, vtkIdType v, vtkVariantArray *propertyArr = 0); 00193 00195 00202 void LazyAddEdge(const vtkVariant& u, vtkIdType v, 00203 vtkVariantArray *propertyArr = 0); 00205 00207 00213 void LazyAddEdge(vtkIdType u, const vtkVariant& v, 00214 vtkVariantArray *propertyArr = 0); 00216 00218 00224 void LazyAddEdge(const vtkVariant& u, 00225 const vtkVariant& v, 00226 vtkVariantArray *propertyArr = 0); 00228 00234 vtkGraphEdge *AddGraphEdge(vtkIdType u, vtkIdType v); 00235 00237 00243 vtkIdType AddChild(vtkIdType parent, 00244 vtkVariantArray *propertyArr); 00245 vtkIdType AddChild(vtkIdType parent) 00246 { return this->AddChild(parent, 0); } 00248 00252 void RemoveVertex(vtkIdType v); 00253 00256 void RemoveEdge(vtkIdType e); 00257 00260 void RemoveVertices(vtkIdTypeArray* arr); 00261 00263 void RemoveEdges(vtkIdTypeArray* arr); 00264 00265 protected: 00266 vtkMutableDirectedGraph(); 00267 ~vtkMutableDirectedGraph(); 00268 00270 vtkGraphEdge *GraphEdge; 00271 00272 private: 00273 vtkMutableDirectedGraph(const vtkMutableDirectedGraph&); // Not implemented. 00274 void operator=(const vtkMutableDirectedGraph&); // Not implemented. 00275 }; 00276 00277 #endif