VTK  9.5.2
vtkLegendScaleActor.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
46
47#ifndef vtkLegendScaleActor_h
48#define vtkLegendScaleActor_h
49
50#include "vtkDeprecation.h" // for deprecation
51#include "vtkProp.h"
52#include "vtkRenderingAnnotationModule.h" // For export macro
53#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
54
55#include "vtkNew.h" // for vtkNew
56
57VTK_ABI_NAMESPACE_BEGIN
58class vtkAxisActor2D;
59class vtkProperty2D;
60class vtkTextProperty;
61class vtkPolyData;
63class vtkActor2D;
64class vtkTextMapper;
65class vtkPoints;
66class vtkCoordinate;
68
69class VTKRENDERINGANNOTATION_EXPORT VTK_MARSHALAUTO vtkLegendScaleActor : public vtkProp
70{
71public:
76
78
82 void PrintSelf(ostream& os, vtkIndent indent) override;
84
91
93
99 vtkSetClampMacro(LabelMode, int, DISTANCE, COORDINATES);
100 vtkGetMacro(LabelMode, int);
102 VTK_DEPRECATED_IN_9_4_0("This class can now determine current plane. Please use the generic "
103 "SetLabelModeToCoordinates instead.")
107
109
126
128
134 vtkBooleanMacro(LegendVisibility, vtkTypeBool);
136
138
141 void AllAxesOn();
144
146
152
154
157 vtkSetMacro(GridVisibility, bool);
158 vtkGetMacro(GridVisibility, bool);
159 vtkBooleanMacro(GridVisibility, bool);
161
163
168 vtkSetClampMacro(RightBorderOffset, int, 5, VTK_INT_MAX);
169 vtkGetMacro(RightBorderOffset, int);
171
173
178 vtkSetClampMacro(TopBorderOffset, int, 5, VTK_INT_MAX);
179 vtkGetMacro(TopBorderOffset, int);
181
183
188 vtkSetClampMacro(LeftBorderOffset, int, 5, VTK_INT_MAX);
189 vtkGetMacro(LeftBorderOffset, int);
191
193
198 vtkSetClampMacro(BottomBorderOffset, int, 5, VTK_INT_MAX);
199 vtkGetMacro(BottomBorderOffset, int);
201
203
207 vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
208 vtkGetMacro(CornerOffsetFactor, double);
210
212
216 void SetNotation(int notation);
219
221
224 void SetPrecision(int val);
227
229
235
237
243
245
249 vtkSetVector3Macro(Origin, double);
250 vtkGetVector3Macro(Origin, double);
252
254
260
267
272
278
280 void SetUseFontSizeFromProperty(bool sizeFromProp);
281
289 "This does not respect the number of labels. Please use SetSnapToGrid instead.")
290 void SetAdjustLabels(bool adjust);
291
297 void SetSnapToGrid(bool snap);
299
301
306 vtkGetObjectMacro(RightAxis, vtkAxisActor2D);
307 vtkGetObjectMacro(TopAxis, vtkAxisActor2D);
308 vtkGetObjectMacro(LeftAxis, vtkAxisActor2D);
309 vtkGetObjectMacro(BottomAxis, vtkAxisActor2D);
311
313
316 virtual void BuildRepresentation(vtkViewport* viewport);
322
323protected:
326
333
334 // The four axes around the borders of the renderer
339
340 // Support for grid
343 bool GridVisibility = false;
344
345 // Control the display of the axes
350
351 // Support for the legend.
362
364
365private:
367 void operator=(const vtkLegendScaleActor&) = delete;
368
374 void UpdateAxisRange(vtkAxisActor2D* axis, vtkViewport* viewport, bool invert = false);
375
376 double Origin[3] = { 0, 0, 0 };
377};
378
379VTK_ABI_NAMESPACE_END
380#endif
a actor that draws 2D data
Definition vtkActor2D.h:145
Create an axis with tick marks and labels.
renders a 2D grid given pairs of point positions
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition vtkIndent.h:108
vtkNew< vtkTextProperty > LegendTitleProperty
vtkNew< vtkAxisActor2D > BottomAxis
void SetPrecision(int val)
Get/set the numerical precision to use for axis labels, default is 2.
vtkNew< vtkCoordinate > Coordinate
vtkNew< vtkAxisActor2D > RightAxis
void GetActors2D(vtkPropCollection *) override
Standard methods supporting the rendering process.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
vtkNew< vtkTextMapper > LabelMappers[6]
void AllAnnotationsOff()
Convenience method that turns all the axes and the legend scale.
vtkNew< vtkAxisGridActorInternal > GridActor
virtual void SetLabelMode(int)
Specify the mode for labeling the scale axes.
vtkProperty2D * GetAxesProperty()
Return the property used for the right axis which should be the same as the other ones if set using S...
void SetLabelModeToDistance()
Specify the mode for labeling the scale axes.
void AllAxesOn()
Convenience method that turns all the axes either on or off.
int RenderOpaqueGeometry(vtkViewport *) override
Standard methods supporting the rendering process.
vtkNew< vtkAxisActor2D > TopAxis
void SetNumberOfVerticalLabels(int val)
Get/set the number of ticks (and labels) for the vertical axis, default is 5.
void SetAxesTextProperty(vtkTextProperty *property)
Configuration forwarded to each axis.
int GetNotation()
Get/set the numerical notation for axes labels: standard, scientific or mixed (0, 1,...
void SetAdjustLabels(bool adjust)
Set the axes to adjust labels to a "nice" one.
vtkNew< vtkPolyDataMapper2D > GridMapper
void AllAxesOff()
Convenience method that turns all the axes either on or off.
void ReleaseGraphicsResources(vtkWindow *) override
Standard methods supporting the rendering process.
void SetAxesProperty(vtkProperty2D *property)
Set the 2D property for both axis and grid.
vtkNew< vtkPoints > LegendPoints
int GetPrecision()
Get/set the numerical precision to use for axis labels, default is 2.
virtual void BuildRepresentation(vtkViewport *viewport)
Standard methods supporting the rendering process.
vtkNew< vtkTextProperty > LegendLabelProperty
static vtkLegendScaleActor * New()
Instantiate the class.
vtkNew< vtkActor2D > LabelActors[6]
vtkNew< vtkAxisActor2D > LeftAxis
void SetNumberOfHorizontalLabels(int val)
Get/set the number of ticks (and labels) for the horizontal axis, default is 5.
vtkNew< vtkActor2D > LegendActor
void AllAnnotationsOn()
Convenience method that turns all the axes and the legend scale.
void SetLabelModeToXYCoordinates()
Specify the mode for labeling the scale axes.
void SetSnapToGrid(bool snap)
If on, labels are positioned on rounded values.
void SetUseFontSizeFromProperty(bool sizeFromProp)
Set the axes to get font size from text property.
int GetNumberOfHorizontalLabels()
Get/set the number of ticks (and labels) for the horizontal axis, default is 5.
vtkNew< vtkPolyData > Legend
int RenderOverlay(vtkViewport *) override
Standard methods supporting the rendering process.
void SetNotation(int notation)
Get/set the numerical notation for axes labels: standard, scientific or mixed (0, 1,...
int GetNumberOfVerticalLabels()
Get/set the number of ticks (and labels) for the vertical axis, default is 5.
void SetLabelModeToCoordinates()
Specify the mode for labeling the scale axes.
vtkNew< vtkPolyDataMapper2D > LegendMapper
Allocate and hold a VTK object.
Definition vtkNew.h:167
represent and manipulate 3D points
Definition vtkPoints.h:139
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
an ordered list of Props
represent surface properties of a 2D image
2D text annotation
represent text properties.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:45
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_4_0(reason)
#define VTK_INT_MAX
Definition vtkType.h:161
#define VTK_MARSHALAUTO