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 "vtkMapper2D.h"
39 #include "vtkRenderingLabelModule.h" // For export macro
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) override;
51 
55  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) 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 
143  {
147  NUMBER_OF_LABEL_SHAPES
148  };
149 
151 
155  vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES - 1);
156  vtkGetMacro(Shape, int);
157  virtual void SetShapeToNone() { this->SetShape(NONE); }
158  virtual void SetShapeToRect() { this->SetShape(RECT); }
159  virtual void SetShapeToRoundedRect() { this->SetShape(ROUNDED_RECT); }
161 
163  {
166  NUMBER_OF_LABEL_STYLES
167  };
168 
170 
174  vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES - 1);
175  vtkGetMacro(Style, int);
176  virtual void SetStyleToFilled() { this->SetStyle(FILLED); }
177  virtual void SetStyleToOutline() { this->SetStyle(OUTLINE); }
179 
181 
185  vtkSetMacro(Margin, double);
186  vtkGetMacro(Margin, double);
188 
190 
193  vtkSetVector3Macro(BackgroundColor, double);
194  vtkGetVector3Macro(BackgroundColor, double);
196 
198 
201  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
202  vtkGetMacro(BackgroundOpacity, double);
204 
206 
209  vtkGetObjectMacro(AnchorTransform, vtkCoordinate);
211 
217  void ReleaseGraphicsResources(vtkWindow*) override;
218 
219 protected:
221  ~vtkLabelPlacementMapper() override;
222 
223  virtual void SetAnchorTransform(vtkCoordinate*);
224 
225  int FillInputPortInformation(int port, vtkInformation* info) override;
226 
227  class Internal;
228  Internal* Buckets;
229 
240 
241  int LastRendererSize[2];
242  double LastCameraPosition[3];
243  double LastCameraFocalPoint[3];
244  double LastCameraViewUp[3];
247 
248  int Style;
249  int Shape;
250  double Margin;
252  double BackgroundColor[3];
253 
254 private:
256  void operator=(const vtkLabelPlacementMapper&) = delete;
257 };
258 
259 #endif
vtkLabelPlacementMapper::LastCameraParallelScale
double LastCameraParallelScale
Definition: vtkLabelPlacementMapper.h:245
vtkMapper2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLabelPlacementMapper::OUTLINE
Definition: vtkLabelPlacementMapper.h:165
vtkMapper2D::RenderOverlay
virtual void RenderOverlay(vtkViewport *, vtkActor2D *)
Definition: vtkMapper2D.h:41
vtkLabelPlacementMapper::Shape
int Shape
Definition: vtkLabelPlacementMapper.h:249
vtkLabelPlacementMapper::SetShapeToRect
virtual void SetShapeToRect()
Definition: vtkLabelPlacementMapper.h:158
vtkLabelPlacementMapper::SetStyleToFilled
virtual void SetStyleToFilled()
Definition: vtkLabelPlacementMapper.h:176
vtkAlgorithm::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkLabelPlacementMapper::Margin
double Margin
Definition: vtkLabelPlacementMapper.h:250
vtkX3D::Shape
Definition: vtkX3D.h:42
vtkLabelPlacementMapper::Style
int Style
Definition: vtkLabelPlacementMapper.h:248
vtkLabelPlacementMapper
Places and renders non-overlapping labels.
Definition: vtkLabelPlacementMapper.h:45
vtkLabelPlacementMapper::RenderStrategy
vtkLabelRenderStrategy * RenderStrategy
Definition: vtkLabelPlacementMapper.h:230
vtkLabelPlacementMapper::OutputTraversedBounds
bool OutputTraversedBounds
Definition: vtkLabelPlacementMapper.h:239
vtkLabelPlacementMapper::SetShapeToNone
virtual void SetShapeToNone()
Definition: vtkLabelPlacementMapper.h:157
vtkLabelPlacementMapper::LabelStyle
LabelStyle
Definition: vtkLabelPlacementMapper.h:162
vtkLabelPlacementMapper::LabelShape
LabelShape
Definition: vtkLabelPlacementMapper.h:142
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkLabelPlacementMapper::NONE
Definition: vtkLabelPlacementMapper.h:144
vtkLabelPlacementMapper::BackgroundOpacity
double BackgroundOpacity
Definition: vtkLabelPlacementMapper.h:251
vtkX3D::port
Definition: vtkX3D.h:453
vtkLabelPlacementMapper::PlaceAllLabels
bool PlaceAllLabels
Definition: vtkLabelPlacementMapper.h:238
vtkLabelPlacementMapper::FILLED
Definition: vtkLabelPlacementMapper.h:164
vtkLabelPlacementMapper::UseUnicodeStrings
bool UseUnicodeStrings
Definition: vtkLabelPlacementMapper.h:237
vtkLabelPlacementMapper::Buckets
Internal * Buckets
Definition: vtkLabelPlacementMapper.h:227
vtkLabelPlacementMapper::MaximumLabelFraction
double MaximumLabelFraction
Definition: vtkLabelPlacementMapper.h:233
vtkLabelPlacementMapper::SetShapeToRoundedRect
virtual void SetShapeToRoundedRect()
Definition: vtkLabelPlacementMapper.h:159
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkLabelPlacementMapper::IteratorType
int IteratorType
Definition: vtkLabelPlacementMapper.h:246
vtkMapper2D.h
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:76
vtkLabelPlacementMapper::PositionsAsNormals
bool PositionsAsNormals
Definition: vtkLabelPlacementMapper.h:234
vtkLabelPlacementMapper::AnchorTransform
vtkCoordinate * AnchorTransform
Definition: vtkLabelPlacementMapper.h:231
vtkAbstractMapper::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
Definition: vtkAbstractMapper.h:68
vtkLabelPlacementMapper::ROUNDED_RECT
Definition: vtkLabelPlacementMapper.h:146
vtkLabelPlacementMapper::VisiblePoints
vtkSelectVisiblePoints * VisiblePoints
Definition: vtkLabelPlacementMapper.h:232
vtkMapper2D
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:35
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkLabelRenderStrategy
Superclass for label rendering implementations.
Definition: vtkLabelRenderStrategy.h:36
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
vtkX3D::info
Definition: vtkX3D.h:382
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkLabelPlacementMapper::UseDepthBuffer
bool UseDepthBuffer
Definition: vtkLabelPlacementMapper.h:236
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkSelectVisiblePoints
extract points that are visible (based on z-buffer calculation)
Definition: vtkSelectVisiblePoints.h:54
vtkLabelPlacementMapper::SetStyleToOutline
virtual void SetStyleToOutline()
Definition: vtkLabelPlacementMapper.h:177
vtkLabelPlacementMapper::RECT
Definition: vtkLabelPlacementMapper.h:145
vtkLabelPlacementMapper::GeneratePerturbedLabelSpokes
bool GeneratePerturbedLabelSpokes
Definition: vtkLabelPlacementMapper.h:235