VTK  9.7.1
vtkLabelPlacer.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
29 #ifndef vtkLabelPlacer_h
30 #define vtkLabelPlacer_h
31 
32 #include "vtkDeprecation.h" // For deprecation macro
33 #include "vtkPolyDataAlgorithm.h"
34 #include "vtkRenderingLabelModule.h" // For export macro
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkRenderer;
38 class vtkCoordinate;
40 
42  "Please use vtkLabelPlacementMapper instead") VTKRENDERINGLABEL_EXPORT vtkLabelPlacer
43  : public vtkPolyDataAlgorithm
44 {
45 public:
46  static vtkLabelPlacer* New();
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
50  vtkGetObjectMacro(Renderer, vtkRenderer);
51  virtual void SetRenderer(vtkRenderer*);
52 
53  vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
54 
57  {
58  VerticalBottomBit = 1,
59  VerticalBaselineBit = 2,
60  VerticalCenterBit = 4,
61  VerticalTopBit = 8,
62  HorizontalLeftBit = 16,
63  HorizontalCenterBit = 32,
64  HorizontalRightBit = 64,
65  VerticalBitMask = 15,
66  HorizontalBitMask = 112,
67 
68  LowerLeft = 17,
69  LowerCenter =
70  33,
71  LowerRight = 65,
72 
73  BaselineLeft = 18,
74  BaselineCenter = 34,
76  BaselineRight = 66,
78 
80  CenterLeft = 20,
81  CenterCenter =
83  36,
84  CenterRight = 68,
85 
87  UpperLeft = 24,
88  UpperCenter = 40,
89  UpperRight = 72
90  };
91 
94  {
95  WORLD = 0,
96  DISPLAY = 1
97  };
99 
101 
104  virtual void SetGravity(int gravity);
105  vtkGetMacro(Gravity, int);
107 
109 
113  vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
114  vtkGetMacro(MaximumLabelFraction, double);
116 
118 
122  vtkSetMacro(IteratorType, int);
123  vtkGetMacro(IteratorType, int);
125 
126  vtkMTimeType GetMTime() override;
127 
129 
134  vtkGetMacro(PositionsAsNormals, bool);
135  vtkSetMacro(PositionsAsNormals, bool);
136  vtkBooleanMacro(PositionsAsNormals, bool);
138 
140 
144  vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
145  vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
146  vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
148 
150 
154  vtkGetMacro(UseDepthBuffer, bool);
155  vtkSetMacro(UseDepthBuffer, bool);
156  vtkBooleanMacro(UseDepthBuffer, bool);
158 
160 
163  vtkGetMacro(OutputTraversedBounds, bool);
164  vtkSetMacro(OutputTraversedBounds, bool);
165  vtkBooleanMacro(OutputTraversedBounds, bool);
167 
169 
173  vtkGetMacro(OutputCoordinateSystem, int);
174  vtkSetClampMacro(OutputCoordinateSystem, int, WORLD, DISPLAY);
175  void OutputCoordinateSystemWorld() { this->SetOutputCoordinateSystem(vtkLabelPlacer::WORLD); }
176  void OutputCoordinateSystemDisplay() { this->SetOutputCoordinateSystem(vtkLabelPlacer::DISPLAY); }
178 
179 protected:
180  vtkLabelPlacer();
181  ~vtkLabelPlacer() override;
182 
183  virtual void SetAnchorTransform(vtkCoordinate*);
184 
185  int FillInputPortInformation(int port, vtkInformation* info) override;
186  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
187  vtkInformationVector* outputVector) override;
188 
189  class Internal;
190  Internal* Buckets;
191 
195  int Gravity;
201 
202  int LastRendererSize[2];
203  double LastCameraPosition[3];
204  double LastCameraFocalPoint[3];
205  double LastCameraViewUp[3];
209 
210 private:
211  vtkLabelPlacer(const vtkLabelPlacer&) = delete;
212  void operator=(const vtkLabelPlacer&) = delete;
213 };
214 
215 VTK_ABI_NAMESPACE_END
216 #endif // vtkLabelPlacer_h
OutputCoordinates
Coordinate systems that output dataset may use.
extract points that are visible (based on z-buffer calculation)
place a prioritized hierarchy of labels in screen space
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Internal * Buckets
vtkRenderer * Renderer
abstract specification for renderers
Definition: vtkRenderer.h:63
void OutputCoordinateSystemDisplay()
Set/get the coordinate system used for output labels.
static vtkPolyDataAlgorithm * New()
Output 2-D display coordinates for each label anchor (3 components but only 2 are significant)...
#define VTK_DEPRECATED_IN_9_6_0(reason)
Superclass for algorithms that produce only polydata as output.
Output 3-D world-space coordinates for each label anchor.
bool GeneratePerturbedLabelSpokes
a simple class to control print indentation
Definition: vtkIndent.h:28
void OutputCoordinateSystemWorld()
Set/get the coordinate system used for output labels.
bool OutputTraversedBounds
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkSelectVisiblePoints * VisiblePoints
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
vtkCoordinate * AnchorTransform
LabelGravity
Specifications for the placement of the label relative to an anchor point.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
double LastCameraParallelScale
double MaximumLabelFraction
Places and renders non-overlapping labels.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.