/usr/include/vtk-7.1/vtkLegendScaleActor.h is in libvtk7-dev 7.1.1+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkLegendScaleActor.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkLegendScaleActor
* @brief annotate the render window with scale and distance information
*
* This class is used to annotate the render window. Its basic goal is to
* provide an indication of the scale of the scene. Four axes surrounding the
* render window indicate (in a variety of ways) the scale of what the camera
* is viewing. An option also exists for displaying a scale legend.
*
* The axes can be programmed either to display distance scales or x-y
* coordinate values. By default, the scales display a distance. However,
* if you know that the view is down the z-axis, the scales can be programmed
* to display x-y coordinate values.
*
* @warning
* Please be aware that the axes and scale values are subject to perspective
* effects. The distances are computed in the focal plane of the camera.
* When there are large view angles (i.e., perspective projection), the
* computed distances may provide users the wrong sense of scale. These
* effects are not present when parallel projection is enabled.
*/
#ifndef vtkLegendScaleActor_h
#define vtkLegendScaleActor_h
#include "vtkRenderingAnnotationModule.h" // For export macro
#include "vtkProp.h"
#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
class vtkAxisActor2D;
class vtkTextProperty;
class vtkPolyData;
class vtkPolyDataMapper2D;
class vtkActor2D;
class vtkTextMapper;
class vtkPoints;
class vtkCoordinate;
class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp
{
public:
/**
* Instantiate the class.
*/
static vtkLegendScaleActor *New();
//@{
/**
* Standard methods for the class.
*/
vtkTypeMacro(vtkLegendScaleActor,vtkProp);
void PrintSelf(ostream& os, vtkIndent indent);
//@}
enum AttributeLocation
{
DISTANCE=0,
XY_COORDINATES=1
};
//@{
/**
* Specify the mode for labeling the scale axes. By default, the axes are
* labeled with the distance between points (centered at a distance of
* 0.0). Alternatively if you know that the view is down the z-axis; the
* axes can be labeled with x-y coordinate values.
*/
vtkSetClampMacro(LabelMode,int,DISTANCE,XY_COORDINATES);
vtkGetMacro(LabelMode,int);
void SetLabelModeToDistance() {this->SetLabelMode(DISTANCE);}
void SetLabelModeToXYCoordinates() {this->SetLabelMode(XY_COORDINATES);}
//@}
//@{
/**
* Set/Get the flags that control which of the four axes to display (top,
* bottom, left and right). By default, all the axes are displayed.
*/
vtkSetMacro(RightAxisVisibility,int);
vtkGetMacro(RightAxisVisibility,int);
vtkBooleanMacro(RightAxisVisibility,int);
vtkSetMacro(TopAxisVisibility,int);
vtkGetMacro(TopAxisVisibility,int);
vtkBooleanMacro(TopAxisVisibility,int);
vtkSetMacro(LeftAxisVisibility,int);
vtkGetMacro(LeftAxisVisibility,int);
vtkBooleanMacro(LeftAxisVisibility,int);
vtkSetMacro(BottomAxisVisibility,int);
vtkGetMacro(BottomAxisVisibility,int);
vtkBooleanMacro(BottomAxisVisibility,int);
//@}
//@{
/**
* Indicate whether the legend scale should be displayed or not.
* The default is On.
*/
vtkSetMacro(LegendVisibility,int);
vtkGetMacro(LegendVisibility,int);
vtkBooleanMacro(LegendVisibility,int);
//@}
//@{
/**
* Convenience method that turns all the axes either on or off.
*/
void AllAxesOn();
void AllAxesOff();
//@}
//@{
/**
* Convenience method that turns all the axes and the legend scale.
*/
void AllAnnotationsOn();
void AllAnnotationsOff();
//@}
//@{
/**
* Set/Get the offset of the right axis from the border. This number is expressed in
* pixels, and represents the approximate distance of the axes from the sides
* of the renderer. The default is 50.
*/
vtkSetClampMacro(RightBorderOffset,int,5,VTK_INT_MAX);
vtkGetMacro(RightBorderOffset,int);
//@}
//@{
/**
* Set/Get the offset of the top axis from the border. This number is expressed in
* pixels, and represents the approximate distance of the axes from the sides
* of the renderer. The default is 30.
*/
vtkSetClampMacro(TopBorderOffset,int,5,VTK_INT_MAX);
vtkGetMacro(TopBorderOffset,int);
//@}
//@{
/**
* Set/Get the offset of the left axis from the border. This number is expressed in
* pixels, and represents the approximate distance of the axes from the sides
* of the renderer. The default is 50.
*/
vtkSetClampMacro(LeftBorderOffset,int,5,VTK_INT_MAX);
vtkGetMacro(LeftBorderOffset,int);
//@}
//@{
/**
* Set/Get the offset of the bottom axis from the border. This number is expressed in
* pixels, and represents the approximate distance of the axes from the sides
* of the renderer. The default is 30.
*/
vtkSetClampMacro(BottomBorderOffset,int,5,VTK_INT_MAX);
vtkGetMacro(BottomBorderOffset,int);
//@}
//@{
/**
* Get/Set the corner offset. This is the offset factor used to offset the
* axes at the corners. Default value is 2.0.
*/
vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
vtkGetMacro(CornerOffsetFactor, double);
//@}
//@{
/**
* Set/Get the labels text properties for the legend title and labels.
*/
vtkGetObjectMacro(LegendTitleProperty,vtkTextProperty);
vtkGetObjectMacro(LegendLabelProperty,vtkTextProperty);
//@}
//@{
/**
* These are methods to retrieve the vtkAxisActors used to represent
* the four axes that form this representation. Users may retrieve and
* then modify these axes to control their appearance.
*/
vtkGetObjectMacro(RightAxis,vtkAxisActor2D);
vtkGetObjectMacro(TopAxis,vtkAxisActor2D);
vtkGetObjectMacro(LeftAxis,vtkAxisActor2D);
vtkGetObjectMacro(BottomAxis,vtkAxisActor2D);
//@}
//@{
/**
* Standard methods supporting the rendering process.
*/
virtual void BuildRepresentation(vtkViewport *viewport);
virtual void GetActors2D(vtkPropCollection*);
virtual void ReleaseGraphicsResources(vtkWindow*);
virtual int RenderOverlay(vtkViewport*);
virtual int RenderOpaqueGeometry(vtkViewport*);
//@}
protected:
vtkLegendScaleActor();
~vtkLegendScaleActor();
int LabelMode;
int RightBorderOffset;
int TopBorderOffset;
int LeftBorderOffset;
int BottomBorderOffset;
double CornerOffsetFactor;
// The four axes around the borders of the renderer
vtkAxisActor2D *RightAxis;
vtkAxisActor2D *TopAxis;
vtkAxisActor2D *LeftAxis;
vtkAxisActor2D *BottomAxis;
// Control the display of the axes
int RightAxisVisibility;
int TopAxisVisibility;
int LeftAxisVisibility;
int BottomAxisVisibility;
// Support for the legend.
int LegendVisibility;
vtkPolyData *Legend;
vtkPoints *LegendPoints;
vtkPolyDataMapper2D *LegendMapper;
vtkActor2D *LegendActor;
vtkTextMapper *LabelMappers[6];
vtkActor2D *LabelActors[6];
vtkTextProperty *LegendTitleProperty;
vtkTextProperty *LegendLabelProperty;
vtkCoordinate *Coordinate;
vtkTimeStamp BuildTime;
private:
vtkLegendScaleActor(const vtkLegendScaleActor&) VTK_DELETE_FUNCTION;
void operator=(const vtkLegendScaleActor&) VTK_DELETE_FUNCTION;
};
#endif
|