VTK: Rendering/Label/vtkLabelPlacementMapper.h Source File

| VTK 9.3.1

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
37 VTK_ABI_NAMESPACE_BEGIN
38 class vtkCoordinate;
39 class vtkLabelRenderStrategy;
40 class vtkSelectVisiblePoints;
41
42 class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
43 {
44 public:
45 static vtkLabelPlacementMapper* New();
46 vtkTypeMacro(vtkLabelPlacementMapper, vtkMapper2D);
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
52 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
53
55
58 virtual void SetRenderStrategy(vtkLabelRenderStrategy* s);
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
130 enum LabelShape
131 {
132 NONE,
133 RECT,
134 ROUNDED_RECT,
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
150 enum LabelStyle
151 {
152 FILLED,
153 OUTLINE,
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
205 void ReleaseGraphicsResources(vtkWindow*) override;
206
207 protected:
208 vtkLabelPlacementMapper();
209 ~vtkLabelPlacementMapper() override;
210
211 virtual void SetAnchorTransform(vtkCoordinate*);
212
213 int FillInputPortInformation(int port, vtkInformation* info) override;
214
215 class Internal;
216 Internal* Buckets;
217
218 vtkLabelRenderStrategy* RenderStrategy;
219 vtkCoordinate* AnchorTransform;
220 vtkSelectVisiblePoints* VisiblePoints;
221 double MaximumLabelFraction;
222 bool PositionsAsNormals;
223 bool GeneratePerturbedLabelSpokes;
224 bool UseDepthBuffer;
225 bool PlaceAllLabels;
226 bool OutputTraversedBounds;
227
228 int LastRendererSize[2];
229 double LastCameraPosition[3];
230 double LastCameraFocalPoint[3];
231 double LastCameraViewUp[3];
232 double LastCameraParallelScale;
233 int IteratorType;
234
235 int Style;
236 int Shape;
237 double Margin;
238 double BackgroundOpacity;
239 double BackgroundColor[3];
240
241 private:
242 vtkLabelPlacementMapper(const vtkLabelPlacementMapper&) = delete;
243 void operator=(const vtkLabelPlacementMapper&) = delete;
244 };
245
246 VTK_ABI_NAMESPACE_END
247 #endif
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:44
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:78
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkLabelPlacementMapper
Places and renders non-overlapping labels.
Definition: vtkLabelPlacementMapper.h:43
vtkLabelPlacementMapper::SetAnchorTransform
virtual void SetAnchorTransform(vtkCoordinate *)
vtkLabelPlacementMapper::LastCameraParallelScale
double LastCameraParallelScale
Definition: vtkLabelPlacementMapper.h:232
vtkLabelPlacementMapper::vtkLabelPlacementMapper
vtkLabelPlacementMapper()
vtkLabelPlacementMapper::SetStyleToOutline
virtual void SetStyleToOutline()
The style of the label background shape, should be one of the values in the LabelStyle enumeration.
Definition: vtkLabelPlacementMapper.h:165
vtkLabelPlacementMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
vtkLabelPlacementMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLabelPlacementMapper::RenderStrategy
vtkLabelRenderStrategy * RenderStrategy
Definition: vtkLabelPlacementMapper.h:218
vtkLabelPlacementMapper::SetShapeToRoundedRect
virtual void SetShapeToRoundedRect()
The shape of the label background, should be one of the values in the LabelShape enumeration.
Definition: vtkLabelPlacementMapper.h:147
vtkLabelPlacementMapper::OutputTraversedBounds
bool OutputTraversedBounds
Definition: vtkLabelPlacementMapper.h:226
vtkLabelPlacementMapper::SetRenderStrategy
virtual void SetRenderStrategy(vtkLabelRenderStrategy *s)
Set the label rendering strategy.
vtkLabelPlacementMapper::Margin
double Margin
Definition: vtkLabelPlacementMapper.h:237
vtkLabelPlacementMapper::SetStyleToFilled
virtual void SetStyleToFilled()
The style of the label background shape, should be one of the values in the LabelStyle enumeration.
Definition: vtkLabelPlacementMapper.h:164
vtkLabelPlacementMapper::PlaceAllLabels
bool PlaceAllLabels
Definition: vtkLabelPlacementMapper.h:225
vtkLabelPlacementMapper::New
static vtkLabelPlacementMapper * New()
vtkLabelPlacementMapper::AnchorTransform
vtkCoordinate * AnchorTransform
Definition: vtkLabelPlacementMapper.h:219
vtkLabelPlacementMapper::~vtkLabelPlacementMapper
~vtkLabelPlacementMapper() override
vtkLabelPlacementMapper::Shape
int Shape
Definition: vtkLabelPlacementMapper.h:236
vtkLabelPlacementMapper::GeneratePerturbedLabelSpokes
bool GeneratePerturbedLabelSpokes
Definition: vtkLabelPlacementMapper.h:223
vtkLabelPlacementMapper::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkLabelPlacementMapper::PositionsAsNormals
bool PositionsAsNormals
Definition: vtkLabelPlacementMapper.h:222
vtkLabelPlacementMapper::LabelStyle
LabelStyle
Definition: vtkLabelPlacementMapper.h:151
vtkLabelPlacementMapper::OUTLINE
@ OUTLINE
Definition: vtkLabelPlacementMapper.h:153
vtkLabelPlacementMapper::FILLED
@ FILLED
Definition: vtkLabelPlacementMapper.h:152
vtkLabelPlacementMapper::MaximumLabelFraction
double MaximumLabelFraction
Definition: vtkLabelPlacementMapper.h:221
vtkLabelPlacementMapper::SetShapeToRect
virtual void SetShapeToRect()
The shape of the label background, should be one of the values in the LabelShape enumeration.
Definition: vtkLabelPlacementMapper.h:146
vtkLabelPlacementMapper::IteratorType
int IteratorType
Definition: vtkLabelPlacementMapper.h:233
vtkLabelPlacementMapper::RenderOverlay
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override
Draw non-overlapping labels to the screen.
vtkLabelPlacementMapper::LabelShape
LabelShape
Definition: vtkLabelPlacementMapper.h:131
vtkLabelPlacementMapper::RECT
@ RECT
Definition: vtkLabelPlacementMapper.h:133
vtkLabelPlacementMapper::NONE
@ NONE
Definition: vtkLabelPlacementMapper.h:132
vtkLabelPlacementMapper::ROUNDED_RECT
@ ROUNDED_RECT
Definition: vtkLabelPlacementMapper.h:134
vtkLabelPlacementMapper::VisiblePoints
vtkSelectVisiblePoints * VisiblePoints
Definition: vtkLabelPlacementMapper.h:220
vtkLabelPlacementMapper::Style
int Style
Definition: vtkLabelPlacementMapper.h:235
vtkLabelPlacementMapper::Buckets
Internal * Buckets
Definition: vtkLabelPlacementMapper.h:215
vtkLabelPlacementMapper::UseDepthBuffer
bool UseDepthBuffer
Definition: vtkLabelPlacementMapper.h:224
vtkLabelPlacementMapper::BackgroundOpacity
double BackgroundOpacity
Definition: vtkLabelPlacementMapper.h:238
vtkLabelPlacementMapper::SetShapeToNone
virtual void SetShapeToNone()
The shape of the label background, should be one of the values in the LabelShape enumeration.
Definition: vtkLabelPlacementMapper.h:145
vtkLabelRenderStrategy
Superclass for label rendering implementations.
Definition: vtkLabelRenderStrategy.h:25
vtkMapper2D
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:25
vtkSelectVisiblePoints
extract points that are visible (based on z-buffer calculation)
Definition: vtkSelectVisiblePoints.h:59
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:54
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkX3D::Shape
@ Shape
Definition: vtkX3D.h:36
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtk::detail::iarrays::NONE
@ NONE
Definition: vtkImplicitArrayTraits.h:239
vtkMapper2D.h