VTK  9.3.20240418
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
41 #ifndef vtkLabelPlacementMapper_h
42 #define vtkLabelPlacementMapper_h
43 
44 #include "vtkMapper2D.h"
45 #include "vtkRenderingLabelModule.h" // For export macro
46 
47 VTK_ABI_NAMESPACE_BEGIN
48 class vtkCoordinate;
51 
52 class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
53 {
54 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
62  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
63 
65 
69  vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
71 
73 
77  vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
78  vtkGetMacro(MaximumLabelFraction, double);
80 
82 
86  vtkSetMacro(IteratorType, int);
87  vtkGetMacro(IteratorType, int);
89 
91 
96  vtkGetMacro(PositionsAsNormals, bool);
97  vtkSetMacro(PositionsAsNormals, bool);
98  vtkBooleanMacro(PositionsAsNormals, bool);
100 
102 
106  vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
107  vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
108  vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
110 
112 
116  vtkGetMacro(UseDepthBuffer, bool);
117  vtkSetMacro(UseDepthBuffer, bool);
118  vtkBooleanMacro(UseDepthBuffer, bool);
120 
122 
126  vtkSetMacro(PlaceAllLabels, bool);
127  vtkGetMacro(PlaceAllLabels, bool);
128  vtkBooleanMacro(PlaceAllLabels, bool);
130 
132 
135  vtkSetMacro(OutputTraversedBounds, bool);
136  vtkGetMacro(OutputTraversedBounds, bool);
137  vtkBooleanMacro(OutputTraversedBounds, bool);
139 
141  {
145  NUMBER_OF_LABEL_SHAPES
146  };
147 
149 
153  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
154  vtkGetMacro(Shape, int);
155  virtual void SetShapeToNone() { this->SetShape(NONE); }
156  virtual void SetShapeToRect() { this->SetShape(RECT); }
157  virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
159 
161  {
164  NUMBER_OF_LABEL_STYLES
165  };
166 
168 
172  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
173  vtkGetMacro(Style, int);
174  virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
175  virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
177 
179 
183  vtkSetMacro(Margin, double);
184  vtkGetMacro(Margin, double);
186 
188 
191  vtkSetVector3Macro(BackgroundColor, double);
192  vtkGetVector3Macro(BackgroundColor, double);
194 
196 
199  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
200  vtkGetMacro(BackgroundOpacity, double);
202 
204 
207  vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
209 
216 
217 protected:
220 
222 
224 
225  class Internal;
226  Internal* Buckets;
227 
237 
238  int LastRendererSize[2];
239  double LastCameraPosition[3];
240  double LastCameraFocalPoint[3];
241  double LastCameraViewUp[3];
244 
245  int Style;
246  int Shape;
247  double Margin;
249  double BackgroundColor[3];
250 
251 private:
253  void operator=(const vtkLabelPlacementMapper&) = delete;
254 };
255 
256 VTK_ABI_NAMESPACE_END
257 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:145
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition: vtkIndent.h:108
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:26
extract points that are visible (based on z-buffer calculation)
abstract specification for Viewports
Definition: vtkViewport.h:65
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48
@ Shape
Definition: vtkX3D.h:36
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447