VTK  9.3.0
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 "vtkProp3DFollower.h"
21#include "vtkRenderingAnnotationModule.h" // For export macro
22#include "vtkWeakPointer.h" // For vtkWeakPointer
23
24VTK_ABI_NAMESPACE_BEGIN
25class vtkAxisActor;
26class vtkViewport;
27
28class VTKRENDERINGANNOTATION_EXPORT vtkProp3DAxisFollower : public vtkProp3DFollower
29{
30public:
35
37
41 void PrintSelf(ostream& os, vtkIndent indent) override;
43
45
48 virtual void SetAxis(vtkAxisActor*);
51
53
58 vtkSetMacro(AutoCenter, vtkTypeBool);
59 vtkGetMacro(AutoCenter, vtkTypeBool);
60 vtkBooleanMacro(AutoCenter, vtkTypeBool);
62
64
69 vtkSetMacro(EnableDistanceLOD, int);
70 vtkGetMacro(EnableDistanceLOD, int);
72
74
79 vtkSetClampMacro(DistanceLODThreshold, double, 0.0, 1.0);
80 vtkGetMacro(DistanceLODThreshold, double);
82
84
89 vtkSetMacro(EnableViewAngleLOD, int);
90 vtkGetMacro(EnableViewAngleLOD, int);
92
94
99 vtkSetClampMacro(ViewAngleLODThreshold, double, 0.0, 1.0);
100 vtkGetMacro(ViewAngleLODThreshold, double);
102
104
109 void SetScreenOffset(double offset);
111
113
116 vtkSetVector2Macro(ScreenOffsetVector, double);
117 vtkGetVector2Macro(ScreenOffsetVector, double);
119
124 void ComputeMatrix() override;
125
129 void ShallowCopy(vtkProp* prop) override;
130
135 static double AutoScale(
136 vtkViewport* viewport, vtkCamera* camera, double screenSize, double position[3]);
137
139
144 int RenderOpaqueGeometry(vtkViewport* viewport) override;
146 int RenderVolumetricGeometry(vtkViewport* viewport) override;
148
149 virtual void SetViewport(vtkViewport* viewport);
151
152protected:
155
157 double Rx[3], double Ry[3], double Rz[3], vtkAxisActor* axis1, double* dop, vtkViewport* ren);
158
159 void ComputeRotationAndTranlation(vtkViewport* ren, double translation[3], double Rx[3],
160 double Ry[3], double Rz[3], vtkAxisActor* axis);
161
162 // \NOTE: Not used as of now.
163 void ComputerAutoCenterTranslation(const double& autoScaleFactor, double translation[3]);
164
166 void ExecuteViewAngleVisibility(double normal[3]);
167
168 bool IsTextUpsideDown(double* a, double* b);
169
171
174
177
178 double ScreenOffsetVector[2];
179
182
183private:
185 void operator=(const vtkProp3DAxisFollower&) = delete;
186
187 int TextUpsideDown;
188 int VisibleAtCurrentViewAngle;
189};
190
191VTK_ABI_NAMESPACE_END
192#endif
Create an axis with tick marks and labels.
a virtual camera for 3D rendering
Definition vtkCamera.h:41
a simple class to control print indentation
Definition vtkIndent.h:29
a subclass of vtkProp3DFollower that ensures that data is always parallel to the axis defined by a vt...
virtual vtkAxisActor * GetAxis()
Set axis that needs to be followed.
virtual void SetAxis(vtkAxisActor *)
Set axis that needs to be followed.
static double AutoScale(vtkViewport *viewport, vtkCamera *camera, double screenSize, double position[3])
Calculate scale factor to maintain same size of a object on the screen.
void ComputeMatrix() override
Generate the matrix based on ivars.
void CalculateOrthogonalVectors(double Rx[3], double Ry[3], double Rz[3], vtkAxisActor *axis1, double *dop, vtkViewport *ren)
vtkWeakPointer< vtkAxisActor > Axis
virtual void SetViewport(vtkViewport *viewport)
int RenderOpaqueGeometry(vtkViewport *viewport) override
This causes the actor to be rendered.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods for type and printing.
void ComputeRotationAndTranlation(vtkViewport *ren, double translation[3], double Rx[3], double Ry[3], double Rz[3], vtkAxisActor *axis)
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
This causes the actor to be rendered.
int RenderVolumetricGeometry(vtkViewport *viewport) override
This causes the actor to be rendered.
void ComputerAutoCenterTranslation(const double &autoScaleFactor, double translation[3])
vtkWeakPointer< vtkViewport > Viewport
static vtkProp3DAxisFollower * New()
Creates a follower with no camera set.
void ShallowCopy(vtkProp *prop) override
Shallow copy of a follower.
bool IsTextUpsideDown(double *a, double *b)
void SetScreenOffset(double offset)
Set/Get the desired screen vertical offset from the axis.
virtual vtkViewport * GetViewport()
~vtkProp3DAxisFollower() override
void ExecuteViewAngleVisibility(double normal[3])
double GetScreenOffset()
Set/Get the desired screen vertical offset from the axis.
a vtkProp3D that always faces the camera
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:43
abstract specification for Viewports
Definition vtkViewport.h:45
a weak reference to a vtkObject.
int vtkTypeBool
Definition vtkABI.h:64