1 /*========================================================================= 2 3 Program: Visualization Toolkit 4 Module: vtkDirectedGraph.h 5 6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 7 All rights reserved. 8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 9 10 This software is distributed WITHOUT ANY WARRANTY; without even 11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 12 PURPOSE. See the above copyright notice for more information. 13 14 =========================================================================*/ 15 /*------------------------------------------------------------------------- 16 Copyright 2008 Sandia Corporation. 17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 18 the U.S. Government retains certain rights in this software. 19 -------------------------------------------------------------------------*/ 20 /** 21 * @class vtkDirectedGraph 22 * @brief A directed graph. 23 * 24 * 25 * vtkDirectedGraph is a collection of vertices along with a collection of 26 * directed edges (edges that have a source and target). ShallowCopy() 27 * and DeepCopy() (and CheckedShallowCopy(), CheckedDeepCopy()) 28 * accept instances of vtkTree and vtkMutableDirectedGraph. 29 * 30 * vtkDirectedGraph is read-only. To create an undirected graph, 31 * use an instance of vtkMutableDirectedGraph, then you may set the 32 * structure to a vtkDirectedGraph using ShallowCopy(). 33 * 34 * @sa 35 * vtkGraph vtkMutableDirectedGraph 36 */ 37 38 #ifndef vtkDirectedGraph_h 39 #define vtkDirectedGraph_h 40 41 #include "vtkCommonDataModelModule.h" // For export macro 42 #include "vtkGraph.h" 43 44 class VTKCOMMONDATAMODEL_EXPORT vtkDirectedGraph : public vtkGraph 45 { 46 public: 47 static vtkDirectedGraph* New(); 48 vtkTypeMacro(vtkDirectedGraph, vtkGraph); 49 void PrintSelf(ostream& os, vtkIndent indent) override; 50 51 /** 52 * Return what type of dataset this is. 53 */ GetDataObjectType()54 int GetDataObjectType() override { return VTK_DIRECTED_GRAPH; } 55 56 ///@{ 57 /** 58 * Retrieve a graph from an information vector. 59 */ 60 static vtkDirectedGraph* GetData(vtkInformation* info); 61 static vtkDirectedGraph* GetData(vtkInformationVector* v, int i = 0); 62 ///@} 63 64 /** 65 * Check the storage, and accept it if it is a valid 66 * undirected graph. This is public to allow 67 * the ToDirected/UndirectedGraph to work. 68 */ 69 bool IsStructureValid(vtkGraph* g) override; 70 71 protected: 72 vtkDirectedGraph(); 73 ~vtkDirectedGraph() override; 74 75 private: 76 vtkDirectedGraph(const vtkDirectedGraph&) = delete; 77 void operator=(const vtkDirectedGraph&) = delete; 78 }; 79 80 #endif 81