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
31#ifndef vtkLabelPlacementMapper_h
32#define vtkLabelPlacementMapper_h
33
34#include "vtkMapper2D.h"
35#include "vtkRenderingLabelModule.h" // For export macro
36
37VTK_ABI_NAMESPACE_BEGIN
38class vtkCoordinate;
41
42class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
43{
44public:
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
52 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
53
55
59 vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
61
63
67 vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
68 vtkGetMacro(MaximumLabelFraction, double);
70
72
76 vtkSetMacro(IteratorType, int);
77 vtkGetMacro(IteratorType, int);
79
81
86 vtkGetMacro(PositionsAsNormals, bool);
87 vtkSetMacro(PositionsAsNormals, bool);
88 vtkBooleanMacro(PositionsAsNormals, bool);
90
92
96 vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
97 vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
98 vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
100
102
106 vtkGetMacro(UseDepthBuffer, bool);
107 vtkSetMacro(UseDepthBuffer, bool);
108 vtkBooleanMacro(UseDepthBuffer, bool);
110
112
116 vtkSetMacro(PlaceAllLabels, bool);
117 vtkGetMacro(PlaceAllLabels, bool);
118 vtkBooleanMacro(PlaceAllLabels, bool);
120
122
125 vtkSetMacro(OutputTraversedBounds, bool);
126 vtkGetMacro(OutputTraversedBounds, bool);
127 vtkBooleanMacro(OutputTraversedBounds, bool);
129
131 {
135 NUMBER_OF_LABEL_SHAPES
136 };
137
139
143 vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
144 vtkGetMacro(Shape, int);
145 virtual void SetShapeToNone() { this->SetShape(NONE); }
146 virtual void SetShapeToRect() { this->SetShape(RECT); }
147 virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
149
151 {
154 NUMBER_OF_LABEL_STYLES
155 };
156
158
162 vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
163 vtkGetMacro(Style, int);
164 virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
165 virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
167
169
173 vtkSetMacro(Margin, double);
174 vtkGetMacro(Margin, double);
176
178
181 vtkSetVector3Macro(BackgroundColor, double);
182 vtkGetVector3Macro(BackgroundColor, double);
184
186
189 vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
190 vtkGetMacro(BackgroundOpacity, double);
192
194
197 vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
199
206
207protected:
210
212
213 int FillInputPortInformation(int port, vtkInformation* info) override;
214
215 class Internal;
216 Internal* Buckets;
217
227
228 int LastRendererSize[2];
229 double LastCameraPosition[3];
230 double LastCameraFocalPoint[3];
231 double LastCameraViewUp[3];
234
235 int Style;
236 int Shape;
237 double Margin;
239 double BackgroundColor[3];
240
241private:
243 void operator=(const vtkLabelPlacementMapper&) = delete;
244};
245
246VTK_ABI_NAMESPACE_END
247#endif
a actor that draws 2D data
Definition vtkActor2D.h:44
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition vtkIndent.h:38
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:54
window superclass for vtkRenderWindow
Definition vtkWindow.h:34