VTK  9.1.0
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-------------------------------------------------------------------------*/
42#ifndef vtkLabelPlacer_h
43#define vtkLabelPlacer_h
44
46#include "vtkRenderingLabelModule.h" // For export macro
47
48class vtkRenderer;
49class vtkCoordinate;
51
52class VTKRENDERINGLABEL_EXPORT vtkLabelPlacer : public vtkPolyDataAlgorithm
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
59 vtkGetObjectMacro(Renderer, vtkRenderer);
60 virtual void SetRenderer(vtkRenderer*);
61
62 vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
63
66 {
67 VerticalBottomBit = 1,
68 VerticalBaselineBit = 2,
69 VerticalCenterBit = 4,
70 VerticalTopBit = 8,
71 HorizontalLeftBit = 16,
72 HorizontalCenterBit = 32,
73 HorizontalRightBit = 64,
74 VerticalBitMask = 15,
75 HorizontalBitMask = 112,
76
77 LowerLeft = 17,
78 LowerCenter =
79 33,
80 LowerRight = 65,
81
82 BaselineLeft = 18,
84 BaselineCenter = 34,
86 BaselineRight = 66,
88
89 CenterLeft = 20,
91 CenterCenter =
92 36,
93 CenterRight = 68,
95
96 UpperLeft = 24,
97 UpperCenter = 40,
98 UpperRight = 72
99 };
100
103 {
104 WORLD = 0,
105 DISPLAY = 1
107 };
108
110
113 virtual void SetGravity(int gravity);
114 vtkGetMacro(Gravity, int);
116
118
122 vtkSetClampMacro(MaximumLabelFraction, double, 0., 1.);
123 vtkGetMacro(MaximumLabelFraction, double);
125
127
131 vtkSetMacro(IteratorType, int);
132 vtkGetMacro(IteratorType, int);
134
136
139 vtkSetMacro(UseUnicodeStrings, bool);
140 vtkGetMacro(UseUnicodeStrings, bool);
141 vtkBooleanMacro(UseUnicodeStrings, bool);
143
145
147
152 vtkGetMacro(PositionsAsNormals, bool);
153 vtkSetMacro(PositionsAsNormals, bool);
154 vtkBooleanMacro(PositionsAsNormals, bool);
156
158
162 vtkGetMacro(GeneratePerturbedLabelSpokes, bool);
163 vtkSetMacro(GeneratePerturbedLabelSpokes, bool);
164 vtkBooleanMacro(GeneratePerturbedLabelSpokes, bool);
166
168
172 vtkGetMacro(UseDepthBuffer, bool);
173 vtkSetMacro(UseDepthBuffer, bool);
174 vtkBooleanMacro(UseDepthBuffer, bool);
176
178
181 vtkGetMacro(OutputTraversedBounds, bool);
182 vtkSetMacro(OutputTraversedBounds, bool);
183 vtkBooleanMacro(OutputTraversedBounds, bool);
185
187
191 vtkGetMacro(OutputCoordinateSystem, int);
192 vtkSetClampMacro(OutputCoordinateSystem, int, WORLD, DISPLAY);
193 void OutputCoordinateSystemWorld() { this->SetOutputCoordinateSystem(vtkLabelPlacer::WORLD); }
194 void OutputCoordinateSystemDisplay() { this->SetOutputCoordinateSystem(vtkLabelPlacer::DISPLAY); }
196
197protected:
199 ~vtkLabelPlacer() override;
200
202
205 vtkInformationVector* outputVector) override;
206
207 class Internal;
208 Internal* Buckets;
209
220
221 int LastRendererSize[2];
222 double LastCameraPosition[3];
223 double LastCameraFocalPoint[3];
224 double LastCameraViewUp[3];
228
229private:
230 vtkLabelPlacer(const vtkLabelPlacer&) = delete;
231 void operator=(const vtkLabelPlacer&) = delete;
232};
233
234#endif // vtkLabelPlacer_h
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition: vtkIndent.h:113
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:173
extract points that are visible (based on z-buffer calculation)
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287