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
49#include "vtkRenderingLabelModule.h" // For export macro
50
51class vtkRenderer;
52class vtkCoordinate;
54
55class VTKRENDERINGLABEL_EXPORT vtkLabelPlacer : public vtkPolyDataAlgorithm
56{
57public:
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,
87 BaselineCenter = 34,
89 BaselineRight = 66,
91
92 CenterLeft = 20,
94 CenterCenter =
95 36,
96 CenterRight = 68,
98
99 UpperLeft = 24,
100 UpperCenter = 40,
101 UpperRight = 72
102 };
103
106 {
107 WORLD = 0,
108 DISPLAY = 1
110 };
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
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
191protected:
193 ~vtkLabelPlacer() override;
194
196
197 int FillInputPortInformation(int port, vtkInformation* info) override;
199 vtkInformationVector* outputVector) override;
200
201 class Internal;
202 Internal* Buckets;
203
213
214 int LastRendererSize[2];
215 double LastCameraPosition[3];
216 double LastCameraFocalPoint[3];
217 double LastCameraViewUp[3];
221
222private:
223 vtkLabelPlacer(const vtkLabelPlacer&) = delete;
224 void operator=(const vtkLabelPlacer&) = delete;
225};
226
227#endif // vtkLabelPlacer_h
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:80
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
place a prioritized hierarchy of labels in screen space
virtual void SetRenderer(vtkRenderer *)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Internal * Buckets
double MaximumLabelFraction
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
LabelGravity
Specifications for the placement of the label relative to an anchor point.
void OutputCoordinateSystemWorld()
Set/get the coordinate system used for output labels.
static vtkLabelPlacer * New()
vtkCoordinate * AnchorTransform
virtual void SetAnchorTransform(vtkCoordinate *)
bool OutputTraversedBounds
~vtkLabelPlacer() override
vtkMTimeType GetMTime() override
Return this object's modified time.
void OutputCoordinateSystemDisplay()
Set/get the coordinate system used for output labels.
vtkRenderer * Renderer
OutputCoordinates
Coordinate systems that output dataset may use.
@ DISPLAY
Output 2-D display coordinates for each label anchor (3 components but only 2 are significant).
@ WORLD
Output 3-D world-space coordinates for each label anchor.
virtual void SetGravity(int gravity)
The placement of the label relative to the anchor point.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkSelectVisiblePoints * VisiblePoints
double LastCameraParallelScale
bool GeneratePerturbedLabelSpokes
Superclass for algorithms that produce only polydata as output.
abstract specification for renderers
Definition: vtkRenderer.h:73
extract points that are visible (based on z-buffer calculation)
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287