VTK  9.7.1
vtkLabelPlacementMapper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
22 #ifndef vtkLabelPlacementMapper_h
23 #define vtkLabelPlacementMapper_h
24 
25 #include "vtkMapper2D.h"
26 #include "vtkRenderingLabelModule.h" // For export macro
27 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkCoordinate;
33 
34 class VTKRENDERINGLABEL_EXPORT VTK_MARSHALAUTO vtkLabelPlacementMapper : public vtkMapper2D
35 {
36 public:
37  static vtkLabelPlacementMapper* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
45 
47 
50  virtual void SetRenderStrategy(vtkLabelRenderStrategy* s);
51  vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
53 
55 
59  vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
60  vtkGetMacro(MaximumLabelFraction, double);
62 
64 
68  vtkSetMacro(IteratorType, int);
69  vtkGetMacro(IteratorType, int);
71 
73 
78  vtkGetMacro(PositionsAsNormals, bool);
79  vtkSetMacro(PositionsAsNormals, bool);
80  vtkBooleanMacro(PositionsAsNormals, bool);
82 
84 
88  vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
89  vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
90  vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
92 
94 
98  vtkGetMacro(UseDepthBuffer, bool);
99  vtkSetMacro(UseDepthBuffer, bool);
100  vtkBooleanMacro(UseDepthBuffer, bool);
102 
104 
108  vtkSetMacro(PlaceAllLabels, bool);
109  vtkGetMacro(PlaceAllLabels, bool);
110  vtkBooleanMacro(PlaceAllLabels, bool);
112 
114 
117  vtkSetMacro(OutputTraversedBounds, bool);
118  vtkGetMacro(OutputTraversedBounds, bool);
119  vtkBooleanMacro(OutputTraversedBounds, bool);
121 
123  {
127  NUMBER_OF_LABEL_SHAPES
128  };
129 
131 
135  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
136  vtkGetMacro(Shape, int);
137  virtual void SetShapeToNone() { this->SetShape(NONE); }
138  virtual void SetShapeToRect() { this->SetShape(RECT); }
139  virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
141 
143  {
146  NUMBER_OF_LABEL_STYLES
147  };
148 
150 
154  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
155  vtkGetMacro(Style, int);
156  virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
157  virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
159 
161 
165  vtkSetMacro(Margin, double);
166  vtkGetMacro(Margin, double);
168 
170 
173  vtkSetVector3Macro(BackgroundColor, double);
174  vtkGetVector3Macro(BackgroundColor, double);
176 
178 
181  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
182  vtkGetMacro(BackgroundOpacity, double);
184 
186 
189  vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
190  virtual void SetAnchorTransform(vtkCoordinate*);
192 
198  void ReleaseGraphicsResources(vtkWindow*) override;
199 
200 protected:
202  ~vtkLabelPlacementMapper() override;
203 
204  int FillInputPortInformation(int port, vtkInformation* info) override;
205 
206  class Internal;
207  Internal* Buckets;
208 
218 
219  int LastRendererSize[2];
220  double LastCameraPosition[3];
221  double LastCameraFocalPoint[3];
222  double LastCameraViewUp[3];
225 
226  int Style;
227  int Shape;
228  double Margin;
230  double BackgroundColor[3];
231 
232 private:
234  void operator=(const vtkLabelPlacementMapper&) = delete;
235 };
236 
237 VTK_ABI_NAMESPACE_END
238 #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:31
abstract specification for Viewports
Definition: vtkViewport.h:46
a actor that draws 2D data
Definition: vtkActor2D.h:35
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:41
vtkLabelRenderStrategy * RenderStrategy
a simple class to control print indentation
Definition: vtkIndent.h:28
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:69
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()
#define VTK_MARSHALAUTO
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:25
virtual void SetStyleToFilled()
The style of the label background shape, should be one of the values in the LabelStyle enumeration...