/usr/include/vtk-7.1/vtkAxisFollower.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 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkAxisFollower.cxx
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 vtkAxisFollower
* @brief a subclass of vtkFollower that ensures that
* data is always parallel to the axis defined by a vtkAxisActor.
*
* vtkAxisFollower is a subclass of vtkFollower that always follows its
* specified axis. More specifically it will not change its position or scale,
* but it will continually update its orientation so that it is aliged with the
* axis and facing at angle to the camera to provide maximum visibilty.
* This is typically used for text labels for 3d plots.
* @sa
* vtkActor vtkFollower vtkCamera vtkAxisActor vtkCubeAxesActor
*/
#ifndef vtkAxisFollower_h
#define vtkAxisFollower_h
#include "vtkRenderingAnnotationModule.h" // For export macro
#include "vtkFollower.h"
#include "vtkWeakPointer.h" // For vtkWeakPointer
// Forward declarations.
class vtkAxisActor;
class vtkRenderer;
class VTKRENDERINGANNOTATION_EXPORT vtkAxisFollower : public vtkFollower
{
public:
vtkTypeMacro(vtkAxisFollower,vtkFollower);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
/**
* Creates a follower with no camera set
*/
static vtkAxisFollower *New();
//@{
/**
* Set axis that needs to be followed.
*/
virtual void SetAxis(vtkAxisActor*);
virtual vtkAxisActor* GetAxis();
//@}
//@{
/**
* Set/Get state of auto center mode where additional
* translation will be added to make sure the underlying
* geometry has its pivot point at the center of its bounds.
*/
vtkSetMacro(AutoCenter, int);
vtkGetMacro(AutoCenter, int);
vtkBooleanMacro(AutoCenter, int);
//@}
//@{
/**
* Enable / disable use of distance based LOD. If enabled the actor
* will not be visible at a certain distance from the camera.
* Default is false.
*/
vtkSetMacro(EnableDistanceLOD, int);
vtkGetMacro(EnableDistanceLOD, int);
//@}
//@{
/**
* Set distance LOD threshold (0.0 - 1.0).This determines at what fraction
* of camera far clip range, actor is not visible.
* Default is 0.80.
*/
vtkSetClampMacro(DistanceLODThreshold, double, 0.0, 1.0);
vtkGetMacro(DistanceLODThreshold, double);
//@}
//@{
/**
* Enable / disable use of view angle based LOD. If enabled the actor
* will not be visible at a certain view angle.
* Default is true.
*/
vtkSetMacro(EnableViewAngleLOD, int);
vtkGetMacro(EnableViewAngleLOD, int);
//@}
//@{
/**
* Set view angle LOD threshold (0.0 - 1.0).This determines at what view
* angle to geometry will make the geometry not visibile.
* Default is 0.34.
*/
vtkSetClampMacro(ViewAngleLODThreshold, double, 0.0, 1.0);
vtkGetMacro(ViewAngleLODThreshold, double);
//@}
//@{
/**
* Set/Get the desired screen offset from the axis.
* Convenience method, using a zero horizontal offset
*/
double GetScreenOffset();
void SetScreenOffset(double offset);
//@}
//@{
/**
* Set/Get the desired screen offset from the axis.
* first component is horizontal, second is vertical.
*/
vtkSetVector2Macro(ScreenOffsetVector, double);
vtkGetVector2Macro(ScreenOffsetVector, double);
//@}
//@{
/**
* This causes the actor to be rendered. It in turn will render the actor's
* property, texture map and then mapper. If a property hasn't been
* assigned, then the actor will create one automatically.
*/
virtual int RenderOpaqueGeometry(vtkViewport *viewport);
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
virtual void Render(vtkRenderer *ren);
//@}
/**
* Generate the matrix based on ivars. This method overloads its superclasses
* ComputeMatrix() method due to the special vtkFollower matrix operations.
*/
virtual void ComputeTransformMatrix(vtkRenderer *ren);
/**
* Shallow copy of a follower. Overloads the virtual vtkProp method.
*/
void ShallowCopy(vtkProp *prop);
/**
* Calculate scale factor to maintain same size of a object
* on the screen.
*/
static double AutoScale(vtkViewport *viewport, vtkCamera * camera,
double screenSize, double position[3]);
protected:
vtkAxisFollower();
~vtkAxisFollower();
void CalculateOrthogonalVectors(double Rx[3], double Ry[3], double Rz[3],
vtkAxisActor *axis1, double *dop,
vtkRenderer *ren);
void ComputeRotationAndTranlation(vtkRenderer *ren, double translation[3],
double Rx[3], double Ry[3], double Rz[3],
vtkAxisActor *axis);
// \NOTE: Not used as of now.
void ComputerAutoCenterTranslation(const double& autoScaleFactor,
double translation[3]);
int TestDistanceVisibility();
void ExecuteViewAngleVisibility(double normal[3]);
bool IsTextUpsideDown(double* a, double* b);
int AutoCenter;
int EnableDistanceLOD;
double DistanceLODThreshold;
int EnableViewAngleLOD;
double ViewAngleLODThreshold;
double ScreenOffsetVector[2];
vtkWeakPointer<vtkAxisActor> Axis;
private:
int TextUpsideDown;
int VisibleAtCurrentViewAngle;
vtkAxisFollower(const vtkAxisFollower&) VTK_DELETE_FUNCTION;
void operator =(const vtkAxisFollower&) VTK_DELETE_FUNCTION;
// hide the two parameter Render() method from the user and the compiler.
virtual void Render(vtkRenderer *, vtkMapper *) {}
//Internal matrices to avoid New/Delete for performance reasons
vtkMatrix4x4 *InternalMatrix;
};
#endif // vtkAxisFollower_h
|