VTK
dox/Infovis/vtkMutableGraphHelper.h
Go to the documentation of this file.
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 
00060 //BTX
00062 
00063   vtkEdgeType AddEdge(vtkIdType u, vtkIdType v);
00064 //ETX
00065   vtkGraphEdge* AddGraphEdge(vtkIdType u, vtkIdType v);
00067 
00069   vtkIdType AddVertex();
00070 
00072   void RemoveVertex(vtkIdType v);
00073 
00075   void RemoveVertices(vtkIdTypeArray* verts);
00076 
00078   void RemoveEdge(vtkIdType e);
00079 
00081   void RemoveEdges(vtkIdTypeArray* edges);
00082 
00083 protected:
00084   vtkMutableGraphHelper();
00085   ~vtkMutableGraphHelper();
00086 
00087   vtkGetObjectMacro(InternalGraph, vtkGraph);
00088   void SetInternalGraph(vtkGraph* g);
00089   vtkGraph* InternalGraph;
00090 
00091   vtkGraphEdge* GraphEdge;
00092 
00093   vtkMutableDirectedGraph* DirectedGraph;
00094   vtkMutableUndirectedGraph* UndirectedGraph;
00095 
00096 private:
00097   vtkMutableGraphHelper(const vtkMutableGraphHelper&);  // Not implemented.
00098   void operator=(const vtkMutableGraphHelper&);  // Not implemented.
00099 };
00100 
00101 #endif