VTK  9.1.0
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 "vtkProp3DFollower.h"
33#include "vtkRenderingAnnotationModule.h" // For export macro
34#include "vtkWeakPointer.h" // For vtkWeakPointer
35
36class vtkAxisActor;
37class vtkViewport;
38
39class VTKRENDERINGANNOTATION_EXPORT vtkProp3DAxisFollower : public vtkProp3DFollower
40{
41public:
46
48
52 void PrintSelf(ostream& os, vtkIndent indent) override;
54
56
59 virtual void SetAxis(vtkAxisActor*);
62
64
69 vtkSetMacro(AutoCenter, vtkTypeBool);
70 vtkGetMacro(AutoCenter, vtkTypeBool);
71 vtkBooleanMacro(AutoCenter, vtkTypeBool);
73
75
80 vtkSetMacro(EnableDistanceLOD, int);
81 vtkGetMacro(EnableDistanceLOD, int);
83
85
90 vtkSetClampMacro(DistanceLODThreshold, double, 0.0, 1.0);
91 vtkGetMacro(DistanceLODThreshold, double);
93
95
100 vtkSetMacro(EnableViewAngleLOD, int);
101 vtkGetMacro(EnableViewAngleLOD, int);
103
105
110 vtkSetClampMacro(ViewAngleLODThreshold, double, 0.0, 1.0);
111 vtkGetMacro(ViewAngleLODThreshold, double);
113
115
122
124
127 vtkSetVector2Macro(ScreenOffsetVector, double);
128 vtkGetVector2Macro(ScreenOffsetVector, double);
130
135 void ComputeMatrix() override;
136
140 void ShallowCopy(vtkProp* prop) override;
141
146 static double AutoScale(
147 vtkViewport* viewport, vtkCamera* camera, double screenSize, double position[3]);
148
150
155 int RenderOpaqueGeometry(vtkViewport* viewport) override;
157 int RenderVolumetricGeometry(vtkViewport* viewport) override;
159
160 virtual void SetViewport(vtkViewport* viewport);
162
163protected:
166
168 double Rx[3], double Ry[3], double Rz[3], vtkAxisActor* axis1, double* dop, vtkViewport* ren);
169
170 void ComputeRotationAndTranlation(vtkViewport* ren, double translation[3], double Rx[3],
171 double Ry[3], double Rz[3], vtkAxisActor* axis);
172
173 // \NOTE: Not used as of now.
174 void ComputerAutoCenterTranslation(const double& autoScaleFactor, double translation[3]);
175
177 void ExecuteViewAngleVisibility(double normal[3]);
178
179 bool IsTextUpsideDown(double* a, double* b);
180
182
185
188
189 double ScreenOffsetVector[2];
190
193
194private:
196 void operator=(const vtkProp3DAxisFollower&) = delete;
197
198 int TextUpsideDown;
199 int VisibleAtCurrentViewAngle;
200};
201
202#endif
Create an axis with tick marks and labels.
Definition: vtkAxisActor.h:91
a virtual camera for 3D rendering
Definition: vtkCamera.h:155
a simple class to control print indentation
Definition: vtkIndent.h:113
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:67
abstract specification for Viewports
Definition: vtkViewport.h:47
@ translation
Definition: vtkX3D.h:238
@ position
Definition: vtkX3D.h:267
@ offset
Definition: vtkX3D.h:444
int vtkTypeBool
Definition: vtkABI.h:69