VTK  9.1.0
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 =========================================================================*/
56 #ifndef vtkLegendScaleActor_h
57 #define vtkLegendScaleActor_h
58 
59 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
60 #include "vtkProp.h"
61 #include "vtkRenderingAnnotationModule.h" // For export macro
62 
63 class vtkAxisActor2D;
64 class vtkTextProperty;
65 class vtkPolyData;
67 class vtkActor2D;
68 class vtkTextMapper;
69 class vtkPoints;
70 class vtkCoordinate;
71 
72 class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
73 {
74 public:
79 
81 
84  vtkTypeMacro(vtkLegendScaleActor, vtkProp);
85  void PrintSelf(ostream& os, vtkIndent indent) override;
87 
89  {
90  DISTANCE = 0,
91  XY_COORDINATES = 1
92  };
93 
95 
101  vtkSetClampMacro(LabelMode, int, DISTANCE, XY_COORDINATES);
102  vtkGetMacro(LabelMode, int);
103  void SetLabelModeToDistance() { this->SetLabelMode(DISTANCE); }
104  void SetLabelModeToXYCoordinates() { this->SetLabelMode(XY_COORDINATES); }
106 
108 
112  vtkSetMacro(RightAxisVisibility, vtkTypeBool);
113  vtkGetMacro(RightAxisVisibility, vtkTypeBool);
114  vtkBooleanMacro(RightAxisVisibility, vtkTypeBool);
115  vtkSetMacro(TopAxisVisibility, vtkTypeBool);
116  vtkGetMacro(TopAxisVisibility, vtkTypeBool);
117  vtkBooleanMacro(TopAxisVisibility, vtkTypeBool);
118  vtkSetMacro(LeftAxisVisibility, vtkTypeBool);
119  vtkGetMacro(LeftAxisVisibility, vtkTypeBool);
120  vtkBooleanMacro(LeftAxisVisibility, vtkTypeBool);
121  vtkSetMacro(BottomAxisVisibility, vtkTypeBool);
122  vtkGetMacro(BottomAxisVisibility, vtkTypeBool);
123  vtkBooleanMacro(BottomAxisVisibility, vtkTypeBool);
125 
127 
131  vtkSetMacro(LegendVisibility, vtkTypeBool);
132  vtkGetMacro(LegendVisibility, vtkTypeBool);
133  vtkBooleanMacro(LegendVisibility, vtkTypeBool);
135 
137 
140  void AllAxesOn();
141  void AllAxesOff();
143 
145 
151 
153 
158  vtkSetClampMacro(RightBorderOffset, int, 5, VTK_INT_MAX);
159  vtkGetMacro(RightBorderOffset, int);
161 
163 
168  vtkSetClampMacro(TopBorderOffset, int, 5, VTK_INT_MAX);
169  vtkGetMacro(TopBorderOffset, int);
171 
173 
178  vtkSetClampMacro(LeftBorderOffset, int, 5, VTK_INT_MAX);
179  vtkGetMacro(LeftBorderOffset, int);
181 
183 
188  vtkSetClampMacro(BottomBorderOffset, int, 5, VTK_INT_MAX);
189  vtkGetMacro(BottomBorderOffset, int);
191 
193 
197  vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
198  vtkGetMacro(CornerOffsetFactor, double);
200 
202 
205  vtkGetObjectMacro(LegendTitleProperty, vtkTextProperty);
206  vtkGetObjectMacro(LegendLabelProperty, vtkTextProperty);
208 
210 
215  vtkGetObjectMacro(RightAxis, vtkAxisActor2D);
216  vtkGetObjectMacro(TopAxis, vtkAxisActor2D);
217  vtkGetObjectMacro(LeftAxis, vtkAxisActor2D);
218  vtkGetObjectMacro(BottomAxis, vtkAxisActor2D);
220 
222 
225  virtual void BuildRepresentation(vtkViewport* viewport);
228  int RenderOverlay(vtkViewport*) override;
231 
232 protected:
235 
242 
243  // The four axes around the borders of the renderer
248 
249  // Control the display of the axes
254 
255  // Support for the legend.
261  vtkTextMapper* LabelMappers[6];
262  vtkActor2D* LabelActors[6];
266 
268 
269 private:
270  vtkLegendScaleActor(const vtkLegendScaleActor&) = delete;
271  void operator=(const vtkLegendScaleActor&) = delete;
272 };
273 
274 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkLegendScaleActor::Legend
vtkPolyData * Legend
Definition: vtkLegendScaleActor.h:257
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkLegendScaleActor::TopAxis
vtkAxisActor2D * TopAxis
Definition: vtkLegendScaleActor.h:245
vtkLegendScaleActor::SetLabelModeToXYCoordinates
void SetLabelModeToXYCoordinates()
Specify the mode for labeling the scale axes.
Definition: vtkLegendScaleActor.h:104
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:154
vtkLegendScaleActor::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *) override
Standard methods supporting the rendering process.
vtkLegendScaleActor::BottomAxisVisibility
vtkTypeBool BottomAxisVisibility
Definition: vtkLegendScaleActor.h:253
vtkLegendScaleActor::BuildRepresentation
virtual void BuildRepresentation(vtkViewport *viewport)
Standard methods supporting the rendering process.
vtkLegendScaleActor::BottomAxis
vtkAxisActor2D * BottomAxis
Definition: vtkLegendScaleActor.h:247
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:52
vtkLegendScaleActor::RenderOverlay
int RenderOverlay(vtkViewport *) override
Standard methods supporting the rendering process.
vtkLegendScaleActor::BuildTime
vtkTimeStamp BuildTime
Definition: vtkLegendScaleActor.h:267
vtkLegendScaleActor::CornerOffsetFactor
double CornerOffsetFactor
Definition: vtkLegendScaleActor.h:241
vtkLegendScaleActor::RightBorderOffset
int RightBorderOffset
Definition: vtkLegendScaleActor.h:237
vtkLegendScaleActor::LeftAxisVisibility
vtkTypeBool LeftAxisVisibility
Definition: vtkLegendScaleActor.h:252
vtkLegendScaleActor::AllAnnotationsOn
void AllAnnotationsOn()
Convenience method that turns all the axes and the legend scale.
vtkLegendScaleActor::vtkLegendScaleActor
vtkLegendScaleActor()
vtkProp.h
vtkLegendScaleActor::LegendMapper
vtkPolyDataMapper2D * LegendMapper
Definition: vtkLegendScaleActor.h:259
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkLegendScaleActor::LegendVisibility
vtkTypeBool LegendVisibility
Definition: vtkLegendScaleActor.h:256
vtkLegendScaleActor::LegendTitleProperty
vtkTextProperty * LegendTitleProperty
Definition: vtkLegendScaleActor.h:263
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:157
vtkLegendScaleActor
annotate the render window with scale and distance information
Definition: vtkLegendScaleActor.h:73
vtkLegendScaleActor::LabelMode
int LabelMode
Definition: vtkLegendScaleActor.h:236
vtkLegendScaleActor::LeftAxis
vtkAxisActor2D * LeftAxis
Definition: vtkLegendScaleActor.h:246
vtkLegendScaleActor::New
static vtkLegendScaleActor * New()
Instantiate the class.
vtkLegendScaleActor::BottomBorderOffset
int BottomBorderOffset
Definition: vtkLegendScaleActor.h:240
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkLegendScaleActor::TopAxisVisibility
vtkTypeBool TopAxisVisibility
Definition: vtkLegendScaleActor.h:251
vtkLegendScaleActor::AllAnnotationsOff
void AllAnnotationsOff()
Convenience method that turns all the axes and the legend scale.
vtkLegendScaleActor::~vtkLegendScaleActor
~vtkLegendScaleActor() override
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:186
vtkLegendScaleActor::LegendLabelProperty
vtkTextProperty * LegendLabelProperty
Definition: vtkLegendScaleActor.h:264
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkCoordinate.h
vtkLegendScaleActor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:143
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:149
vtkLegendScaleActor::AllAxesOn
void AllAxesOn()
Convenience method that turns all the axes either on or off.
vtkLegendScaleActor::AllAxesOff
void AllAxesOff()
Convenience method that turns all the axes either on or off.
vtkLegendScaleActor::LegendActor
vtkActor2D * LegendActor
Definition: vtkLegendScaleActor.h:260
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkAxisActor2D
Create an axis with tick marks and labels.
Definition: vtkAxisActor2D.h:70
vtkLegendScaleActor::AttributeLocation
AttributeLocation
Definition: vtkLegendScaleActor.h:89
vtkLegendScaleActor::RightAxisVisibility
vtkTypeBool RightAxisVisibility
Definition: vtkLegendScaleActor.h:250
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:85
vtkLegendScaleActor::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Standard methods supporting the rendering process.
vtkLegendScaleActor::GetActors2D
void GetActors2D(vtkPropCollection *) override
Standard methods supporting the rendering process.
vtkLegendScaleActor::SetLabelModeToDistance
void SetLabelModeToDistance()
Specify the mode for labeling the scale axes.
Definition: vtkLegendScaleActor.h:103
vtkLegendScaleActor::LegendPoints
vtkPoints * LegendPoints
Definition: vtkLegendScaleActor.h:258
vtkLegendScaleActor::LeftBorderOffset
int LeftBorderOffset
Definition: vtkLegendScaleActor.h:239
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkLegendScaleActor::Coordinate
vtkCoordinate * Coordinate
Definition: vtkLegendScaleActor.h:265
vtkLegendScaleActor::TopBorderOffset
int TopBorderOffset
Definition: vtkLegendScaleActor.h:238
vtkLegendScaleActor::RightAxis
vtkAxisActor2D * RightAxis
Definition: vtkLegendScaleActor.h:244