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 -------------------------------------------------------------------------*/
35 #ifndef vtkLabelPlacementMapper_h
36 #define vtkLabelPlacementMapper_h
37 
38 #include "vtkRenderingLabelModule.h" // For export macro
39 #include "vtkMapper2D.h"
40 
41 class vtkCoordinate;
44 
45 class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
46 {
47 public:
48  static vtkLabelPlacementMapper *New();
50  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
51 
55  void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) VTK_OVERRIDE;
56 
58 
61  virtual void SetRenderStrategy(vtkLabelRenderStrategy* s);
62  vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
64 
66 
70  vtkSetClampMacro(MaximumLabelFraction,double,0.,1.);
71  vtkGetMacro(MaximumLabelFraction,double);
73 
75 
79  vtkSetMacro(IteratorType,int);
80  vtkGetMacro(IteratorType,int);
82 
84 
87  vtkSetMacro(UseUnicodeStrings,bool);
88  vtkGetMacro(UseUnicodeStrings,bool);
89  vtkBooleanMacro(UseUnicodeStrings,bool);
91 
93 
98  vtkGetMacro(PositionsAsNormals,bool);
99  vtkSetMacro(PositionsAsNormals,bool);
100  vtkBooleanMacro(PositionsAsNormals,bool);
102 
104 
108  vtkGetMacro(GeneratePerturbedLabelSpokes,bool);
109  vtkSetMacro(GeneratePerturbedLabelSpokes,bool);
110  vtkBooleanMacro(GeneratePerturbedLabelSpokes,bool);
112 
114 
118  vtkGetMacro(UseDepthBuffer,bool);
119  vtkSetMacro(UseDepthBuffer,bool);
120  vtkBooleanMacro(UseDepthBuffer,bool);
122 
124 
128  vtkSetMacro(PlaceAllLabels, bool);
129  vtkGetMacro(PlaceAllLabels, bool);
130  vtkBooleanMacro(PlaceAllLabels, bool);
132 
134 
137  vtkSetMacro(OutputTraversedBounds, bool);
138  vtkGetMacro(OutputTraversedBounds, bool);
139  vtkBooleanMacro(OutputTraversedBounds, bool);
141 
142  enum LabelShape {
146  NUMBER_OF_LABEL_SHAPES
147  };
148 
150 
154  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES-1);
155  vtkGetMacro(Shape, int);
156  virtual void SetShapeToNone()
157  { this->SetShape(NONE); }
158  virtual void SetShapeToRect()
159  { this->SetShape(RECT); }
160  virtual void SetShapeToRoundedRect()
161  { this->SetShape(ROUNDED_RECT); }
163 
164  enum LabelStyle {
167  NUMBER_OF_LABEL_STYLES
168  };
169 
171 
175  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES-1);
176  vtkGetMacro(Style, int);
177  virtual void SetStyleToFilled()
178  { this->SetStyle(FILLED); }
179  virtual void SetStyleToOutline()
180  { this->SetStyle(OUTLINE); }
182 
184 
188  vtkSetMacro(Margin, double);
189  vtkGetMacro(Margin, double);
191 
193 
196  vtkSetVector3Macro(BackgroundColor, double);
197  vtkGetVector3Macro(BackgroundColor, double);
199 
201 
204  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
205  vtkGetMacro(BackgroundOpacity, double);
207 
209 
212  vtkGetObjectMacro(AnchorTransform,vtkCoordinate);
214 
220  void ReleaseGraphicsResources(vtkWindow *) VTK_OVERRIDE;
221 
222 protected:
224  ~vtkLabelPlacementMapper() VTK_OVERRIDE;
225 
226  virtual void SetAnchorTransform( vtkCoordinate* );
227 
228  int FillInputPortInformation( int port, vtkInformation* info ) VTK_OVERRIDE;
229 
230  class Internal;
231  Internal* Buckets;
232 
243 
244  int LastRendererSize[2];
245  double LastCameraPosition[3];
246  double LastCameraFocalPoint[3];
247  double LastCameraViewUp[3];
250 
251  int Style;
252  int Shape;
253  double Margin;
255  double BackgroundColor[3];
256 
257 private:
258  vtkLabelPlacementMapper(const vtkLabelPlacementMapper&) VTK_DELETE_FUNCTION;
259  void operator=(const vtkLabelPlacementMapper&) VTK_DELETE_FUNCTION;
260 };
261 
262 #endif
263 
virtual void SetStyleToOutline()
The style of the label background shape, should be one of the values in the LabelStyle enumeration...
Superclass for label rendering implementations.
extract points that are visible (based on z-buffer calculation)
virtual void SetShapeToNone()
The shape of the label background, should be one of the values in the LabelShape enumeration.
Store vtkAlgorithm input/output information.
virtual void RenderOverlay(vtkViewport *, vtkActor2D *)
Definition: vtkMapper2D.h:41
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:39
virtual void SetShapeToRect()
The shape of the label background, should be one of the values in the LabelShape enumeration.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkLabelRenderStrategy * RenderStrategy
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:72
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual void SetShapeToRoundedRect()
The shape of the label background, should be one of the values in the LabelShape enumeration.
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
vtkSelectVisiblePoints * VisiblePoints
static vtkAlgorithm * New()
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Places and renders non-overlapping labels.
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:35
virtual void SetStyleToFilled()
The style of the label background shape, should be one of the values in the LabelStyle enumeration...