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-------------------------------------------------------------------------*/
47#ifndef vtkLabelPlacementMapper_h
48#define vtkLabelPlacementMapper_h
49
50#include "vtkMapper2D.h"
51#include "vtkRenderingLabelModule.h" // For export macro
52
53class vtkCoordinate;
56
57class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
58{
59public:
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
67 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
68
70
74 vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
76
78
82 vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
83 vtkGetMacro(MaximumLabelFraction, double);
85
87
91 vtkSetMacro(IteratorType, int);
92 vtkGetMacro(IteratorType, int);
94
96
101 vtkGetMacro(PositionsAsNormals, bool);
102 vtkSetMacro(PositionsAsNormals, bool);
103 vtkBooleanMacro(PositionsAsNormals, bool);
105
107
111 vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
112 vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
113 vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
115
117
121 vtkGetMacro(UseDepthBuffer, bool);
122 vtkSetMacro(UseDepthBuffer, bool);
123 vtkBooleanMacro(UseDepthBuffer, bool);
125
127
131 vtkSetMacro(PlaceAllLabels, bool);
132 vtkGetMacro(PlaceAllLabels, bool);
133 vtkBooleanMacro(PlaceAllLabels, bool);
135
137
140 vtkSetMacro(OutputTraversedBounds, bool);
141 vtkGetMacro(OutputTraversedBounds, bool);
142 vtkBooleanMacro(OutputTraversedBounds, bool);
144
146 {
150 NUMBER_OF_LABEL_SHAPES
151 };
152
154
158 vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
159 vtkGetMacro(Shape, int);
160 virtual void SetShapeToNone() { this->SetShape(NONE); }
161 virtual void SetShapeToRect() { this->SetShape(RECT); }
162 virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
164
166 {
169 NUMBER_OF_LABEL_STYLES
170 };
171
173
177 vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
178 vtkGetMacro(Style, int);
179 virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
180 virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
182
184
188 vtkSetMacro(Margin, double);
189 vtkGetMacro(Margin, double);
191
193
196 vtkSetVector3Macro(BackgroundColor, double);
197 vtkGetVector3Macro(BackgroundColor, double);
199
201
204 vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
205 vtkGetMacro(BackgroundOpacity, double);
207
209
212 vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
214
221
222protected:
225
227
228 int FillInputPortInformation(int port, vtkInformation* info) override;
229
230 class Internal;
231 Internal* Buckets;
232
242
243 int LastRendererSize[2];
244 double LastCameraPosition[3];
245 double LastCameraFocalPoint[3];
246 double LastCameraViewUp[3];
249
250 int Style;
251 int Shape;
252 double Margin;
254 double BackgroundColor[3];
255
256private:
258 void operator=(const vtkLabelPlacementMapper&) = delete;
259};
260
261#endif
a actor that draws 2D data
Definition vtkActor2D.h:55
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition vtkIndent.h:49
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:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48