VTK  9.2.6
vtkLabelPlacer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLabelPlacer.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 -------------------------------------------------------------------------*/
45 #ifndef vtkLabelPlacer_h
46 #define vtkLabelPlacer_h
47 
48 #include "vtkPolyDataAlgorithm.h"
49 #include "vtkRenderingLabelModule.h" // For export macro
50 
51 class vtkRenderer;
52 class vtkCoordinate;
54 
55 class VTKRENDERINGLABEL_EXPORT vtkLabelPlacer : public vtkPolyDataAlgorithm
56 {
57 public:
58  static vtkLabelPlacer* New();
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
62  vtkGetObjectMacro(Renderer, vtkRenderer);
63  virtual void SetRenderer(vtkRenderer*);
64 
65  vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
66 
69  {
70  VerticalBottomBit = 1,
71  VerticalBaselineBit = 2,
72  VerticalCenterBit = 4,
73  VerticalTopBit = 8,
74  HorizontalLeftBit = 16,
75  HorizontalCenterBit = 32,
76  HorizontalRightBit = 64,
77  VerticalBitMask = 15,
78  HorizontalBitMask = 112,
79 
80  LowerLeft = 17,
81  LowerCenter =
82  33,
83  LowerRight = 65,
84 
85  BaselineLeft = 18,
86  BaselineCenter = 34,
88  BaselineRight = 66,
90 
92  CenterLeft = 20,
93  CenterCenter =
95  36,
96  CenterRight = 68,
97 
99  UpperLeft = 24,
100  UpperCenter = 40,
101  UpperRight = 72
102  };
103 
106  {
107  WORLD = 0,
108  DISPLAY = 1
109  };
111 
113 
116  virtual void SetGravity(int gravity);
117  vtkGetMacro(Gravity, int);
119 
121 
125  vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
126  vtkGetMacro(MaximumLabelFraction, double);
128 
130 
134  vtkSetMacro(IteratorType, int);
135  vtkGetMacro(IteratorType, int);
137 
138  vtkMTimeType GetMTime() override;
139 
141 
146  vtkGetMacro(PositionsAsNormals, bool);
147  vtkSetMacro(PositionsAsNormals, bool);
148  vtkBooleanMacro(PositionsAsNormals, bool);
150 
152 
156  vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
157  vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
158  vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
160 
162 
166  vtkGetMacro(UseDepthBuffer, bool);
167  vtkSetMacro(UseDepthBuffer, bool);
168  vtkBooleanMacro(UseDepthBuffer, bool);
170 
172 
175  vtkGetMacro(OutputTraversedBounds, bool);
176  vtkSetMacro(OutputTraversedBounds, bool);
177  vtkBooleanMacro(OutputTraversedBounds, bool);
179 
181 
185  vtkGetMacro(OutputCoordinateSystem, int);
186  vtkSetClampMacro(OutputCoordinateSystem, int, WORLD, DISPLAY);
187  void OutputCoordinateSystemWorld() { this->SetOutputCoordinateSystem(vtkLabelPlacer::WORLD); }
188  void OutputCoordinateSystemDisplay() { this->SetOutputCoordinateSystem(vtkLabelPlacer::DISPLAY); }
190 
191 protected:
192  vtkLabelPlacer();
193  ~vtkLabelPlacer() override;
194 
195  virtual void SetAnchorTransform(vtkCoordinate*);
196 
197  int FillInputPortInformation(int port, vtkInformation* info) override;
198  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
199  vtkInformationVector* outputVector) override;
200 
201  class Internal;
202  Internal* Buckets;
203 
207  int Gravity;
213 
214  int LastRendererSize[2];
215  double LastCameraPosition[3];
216  double LastCameraFocalPoint[3];
217  double LastCameraViewUp[3];
221 
222 private:
223  vtkLabelPlacer(const vtkLabelPlacer&) = delete;
224  void operator=(const vtkLabelPlacer&) = delete;
225 };
226 
227 #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:287
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:72
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)...
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:39
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:79
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
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.