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=========================================================================*/
49#ifndef vtkLegendScaleActor_h
50#define vtkLegendScaleActor_h
51
52#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
53#include "vtkProp.h"
54#include "vtkRenderingAnnotationModule.h" // For export macro
55
56class vtkAxisActor2D;
57class vtkTextProperty;
58class vtkPolyData;
60class vtkActor2D;
61class vtkTextMapper;
62class vtkPoints;
63class vtkCoordinate;
64
65class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
66{
67public:
72
74
78 void PrintSelf(ostream& os, vtkIndent indent) override;
80
82 {
83 DISTANCE = 0,
84 XY_COORDINATES = 1
85 };
86
88
94 vtkSetClampMacro(LabelMode, int, DISTANCE, XY_COORDINATES);
95 vtkGetMacro(LabelMode, int);
96 void SetLabelModeToDistance() { this->SetLabelMode(DISTANCE); }
97 void SetLabelModeToXYCoordinates() { this->SetLabelMode(XY_COORDINATES); }
99
101
105 vtkSetMacro(RightAxisVisibility, vtkTypeBool);
106 vtkGetMacro(RightAxisVisibility, vtkTypeBool);
107 vtkBooleanMacro(RightAxisVisibility, vtkTypeBool);
108 vtkSetMacro(TopAxisVisibility, vtkTypeBool);
109 vtkGetMacro(TopAxisVisibility, vtkTypeBool);
110 vtkBooleanMacro(TopAxisVisibility, vtkTypeBool);
111 vtkSetMacro(LeftAxisVisibility, vtkTypeBool);
112 vtkGetMacro(LeftAxisVisibility, vtkTypeBool);
113 vtkBooleanMacro(LeftAxisVisibility, vtkTypeBool);
114 vtkSetMacro(BottomAxisVisibility, vtkTypeBool);
115 vtkGetMacro(BottomAxisVisibility, vtkTypeBool);
116 vtkBooleanMacro(BottomAxisVisibility, vtkTypeBool);
118
120
124 vtkSetMacro(LegendVisibility, vtkTypeBool);
125 vtkGetMacro(LegendVisibility, vtkTypeBool);
126 vtkBooleanMacro(LegendVisibility, vtkTypeBool);
128
130
133 void AllAxesOn();
136
138
144
146
151 vtkSetClampMacro(RightBorderOffset, int, 5, VTK_INT_MAX);
152 vtkGetMacro(RightBorderOffset, int);
154
156
161 vtkSetClampMacro(TopBorderOffset, int, 5, VTK_INT_MAX);
162 vtkGetMacro(TopBorderOffset, int);
164
166
171 vtkSetClampMacro(LeftBorderOffset, int, 5, VTK_INT_MAX);
172 vtkGetMacro(LeftBorderOffset, int);
174
176
181 vtkSetClampMacro(BottomBorderOffset, int, 5, VTK_INT_MAX);
182 vtkGetMacro(BottomBorderOffset, int);
184
186
190 vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
191 vtkGetMacro(CornerOffsetFactor, double);
193
195
198 vtkGetObjectMacro(LegendTitleProperty, vtkTextProperty);
199 vtkGetObjectMacro(LegendLabelProperty, vtkTextProperty);
201
203
208 vtkGetObjectMacro(RightAxis, vtkAxisActor2D);
209 vtkGetObjectMacro(TopAxis, vtkAxisActor2D);
210 vtkGetObjectMacro(LeftAxis, vtkAxisActor2D);
211 vtkGetObjectMacro(BottomAxis, vtkAxisActor2D);
213
215
218 virtual void BuildRepresentation(vtkViewport* viewport);
224
225protected:
228
235
236 // The four axes around the borders of the renderer
241
242 // Control the display of the axes
247
248 // Support for the legend.
254 vtkTextMapper* LabelMappers[6];
255 vtkActor2D* LabelActors[6];
259
261
262private:
264 void operator=(const vtkLegendScaleActor&) = delete;
265};
266
267#endif
a actor that draws 2D data
Definition vtkActor2D.h:55
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:49
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:49
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
2D text annotation
represent text properties.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_INT_MAX
Definition vtkType.h:155