VTK  9.1.0
vtkLabelPlacementMapper.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkLabelPlacementMapper.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2008 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
44#ifndef vtkLabelPlacementMapper_h
45#define vtkLabelPlacementMapper_h
46
47#include "vtkMapper2D.h"
48#include "vtkRenderingLabelModule.h" // For export macro
49
50class vtkCoordinate;
53
54class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
55{
56public:
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
64 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
65
67
71 vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
73
75
79 vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
80 vtkGetMacro(MaximumLabelFraction, double);
82
84
88 vtkSetMacro(IteratorType, int);
89 vtkGetMacro(IteratorType, int);
91
93
96 vtkSetMacro(UseUnicodeStrings, bool);
97 vtkGetMacro(UseUnicodeStrings, bool);
98 vtkBooleanMacro(UseUnicodeStrings, bool);
100
102
107 vtkGetMacro(PositionsAsNormals, bool);
108 vtkSetMacro(PositionsAsNormals, bool);
109 vtkBooleanMacro(PositionsAsNormals, bool);
111
113
117 vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
118 vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
119 vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
121
123
127 vtkGetMacro(UseDepthBuffer, bool);
128 vtkSetMacro(UseDepthBuffer, bool);
129 vtkBooleanMacro(UseDepthBuffer, bool);
131
133
137 vtkSetMacro(PlaceAllLabels, bool);
138 vtkGetMacro(PlaceAllLabels, bool);
139 vtkBooleanMacro(PlaceAllLabels, bool);
141
143
146 vtkSetMacro(OutputTraversedBounds, bool);
147 vtkGetMacro(OutputTraversedBounds, bool);
148 vtkBooleanMacro(OutputTraversedBounds, bool);
150
152 {
156 NUMBER_OF_LABEL_SHAPES
157 };
158
160
164 vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
165 vtkGetMacro(Shape, int);
166 virtual void SetShapeToNone() { this->SetShape(NONE); }
167 virtual void SetShapeToRect() { this->SetShape(RECT); }
168 virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
170
172 {
175 NUMBER_OF_LABEL_STYLES
176 };
177
179
183 vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
184 vtkGetMacro(Style, int);
185 virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
186 virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
188
190
194 vtkSetMacro(Margin, double);
195 vtkGetMacro(Margin, double);
197
199
202 vtkSetVector3Macro(BackgroundColor, double);
203 vtkGetVector3Macro(BackgroundColor, double);
205
207
210 vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
211 vtkGetMacro(BackgroundOpacity, double);
213
215
218 vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
220
227
228protected:
231
233
235
236 class Internal;
237 Internal* Buckets;
238
249
250 int LastRendererSize[2];
251 double LastCameraPosition[3];
252 double LastCameraFocalPoint[3];
253 double LastCameraViewUp[3];
256
257 int Style;
258 int Shape;
259 double Margin;
261 double BackgroundColor[3];
262
263private:
265 void operator=(const vtkLabelPlacementMapper&) = delete;
266};
267
268#endif
a actor that draws 2D data
Definition: vtkActor2D.h:49
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:86
a simple class to control print indentation
Definition: vtkIndent.h:43
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:36
extract points that are visible (based on z-buffer calculation)
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:45
@ Shape
Definition: vtkX3D.h:42
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453