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 "vtkMapper2D.h"
44 
45 class vtkCoordinate;
48 
50 {
51 public:
52  static vtkLabelPlacementMapper *New();
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
57  void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
58 
60 
61  virtual void SetRenderStrategy(vtkLabelRenderStrategy* s);
62  vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
64 
66 
68  vtkSetClampMacro(MaximumLabelFraction,double,0.,1.);
69  vtkGetMacro(MaximumLabelFraction,double);
71 
73 
75  vtkSetMacro(IteratorType,int);
76  vtkGetMacro(IteratorType,int);
78 
80 
81  vtkSetMacro(UseUnicodeStrings,bool);
82  vtkGetMacro(UseUnicodeStrings,bool);
83  vtkBooleanMacro(UseUnicodeStrings,bool);
85 
87 
91  vtkGetMacro(PositionsAsNormals,bool);
92  vtkSetMacro(PositionsAsNormals,bool);
93  vtkBooleanMacro(PositionsAsNormals,bool);
95 
97 
99  vtkGetMacro(GeneratePerturbedLabelSpokes,bool);
100  vtkSetMacro(GeneratePerturbedLabelSpokes,bool);
101  vtkBooleanMacro(GeneratePerturbedLabelSpokes,bool);
103 
105 
108  vtkGetMacro(UseDepthBuffer,bool);
109  vtkSetMacro(UseDepthBuffer,bool);
110  vtkBooleanMacro(UseDepthBuffer,bool);
112 
114 
116  vtkSetMacro(PlaceAllLabels, bool);
117  vtkGetMacro(PlaceAllLabels, bool);
118  vtkBooleanMacro(PlaceAllLabels, bool);
120 
122 
123  vtkSetMacro(OutputTraversedBounds, bool);
124  vtkGetMacro(OutputTraversedBounds, bool);
125  vtkBooleanMacro(OutputTraversedBounds, bool);
127 
128  //BTX
129  enum LabelShape {
133  NUMBER_OF_LABEL_SHAPES
134  };
135  //ETX
136 
138 
140  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES-1);
141  vtkGetMacro(Shape, int);
142  virtual void SetShapeToNone()
143  { this->SetShape(NONE); }
144  virtual void SetShapeToRect()
145  { this->SetShape(RECT); }
146  virtual void SetShapeToRoundedRect()
147  { this->SetShape(ROUNDED_RECT); }
149 
150  //BTX
151  enum LabelStyle {
154  NUMBER_OF_LABEL_STYLES
155  };
156  //ETX
157 
159 
161  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES-1);
162  vtkGetMacro(Style, int);
163  virtual void SetStyleToFilled()
164  { this->SetStyle(FILLED); }
165  virtual void SetStyleToOutline()
166  { this->SetStyle(OUTLINE); }
168 
170 
171  vtkSetMacro(Margin, double);
172  vtkGetMacro(Margin, double);
174 
176 
177  vtkSetVector3Macro(BackgroundColor, double);
178  vtkGetVector3Macro(BackgroundColor, double);
180 
182 
183  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
184  vtkGetMacro(BackgroundOpacity, double);
186 
188 
189  vtkGetObjectMacro(AnchorTransform,vtkCoordinate);
191 
192 protected:
195 
196  virtual void SetAnchorTransform( vtkCoordinate* );
197 
198  virtual int FillInputPortInformation( int port, vtkInformation* info );
199 
200  //BTX
201  class Internal;
202  Internal* Buckets;
203  //ETX
204 
215 
216  int LastRendererSize[2];
217  double LastCameraPosition[3];
218  double LastCameraFocalPoint[3];
219  double LastCameraViewUp[3];
222 
223  int Style;
224  int Shape;
225  double Margin;
227  double BackgroundColor[3];
228 
229 private:
230  vtkLabelPlacementMapper(const vtkLabelPlacementMapper&); // Not implemented.
231  void operator=(const vtkLabelPlacementMapper&); // Not implemented.
232 };
233 
234 #endif
235 
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:39
abstract specification for Viewports
Definition: vtkViewport.h:45
a actor that draws 2D data
Definition: vtkActor2D.h:43
vtkLabelRenderStrategy * RenderStrategy
a simple class to control print indentation
Definition: vtkIndent.h:37
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:68
#define VTK_RENDERING_EXPORT
vtkSelectVisiblePoints * VisiblePoints
static vtkAlgorithm * New()
Places and renders non-overlapping labels.
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:33