VTK  9.3.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 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkCoordinate;
32 
33 class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
34 {
35 public:
36  static vtkLabelPlacementMapper* New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
43  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
44 
46 
49  virtual void SetRenderStrategy(vtkLabelRenderStrategy* s);
50  vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
52 
54 
58  vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
59  vtkGetMacro(MaximumLabelFraction, double);
61 
63 
67  vtkSetMacro(IteratorType, int);
68  vtkGetMacro(IteratorType, int);
70 
72 
77  vtkGetMacro(PositionsAsNormals, bool);
78  vtkSetMacro(PositionsAsNormals, bool);
79  vtkBooleanMacro(PositionsAsNormals, bool);
81 
83 
87  vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
88  vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
89  vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
91 
93 
97  vtkGetMacro(UseDepthBuffer, bool);
98  vtkSetMacro(UseDepthBuffer, bool);
99  vtkBooleanMacro(UseDepthBuffer, bool);
101 
103 
107  vtkSetMacro(PlaceAllLabels, bool);
108  vtkGetMacro(PlaceAllLabels, bool);
109  vtkBooleanMacro(PlaceAllLabels, bool);
111 
113 
116  vtkSetMacro(OutputTraversedBounds, bool);
117  vtkGetMacro(OutputTraversedBounds, bool);
118  vtkBooleanMacro(OutputTraversedBounds, bool);
120 
122  {
126  NUMBER_OF_LABEL_SHAPES
127  };
128 
130 
134  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
135  vtkGetMacro(Shape, int);
136  virtual void SetShapeToNone() { this->SetShape(NONE); }
137  virtual void SetShapeToRect() { this->SetShape(RECT); }
138  virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
140 
142  {
145  NUMBER_OF_LABEL_STYLES
146  };
147 
149 
153  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
154  vtkGetMacro(Style, int);
155  virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
156  virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
158 
160 
164  vtkSetMacro(Margin, double);
165  vtkGetMacro(Margin, double);
167 
169 
172  vtkSetVector3Macro(BackgroundColor, double);
173  vtkGetVector3Macro(BackgroundColor, double);
175 
177 
180  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
181  vtkGetMacro(BackgroundOpacity, double);
183 
185 
188  vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
190 
196  void ReleaseGraphicsResources(vtkWindow*) override;
197 
198 protected:
200  ~vtkLabelPlacementMapper() override;
201 
202  virtual void SetAnchorTransform(vtkCoordinate*);
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:30
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:34
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:27
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:68
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:24
virtual void SetStyleToFilled()
The style of the label background shape, should be one of the values in the LabelStyle enumeration...