VTK
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 "vtkRenderingLabelModule.h" // For export macro
50
51class vtkRenderer;
52class vtkCoordinate;
54
55class VTKRENDERINGLABEL_EXPORT vtkLabelPlacer : public vtkPolyDataAlgorithm
56{
57public:
60 virtual void PrintSelf( ostream& os, vtkIndent indent );
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=33,
82 LowerRight=65,
83
84 BaselineLeft=18,
85 BaselineCenter=34,
86 BaselineRight=66,
87
88 CenterLeft=20,
89 CenterCenter=36,
90 CenterRight=68,
91
92 UpperLeft=24,
93 UpperCenter=40,
94 UpperRight=72
95 };
96
99 {
100 WORLD=0,
101 DISPLAY=1
102 };
103
105
108 virtual void SetGravity( int gravity );
109 vtkGetMacro(Gravity,int);
111
113
117 vtkSetClampMacro(MaximumLabelFraction,double,0.,1.);
118 vtkGetMacro(MaximumLabelFraction,double);
120
122
126 vtkSetMacro(IteratorType,int);
127 vtkGetMacro(IteratorType,int);
129
131
134 vtkSetMacro(UseUnicodeStrings,bool);
135 vtkGetMacro(UseUnicodeStrings,bool);
136 vtkBooleanMacro(UseUnicodeStrings,bool);
138
140
142
147 vtkGetMacro(PositionsAsNormals,bool);
148 vtkSetMacro(PositionsAsNormals,bool);
149 vtkBooleanMacro(PositionsAsNormals,bool);
151
153
157 vtkGetMacro(GeneratePerturbedLabelSpokes,bool);
158 vtkSetMacro(GeneratePerturbedLabelSpokes,bool);
159 vtkBooleanMacro(GeneratePerturbedLabelSpokes,bool);
161
163
167 vtkGetMacro(UseDepthBuffer,bool);
168 vtkSetMacro(UseDepthBuffer,bool);
169 vtkBooleanMacro(UseDepthBuffer,bool);
171
173
176 vtkGetMacro(OutputTraversedBounds,bool);
177 vtkSetMacro(OutputTraversedBounds,bool);
178 vtkBooleanMacro(OutputTraversedBounds,bool);
180
182
186 vtkGetMacro(OutputCoordinateSystem,int);
187 vtkSetClampMacro(OutputCoordinateSystem,int,WORLD,DISPLAY);
188 void OutputCoordinateSystemWorld() { this->SetOutputCoordinateSystem( vtkLabelPlacer::WORLD ); }
189 void OutputCoordinateSystemDisplay() { this->SetOutputCoordinateSystem( vtkLabelPlacer::DISPLAY ); }
191
192protected:
195
197
199 virtual int RequestData( vtkInformation* request,
200 vtkInformationVector** inputVector, vtkInformationVector* outputVector );
201
202 class Internal;
203 Internal* Buckets;
204
215
216 int LastRendererSize[2];
217 double LastCameraPosition[3];
218 double LastCameraFocalPoint[3];
219 double LastCameraViewUp[3];
223
224private:
225 vtkLabelPlacer( const vtkLabelPlacer& ) VTK_DELETE_FUNCTION;
226 void operator = ( const vtkLabelPlacer& ) VTK_DELETE_FUNCTION;
227};
228
229#endif // vtkLabelPlacer_h
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:71
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 *)
int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
Internal * Buckets
virtual vtkMTimeType GetMTime()
Return this object's modified time.
double MaximumLabelFraction
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
LabelGravity
Specifications for the placement of the label relative to an anchor point.
void OutputCoordinateSystemWorld()
static vtkLabelPlacer * New()
vtkCoordinate * AnchorTransform
virtual void SetAnchorTransform(vtkCoordinate *)
bool OutputTraversedBounds
void OutputCoordinateSystemDisplay()
vtkRenderer * Renderer
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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.
vtkSelectVisiblePoints * VisiblePoints
double LastCameraParallelScale
bool GeneratePerturbedLabelSpokes
virtual ~vtkLabelPlacer()
Superclass for algorithms that produce only polydata as output.
abstract specification for renderers
Definition: vtkRenderer.h:64
extract points that are visible (based on z-buffer calculation)
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248