VTK  9.3.0
vtkAttributeClustering2DLayoutStrategy.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
17#ifndef vtkAttributeClustering2DLayoutStrategy_h
18#define vtkAttributeClustering2DLayoutStrategy_h
19
21#include "vtkInfovisLayoutModule.h" // For export macro
22
23#include "vtkSmartPointer.h" // Required for smart pointer internal ivars.
24
25VTK_ABI_NAMESPACE_BEGIN
26class vtkFastSplatter;
27class vtkImageData;
28class vtkIntArray;
29class vtkFloatArray;
30
32{
33public:
35
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
40
44 vtkGetStringMacro(VertexAttribute);
45 void SetVertexAttribute(const char*);
47
49
54 vtkSetClampMacro(RandomSeed, int, 0, VTK_INT_MAX);
55 vtkGetMacro(RandomSeed, int);
57
59
67 vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_INT_MAX);
68 vtkGetMacro(MaxNumberOfIterations, int);
70
72
79 vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_INT_MAX);
80 vtkGetMacro(IterationsPerLayout, int);
82
84
90 vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
91 vtkGetMacro(InitialTemperature, float);
93
95
103 vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
104 vtkGetMacro(CoolDownRate, double);
106
108
112 vtkSetMacro(RestDistance, float);
113 vtkGetMacro(RestDistance, float);
115
120 void Initialize() override;
121
129 void Layout() override;
130
135 int IsLayoutComplete() override { return this->LayoutComplete; }
136
137protected:
140
141 int MaxNumberOfIterations; // Maximum number of iterations.
143 float CoolDownRate; // Cool-down rate. Note: Higher # = Slower rate.
144
145private:
146 // This class 'has a' vtkFastSplatter for the density grid
149 vtkSmartPointer<vtkFloatArray> RepulsionArray;
150 vtkSmartPointer<vtkFloatArray> AttractionArray;
151 vtkSmartPointer<vtkIntArray> EdgeCountArray;
152
153 int RandomSeed;
154 int IterationsPerLayout;
155 int TotalIterations;
156 int LayoutComplete;
157 float Temp;
158 float RestDistance;
159 float CuttingThreshold;
160 char* VertexAttribute;
161
162 // Private helper methods
163 void GenerateCircularSplat(vtkImageData* splat, int x, int y);
164 void GenerateGaussianSplat(vtkImageData* splat, int x, int y);
165 void ResolveCoincidentVertices();
166
167 class Internals;
168 Internals* Implementation;
169
171 void operator=(const vtkAttributeClustering2DLayoutStrategy&) = delete;
172};
173
174VTK_ABI_NAMESPACE_END
175#endif
static vtkAttributeClustering2DLayoutStrategy * New()
void SetVertexAttribute(const char *)
The name of the array on the vertices, whose values will be used for determining clusters.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Layout() override
This is the layout method where the graph that was set in SetGraph() is laid out.
int IsLayoutComplete() override
I'm an iterative layout so this method lets the caller know if I'm done laying out the graph.
void Initialize() override
This strategy sets up some data structures for faster processing of each Layout() call.
A splatter optimized for splatting single kernels.
dynamic, self-adjusting array of float
abstract superclass for all graph layout strategies
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:29
dynamic, self-adjusting array of int
Definition vtkIntArray.h:35
Hold a reference to a vtkObjectBase instance.
#define VTK_DOUBLE_MAX
Definition vtkType.h:154
#define VTK_INT_MAX
Definition vtkType.h:144
#define VTK_FLOAT_MAX
Definition vtkType.h:152