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) override;
55 
57 
60  virtual void SetAxis(vtkAxisActor*);
61  virtual vtkAxisActor* GetAxis();
63 
65 
70  vtkSetMacro(AutoCenter, vtkTypeBool);
71  vtkGetMacro(AutoCenter, vtkTypeBool);
72  vtkBooleanMacro(AutoCenter, vtkTypeBool);
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  void ComputeMatrix() override;
137 
141  void ShallowCopy(vtkProp *prop) override;
142 
147  static double AutoScale(vtkViewport *viewport, vtkCamera * camera,
148  double screenSize, double position[3]);
149 
151 
156  int RenderOpaqueGeometry(vtkViewport *viewport) override;
157  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
158  int RenderVolumetricGeometry(vtkViewport *viewport) override;
160 
161  virtual void SetViewport(vtkViewport* viewport);
162  virtual vtkViewport* GetViewport();
163 
164 protected:
166  ~vtkProp3DAxisFollower() override;
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:
199  void operator=(const vtkProp3DAxisFollower&) = delete;
200 
201  int TextUpsideDown;
202  int VisibleAtCurrentViewAngle;
203 
204 };
205 
206 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
int RenderOpaqueGeometry(vtkViewport *viewport) override
This causes the actor to be rendered.
abstract specification for Viewports
Definition: vtkViewport.h:47
Create an axis with tick marks and labels.
Definition: vtkAxisActor.h:74
int RenderVolumetricGeometry(vtkViewport *viewport) override
This causes the actor to be rendered.
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:39
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.
vtkWeakPointer< vtkViewport > Viewport
a subclass of vtkProp3DFollower that ensures that data is always parallel to the axis defined by a vt...
vtkWeakPointer< vtkAxisActor > Axis
void ShallowCopy(vtkProp *prop) override
Shallow copy of a follower.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods for type and printing.
void ComputeMatrix() override
Generate the matrix based on ivars.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
This causes the actor to be rendered.