00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkMutableGraphHelper.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 (c) Sandia Corporation 00017 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. 00018 ----------------------------------------------------------------------------*/ 00033 #ifndef __vtkMutableGraphHelper_h 00034 #define __vtkMutableGraphHelper_h 00035 00036 #include "vtkObject.h" 00037 #include "vtkGraph.h" // For vtkEdgeType 00038 00039 class vtkDataSetAttributes; 00040 class vtkGraph; 00041 class vtkGraphEdge; 00042 class vtkMutableDirectedGraph; 00043 class vtkMutableUndirectedGraph; 00044 00045 class VTK_INFOVIS_EXPORT vtkMutableGraphHelper : public vtkObject 00046 { 00047 public: 00048 static vtkMutableGraphHelper *New(); 00049 vtkTypeMacro(vtkMutableGraphHelper, vtkObject); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00051 00053 00056 void SetGraph(vtkGraph* g); 00057 vtkGraph* GetGraph(); 00059 00061 00062 vtkEdgeType AddEdge(vtkIdType u, vtkIdType v); 00063 //ETX 00064 vtkGraphEdge* AddGraphEdge(vtkIdType u, vtkIdType v); 00066 00068 vtkIdType AddVertex(); 00069 00071 void RemoveVertex(vtkIdType v); 00072 00074 void RemoveVertices(vtkIdTypeArray* verts); 00075 00077 void RemoveEdge(vtkIdType e); 00078 00080 void RemoveEdges(vtkIdTypeArray* edges); 00081 00082 protected: 00083 vtkMutableGraphHelper(); 00084 ~vtkMutableGraphHelper(); 00085 00086 vtkGetObjectMacro(InternalGraph, vtkGraph); 00087 void SetInternalGraph(vtkGraph* g); 00088 vtkGraph* InternalGraph; 00089 00090 vtkGraphEdge* GraphEdge; 00091 00092 vtkMutableDirectedGraph* DirectedGraph; 00093 vtkMutableUndirectedGraph* UndirectedGraph; 00094 00095 private: 00096 vtkMutableGraphHelper(const vtkMutableGraphHelper&); // Not implemented. 00097 void operator=(const vtkMutableGraphHelper&); // Not implemented. 00098 }; 00099 00100 #endif