VTK  9.3.0
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
22#ifndef vtkLabelPlacementMapper_h
23#define vtkLabelPlacementMapper_h
24
25#include "vtkMapper2D.h"
26#include "vtkRenderingLabelModule.h" // For export macro
27
28VTK_ABI_NAMESPACE_BEGIN
29class vtkCoordinate;
32
33class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
34{
35public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
43 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
44
46
50 vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
52
54
58 vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
59 vtkGetMacro(MaximumLabelFraction, double);
61
63
67 vtkSetMacro(IteratorType, int);
68 vtkGetMacro(IteratorType, int);
70
72
77 vtkGetMacro(PositionsAsNormals, bool);
78 vtkSetMacro(PositionsAsNormals, bool);
79 vtkBooleanMacro(PositionsAsNormals, bool);
81
83
87 vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
88 vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
89 vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
91
93
97 vtkGetMacro(UseDepthBuffer, bool);
98 vtkSetMacro(UseDepthBuffer, bool);
99 vtkBooleanMacro(UseDepthBuffer, bool);
101
103
107 vtkSetMacro(PlaceAllLabels, bool);
108 vtkGetMacro(PlaceAllLabels, bool);
109 vtkBooleanMacro(PlaceAllLabels, bool);
111
113
116 vtkSetMacro(OutputTraversedBounds, bool);
117 vtkGetMacro(OutputTraversedBounds, bool);
118 vtkBooleanMacro(OutputTraversedBounds, bool);
120
122 {
126 NUMBER_OF_LABEL_SHAPES
127 };
128
130
134 vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
135 vtkGetMacro(Shape, int);
136 virtual void SetShapeToNone() { this->SetShape(NONE); }
137 virtual void SetShapeToRect() { this->SetShape(RECT); }
138 virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
140
142 {
145 NUMBER_OF_LABEL_STYLES
146 };
147
149
153 vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
154 vtkGetMacro(Style, int);
155 virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
156 virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
158
160
164 vtkSetMacro(Margin, double);
165 vtkGetMacro(Margin, double);
167
169
172 vtkSetVector3Macro(BackgroundColor, double);
173 vtkGetVector3Macro(BackgroundColor, double);
175
177
180 vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
181 vtkGetMacro(BackgroundOpacity, double);
183
185
188 vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
190
197
198protected:
201
203
204 int FillInputPortInformation(int port, vtkInformation* info) override;
205
206 class Internal;
207 Internal* Buckets;
208
218
219 int LastRendererSize[2];
220 double LastCameraPosition[3];
221 double LastCameraFocalPoint[3];
222 double LastCameraViewUp[3];
225
226 int Style;
227 int Shape;
228 double Margin;
230 double BackgroundColor[3];
231
232private:
234 void operator=(const vtkLabelPlacementMapper&) = delete;
235};
236
237VTK_ABI_NAMESPACE_END
238#endif
a actor that draws 2D data
Definition vtkActor2D.h:35
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.
Places and renders non-overlapping labels.
virtual void SetAnchorTransform(vtkCoordinate *)
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.
Superclass for label rendering implementations.
abstract class specifies interface for objects which render 2D actors
Definition vtkMapper2D.h:25
extract points that are visible (based on z-buffer calculation)
abstract specification for Viewports
Definition vtkViewport.h:45
window superclass for vtkRenderWindow
Definition vtkWindow.h:25