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=========================================================================*/
46#ifndef vtkLegendScaleActor_h
47#define vtkLegendScaleActor_h
48
49#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
50#include "vtkProp.h"
51#include "vtkRenderingAnnotationModule.h" // For export macro
52
53class vtkAxisActor2D;
54class vtkTextProperty;
55class vtkPolyData;
57class vtkActor2D;
58class vtkTextMapper;
59class vtkPoints;
60class vtkCoordinate;
61
62class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
63{
64public:
69
71
75 void PrintSelf(ostream& os, vtkIndent indent) override;
77
79 {
80 DISTANCE = 0,
81 XY_COORDINATES = 1
82 };
83
85
91 vtkSetClampMacro(LabelMode, int, DISTANCE, XY_COORDINATES);
92 vtkGetMacro(LabelMode, int);
93 void SetLabelModeToDistance() { this->SetLabelMode(DISTANCE); }
94 void SetLabelModeToXYCoordinates() { this->SetLabelMode(XY_COORDINATES); }
96
98
102 vtkSetMacro(RightAxisVisibility, vtkTypeBool);
103 vtkGetMacro(RightAxisVisibility, vtkTypeBool);
104 vtkBooleanMacro(RightAxisVisibility, vtkTypeBool);
105 vtkSetMacro(TopAxisVisibility, vtkTypeBool);
106 vtkGetMacro(TopAxisVisibility, vtkTypeBool);
107 vtkBooleanMacro(TopAxisVisibility, vtkTypeBool);
108 vtkSetMacro(LeftAxisVisibility, vtkTypeBool);
109 vtkGetMacro(LeftAxisVisibility, vtkTypeBool);
110 vtkBooleanMacro(LeftAxisVisibility, vtkTypeBool);
111 vtkSetMacro(BottomAxisVisibility, vtkTypeBool);
112 vtkGetMacro(BottomAxisVisibility, vtkTypeBool);
113 vtkBooleanMacro(BottomAxisVisibility, vtkTypeBool);
115
117
121 vtkSetMacro(LegendVisibility, vtkTypeBool);
122 vtkGetMacro(LegendVisibility, vtkTypeBool);
123 vtkBooleanMacro(LegendVisibility, vtkTypeBool);
125
127
130 void AllAxesOn();
133
135
141
143
148 vtkSetClampMacro(RightBorderOffset, int, 5, VTK_INT_MAX);
149 vtkGetMacro(RightBorderOffset, int);
151
153
158 vtkSetClampMacro(TopBorderOffset, int, 5, VTK_INT_MAX);
159 vtkGetMacro(TopBorderOffset, int);
161
163
168 vtkSetClampMacro(LeftBorderOffset, int, 5, VTK_INT_MAX);
169 vtkGetMacro(LeftBorderOffset, int);
171
173
178 vtkSetClampMacro(BottomBorderOffset, int, 5, VTK_INT_MAX);
179 vtkGetMacro(BottomBorderOffset, int);
181
183
187 vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
188 vtkGetMacro(CornerOffsetFactor, double);
190
192
195 vtkGetObjectMacro(LegendTitleProperty, vtkTextProperty);
196 vtkGetObjectMacro(LegendLabelProperty, vtkTextProperty);
198
200
205 vtkGetObjectMacro(RightAxis, vtkAxisActor2D);
206 vtkGetObjectMacro(TopAxis, vtkAxisActor2D);
207 vtkGetObjectMacro(LeftAxis, vtkAxisActor2D);
208 vtkGetObjectMacro(BottomAxis, vtkAxisActor2D);
210
212
215 virtual void BuildRepresentation(vtkViewport* viewport);
221
222protected:
225
232
233 // The four axes around the borders of the renderer
238
239 // Control the display of the axes
244
245 // Support for the legend.
251 vtkTextMapper* LabelMappers[6];
252 vtkActor2D* LabelActors[6];
256
258
259private:
261 void operator=(const vtkLegendScaleActor&) = delete;
262};
263
264#endif
a actor that draws 2D data
Definition: vtkActor2D.h:49
Create an axis with tick marks and labels.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:86
a simple class to control print indentation
Definition: vtkIndent.h:43
annotate the render window with scale and distance information
vtkTextProperty * LegendLabelProperty
~vtkLegendScaleActor() override
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.
static vtkLegendScaleActor * New()
Instantiate the class.
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:43
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:95
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
2D text annotation
Definition: vtkTextMapper.h:57
represent text properties.
record modification and/or execution time
Definition: vtkTimeStamp.h:42
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:45
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_INT_MAX
Definition: vtkType.h:155