VTK  9.2.6
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-------------------------------------------------------------------------*/
34
35#ifndef vtkLabelPlacementMapper_h
36#define vtkLabelPlacementMapper_h
37
38#include "vtkMapper2D.h"
39#include "vtkRenderingLabelModule.h" // For export macro
40
41class vtkCoordinate;
44
45class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
46{
47public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
55 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
56
58
64
66
70 vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
71 vtkGetMacro(MaximumLabelFraction, double);
73
75
79 vtkSetMacro(IteratorType, int);
80 vtkGetMacro(IteratorType, int);
82
84
89 vtkGetMacro(PositionsAsNormals, bool);
90 vtkSetMacro(PositionsAsNormals, bool);
91 vtkBooleanMacro(PositionsAsNormals, bool);
93
95
99 vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
101 vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
103
105
109 vtkGetMacro(UseDepthBuffer, bool);
110 vtkSetMacro(UseDepthBuffer, bool);
111 vtkBooleanMacro(UseDepthBuffer, bool);
113
115
119 vtkSetMacro(PlaceAllLabels, bool);
120 vtkGetMacro(PlaceAllLabels, bool);
121 vtkBooleanMacro(PlaceAllLabels, bool);
123
125
128 vtkSetMacro(OutputTraversedBounds, bool);
129 vtkGetMacro(OutputTraversedBounds, bool);
130 vtkBooleanMacro(OutputTraversedBounds, bool);
132
140
142
146 vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
147 vtkGetMacro(Shape, int);
148 virtual void SetShapeToNone() { this->SetShape(NONE); }
149 virtual void SetShapeToRect() { this->SetShape(RECT); }
150 virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
152
159
161
165 vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
166 vtkGetMacro(Style, int);
167 virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
168 virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
170
172
176 vtkSetMacro(Margin, double);
177 vtkGetMacro(Margin, double);
179
181
184 vtkSetVector3Macro(BackgroundColor, double);
185 vtkGetVector3Macro(BackgroundColor, double);
187
189
192 vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
193 vtkGetMacro(BackgroundOpacity, double);
195
197
200 vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
202
209
210protected:
213
215
216 int FillInputPortInformation(int port, vtkInformation* info) override;
217
218 class Internal;
219 Internal* Buckets;
220
230
237
238 int Style;
239 int Shape;
240 double Margin;
243
244private:
246 void operator=(const vtkLabelPlacementMapper&) = delete;
247};
248
249#endif
a actor that draws 2D data
Definition vtkActor2D.h:40
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition vtkIndent.h:34
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:50
window superclass for vtkRenderWindow
Definition vtkWindow.h:39