VTK
vtkProp3DAxisFollower.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkProp3DAxisFollower.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 =========================================================================*/
29 #ifndef vtkProp3DAxisFollower_h
30 #define vtkProp3DAxisFollower_h
31 
32 #include "vtkRenderingAnnotationModule.h" // For export macro
33 #include "vtkProp3DFollower.h"
34 #include "vtkWeakPointer.h" // For vtkWeakPointer
35 
36 class vtkAxisActor;
37 class vtkViewport;
38 
39 class VTKRENDERINGANNOTATION_EXPORT vtkProp3DAxisFollower
40  : public vtkProp3DFollower
41 {
42  public:
46  static vtkProp3DAxisFollower *New();
47 
49 
53  void PrintSelf(ostream& os, vtkIndent indent);
55 
57 
60  virtual void SetAxis(vtkAxisActor*);
61  virtual vtkAxisActor* GetAxis();
63 
65 
70  vtkSetMacro(AutoCenter, int);
71  vtkGetMacro(AutoCenter, int);
72  vtkBooleanMacro(AutoCenter, int);
74 
76 
81  vtkSetMacro(EnableDistanceLOD, int);
82  vtkGetMacro(EnableDistanceLOD, int);
84 
86 
91  vtkSetClampMacro(DistanceLODThreshold, double, 0.0, 1.0);
92  vtkGetMacro(DistanceLODThreshold, double);
94 
96 
101  vtkSetMacro(EnableViewAngleLOD, int);
102  vtkGetMacro(EnableViewAngleLOD, int);
104 
106 
111  vtkSetClampMacro(ViewAngleLODThreshold, double, 0.0, 1.0);
112  vtkGetMacro(ViewAngleLODThreshold, double);
114 
116 
120  double GetScreenOffset();
121  void SetScreenOffset(double offset);
123 
125 
128  vtkSetVector2Macro(ScreenOffsetVector, double);
129  vtkGetVector2Macro(ScreenOffsetVector, double);
131 
136  virtual void ComputeMatrix();
137 
141  void ShallowCopy(vtkProp *prop);
142 
147  static double AutoScale(vtkViewport *viewport, vtkCamera * camera,
148  double screenSize, double position[3]);
149 
151 
156  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
157  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
158  virtual int RenderVolumetricGeometry(vtkViewport *viewport);
160 
161  virtual void SetViewport(vtkViewport* viewport);
162  virtual vtkViewport* GetViewport();
163 
164 protected:
167 
168  void CalculateOrthogonalVectors(double Rx[3], double Ry[3], double Rz[3],
169  vtkAxisActor *axis1, double *dop,
170  vtkViewport *ren);
171 
172  void ComputeRotationAndTranlation(vtkViewport *ren, double translation[3],
173  double Rx[3], double Ry[3], double Rz[3],
174  vtkAxisActor *axis);
175 
176  // \NOTE: Not used as of now.
177  void ComputerAutoCenterTranslation(const double& autoScaleFactor,
178  double translation[3]);
179 
180  int TestDistanceVisibility();
181  void ExecuteViewAngleVisibility(double normal[3]);
182 
183  bool IsTextUpsideDown(double* a, double* b);
184 
186 
189 
192 
193  double ScreenOffsetVector [2];
194 
197 private:
198  vtkProp3DAxisFollower(const vtkProp3DAxisFollower&) VTK_DELETE_FUNCTION;
199  void operator=(const vtkProp3DAxisFollower&) VTK_DELETE_FUNCTION;
200 
201  int TextUpsideDown;
202  int VisibleAtCurrentViewAngle;
203 
204 };
205 
206 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
abstract specification for Viewports
Definition: vtkViewport.h:47
void PrintSelf(ostream &os, vtkIndent indent)
Standard VTK methods for type and printing.
virtual int RenderVolumetricGeometry(vtkViewport *viewport)
This causes the actor to be rendered.
Create an axis with tick marks and labels.
Definition: vtkAxisActor.h:74
void ShallowCopy(vtkProp *prop)
Shallow copy of a follower.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
This causes the actor to be rendered.
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
a vtkProp3D that always faces the camera
static vtkProp3DFollower * New()
Creates a follower with no camera set.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
This causes the actor to be rendered.
vtkWeakPointer< vtkViewport > Viewport
a subclass of vtkProp3DFollower that ensures that data is always parallel to the axis defined by a vt...
virtual void ComputeMatrix()
Generate the matrix based on ivars.
vtkWeakPointer< vtkAxisActor > Axis
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.