VTK  9.1.0
vtkLegendScaleActor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLegendScaleActor.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 =========================================================================*/
37 #ifndef vtkLegendScaleActor_h
38 #define vtkLegendScaleActor_h
39 
40 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
41 #include "vtkProp.h"
42 #include "vtkRenderingAnnotationModule.h" // For export macro
43 
44 class vtkAxisActor2D;
45 class vtkTextProperty;
46 class vtkPolyData;
48 class vtkActor2D;
49 class vtkTextMapper;
50 class vtkPoints;
51 class vtkCoordinate;
52 
53 class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
54 {
55 public:
60 
62 
65  vtkTypeMacro(vtkLegendScaleActor, vtkProp);
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
70  {
71  DISTANCE = 0,
72  XY_COORDINATES = 1
73  };
74 
76 
82  vtkSetClampMacro(LabelMode, int, DISTANCE, XY_COORDINATES);
83  vtkGetMacro(LabelMode, int);
84  void SetLabelModeToDistance() { this->SetLabelMode(DISTANCE); }
85  void SetLabelModeToXYCoordinates() { this->SetLabelMode(XY_COORDINATES); }
87 
89 
93  vtkSetMacro(RightAxisVisibility, vtkTypeBool);
94  vtkGetMacro(RightAxisVisibility, vtkTypeBool);
95  vtkBooleanMacro(RightAxisVisibility, vtkTypeBool);
96  vtkSetMacro(TopAxisVisibility, vtkTypeBool);
97  vtkGetMacro(TopAxisVisibility, vtkTypeBool);
98  vtkBooleanMacro(TopAxisVisibility, vtkTypeBool);
99  vtkSetMacro(LeftAxisVisibility, vtkTypeBool);
100  vtkGetMacro(LeftAxisVisibility, vtkTypeBool);
101  vtkBooleanMacro(LeftAxisVisibility, vtkTypeBool);
102  vtkSetMacro(BottomAxisVisibility, vtkTypeBool);
103  vtkGetMacro(BottomAxisVisibility, vtkTypeBool);
104  vtkBooleanMacro(BottomAxisVisibility, vtkTypeBool);
106 
108 
112  vtkSetMacro(LegendVisibility, vtkTypeBool);
113  vtkGetMacro(LegendVisibility, vtkTypeBool);
114  vtkBooleanMacro(LegendVisibility, vtkTypeBool);
116 
118 
121  void AllAxesOn();
122  void AllAxesOff();
124 
126 
132 
134 
139  vtkSetClampMacro(RightBorderOffset, int, 5, VTK_INT_MAX);
140  vtkGetMacro(RightBorderOffset, int);
142 
144 
149  vtkSetClampMacro(TopBorderOffset, int, 5, VTK_INT_MAX);
150  vtkGetMacro(TopBorderOffset, int);
152 
154 
159  vtkSetClampMacro(LeftBorderOffset, int, 5, VTK_INT_MAX);
160  vtkGetMacro(LeftBorderOffset, int);
162 
164 
169  vtkSetClampMacro(BottomBorderOffset, int, 5, VTK_INT_MAX);
170  vtkGetMacro(BottomBorderOffset, int);
172 
174 
178  vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
179  vtkGetMacro(CornerOffsetFactor, double);
181 
183 
186  vtkGetObjectMacro(LegendTitleProperty, vtkTextProperty);
187  vtkGetObjectMacro(LegendLabelProperty, vtkTextProperty);
189 
191 
196  vtkGetObjectMacro(RightAxis, vtkAxisActor2D);
197  vtkGetObjectMacro(TopAxis, vtkAxisActor2D);
198  vtkGetObjectMacro(LeftAxis, vtkAxisActor2D);
199  vtkGetObjectMacro(BottomAxis, vtkAxisActor2D);
201 
203 
206  virtual void BuildRepresentation(vtkViewport* viewport);
209  int RenderOverlay(vtkViewport*) override;
212 
213 protected:
216 
223 
224  // The four axes around the borders of the renderer
229 
230  // Control the display of the axes
235 
236  // Support for the legend.
242  vtkTextMapper* LabelMappers[6];
243  vtkActor2D* LabelActors[6];
247 
249 
250 private:
251  vtkLegendScaleActor(const vtkLegendScaleActor&) = delete;
252  void operator=(const vtkLegendScaleActor&) = delete;
253 };
254 
255 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:40
Create an axis with tick marks and labels.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:77
a simple class to control print indentation
Definition: vtkIndent.h:34
annotate the render window with scale and distance information
vtkTextProperty * LegendLabelProperty
~vtkLegendScaleActor() override
static vtkLegendScaleActor * New()
Instantiate the class.
void GetActors2D(vtkPropCollection *) override
Standard methods supporting the rendering process.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
void AllAnnotationsOff()
Convenience method that turns all the axes and the legend scale.
vtkAxisActor2D * LeftAxis
vtkAxisActor2D * RightAxis
void SetLabelModeToDistance()
Specify the mode for labeling the scale axes.
vtkTextProperty * LegendTitleProperty
void AllAxesOn()
Convenience method that turns all the axes either on or off.
int RenderOpaqueGeometry(vtkViewport *) override
Standard methods supporting the rendering process.
vtkAxisActor2D * BottomAxis
vtkPolyDataMapper2D * LegendMapper
void AllAxesOff()
Convenience method that turns all the axes either on or off.
void ReleaseGraphicsResources(vtkWindow *) override
Standard methods supporting the rendering process.
vtkCoordinate * Coordinate
vtkAxisActor2D * TopAxis
vtkTypeBool BottomAxisVisibility
virtual void BuildRepresentation(vtkViewport *viewport)
Standard methods supporting the rendering process.
void AllAnnotationsOn()
Convenience method that turns all the axes and the legend scale.
void SetLabelModeToXYCoordinates()
Specify the mode for labeling the scale axes.
int RenderOverlay(vtkViewport *) override
Standard methods supporting the rendering process.
represent and manipulate 3D points
Definition: vtkPoints.h:34
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
2D text annotation
Definition: vtkTextMapper.h:48
represent text properties.
record modification and/or execution time
Definition: vtkTimeStamp.h:33
abstract specification for Viewports
Definition: vtkViewport.h:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_INT_MAX
Definition: vtkType.h:155