VTK  9.2.6
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=========================================================================*/
59#ifndef vtkLegendScaleActor_h
60#define vtkLegendScaleActor_h
61
62#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
63#include "vtkProp.h"
64#include "vtkRenderingAnnotationModule.h" // For export macro
65
66class vtkAxisActor2D;
67class vtkTextProperty;
68class vtkPolyData;
70class vtkActor2D;
71class vtkTextMapper;
72class vtkPoints;
73class vtkCoordinate;
74
75class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
76{
77public:
82
84
88 void PrintSelf(ostream& os, vtkIndent indent) override;
90
92 {
93 DISTANCE = 0,
94 XY_COORDINATES = 1
95 };
96
98
104 vtkSetClampMacro(LabelMode, int, DISTANCE, XY_COORDINATES);
105 vtkGetMacro(LabelMode, int);
106 void SetLabelModeToDistance() { this->SetLabelMode(DISTANCE); }
107 void SetLabelModeToXYCoordinates() { this->SetLabelMode(XY_COORDINATES); }
109
111
115 vtkSetMacro(RightAxisVisibility, vtkTypeBool);
116 vtkGetMacro(RightAxisVisibility, vtkTypeBool);
117 vtkBooleanMacro(RightAxisVisibility, vtkTypeBool);
118 vtkSetMacro(TopAxisVisibility, vtkTypeBool);
119 vtkGetMacro(TopAxisVisibility, vtkTypeBool);
120 vtkBooleanMacro(TopAxisVisibility, vtkTypeBool);
121 vtkSetMacro(LeftAxisVisibility, vtkTypeBool);
122 vtkGetMacro(LeftAxisVisibility, vtkTypeBool);
123 vtkBooleanMacro(LeftAxisVisibility, vtkTypeBool);
124 vtkSetMacro(BottomAxisVisibility, vtkTypeBool);
125 vtkGetMacro(BottomAxisVisibility, vtkTypeBool);
126 vtkBooleanMacro(BottomAxisVisibility, vtkTypeBool);
128
130
134 vtkSetMacro(LegendVisibility, vtkTypeBool);
135 vtkGetMacro(LegendVisibility, vtkTypeBool);
136 vtkBooleanMacro(LegendVisibility, vtkTypeBool);
138
140
143 void AllAxesOn();
146
148
154
156
161 vtkSetClampMacro(RightBorderOffset, int, 5, VTK_INT_MAX);
162 vtkGetMacro(RightBorderOffset, int);
164
166
171 vtkSetClampMacro(TopBorderOffset, int, 5, VTK_INT_MAX);
172 vtkGetMacro(TopBorderOffset, int);
174
176
181 vtkSetClampMacro(LeftBorderOffset, int, 5, VTK_INT_MAX);
182 vtkGetMacro(LeftBorderOffset, int);
184
186
191 vtkSetClampMacro(BottomBorderOffset, int, 5, VTK_INT_MAX);
192 vtkGetMacro(BottomBorderOffset, int);
194
196
200 vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
201 vtkGetMacro(CornerOffsetFactor, double);
203
205
208 vtkGetObjectMacro(LegendTitleProperty, vtkTextProperty);
209 vtkGetObjectMacro(LegendLabelProperty, vtkTextProperty);
211
213
218 vtkGetObjectMacro(RightAxis, vtkAxisActor2D);
219 vtkGetObjectMacro(TopAxis, vtkAxisActor2D);
220 vtkGetObjectMacro(LeftAxis, vtkAxisActor2D);
221 vtkGetObjectMacro(BottomAxis, vtkAxisActor2D);
223
225
228 virtual void BuildRepresentation(vtkViewport* viewport);
234
235protected:
238
245
246 // The four axes around the borders of the renderer
251
252 // Control the display of the axes
257
258 // Support for the legend.
264 vtkTextMapper* LabelMappers[6];
265 vtkActor2D* LabelActors[6];
269
271
272private:
274 void operator=(const vtkLegendScaleActor&) = delete;
275};
276
277#endif
a actor that draws 2D data
Definition: vtkActor2D.h:155
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:119
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:149
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
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:55
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_INT_MAX
Definition: vtkType.h:155