VTK  9.4.20251007
vtkLabelPlacementMapper.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
21
22#ifndef vtkLabelPlacementMapper_h
23#define vtkLabelPlacementMapper_h
24
25#include "vtkMapper2D.h"
26#include "vtkRenderingLabelModule.h" // For export macro
27#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28
29VTK_ABI_NAMESPACE_BEGIN
30class vtkCoordinate;
33
34class VTKRENDERINGLABEL_EXPORT VTK_MARSHALAUTO vtkLabelPlacementMapper : public vtkMapper2D
35{
36public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
44 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
45
47
53
55
59 vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
60 vtkGetMacro(MaximumLabelFraction, double);
62
64
68 vtkSetMacro(IteratorType, int);
69 vtkGetMacro(IteratorType, int);
71
73
78 vtkGetMacro(PositionsAsNormals, bool);
79 vtkSetMacro(PositionsAsNormals, bool);
80 vtkBooleanMacro(PositionsAsNormals, bool);
82
84
88 vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
89 vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
90 vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
92
94
98 vtkGetMacro(UseDepthBuffer, bool);
99 vtkSetMacro(UseDepthBuffer, bool);
100 vtkBooleanMacro(UseDepthBuffer, bool);
102
104
108 vtkSetMacro(PlaceAllLabels, bool);
109 vtkGetMacro(PlaceAllLabels, bool);
110 vtkBooleanMacro(PlaceAllLabels, bool);
112
114
117 vtkSetMacro(OutputTraversedBounds, bool);
118 vtkGetMacro(OutputTraversedBounds, bool);
119 vtkBooleanMacro(OutputTraversedBounds, bool);
121
129
131
135 vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
136 vtkGetMacro(Shape, int);
137 virtual void SetShapeToNone() { this->SetShape(NONE); }
138 virtual void SetShapeToRect() { this->SetShape(RECT); }
139 virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
141
148
150
154 vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
155 vtkGetMacro(Style, int);
156 virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
157 virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
159
161
165 vtkSetMacro(Margin, double);
166 vtkGetMacro(Margin, double);
168
170
173 vtkSetVector3Macro(BackgroundColor, double);
174 vtkGetVector3Macro(BackgroundColor, double);
176
178
181 vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
182 vtkGetMacro(BackgroundOpacity, double);
184
186
189 vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
191
198
199protected:
202
204
205 int FillInputPortInformation(int port, vtkInformation* info) override;
206
207 class Internal;
208 Internal* Buckets;
209
219
226
227 int Style;
228 int Shape;
229 double Margin;
232
233private:
235 void operator=(const vtkLabelPlacementMapper&) = delete;
236};
237
238VTK_ABI_NAMESPACE_END
239#endif
a actor that draws 2D data
Definition vtkActor2D.h:36
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition vtkIndent.h:29
Store vtkAlgorithm input/output information.
virtual void SetAnchorTransform(vtkCoordinate *)
virtual void SetShape(int)
The shape of the label background, should be one of the values in the LabelShape enumeration.
static vtkLabelPlacementMapper * New()
virtual void SetStyleToOutline()
The style of the label background shape, should be one of the values in the LabelStyle enumeration.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLabelRenderStrategy * RenderStrategy
virtual void SetShapeToRoundedRect()
The shape of the label background, should be one of the values in the LabelShape enumeration.
virtual void SetRenderStrategy(vtkLabelRenderStrategy *s)
Set the label rendering strategy.
virtual void SetStyleToFilled()
The style of the label background shape, should be one of the values in the LabelStyle enumeration.
~vtkLabelPlacementMapper() override
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual void SetShapeToRect()
The shape of the label background, should be one of the values in the LabelShape enumeration.
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override
Draw non-overlapping labels to the screen.
vtkSelectVisiblePoints * VisiblePoints
virtual void SetShapeToNone()
The shape of the label background, should be one of the values in the LabelShape enumeration.
virtual void SetStyle(int)
The style of the label background shape, should be one of the values in the LabelStyle enumeration.
Superclass for label rendering implementations.
vtkMapper2D()=default
extract points that are visible (based on z-buffer calculation)
abstract specification for Viewports
Definition vtkViewport.h:46
window superclass for vtkRenderWindow
Definition vtkWindow.h:29
#define VTK_MARSHALAUTO