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 -------------------------------------------------------------------------*/
54 #ifndef vtkLabelPlacementMapper_h
55 #define vtkLabelPlacementMapper_h
56 
57 #include "vtkMapper2D.h"
58 #include "vtkRenderingLabelModule.h" // For export macro
59 
60 class vtkCoordinate;
63 
64 class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
65 {
66 public:
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
74  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
75 
77 
81  vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
83 
85 
89  vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
90  vtkGetMacro(MaximumLabelFraction, double);
92 
94 
98  vtkSetMacro(IteratorType, int);
99  vtkGetMacro(IteratorType, int);
101 
103 
106  vtkSetMacro(UseUnicodeStrings, bool);
107  vtkGetMacro(UseUnicodeStrings, bool);
108  vtkBooleanMacro(UseUnicodeStrings, bool);
110 
112 
117  vtkGetMacro(PositionsAsNormals, bool);
118  vtkSetMacro(PositionsAsNormals, bool);
119  vtkBooleanMacro(PositionsAsNormals, bool);
121 
123 
127  vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
128  vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
129  vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
131 
133 
137  vtkGetMacro(UseDepthBuffer, bool);
138  vtkSetMacro(UseDepthBuffer, bool);
139  vtkBooleanMacro(UseDepthBuffer, bool);
141 
143 
147  vtkSetMacro(PlaceAllLabels, bool);
148  vtkGetMacro(PlaceAllLabels, bool);
149  vtkBooleanMacro(PlaceAllLabels, bool);
151 
153 
156  vtkSetMacro(OutputTraversedBounds, bool);
157  vtkGetMacro(OutputTraversedBounds, bool);
158  vtkBooleanMacro(OutputTraversedBounds, bool);
160 
162  {
166  NUMBER_OF_LABEL_SHAPES
167  };
168 
170 
174  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
175  vtkGetMacro(Shape, int);
176  virtual void SetShapeToNone() { this->SetShape(NONE); }
177  virtual void SetShapeToRect() { this->SetShape(RECT); }
178  virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
180 
182  {
185  NUMBER_OF_LABEL_STYLES
186  };
187 
189 
193  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
194  vtkGetMacro(Style, int);
195  virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
196  virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
198 
200 
204  vtkSetMacro(Margin, double);
205  vtkGetMacro(Margin, double);
207 
209 
212  vtkSetVector3Macro(BackgroundColor, double);
213  vtkGetVector3Macro(BackgroundColor, double);
215 
217 
220  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
221  vtkGetMacro(BackgroundOpacity, double);
223 
225 
228  vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
230 
237 
238 protected:
241 
243 
245 
246  class Internal;
247  Internal* Buckets;
248 
259 
260  int LastRendererSize[2];
261  double LastCameraPosition[3];
262  double LastCameraFocalPoint[3];
263  double LastCameraViewUp[3];
266 
267  int Style;
268  int Shape;
269  double Margin;
271  double BackgroundColor[3];
272 
273 private:
275  void operator=(const vtkLabelPlacementMapper&) = delete;
276 };
277 
278 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:149
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition: vtkIndent.h:113
Store vtkAlgorithm input/output information.
Places and renders non-overlapping labels.
virtual void SetAnchorTransform(vtkCoordinate *)
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.
static vtkLabelPlacementMapper * New()
~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:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
@ Shape
Definition: vtkX3D.h:42
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453