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 -------------------------------------------------------------------------*/
44 #ifndef vtkLabelPlacer_h
45 #define vtkLabelPlacer_h
46 
47 #include "vtkRenderingLabelModule.h" // For export macro
48 #include "vtkPolyDataAlgorithm.h"
49 
50 class vtkRenderer;
51 class vtkCoordinate;
53 
55 {
56 public:
57  static vtkLabelPlacer* New();
59  virtual void PrintSelf( ostream& os, vtkIndent indent );
60 
62  virtual void SetRenderer( vtkRenderer* );
63 
64  vtkGetObjectMacro(AnchorTransform,vtkCoordinate);
65 
66  //BTX
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  //ETX
104 
106 
107  virtual void SetGravity( int gravity );
108  vtkGetMacro(Gravity,int);
110 
112 
114  vtkSetClampMacro(MaximumLabelFraction,double,0.,1.);
115  vtkGetMacro(MaximumLabelFraction,double);
117 
119 
121  vtkSetMacro(IteratorType,int);
122  vtkGetMacro(IteratorType,int);
124 
126 
127  vtkSetMacro(UseUnicodeStrings,bool);
128  vtkGetMacro(UseUnicodeStrings,bool);
129  vtkBooleanMacro(UseUnicodeStrings,bool);
131 
132  virtual unsigned long GetMTime();
133 
135 
139  vtkGetMacro(PositionsAsNormals,bool);
140  vtkSetMacro(PositionsAsNormals,bool);
141  vtkBooleanMacro(PositionsAsNormals,bool);
143 
145 
147  vtkGetMacro(GeneratePerturbedLabelSpokes,bool);
148  vtkSetMacro(GeneratePerturbedLabelSpokes,bool);
149  vtkBooleanMacro(GeneratePerturbedLabelSpokes,bool);
151 
153 
156  vtkGetMacro(UseDepthBuffer,bool);
157  vtkSetMacro(UseDepthBuffer,bool);
158  vtkBooleanMacro(UseDepthBuffer,bool);
160 
162 
164  vtkGetMacro(OutputTraversedBounds,bool);
165  vtkSetMacro(OutputTraversedBounds,bool);
166  vtkBooleanMacro(OutputTraversedBounds,bool);
168 
170 
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:
181  virtual ~vtkLabelPlacer();
182 
184 
186  virtual int RequestData( vtkInformation* request,
187  vtkInformationVector** inputVector, vtkInformationVector* outputVector );
188 
189  //BTX
190  class Internal;
191  Internal* Buckets;
192  //ETX
193 
197  int Gravity;
204 
205  int LastRendererSize[2];
206  double LastCameraPosition[3];
207  double LastCameraFocalPoint[3];
208  double LastCameraViewUp[3];
212 
213 private:
214  vtkLabelPlacer( const vtkLabelPlacer& ); // Not implemented.
215  void operator = ( const vtkLabelPlacer& ); // Not implemented.
216 };
217 
218 #endif // vtkLabelPlacer_h
vtkRenderingLabelModule.h
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkLabelPlacer::WORLD
@ WORLD
Output 3-D world-space coordinates for each label anchor.
Definition: vtkLabelPlacer.h:100
vtkLabelPlacer::New
static vtkLabelPlacer * New()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkLabelPlacer::OutputCoordinateSystemWorld
void OutputCoordinateSystemWorld()
Definition: vtkLabelPlacer.h:175
vtkLabelPlacer::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
VTKRENDERINGLABEL_EXPORT
#define VTKRENDERINGLABEL_EXPORT
Definition: vtkRenderingLabelModule.h:15
vtkLabelPlacer::SetGravity
virtual void SetGravity(int gravity)
vtkLabelPlacer::Renderer
vtkRenderer * Renderer
Definition: vtkLabelPlacer.h:194
vtkLabelPlacer::UseDepthBuffer
bool UseDepthBuffer
Definition: vtkLabelPlacer.h:202
vtkLabelPlacer::Gravity
int Gravity
Definition: vtkLabelPlacer.h:197
vtkLabelPlacer::SetRenderer
virtual void SetRenderer(vtkRenderer *)
vtkLabelPlacer::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info)
vtkLabelPlacer::LastCameraParallelScale
double LastCameraParallelScale
Definition: vtkLabelPlacer.h:209
vtkLabelPlacer::DISPLAY
@ DISPLAY
Output 2-D display coordinates for each label anchor (3 components but only 2 are significant).
Definition: vtkLabelPlacer.h:101
vtkPolyDataAlgorithm.h
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkLabelPlacer::OutputCoordinateSystemDisplay
void OutputCoordinateSystemDisplay()
Definition: vtkLabelPlacer.h:176
vtkLabelPlacer::OutputCoordinates
OutputCoordinates
Coordinate systems that output dataset may use.
Definition: vtkLabelPlacer.h:99
vtkLabelPlacer::vtkLabelPlacer
vtkLabelPlacer()
vtkLabelPlacer::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkLabelPlacer::IteratorType
int IteratorType
Definition: vtkLabelPlacer.h:210
vtkLabelPlacer::UseUnicodeStrings
bool UseUnicodeStrings
Definition: vtkLabelPlacer.h:203
vtkLabelPlacer::SetAnchorTransform
virtual void SetAnchorTransform(vtkCoordinate *)
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:70
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkLabelPlacer
place a prioritized hierarchy of labels in screen space
Definition: vtkLabelPlacer.h:55
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkLabelPlacer::AnchorTransform
vtkCoordinate * AnchorTransform
Definition: vtkLabelPlacer.h:195
vtkLabelPlacer::Buckets
Internal * Buckets
Definition: vtkLabelPlacer.h:190
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkLabelPlacer::PositionsAsNormals
bool PositionsAsNormals
Definition: vtkLabelPlacer.h:199
vtkLabelPlacer::MaximumLabelFraction
double MaximumLabelFraction
Definition: vtkLabelPlacer.h:198
vtkLabelPlacer::GetMTime
virtual unsigned long GetMTime()
vtkLabelPlacer::VisiblePoints
vtkSelectVisiblePoints * VisiblePoints
Definition: vtkLabelPlacer.h:196
vtkLabelPlacer::GeneratePerturbedLabelSpokes
bool GeneratePerturbedLabelSpokes
Definition: vtkLabelPlacer.h:201
vtkSelectVisiblePoints
extract points that are visible (based on z-buffer calculation)
Definition: vtkSelectVisiblePoints.h:60
vtkLabelPlacer::~vtkLabelPlacer
virtual ~vtkLabelPlacer()
vtkLabelPlacer::LabelGravity
LabelGravity
Specifications for the placement of the label relative to an anchor point.
Definition: vtkLabelPlacer.h:69
vtkLabelPlacer::OutputCoordinateSystem
int OutputCoordinateSystem
Definition: vtkLabelPlacer.h:211
vtkLabelPlacer::OutputTraversedBounds
bool OutputTraversedBounds
Definition: vtkLabelPlacer.h:200
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44