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 
55 class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
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_LARGE_INTEGER);
129  vtkGetMacro(RightBorderOffset,int);
131 
133 
136  vtkSetClampMacro(TopBorderOffset,int,5,VTK_LARGE_INTEGER);
137  vtkGetMacro(TopBorderOffset,int);
139 
141 
144  vtkSetClampMacro(LeftBorderOffset,int,5,VTK_LARGE_INTEGER);
145  vtkGetMacro(LeftBorderOffset,int);
147 
149 
152  vtkSetClampMacro(BottomBorderOffset,int,5,VTK_LARGE_INTEGER);
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