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 =========================================================================*/
28 #ifndef vtkProp3DAxisFollower_h
29 #define vtkProp3DAxisFollower_h
30 
31 #include "vtkRenderingAnnotationModule.h" // For export macro
32 #include "vtkProp3DFollower.h"
33 #include "vtkWeakPointer.h" // For vtkWeakPointer
34 
35 class vtkAxisActor;
36 class vtkViewport;
37 
39  : public vtkProp3DFollower
40 {
41  public:
43  static vtkProp3DAxisFollower *New();
44 
46 
48  void PrintSelf(ostream& os, vtkIndent indent);
50 
52 
53  virtual void SetAxis(vtkAxisActor*);
54  virtual vtkAxisActor* GetAxis();
56 
58 
61  vtkSetMacro(AutoCenter, int);
62  vtkGetMacro(AutoCenter, int);
63  vtkBooleanMacro(AutoCenter, int);
65 
67 
70  vtkSetMacro(EnableDistanceLOD, int);
71  vtkGetMacro(EnableDistanceLOD, int);
73 
75 
78  vtkSetClampMacro(DistanceLODThreshold, double, 0.0, 1.0);
79  vtkGetMacro(DistanceLODThreshold, double);
81 
83 
85  vtkSetMacro(EnableViewAngleLOD, int);
86  vtkGetMacro(EnableViewAngleLOD, int);
88 
90 
93  vtkSetClampMacro(ViewAngleLODThreshold, double, 0.0, 1.0);
94  vtkGetMacro(ViewAngleLODThreshold, double);
96 
98 
99  vtkSetMacro(ScreenOffset, double);
100  vtkGetMacro(ScreenOffset, double);
102 
106  virtual void ComputeMatrix();
107 
109  void ShallowCopy(vtkProp *prop);
110 
112 
114  static double AutoScale(vtkViewport *viewport, vtkCamera * camera,
115  double screenSize, double position[3]);
117 
119 
122  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
123  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
124  virtual int RenderVolumetricGeometry(vtkViewport *viewport);
126 
127  virtual void SetViewport(vtkViewport* viewport);
128  virtual vtkViewport* GetViewport();
129 
130 protected:
133 
134  void CalculateOrthogonalVectors(double Rx[3], double Ry[3], double Rz[3],
135  vtkAxisActor *axis1, double *dop,
136  vtkViewport *ren);
137 
138 
139  void ComputeRotationAndTranlation(vtkViewport *ren, double translation[3],
140  double Rx[3], double Ry[3], double Rz[3],
141  vtkAxisActor *axis);
142 
143  // \NOTE: Not used as of now.
144  void ComputerAutoCenterTranslation(const double& autoScaleFactor,
145  double translation[3]);
146 
147 
148  int TestDistanceVisibility();
149  void ExecuteViewAngleVisibility(double normal[3]);
150 
151  bool IsTextUpsideDown(double* a, double* b);
152 
154 
157 
160 
161  double ScreenOffset;
162 
165 private:
166  vtkProp3DAxisFollower(const vtkProp3DAxisFollower&); // Not implemented.
167  void operator=(const vtkProp3DAxisFollower&); // Not implemented.
168 
169  int TextUpsideDown;
170  int VisibleAtCurrentViewAngle;
171 
172 };
173 
174 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
abstract specification for Viewports
Definition: vtkViewport.h:46
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RenderVolumetricGeometry(vtkViewport *viewport)
Create an axis with tick marks and labels.
Definition: vtkAxisActor.h:93
void ShallowCopy(vtkProp *prop)
#define VTKRENDERINGANNOTATION_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
a virtual camera for 3D rendering
Definition: vtkCamera.h:48
a vtkProp3D that always faces the camera
static vtkProp3DFollower * New()
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
vtkWeakPointer< vtkViewport > Viewport
a subclass of vtkProp3DFollower that ensures that data is always parallel to the axis defined by a vt...
virtual void ComputeMatrix()
vtkWeakPointer< vtkAxisActor > Axis