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 -------------------------------------------------------------------------*/
38 #ifndef vtkLabelPlacementMapper_h
39 #define vtkLabelPlacementMapper_h
40 
41 #include "vtkMapper2D.h"
42 #include "vtkRenderingLabelModule.h" // For export macro
43 
44 class vtkCoordinate;
47 
48 class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
49 {
50 public:
51  static vtkLabelPlacementMapper* New();
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
58  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
59 
61 
64  virtual void SetRenderStrategy(vtkLabelRenderStrategy* s);
65  vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
67 
69 
73  vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
74  vtkGetMacro(MaximumLabelFraction, double);
76 
78 
82  vtkSetMacro(IteratorType, int);
83  vtkGetMacro(IteratorType, int);
85 
87 
92  vtkGetMacro(PositionsAsNormals, bool);
93  vtkSetMacro(PositionsAsNormals, bool);
94  vtkBooleanMacro(PositionsAsNormals, bool);
96 
98 
102  vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
103  vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
104  vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
106 
108 
112  vtkGetMacro(UseDepthBuffer, bool);
113  vtkSetMacro(UseDepthBuffer, bool);
114  vtkBooleanMacro(UseDepthBuffer, bool);
116 
118 
122  vtkSetMacro(PlaceAllLabels, bool);
123  vtkGetMacro(PlaceAllLabels, bool);
124  vtkBooleanMacro(PlaceAllLabels, bool);
126 
128 
131  vtkSetMacro(OutputTraversedBounds, bool);
132  vtkGetMacro(OutputTraversedBounds, bool);
133  vtkBooleanMacro(OutputTraversedBounds, bool);
135 
137  {
141  NUMBER_OF_LABEL_SHAPES
142  };
143 
145 
149  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
150  vtkGetMacro(Shape, int);
151  virtual void SetShapeToNone() { this->SetShape(NONE); }
152  virtual void SetShapeToRect() { this->SetShape(RECT); }
153  virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
155 
157  {
160  NUMBER_OF_LABEL_STYLES
161  };
162 
164 
168  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
169  vtkGetMacro(Style, int);
170  virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
171  virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
173 
175 
179  vtkSetMacro(Margin, double);
180  vtkGetMacro(Margin, double);
182 
184 
187  vtkSetVector3Macro(BackgroundColor, double);
188  vtkGetVector3Macro(BackgroundColor, double);
190 
192 
195  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
196  vtkGetMacro(BackgroundOpacity, double);
198 
200 
203  vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
205 
211  void ReleaseGraphicsResources(vtkWindow*) override;
212 
213 protected:
215  ~vtkLabelPlacementMapper() override;
216 
217  virtual void SetAnchorTransform(vtkCoordinate*);
218 
219  int FillInputPortInformation(int port, vtkInformation* info) override;
220 
221  class Internal;
222  Internal* Buckets;
223 
233 
234  int LastRendererSize[2];
235  double LastCameraPosition[3];
236  double LastCameraFocalPoint[3];
237  double LastCameraViewUp[3];
240 
241  int Style;
242  int Shape;
243  double Margin;
245  double BackgroundColor[3];
246 
247 private:
249  void operator=(const vtkLabelPlacementMapper&) = delete;
250 };
251 
252 #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:55
a actor that draws 2D data
Definition: vtkActor2D.h:45
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:38
vtkLabelRenderStrategy * RenderStrategy
a simple class to control print indentation
Definition: vtkIndent.h:39
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:79
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...