VTK
vtkLabelPlacementMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLabelPlacementMapper.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 -------------------------------------------------------------------------*/
40 #ifndef vtkLabelPlacementMapper_h
41 #define vtkLabelPlacementMapper_h
42 
43 #include "vtkRenderingLabelModule.h" // For export macro
44 #include "vtkMapper2D.h"
45 
46 class vtkCoordinate;
49 
51 {
52 public:
53  static vtkLabelPlacementMapper *New();
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
58  void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
59 
61 
62  virtual void SetRenderStrategy(vtkLabelRenderStrategy* s);
63  vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
65 
67 
69  vtkSetClampMacro(MaximumLabelFraction,double,0.,1.);
70  vtkGetMacro(MaximumLabelFraction,double);
72 
74 
76  vtkSetMacro(IteratorType,int);
77  vtkGetMacro(IteratorType,int);
79 
81 
82  vtkSetMacro(UseUnicodeStrings,bool);
83  vtkGetMacro(UseUnicodeStrings,bool);
84  vtkBooleanMacro(UseUnicodeStrings,bool);
86 
88 
92  vtkGetMacro(PositionsAsNormals,bool);
93  vtkSetMacro(PositionsAsNormals,bool);
94  vtkBooleanMacro(PositionsAsNormals,bool);
96 
98 
100  vtkGetMacro(GeneratePerturbedLabelSpokes,bool);
101  vtkSetMacro(GeneratePerturbedLabelSpokes,bool);
102  vtkBooleanMacro(GeneratePerturbedLabelSpokes,bool);
104 
106 
109  vtkGetMacro(UseDepthBuffer,bool);
110  vtkSetMacro(UseDepthBuffer,bool);
111  vtkBooleanMacro(UseDepthBuffer,bool);
113 
115 
117  vtkSetMacro(PlaceAllLabels, bool);
118  vtkGetMacro(PlaceAllLabels, bool);
119  vtkBooleanMacro(PlaceAllLabels, bool);
121 
123 
124  vtkSetMacro(OutputTraversedBounds, bool);
125  vtkGetMacro(OutputTraversedBounds, bool);
126  vtkBooleanMacro(OutputTraversedBounds, bool);
128 
129  //BTX
130  enum LabelShape {
134  NUMBER_OF_LABEL_SHAPES
135  };
136  //ETX
137 
139 
141  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES-1);
142  vtkGetMacro(Shape, int);
143  virtual void SetShapeToNone()
144  { this->SetShape(NONE); }
145  virtual void SetShapeToRect()
146  { this->SetShape(RECT); }
147  virtual void SetShapeToRoundedRect()
148  { this->SetShape(ROUNDED_RECT); }
150 
151  //BTX
152  enum LabelStyle {
155  NUMBER_OF_LABEL_STYLES
156  };
157  //ETX
158 
160 
162  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES-1);
163  vtkGetMacro(Style, int);
164  virtual void SetStyleToFilled()
165  { this->SetStyle(FILLED); }
166  virtual void SetStyleToOutline()
167  { this->SetStyle(OUTLINE); }
169 
171 
172  vtkSetMacro(Margin, double);
173  vtkGetMacro(Margin, double);
175 
177 
178  vtkSetVector3Macro(BackgroundColor, double);
179  vtkGetVector3Macro(BackgroundColor, double);
181 
183 
184  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
185  vtkGetMacro(BackgroundOpacity, double);
187 
189 
190  vtkGetObjectMacro(AnchorTransform,vtkCoordinate);
192 
196  virtual void ReleaseGraphicsResources(vtkWindow *);
197 
198 protected:
201 
202  virtual void SetAnchorTransform( vtkCoordinate* );
203 
204  virtual int FillInputPortInformation( int port, vtkInformation* info );
205 
206  //BTX
207  class Internal;
208  Internal* Buckets;
209  //ETX
210 
221 
222  int LastRendererSize[2];
223  double LastCameraPosition[3];
224  double LastCameraFocalPoint[3];
225  double LastCameraViewUp[3];
228 
229  int Style;
230  int Shape;
231  double Margin;
233  double BackgroundColor[3];
234 
235 private:
236  vtkLabelPlacementMapper(const vtkLabelPlacementMapper&); // Not implemented.
237  void operator=(const vtkLabelPlacementMapper&); // Not implemented.
238 };
239 
240 #endif
241 
Superclass for label rendering implementations.
extract points that are visible (based on z-buffer calculation)
Store vtkAlgorithm input/output information.
virtual void RenderOverlay(vtkViewport *, vtkActor2D *)
Definition: vtkMapper2D.h:40
abstract specification for Viewports
Definition: vtkViewport.h:46
a actor that draws 2D data
Definition: vtkActor2D.h:44
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
vtkLabelRenderStrategy * RenderStrategy
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKRENDERINGLABEL_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
virtual int FillInputPortInformation(int port, vtkInformation *info)
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkSelectVisiblePoints * VisiblePoints
static vtkAlgorithm * New()
Places and renders non-overlapping labels.
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:34