VTK
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 =========================================================================*/
39 #ifndef vtkLegendScaleActor_h
40 #define vtkLegendScaleActor_h
41 
42 #include "vtkRenderingAnnotationModule.h" // For export macro
43 #include "vtkProp.h"
44 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
45 
46 class vtkAxisActor2D;
47 class vtkTextProperty;
48 class vtkPolyData;
50 class vtkActor2D;
51 class vtkTextMapper;
52 class vtkPoints;
53 class vtkCoordinate;
54 
56 {
57 public:
59  static vtkLegendScaleActor *New();
60 
62 
64  void PrintSelf(ostream& os, vtkIndent indent);
66 
67 //BTX
69  {
70  DISTANCE=0,
71  XY_COORDINATES=1
72  };
73 //ETX
74 
76 
80  vtkSetClampMacro(LabelMode,int,DISTANCE,XY_COORDINATES);
81  vtkGetMacro(LabelMode,int);
82  void SetLabelModeToDistance() {this->SetLabelMode(DISTANCE);}
83  void SetLabelModeToXYCoordinates() {this->SetLabelMode(XY_COORDINATES);}
85 
87 
90  vtkSetMacro(RightAxisVisibility,int);
91  vtkGetMacro(RightAxisVisibility,int);
92  vtkBooleanMacro(RightAxisVisibility,int);
93  vtkSetMacro(TopAxisVisibility,int);
94  vtkGetMacro(TopAxisVisibility,int);
95  vtkBooleanMacro(TopAxisVisibility,int);
96  vtkSetMacro(LeftAxisVisibility,int);
97  vtkGetMacro(LeftAxisVisibility,int);
98  vtkBooleanMacro(LeftAxisVisibility,int);
99  vtkSetMacro(BottomAxisVisibility,int);
100  vtkGetMacro(BottomAxisVisibility,int);
101  vtkBooleanMacro(BottomAxisVisibility,int);
103 
105 
107  vtkSetMacro(LegendVisibility,int);
108  vtkGetMacro(LegendVisibility,int);
109  vtkBooleanMacro(LegendVisibility,int);
111 
113 
114  void AllAxesOn();
115  void AllAxesOff();
117 
119 
120  void AllAnnotationsOn();
121  void AllAnnotationsOff();
123 
125 
128  vtkSetClampMacro(RightBorderOffset,int,5,VTK_INT_MAX);
129  vtkGetMacro(RightBorderOffset,int);
131 
133 
136  vtkSetClampMacro(TopBorderOffset,int,5,VTK_INT_MAX);
137  vtkGetMacro(TopBorderOffset,int);
139 
141 
144  vtkSetClampMacro(LeftBorderOffset,int,5,VTK_INT_MAX);
145  vtkGetMacro(LeftBorderOffset,int);
147 
149 
152  vtkSetClampMacro(BottomBorderOffset,int,5,VTK_INT_MAX);
153  vtkGetMacro(BottomBorderOffset,int);
155 
157 
159  vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
160  vtkGetMacro(CornerOffsetFactor, double);
162 
164 
165  vtkGetObjectMacro(LegendTitleProperty,vtkTextProperty);
166  vtkGetObjectMacro(LegendLabelProperty,vtkTextProperty);
168 
170 
173  vtkGetObjectMacro(RightAxis,vtkAxisActor2D);
174  vtkGetObjectMacro(TopAxis,vtkAxisActor2D);
175  vtkGetObjectMacro(LeftAxis,vtkAxisActor2D);
176  vtkGetObjectMacro(BottomAxis,vtkAxisActor2D);
178 
180 
181  virtual void BuildRepresentation(vtkViewport *viewport);
182  virtual void GetActors2D(vtkPropCollection*);
183  virtual void ReleaseGraphicsResources(vtkWindow*);
184  virtual int RenderOverlay(vtkViewport*);
185  virtual int RenderOpaqueGeometry(vtkViewport*);
187 
188 protected:
191 
198 
199  // The four axes around the borders of the renderer
204 
205  // Control the display of the axes
210 
211  // Support for the legend.
217  vtkTextMapper *LabelMappers[6];
218  vtkActor2D *LabelActors[6];
222 
224 
225 private:
226  vtkLegendScaleActor(const vtkLegendScaleActor&); //Not implemented
227  void operator=(const vtkLegendScaleActor&); //Not implemented
228 };
229 
230 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
void PrintSelf(ostream &os, vtkIndent indent)
abstract specification for Viewports
Definition: vtkViewport.h:46
virtual int RenderOpaqueGeometry(vtkViewport *)
Definition: vtkProp.h:198
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:204
#define VTK_INT_MAX
Definition: vtkType.h:132
vtkAxisActor2D * RightAxis
a actor that draws 2D data
Definition: vtkActor2D.h:44
record modification and/or execution time
Definition: vtkTimeStamp.h:34
Create an axis with tick marks and labels.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
vtkPolyDataMapper2D * LegendMapper
2D text annotation
Definition: vtkTextMapper.h:52
#define VTKRENDERINGANNOTATION_EXPORT
annotate the render window with scale and distance information
a list of Props
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkProp.h:270
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
vtkAxisActor2D * TopAxis
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkAxisActor2D * LeftAxis
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:63
vtkCoordinate * Coordinate
vtkAxisActor2D * BottomAxis
vtkTextProperty * LegendTitleProperty
static vtkObject * New()
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkTextProperty * LegendLabelProperty