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 
56 class vtkAxisActor2D;
57 class vtkTextProperty;
58 class vtkPolyData;
60 class vtkActor2D;
61 class vtkTextMapper;
62 class vtkPoints;
63 class vtkCoordinate;
64 
65 class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
66 {
67 public:
72 
74 
77  vtkTypeMacro(vtkLegendScaleActor, vtkProp);
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();
134  void AllAxesOff();
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);
221  int RenderOverlay(vtkViewport*) override;
224 
225 protected:
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 
262 private:
263  vtkLegendScaleActor(const vtkLegendScaleActor&) = delete;
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
Definition: vtkCoordinate.h:89
a simple class to control print indentation
Definition: vtkIndent.h:49
annotate the render window with scale and distance information
vtkTextProperty * LegendLabelProperty
~vtkLegendScaleActor() override
static vtkLegendScaleActor * New()
Instantiate the class.
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.
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
Definition: vtkPolyData.h:100
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:66
2D text annotation
Definition: vtkTextMapper.h:60
represent text properties.
record modification and/or execution time
Definition: vtkTimeStamp.h:45
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