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=========================================================================*/
56#ifndef vtkLegendScaleActor_h
57#define vtkLegendScaleActor_h
58
59#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
60#include "vtkProp.h"
61#include "vtkRenderingAnnotationModule.h" // For export macro
62
63class vtkAxisActor2D;
64class vtkTextProperty;
65class vtkPolyData;
67class vtkActor2D;
68class vtkTextMapper;
69class vtkPoints;
70class vtkCoordinate;
71
72class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
73{
74public:
79
81
85 void PrintSelf(ostream& os, vtkIndent indent) override;
87
89 {
90 DISTANCE = 0,
91 XY_COORDINATES = 1
92 };
93
95
101 vtkSetClampMacro(LabelMode, int, DISTANCE, XY_COORDINATES);
102 vtkGetMacro(LabelMode, int);
103 void SetLabelModeToDistance() { this->SetLabelMode(DISTANCE); }
104 void SetLabelModeToXYCoordinates() { this->SetLabelMode(XY_COORDINATES); }
106
108
112 vtkSetMacro(RightAxisVisibility, vtkTypeBool);
113 vtkGetMacro(RightAxisVisibility, vtkTypeBool);
114 vtkBooleanMacro(RightAxisVisibility, vtkTypeBool);
115 vtkSetMacro(TopAxisVisibility, vtkTypeBool);
116 vtkGetMacro(TopAxisVisibility, vtkTypeBool);
117 vtkBooleanMacro(TopAxisVisibility, vtkTypeBool);
118 vtkSetMacro(LeftAxisVisibility, vtkTypeBool);
119 vtkGetMacro(LeftAxisVisibility, vtkTypeBool);
120 vtkBooleanMacro(LeftAxisVisibility, vtkTypeBool);
121 vtkSetMacro(BottomAxisVisibility, vtkTypeBool);
122 vtkGetMacro(BottomAxisVisibility, vtkTypeBool);
123 vtkBooleanMacro(BottomAxisVisibility, vtkTypeBool);
125
127
131 vtkSetMacro(LegendVisibility, vtkTypeBool);
132 vtkGetMacro(LegendVisibility, vtkTypeBool);
133 vtkBooleanMacro(LegendVisibility, vtkTypeBool);
135
137
140 void AllAxesOn();
143
145
151
153
158 vtkSetClampMacro(RightBorderOffset, int, 5, VTK_INT_MAX);
159 vtkGetMacro(RightBorderOffset, int);
161
163
168 vtkSetClampMacro(TopBorderOffset, int, 5, VTK_INT_MAX);
169 vtkGetMacro(TopBorderOffset, int);
171
173
178 vtkSetClampMacro(LeftBorderOffset, int, 5, VTK_INT_MAX);
179 vtkGetMacro(LeftBorderOffset, int);
181
183
188 vtkSetClampMacro(BottomBorderOffset, int, 5, VTK_INT_MAX);
189 vtkGetMacro(BottomBorderOffset, int);
191
193
197 vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
198 vtkGetMacro(CornerOffsetFactor, double);
200
202
205 vtkGetObjectMacro(LegendTitleProperty, vtkTextProperty);
206 vtkGetObjectMacro(LegendLabelProperty, vtkTextProperty);
208
210
215 vtkGetObjectMacro(RightAxis, vtkAxisActor2D);
216 vtkGetObjectMacro(TopAxis, vtkAxisActor2D);
217 vtkGetObjectMacro(LeftAxis, vtkAxisActor2D);
218 vtkGetObjectMacro(BottomAxis, vtkAxisActor2D);
220
222
225 virtual void BuildRepresentation(vtkViewport* viewport);
231
232protected:
235
242
243 // The four axes around the borders of the renderer
248
249 // Control the display of the axes
254
255 // Support for the legend.
261 vtkTextMapper* LabelMappers[6];
262 vtkActor2D* LabelActors[6];
266
268
269private:
271 void operator=(const vtkLegendScaleActor&) = delete;
272};
273
274#endif
a actor that draws 2D data
Definition: vtkActor2D.h:149
Create an axis with tick marks and labels.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition: vtkIndent.h:113
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:143
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
2D text annotation
represent text properties.
record modification and/or execution time
Definition: vtkTimeStamp.h:52
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