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 -------------------------------------------------------------------------*/
41 #ifndef vtkLabelPlacementMapper_h
42 #define vtkLabelPlacementMapper_h
43 
44 #include "vtkRenderingLabelModule.h" // For export macro
45 #include "vtkMapper2D.h"
46 
47 class vtkCoordinate;
50 
51 class VTKRENDERINGLABEL_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
52 {
53 public:
54  static vtkLabelPlacementMapper *New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
61  void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override;
62 
64 
67  virtual void SetRenderStrategy(vtkLabelRenderStrategy* s);
68  vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
70 
72 
76  vtkSetClampMacro(MaximumLabelFraction,double,0.,1.);
77  vtkGetMacro(MaximumLabelFraction,double);
79 
81 
85  vtkSetMacro(IteratorType,int);
86  vtkGetMacro(IteratorType,int);
88 
90 
93  vtkSetMacro(UseUnicodeStrings,bool);
94  vtkGetMacro(UseUnicodeStrings,bool);
95  vtkBooleanMacro(UseUnicodeStrings,bool);
97 
99 
104  vtkGetMacro(PositionsAsNormals,bool);
105  vtkSetMacro(PositionsAsNormals,bool);
106  vtkBooleanMacro(PositionsAsNormals,bool);
108 
110 
114  vtkGetMacro(GeneratePerturbedLabelSpokes,bool);
115  vtkSetMacro(GeneratePerturbedLabelSpokes,bool);
116  vtkBooleanMacro(GeneratePerturbedLabelSpokes,bool);
118 
120 
124  vtkGetMacro(UseDepthBuffer,bool);
125  vtkSetMacro(UseDepthBuffer,bool);
126  vtkBooleanMacro(UseDepthBuffer,bool);
128 
130 
134  vtkSetMacro(PlaceAllLabels, bool);
135  vtkGetMacro(PlaceAllLabels, bool);
136  vtkBooleanMacro(PlaceAllLabels, bool);
138 
140 
143  vtkSetMacro(OutputTraversedBounds, bool);
144  vtkGetMacro(OutputTraversedBounds, bool);
145  vtkBooleanMacro(OutputTraversedBounds, bool);
147 
148  enum LabelShape {
152  NUMBER_OF_LABEL_SHAPES
153  };
154 
156 
160  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES-1);
161  vtkGetMacro(Shape, int);
162  virtual void SetShapeToNone()
163  { this->SetShape(NONE); }
164  virtual void SetShapeToRect()
165  { this->SetShape(RECT); }
166  virtual void SetShapeToRoundedRect()
167  { this->SetShape(ROUNDED_RECT); }
169 
170  enum LabelStyle {
173  NUMBER_OF_LABEL_STYLES
174  };
175 
177 
181  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES-1);
182  vtkGetMacro(Style, int);
183  virtual void SetStyleToFilled()
184  { this->SetStyle(FILLED); }
185  virtual void SetStyleToOutline()
186  { this->SetStyle(OUTLINE); }
188 
190 
194  vtkSetMacro(Margin, double);
195  vtkGetMacro(Margin, double);
197 
199 
202  vtkSetVector3Macro(BackgroundColor, double);
203  vtkGetVector3Macro(BackgroundColor, double);
205 
207 
210  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
211  vtkGetMacro(BackgroundOpacity, double);
213 
215 
218  vtkGetObjectMacro(AnchorTransform,vtkCoordinate);
220 
226  void ReleaseGraphicsResources(vtkWindow *) override;
227 
228 protected:
230  ~vtkLabelPlacementMapper() override;
231 
232  virtual void SetAnchorTransform( vtkCoordinate* );
233 
234  int FillInputPortInformation( int port, vtkInformation* info ) override;
235 
236  class Internal;
237  Internal* Buckets;
238 
249 
250  int LastRendererSize[2];
251  double LastCameraPosition[3];
252  double LastCameraFocalPoint[3];
253  double LastCameraViewUp[3];
256 
257  int Style;
258  int Shape;
259  double Margin;
261  double BackgroundColor[3];
262 
263 private:
265  void operator=(const vtkLabelPlacementMapper&) = delete;
266 };
267 
268 #endif
269 
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:47
a actor that draws 2D data
Definition: vtkActor2D.h:45
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:37
vtkLabelRenderStrategy * RenderStrategy
a simple class to control print indentation
Definition: vtkIndent.h:39
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:81
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()
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...