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 "vtkPolyDataAlgorithm.h"
48 
49 class vtkRenderer;
50 class vtkCoordinate;
52 
54 {
55 public:
56  static vtkLabelPlacer* New();
58  virtual void PrintSelf( ostream& os, vtkIndent indent );
59 
60  vtkGetObjectMacro(Renderer,vtkRenderer);
61  virtual void SetRenderer( vtkRenderer* );
62 
63  vtkGetObjectMacro(AnchorTransform,vtkCoordinate);
64 
65  //BTX
68  {
69  VerticalBottomBit = 1,
70  VerticalBaselineBit = 2,
71  VerticalCenterBit = 4,
72  VerticalTopBit = 8,
73  HorizontalLeftBit = 16,
74  HorizontalCenterBit = 32,
75  HorizontalRightBit = 64,
76  VerticalBitMask = 15,
77  HorizontalBitMask = 112,
78 
79  LowerLeft=17,
80  LowerCenter=33,
81  LowerRight=65,
82 
83  BaselineLeft=18,
84  BaselineCenter=34,
85  BaselineRight=66,
86 
87  CenterLeft=20,
88  CenterCenter=36,
89  CenterRight=68,
90 
91  UpperLeft=24,
92  UpperCenter=40,
93  UpperRight=72
94  };
95 
98  {
99  WORLD=0,
100  DISPLAY=1
101  };
102  //ETX
103 
105 
106  virtual void SetGravity( int gravity );
107  vtkGetMacro(Gravity,int);
109 
111 
113  vtkSetClampMacro(MaximumLabelFraction,double,0.,1.);
114  vtkGetMacro(MaximumLabelFraction,double);
116 
118 
120  vtkSetMacro(IteratorType,int);
121  vtkGetMacro(IteratorType,int);
123 
125 
126  vtkSetMacro(UseUnicodeStrings,bool);
127  vtkGetMacro(UseUnicodeStrings,bool);
128  vtkBooleanMacro(UseUnicodeStrings,bool);
130 
131  virtual unsigned long GetMTime();
132 
134 
138  vtkGetMacro(PositionsAsNormals,bool);
139  vtkSetMacro(PositionsAsNormals,bool);
140  vtkBooleanMacro(PositionsAsNormals,bool);
142 
144 
146  vtkGetMacro(GeneratePerturbedLabelSpokes,bool);
147  vtkSetMacro(GeneratePerturbedLabelSpokes,bool);
148  vtkBooleanMacro(GeneratePerturbedLabelSpokes,bool);
150 
152 
155  vtkGetMacro(UseDepthBuffer,bool);
156  vtkSetMacro(UseDepthBuffer,bool);
157  vtkBooleanMacro(UseDepthBuffer,bool);
159 
161 
163  vtkGetMacro(OutputTraversedBounds,bool);
164  vtkSetMacro(OutputTraversedBounds,bool);
165  vtkBooleanMacro(OutputTraversedBounds,bool);
167 
169 
172  vtkGetMacro(OutputCoordinateSystem,int);
173  vtkSetClampMacro(OutputCoordinateSystem,int,WORLD,DISPLAY);
174  void OutputCoordinateSystemWorld() { this->SetOutputCoordinateSystem( vtkLabelPlacer::WORLD ); }
175  void OutputCoordinateSystemDisplay() { this->SetOutputCoordinateSystem( vtkLabelPlacer::DISPLAY ); }
177 
178 protected:
179  vtkLabelPlacer();
180  virtual ~vtkLabelPlacer();
181 
182  virtual void SetAnchorTransform( vtkCoordinate* );
183 
185  virtual int RequestData( vtkInformation* request,
186  vtkInformationVector** inputVector, vtkInformationVector* outputVector );
187 
188  //BTX
189  class Internal;
190  Internal* Buckets;
191  //ETX
192 
196  int Gravity;
203 
204  int LastRendererSize[2];
205  double LastCameraPosition[3];
206  double LastCameraFocalPoint[3];
207  double LastCameraViewUp[3];
211 
212 private:
213  vtkLabelPlacer( const vtkLabelPlacer& ); // Not implemented.
214  void operator = ( const vtkLabelPlacer& ); // Not implemented.
215 };
216 
217 #endif // __vtkLabelPlacer_h
virtual int FillInputPortInformation(int port, vtkInformation *info)
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.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Internal * Buckets
vtkRenderer * Renderer
abstract specification for renderers
Definition: vtkRenderer.h:69
void OutputCoordinateSystemDisplay()
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
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
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:37
void OutputCoordinateSystemWorld()
bool OutputTraversedBounds
vtkSelectVisiblePoints * VisiblePoints
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
vtkCoordinate * AnchorTransform
#define VTK_RENDERING_EXPORT
LabelGravity
Specifications for the placement of the label relative to an anchor point.
Store zero or more vtkInformation instances.
double LastCameraParallelScale
double MaximumLabelFraction