VTK  9.0.1
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 -------------------------------------------------------------------------*/
35 #ifndef vtkLabelPlacementMapper_h
36 #define vtkLabelPlacementMapper_h
37 
38 #include "vtkMapper2D.h"
39 #include "vtkRenderingLabelModule.h" // For export macro
40 
41 class vtkCoordinate;
44 
45 class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
46 {
47 public:
48  static vtkLabelPlacementMapper* New();
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
55  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
56 
58 
61  virtual void SetRenderStrategy(vtkLabelRenderStrategy* s);
62  vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
64 
66 
70  vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
71  vtkGetMacro(MaximumLabelFraction, double);
73 
75 
79  vtkSetMacro(IteratorType, int);
80  vtkGetMacro(IteratorType, int);
82 
84 
87  vtkSetMacro(UseUnicodeStrings, bool);
88  vtkGetMacro(UseUnicodeStrings, bool);
89  vtkBooleanMacro(UseUnicodeStrings, bool);
91 
93 
98  vtkGetMacro(PositionsAsNormals, bool);
99  vtkSetMacro(PositionsAsNormals, bool);
100  vtkBooleanMacro(PositionsAsNormals, bool);
102 
104 
108  vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
109  vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
110  vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
112 
114 
118  vtkGetMacro(UseDepthBuffer, bool);
119  vtkSetMacro(UseDepthBuffer, bool);
120  vtkBooleanMacro(UseDepthBuffer, bool);
122 
124 
128  vtkSetMacro(PlaceAllLabels, bool);
129  vtkGetMacro(PlaceAllLabels, bool);
130  vtkBooleanMacro(PlaceAllLabels, bool);
132 
134 
137  vtkSetMacro(OutputTraversedBounds, bool);
138  vtkGetMacro(OutputTraversedBounds, bool);
139  vtkBooleanMacro(OutputTraversedBounds, bool);
141 
143  {
147  NUMBER_OF_LABEL_SHAPES
148  };
149 
151 
155  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
156  vtkGetMacro(Shape, int);
157  virtual void SetShapeToNone() { this->SetShape(NONE); }
158  virtual void SetShapeToRect() { this->SetShape(RECT); }
159  virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
161 
163  {
166  NUMBER_OF_LABEL_STYLES
167  };
168 
170 
174  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
175  vtkGetMacro(Style, int);
176  virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
177  virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
179 
181 
185  vtkSetMacro(Margin, double);
186  vtkGetMacro(Margin, double);
188 
190 
193  vtkSetVector3Macro(BackgroundColor, double);
194  vtkGetVector3Macro(BackgroundColor, double);
196 
198 
201  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
202  vtkGetMacro(BackgroundOpacity, double);
204 
206 
209  vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
211 
217  void ReleaseGraphicsResources(vtkWindow*) override;
218 
219 protected:
221  ~vtkLabelPlacementMapper() override;
222 
223  virtual void SetAnchorTransform(vtkCoordinate*);
224 
225  int FillInputPortInformation(int port, vtkInformation* info) override;
226 
227  class Internal;
228  Internal* Buckets;
229 
240 
241  int LastRendererSize[2];
242  double LastCameraPosition[3];
243  double LastCameraFocalPoint[3];
244  double LastCameraViewUp[3];
247 
248  int Style;
249  int Shape;
250  double Margin;
252  double BackgroundColor[3];
253 
254 private:
256  void operator=(const vtkLabelPlacementMapper&) = delete;
257 };
258 
259 #endif
virtual void SetStyleToOutline()
The style of the label background shape, should be one of the values in the LabelStyle enumeration...
Superclass for label rendering implementations.
extract points that are visible (based on z-buffer calculation)
virtual void SetShapeToNone()
The shape of the label background, should be one of the values in the LabelShape enumeration.
Store vtkAlgorithm input/output information.
virtual void RenderOverlay(vtkViewport *, vtkActor2D *)
Definition: vtkMapper2D.h:41
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:39
virtual void SetShapeToRect()
The shape of the label background, should be one of the values in the LabelShape enumeration.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkLabelRenderStrategy * RenderStrategy
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:76
virtual void SetShapeToRoundedRect()
The shape of the label background, should be one of the values in the LabelShape enumeration.
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
vtkSelectVisiblePoints * VisiblePoints
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Places and renders non-overlapping labels.
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:35
virtual void SetStyleToFilled()
The style of the label background shape, should be one of the values in the LabelStyle enumeration...