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
36class vtkAxisActor;
37class vtkViewport;
38
39class VTKRENDERINGANNOTATION_EXPORT vtkProp3DAxisFollower
40 : public vtkProp3DFollower
41{
42 public:
47
49
53 void PrintSelf(ostream& os, vtkIndent indent);
55
57
60 virtual void SetAxis(vtkAxisActor*);
63
65
70 vtkSetMacro(AutoCenter, int);
71 vtkGetMacro(AutoCenter, int);
72 vtkBooleanMacro(AutoCenter, int);
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
123
125
128 vtkSetVector2Macro(ScreenOffsetVector, double);
129 vtkGetVector2Macro(ScreenOffsetVector, double);
131
136 virtual void ComputeMatrix();
137
141 void ShallowCopy(vtkProp *prop);
142
147 static double AutoScale(vtkViewport *viewport, vtkCamera * camera,
148 double screenSize, double position[3]);
149
151
156 virtual int RenderOpaqueGeometry(vtkViewport *viewport);
158 virtual int RenderVolumetricGeometry(vtkViewport *viewport);
160
161 virtual void SetViewport(vtkViewport* viewport);
163
164protected:
167
168 void CalculateOrthogonalVectors(double Rx[3], double Ry[3], double Rz[3],
169 vtkAxisActor *axis1, double *dop,
170 vtkViewport *ren);
171
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
181 void ExecuteViewAngleVisibility(double normal[3]);
182
183 bool IsTextUpsideDown(double* a, double* b);
184
186
189
192
193 double ScreenOffsetVector [2];
194
197private:
198 vtkProp3DAxisFollower(const vtkProp3DAxisFollower&) VTK_DELETE_FUNCTION;
199 void operator=(const vtkProp3DAxisFollower&) VTK_DELETE_FUNCTION;
200
201 int TextUpsideDown;
202 int VisibleAtCurrentViewAngle;
203
204};
205
206#endif
Create an axis with tick marks and labels.
Definition: vtkAxisActor.h:75
a virtual camera for 3D rendering
Definition: vtkCamera.h:51
a simple class to control print indentation
Definition: vtkIndent.h:40
a subclass of vtkProp3DFollower that ensures that data is always parallel to the axis defined by a vt...
virtual vtkAxisActor * GetAxis()
virtual void ComputeMatrix()
Generate the matrix based on ivars.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
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 CalculateOrthogonalVectors(double Rx[3], double Ry[3], double Rz[3], vtkAxisActor *axis1, double *dop, vtkViewport *ren)
vtkWeakPointer< vtkAxisActor > Axis
virtual void SetViewport(vtkViewport *viewport)
void ComputeRotationAndTranlation(vtkViewport *ren, double translation[3], double Rx[3], double Ry[3], double Rz[3], vtkAxisActor *axis)
void ComputerAutoCenterTranslation(const double &autoScaleFactor, double translation[3])
vtkWeakPointer< vtkViewport > Viewport
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
This causes the actor to be rendered.
static vtkProp3DAxisFollower * New()
Creates a follower with no camera set.
bool IsTextUpsideDown(double *a, double *b)
void SetScreenOffset(double offset)
virtual vtkViewport * GetViewport()
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int RenderVolumetricGeometry(vtkViewport *viewport)
void ExecuteViewAngleVisibility(double normal[3])
double GetScreenOffset()
Set/Get the desired screen vertical offset from the axis.
void ShallowCopy(vtkProp *prop)
Shallow copy of a follower.
a vtkProp3D that always faces the camera
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
abstract specification for Viewports
Definition: vtkViewport.h:48
@ translation
Definition: vtkX3D.h:232
@ position
Definition: vtkX3D.h:261
@ offset
Definition: vtkX3D.h:438
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.