VTK  9.3.20240328
vtkGraphLayoutStrategy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
40 #ifndef vtkGraphLayoutStrategy_h
41 #define vtkGraphLayoutStrategy_h
42 
43 #include "vtkInfovisLayoutModule.h" // For export macro
44 #include "vtkObject.h"
45 
46 VTK_ABI_NAMESPACE_BEGIN
47 class vtkGraph;
48 
49 class VTKINFOVISLAYOUT_EXPORT vtkGraphLayoutStrategy : public vtkObject
50 {
51 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
58  virtual void SetGraph(vtkGraph* graph);
59 
65  virtual void Initialize() {}
66 
74  virtual void Layout() = 0;
75 
81  virtual int IsLayoutComplete() { return 1; }
82 
84 
87  virtual void SetWeightEdges(bool state);
88  vtkGetMacro(WeightEdges, bool);
90 
92 
95  virtual void SetEdgeWeightField(const char* field);
96  vtkGetStringMacro(EdgeWeightField);
98 
99 protected:
102 
106 
107 private:
109  void operator=(const vtkGraphLayoutStrategy&) = delete;
110 };
111 
112 VTK_ABI_NAMESPACE_END
113 #endif
abstract superclass for all graph layout strategies
virtual void SetWeightEdges(bool state)
Whether to use edge weights in the layout or not.
virtual void SetEdgeWeightField(const char *field)
Set/Get the field to use for the edge weights.
virtual void Layout()=0
This is the layout method where the graph that was set in SetGraph() is laid out.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkGraphLayoutStrategy() override
virtual int IsLayoutComplete()
If your concrete class is iterative than you should overload IsLayoutComplete() otherwise it simply r...
virtual void Initialize()
This method allows the layout strategy to do initialization of data structures or whatever else it mi...
virtual void SetGraph(vtkGraph *graph)
Setting the graph for the layout strategy.
Base class for graph data types.
Definition: vtkGraph.h:340
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
@ field
Definition: vtkX3D.h:177