VTK
vtkAxisFollower.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAxisFollower.cxx
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 =========================================================================*/
28 #ifndef vtkAxisFollower_h
29 #define vtkAxisFollower_h
30 
31 #include "vtkRenderingAnnotationModule.h" // For export macro
32 #include "vtkFollower.h"
33 
34 #include "vtkWeakPointer.h" // For vtkWeakPointer
35 
36 // Forward declarations.
37 class vtkAxisActor;
38 class vtkRenderer;
39 
41 {
42 public:
44  virtual void PrintSelf(ostream& os, vtkIndent indent);
45 
47  static vtkAxisFollower *New();
48 
50 
51  virtual void SetAxis(vtkAxisActor*);
52  virtual vtkAxisActor* GetAxis();
54 
56 
59  vtkSetMacro(AutoCenter, int);
60  vtkGetMacro(AutoCenter, int);
61  vtkBooleanMacro(AutoCenter, int);
63 
65 
68  vtkSetMacro(EnableDistanceLOD, int);
69  vtkGetMacro(EnableDistanceLOD, int);
71 
73 
76  vtkSetClampMacro(DistanceLODThreshold, double, 0.0, 1.0);
77  vtkGetMacro(DistanceLODThreshold, double);
79 
81 
83  vtkSetMacro(EnableViewAngleLOD, int);
84  vtkGetMacro(EnableViewAngleLOD, int);
86 
88 
91  vtkSetClampMacro(ViewAngleLODThreshold, double, 0.0, 1.0);
92  vtkGetMacro(ViewAngleLODThreshold, double);
94 
96 
97  vtkSetMacro(ScreenOffset, double);
98  vtkGetMacro(ScreenOffset, double);
100 
102 
105  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
106  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
107  virtual void Render(vtkRenderer *ren);
109 
113  virtual void ComputeTransformMatrix(vtkRenderer *ren);
114 
116  void ShallowCopy(vtkProp *prop);
117 
119 
121  static double AutoScale(vtkViewport *viewport, vtkCamera * camera,
122  double screenSize, double position[3]);
124 
125 protected:
126  vtkAxisFollower();
127  ~vtkAxisFollower();
128 
129  void CalculateOrthogonalVectors(double Rx[3], double Ry[3], double Rz[3],
130  vtkAxisActor *axis1, double *dop,
131  vtkRenderer *ren);
132 
133 
134  void ComputeRotationAndTranlation(vtkRenderer *ren, double translation[3],
135  double Rx[3], double Ry[3], double Rz[3],
136  vtkAxisActor *axis);
137 
138  // \NOTE: Not used as of now.
139  void ComputerAutoCenterTranslation(const double& autoScaleFactor,
140  double translation[3]);
141 
142 
143  int TestDistanceVisibility();
144  void ExecuteViewAngleVisibility(double normal[3]);
145 
146  bool IsTextUpsideDown(double* a, double* b);
147 
149 
152 
155 
156  double ScreenOffset;
157 
159 
160 
161 private:
162 
163  int TextUpsideDown;
164  int VisibleAtCurrentViewAngle;
165 
166  vtkAxisFollower(const vtkAxisFollower&); // Not implemented.
167  void operator =(const vtkAxisFollower&); // Not implemented.
168 
169  // hide the two parameter Render() method from the user and the compiler.
170  virtual void Render(vtkRenderer *, vtkMapper *) {}
171 
172  //Internal matrices to avoid New/Delete for performance reasons
173  vtkMatrix4x4 *InternalMatrix;
174 
175 };
176 
177 #endif // vtkAxisFollower_h
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
vtkWeakPointer< vtkAxisActor > Axis
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:38
abstract specification for Viewports
Definition: vtkViewport.h:46
virtual void Render(vtkRenderer *ren)
Create an axis with tick marks and labels.
Definition: vtkAxisActor.h:93
abstract specification for renderers
Definition: vtkRenderer.h:63
void ShallowCopy(vtkProp *prop)
#define VTKRENDERINGANNOTATION_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual camera for 3D rendering
Definition: vtkCamera.h:48
double ViewAngleLODThreshold
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:89
a subclass of vtkFollower that ensures that data is always parallel to the axis defined by a vtkAxisA...
a subclass of actor that always faces the camera
Definition: vtkFollower.h:45
static vtkFollower * New()
double DistanceLODThreshold
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)