VTK  9.3.20240327
vtkCirclePackLayout.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
32 #ifndef vtkCirclePackLayout_h
33 #define vtkCirclePackLayout_h
34 
35 #include "vtkInfovisLayoutModule.h" // For export macro
36 #include "vtkTreeAlgorithm.h"
37 
38 VTK_ABI_NAMESPACE_BEGIN
40 class vtkDoubleArray;
41 class vtkDataArray;
42 class vtkTree;
43 
44 class VTKINFOVISLAYOUT_EXPORT vtkCirclePackLayout : public vtkTreeAlgorithm
45 {
46 public:
48 
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
59  vtkGetStringMacro(CirclesFieldName);
60  vtkSetStringMacro(CirclesFieldName);
62 
67  virtual void SetSizeArrayName(const char* name)
68  {
70  }
71 
73 
76  vtkGetObjectMacro(LayoutStrategy, vtkCirclePackLayoutStrategy);
79 
86  vtkIdType FindVertex(double pnt[2], double* cinfo = nullptr);
87 
92  void GetBoundingCircle(vtkIdType id, double* cinfo);
93 
97  vtkMTimeType GetMTime() override;
98 
99 protected:
102 
105 
107 
108 private:
109  vtkCirclePackLayout(const vtkCirclePackLayout&) = delete;
110  void operator=(const vtkCirclePackLayout&) = delete;
111  void prepareSizeArray(vtkDoubleArray* mySizeArray, vtkTree* tree);
112 };
113 
114 VTK_ABI_NAMESPACE_END
115 #endif
virtual void SetInputArrayToProcess(int idx, int port, int connection, int fieldAssociation, const char *name)
Set the input data arrays that this algorithm will process.
abstract superclass for all circle packing layout strategies.
layout a vtkTree as a circle packing.
static vtkCirclePackLayout * New()
void GetBoundingCircle(vtkIdType id, double *cinfo)
Return the Xcenter, Ycenter, and Radius of the vertex's bounding circle.
virtual void SetSizeArrayName(const char *name)
The array to use for the size of each vertex.
vtkIdType FindVertex(double pnt[2], double *cinfo=nullptr)
Returns the vertex id that contains pnt (or -1 if no one contains it) pnt[0] is x,...
vtkCirclePackLayoutStrategy * LayoutStrategy
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetLayoutStrategy(vtkCirclePackLayoutStrategy *strategy)
The strategy to use when laying out the tree map.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkCirclePackLayout() override
vtkMTimeType GetMTime() override
Get the modification time of the layout algorithm.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
@ FIELD_ASSOCIATION_VERTICES
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only Tree as output.
A rooted tree data structure.
Definition: vtkTree.h:145
@ name
Definition: vtkX3D.h:219
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270