VTK  9.0.1
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 =========================================================================*/
37 #ifndef vtkLegendScaleActor_h
38 #define vtkLegendScaleActor_h
39 
40 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
41 #include "vtkProp.h"
42 #include "vtkRenderingAnnotationModule.h" // For export macro
43 
44 class vtkAxisActor2D;
45 class vtkTextProperty;
46 class vtkPolyData;
48 class vtkActor2D;
49 class vtkTextMapper;
50 class vtkPoints;
51 class vtkCoordinate;
52 
53 class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
54 {
55 public:
59  static vtkLegendScaleActor* New();
60 
62 
65  vtkTypeMacro(vtkLegendScaleActor, vtkProp);
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
70  {
71  DISTANCE = 0,
72  XY_COORDINATES = 1
73  };
74 
76 
82  vtkSetClampMacro(LabelMode, int, DISTANCE, XY_COORDINATES);
83  vtkGetMacro(LabelMode, int);
84  void SetLabelModeToDistance() { this->SetLabelMode(DISTANCE); }
85  void SetLabelModeToXYCoordinates() { this->SetLabelMode(XY_COORDINATES); }
87 
89 
93  vtkSetMacro(RightAxisVisibility, vtkTypeBool);
94  vtkGetMacro(RightAxisVisibility, vtkTypeBool);
95  vtkBooleanMacro(RightAxisVisibility, vtkTypeBool);
96  vtkSetMacro(TopAxisVisibility, vtkTypeBool);
97  vtkGetMacro(TopAxisVisibility, vtkTypeBool);
98  vtkBooleanMacro(TopAxisVisibility, vtkTypeBool);
99  vtkSetMacro(LeftAxisVisibility, vtkTypeBool);
100  vtkGetMacro(LeftAxisVisibility, vtkTypeBool);
101  vtkBooleanMacro(LeftAxisVisibility, vtkTypeBool);
102  vtkSetMacro(BottomAxisVisibility, vtkTypeBool);
103  vtkGetMacro(BottomAxisVisibility, vtkTypeBool);
104  vtkBooleanMacro(BottomAxisVisibility, vtkTypeBool);
106 
108 
112  vtkSetMacro(LegendVisibility, vtkTypeBool);
113  vtkGetMacro(LegendVisibility, vtkTypeBool);
114  vtkBooleanMacro(LegendVisibility, vtkTypeBool);
116 
118 
121  void AllAxesOn();
122  void AllAxesOff();
124 
126 
129  void AllAnnotationsOn();
130  void AllAnnotationsOff();
132 
134 
139  vtkSetClampMacro(RightBorderOffset, int, 5, VTK_INT_MAX);
140  vtkGetMacro(RightBorderOffset, int);
142 
144 
149  vtkSetClampMacro(TopBorderOffset, int, 5, VTK_INT_MAX);
150  vtkGetMacro(TopBorderOffset, int);
152 
154 
159  vtkSetClampMacro(LeftBorderOffset, int, 5, VTK_INT_MAX);
160  vtkGetMacro(LeftBorderOffset, int);
162 
164 
169  vtkSetClampMacro(BottomBorderOffset, int, 5, VTK_INT_MAX);
170  vtkGetMacro(BottomBorderOffset, int);
172 
174 
178  vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
179  vtkGetMacro(CornerOffsetFactor, double);
181 
183 
186  vtkGetObjectMacro(LegendTitleProperty, vtkTextProperty);
187  vtkGetObjectMacro(LegendLabelProperty, vtkTextProperty);
189 
191 
196  vtkGetObjectMacro(RightAxis, vtkAxisActor2D);
197  vtkGetObjectMacro(TopAxis, vtkAxisActor2D);
198  vtkGetObjectMacro(LeftAxis, vtkAxisActor2D);
199  vtkGetObjectMacro(BottomAxis, vtkAxisActor2D);
201 
203 
206  virtual void BuildRepresentation(vtkViewport* viewport);
207  void GetActors2D(vtkPropCollection*) override;
208  void ReleaseGraphicsResources(vtkWindow*) override;
209  int RenderOverlay(vtkViewport*) override;
210  int RenderOpaqueGeometry(vtkViewport*) override;
212 
213 protected:
215  ~vtkLegendScaleActor() override;
216 
223 
224  // The four axes around the borders of the renderer
229 
230  // Control the display of the axes
235 
236  // Support for the legend.
242  vtkTextMapper* LabelMappers[6];
243  vtkActor2D* LabelActors[6];
247 
249 
250 private:
251  vtkLegendScaleActor(const vtkLegendScaleActor&) = delete;
252  void operator=(const vtkLegendScaleActor&) = delete;
253 };
254 
255 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkLegendScaleActor::Legend
vtkPolyData * Legend
Definition: vtkLegendScaleActor.h:238
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkLegendScaleActor::TopAxis
vtkAxisActor2D * TopAxis
Definition: vtkLegendScaleActor.h:226
vtkLegendScaleActor::SetLabelModeToXYCoordinates
void SetLabelModeToXYCoordinates()
Definition: vtkLegendScaleActor.h:85
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:44
vtkLegendScaleActor::BottomAxisVisibility
vtkTypeBool BottomAxisVisibility
Definition: vtkLegendScaleActor.h:234
vtkProp::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:65
vtkProp::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:224
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkLegendScaleActor::BottomAxis
vtkAxisActor2D * BottomAxis
Definition: vtkLegendScaleActor.h:228
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkProp::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:221
vtkLegendScaleActor::BuildTime
vtkTimeStamp BuildTime
Definition: vtkLegendScaleActor.h:248
vtkLegendScaleActor::CornerOffsetFactor
double CornerOffsetFactor
Definition: vtkLegendScaleActor.h:222
vtkLegendScaleActor::RightBorderOffset
int RightBorderOffset
Definition: vtkLegendScaleActor.h:218
vtkLegendScaleActor::LeftAxisVisibility
vtkTypeBool LeftAxisVisibility
Definition: vtkLegendScaleActor.h:233
vtkProp.h
vtkLegendScaleActor::LegendMapper
vtkPolyDataMapper2D * LegendMapper
Definition: vtkLegendScaleActor.h:240
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkLegendScaleActor::LegendVisibility
vtkTypeBool LegendVisibility
Definition: vtkLegendScaleActor.h:237
vtkProp::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLegendScaleActor::LegendTitleProperty
vtkTextProperty * LegendTitleProperty
Definition: vtkLegendScaleActor.h:244
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:47
vtkLegendScaleActor
annotate the render window with scale and distance information
Definition: vtkLegendScaleActor.h:53
vtkLegendScaleActor::LabelMode
int LabelMode
Definition: vtkLegendScaleActor.h:217
vtkLegendScaleActor::LeftAxis
vtkAxisActor2D * LeftAxis
Definition: vtkLegendScaleActor.h:227
vtkLegendScaleActor::BottomBorderOffset
int BottomBorderOffset
Definition: vtkLegendScaleActor.h:221
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkLegendScaleActor::TopAxisVisibility
vtkTypeBool TopAxisVisibility
Definition: vtkLegendScaleActor.h:232
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:76
vtkLegendScaleActor::LegendLabelProperty
vtkTextProperty * LegendLabelProperty
Definition: vtkLegendScaleActor.h:245
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkCoordinate.h
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:33
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkLegendScaleActor::LegendActor
vtkActor2D * LegendActor
Definition: vtkLegendScaleActor.h:241
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkAxisActor2D
Create an axis with tick marks and labels.
Definition: vtkAxisActor2D.h:69
vtkLegendScaleActor::AttributeLocation
AttributeLocation
Definition: vtkLegendScaleActor.h:69
vtkLegendScaleActor::RightAxisVisibility
vtkTypeBool RightAxisVisibility
Definition: vtkLegendScaleActor.h:231
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:306
vtkLegendScaleActor::SetLabelModeToDistance
void SetLabelModeToDistance()
Definition: vtkLegendScaleActor.h:84
vtkLegendScaleActor::LegendPoints
vtkPoints * LegendPoints
Definition: vtkLegendScaleActor.h:239
vtkLegendScaleActor::LeftBorderOffset
int LeftBorderOffset
Definition: vtkLegendScaleActor.h:220
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkLegendScaleActor::Coordinate
vtkCoordinate * Coordinate
Definition: vtkLegendScaleActor.h:246
vtkLegendScaleActor::TopBorderOffset
int TopBorderOffset
Definition: vtkLegendScaleActor.h:219
vtkLegendScaleActor::RightAxis
vtkAxisActor2D * RightAxis
Definition: vtkLegendScaleActor.h:225