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=========================================================================*/
40#ifndef vtkLegendScaleActor_h
41#define vtkLegendScaleActor_h
42
43#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
44#include "vtkProp.h"
45#include "vtkRenderingAnnotationModule.h" // For export macro
46
47class vtkAxisActor2D;
48class vtkTextProperty;
49class vtkPolyData;
51class vtkActor2D;
52class vtkTextMapper;
53class vtkPoints;
54class vtkCoordinate;
55
56class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
57{
58public:
63
65
69 void PrintSelf(ostream& os, vtkIndent indent) override;
71
73 {
74 DISTANCE = 0,
75 XY_COORDINATES = 1
76 };
77
79
85 vtkSetClampMacro(LabelMode, int, DISTANCE, XY_COORDINATES);
86 vtkGetMacro(LabelMode, int);
87 void SetLabelModeToDistance() { this->SetLabelMode(DISTANCE); }
88 void SetLabelModeToXYCoordinates() { this->SetLabelMode(XY_COORDINATES); }
90
92
96 vtkSetMacro(RightAxisVisibility, vtkTypeBool);
97 vtkGetMacro(RightAxisVisibility, vtkTypeBool);
98 vtkBooleanMacro(RightAxisVisibility, vtkTypeBool);
99 vtkSetMacro(TopAxisVisibility, vtkTypeBool);
100 vtkGetMacro(TopAxisVisibility, vtkTypeBool);
101 vtkBooleanMacro(TopAxisVisibility, vtkTypeBool);
102 vtkSetMacro(LeftAxisVisibility, vtkTypeBool);
103 vtkGetMacro(LeftAxisVisibility, vtkTypeBool);
104 vtkBooleanMacro(LeftAxisVisibility, vtkTypeBool);
105 vtkSetMacro(BottomAxisVisibility, vtkTypeBool);
106 vtkGetMacro(BottomAxisVisibility, vtkTypeBool);
107 vtkBooleanMacro(BottomAxisVisibility, vtkTypeBool);
109
111
115 vtkSetMacro(LegendVisibility, vtkTypeBool);
116 vtkGetMacro(LegendVisibility, vtkTypeBool);
117 vtkBooleanMacro(LegendVisibility, vtkTypeBool);
119
121
124 void AllAxesOn();
127
129
135
137
142 vtkSetClampMacro(RightBorderOffset, int, 5, VTK_INT_MAX);
143 vtkGetMacro(RightBorderOffset, int);
145
147
152 vtkSetClampMacro(TopBorderOffset, int, 5, VTK_INT_MAX);
153 vtkGetMacro(TopBorderOffset, int);
155
157
162 vtkSetClampMacro(LeftBorderOffset, int, 5, VTK_INT_MAX);
163 vtkGetMacro(LeftBorderOffset, int);
165
167
172 vtkSetClampMacro(BottomBorderOffset, int, 5, VTK_INT_MAX);
173 vtkGetMacro(BottomBorderOffset, int);
175
177
181 vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
182 vtkGetMacro(CornerOffsetFactor, double);
184
186
189 vtkGetObjectMacro(LegendTitleProperty, vtkTextProperty);
190 vtkGetObjectMacro(LegendLabelProperty, vtkTextProperty);
192
194
199 vtkGetObjectMacro(RightAxis, vtkAxisActor2D);
200 vtkGetObjectMacro(TopAxis, vtkAxisActor2D);
201 vtkGetObjectMacro(LeftAxis, vtkAxisActor2D);
202 vtkGetObjectMacro(BottomAxis, vtkAxisActor2D);
204
206
209 virtual void BuildRepresentation(vtkViewport* viewport);
215
216protected:
219
226
227 // The four axes around the borders of the renderer
232
233 // Control the display of the axes
238
239 // Support for the legend.
245 vtkTextMapper* LabelMappers[6];
246 vtkActor2D* LabelActors[6];
250
252
253private:
255 void operator=(const vtkLegendScaleActor&) = delete;
256};
257
258#endif
a actor that draws 2D data
Definition vtkActor2D.h:46
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:40
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.
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:40
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:91
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:57
2D text annotation
represent text properties.
record modification and/or execution time
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