VTK  9.7.1
vtkProp3DAxisFollower.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkProp3DAxisFollower_h
18 #define vtkProp3DAxisFollower_h
19 
20 #include "vtkDeprecation.h"
21 #include "vtkProp3DFollower.h"
22 #include "vtkRenderingAnnotationModule.h" // For export macro
23 #include "vtkWeakPointer.h" // For vtkWeakPointer
24 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkAxisActor;
28 class vtkViewport;
29 
30 class VTKRENDERINGANNOTATION_EXPORT VTK_MARSHALAUTO vtkProp3DAxisFollower : public vtkProp3DFollower
31 {
32 public:
36  static vtkProp3DAxisFollower* New();
37 
39 
43  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
50  virtual void SetAxis(vtkAxisActor*);
51  virtual vtkAxisActor* GetAxis();
53 
55 
60  vtkSetMacro(AutoCenter, vtkTypeBool);
61  vtkGetMacro(AutoCenter, vtkTypeBool);
62  vtkBooleanMacro(AutoCenter, vtkTypeBool);
64 
66 
71  vtkSetMacro(EnableDistanceLOD, int);
72  vtkGetMacro(EnableDistanceLOD, int);
74 
76 
81  vtkSetClampMacro(DistanceLODThreshold, double, 0.0, 1.0);
82  vtkGetMacro(DistanceLODThreshold, double);
84 
86 
91  vtkSetMacro(EnableViewAngleLOD, int);
92  vtkGetMacro(EnableViewAngleLOD, int);
94 
96 
101  vtkSetClampMacro(ViewAngleLODThreshold, double, 0.0, 1.0);
102  vtkGetMacro(ViewAngleLODThreshold, double);
104 
106 
110  double GetScreenOffset();
111  void SetScreenOffset(double offset);
113 
115 
118  vtkSetVector2Macro(ScreenOffsetVector, double);
119  vtkGetVector2Macro(ScreenOffsetVector, double);
121 
126  void ComputeMatrix() override;
127 
131  void ShallowCopy(vtkProp* prop) override;
132 
137  static double AutoScale(
138  vtkViewport* viewport, vtkCamera* camera, double screenSize, double position[3]);
139 
141 
146  int RenderOpaqueGeometry(vtkViewport* viewport) override;
147  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
148  int RenderVolumetricGeometry(vtkViewport* viewport) override;
150 
151  virtual void SetViewport(vtkViewport* viewport);
152  virtual vtkViewport* GetViewport();
153 
154 protected:
156  ~vtkProp3DAxisFollower() override;
157 
158  void CalculateOrthogonalVectors(
159  double Rx[3], double Ry[3], double Rz[3], vtkAxisActor* axis1, double* dop, vtkViewport* ren);
160 
161  void ComputeRotationAndTranlation(vtkViewport* ren, double translation[3], double Rx[3],
162  double Ry[3], double Rz[3], vtkAxisActor* axis);
163 
164  // \NOTE: Not used as of now.
165  VTK_DEPRECATED_IN_9_6_0("Unmaintained method, please do not use.")
166  void ComputerAutoCenterTranslation(const double& autoScaleFactor, double translation[3]);
167 
168  int TestDistanceVisibility();
169  void ExecuteViewAngleVisibility(double normal[3]);
170 
171  bool IsTextUpsideDown(double* a, double* b);
172 
173  vtkTypeBool AutoCenter;
174 
175  int EnableDistanceLOD;
176  double DistanceLODThreshold;
177 
178  int EnableViewAngleLOD;
179  double ViewAngleLODThreshold;
180 
181  double ScreenOffsetVector[2];
182 
185 
186 private:
188  void operator=(const vtkProp3DAxisFollower&) = delete;
189 
190  int TextUpsideDown;
191  int VisibleAtCurrentViewAngle;
192 };
193 
194 VTK_ABI_NAMESPACE_END
195 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
int RenderOpaqueGeometry(vtkViewport *viewport) override
This causes the actor to be rendered.
abstract specification for Viewports
Definition: vtkViewport.h:46
Create an axis with tick marks and labels.
Definition: vtkAxisActor.h:71
int RenderVolumetricGeometry(vtkViewport *viewport) override
This causes the actor to be rendered.
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_DEPRECATED_IN_9_6_0(reason)
a simple class to control print indentation
Definition: vtkIndent.h:28
a virtual camera for 3D rendering
Definition: vtkCamera.h:41
a weak reference to a vtkObject.
Definition: vtkMeta.h:25
a vtkProp3D that always faces the camera
static vtkProp3DFollower * New()
Creates a follower with no camera set.
a subclass of vtkProp3DFollower that ensures that data is always parallel to the axis defined by a vt...
#define VTK_MARSHALAUTO
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.