VTK
vtkAxisFollower.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAxisFollower.cxx
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 =========================================================================*/
28 #ifndef vtkAxisFollower_h
29 #define vtkAxisFollower_h
30 
31 #include "vtkRenderingAnnotationModule.h" // For export macro
32 #include "vtkFollower.h"
33 
34 #include "vtkWeakPointer.h" // For vtkWeakPointer
35 
36 // Forward declarations.
37 class vtkAxisActor;
38 class vtkRenderer;
39 
41 {
42 public:
44  virtual void PrintSelf(ostream& os, vtkIndent indent);
45 
47  static vtkAxisFollower *New();
48 
50 
51  virtual void SetAxis(vtkAxisActor*);
52  virtual vtkAxisActor* GetAxis();
54 
56 
59  vtkSetMacro(AutoCenter, int);
60  vtkGetMacro(AutoCenter, int);
61  vtkBooleanMacro(AutoCenter, int);
63 
65 
68  vtkSetMacro(EnableDistanceLOD, int);
69  vtkGetMacro(EnableDistanceLOD, int);
71 
73 
76  vtkSetClampMacro(DistanceLODThreshold, double, 0.0, 1.0);
77  vtkGetMacro(DistanceLODThreshold, double);
79 
81 
83  vtkSetMacro(EnableViewAngleLOD, int);
84  vtkGetMacro(EnableViewAngleLOD, int);
86 
88 
91  vtkSetClampMacro(ViewAngleLODThreshold, double, 0.0, 1.0);
92  vtkGetMacro(ViewAngleLODThreshold, double);
94 
96 
97  vtkSetMacro(ScreenOffset, double);
98  vtkGetMacro(ScreenOffset, double);
100 
102 
105  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
107  virtual void Render(vtkRenderer *ren);
109 
114 
116  void ShallowCopy(vtkProp *prop);
117 
119 
121  static double AutoScale(vtkViewport *viewport, vtkCamera * camera,
122  double screenSize, double position[3]);
124 
125 protected:
128 
129  void CalculateOrthogonalVectors(double Rx[3], double Ry[3], double Rz[3],
130  vtkAxisActor *axis1, double *dop,
131  vtkRenderer *ren);
132 
133 
135  double Rx[3], double Ry[3], double Rz[3],
136  vtkAxisActor *axis);
137 
138  // \NOTE: Not used as of now.
139  void ComputerAutoCenterTranslation(const double& autoScaleFactor,
140  double translation[3]);
141 
142 
144  void ExecuteViewAngleVisibility(double normal[3]);
145 
146  bool IsTextUpsideDown(double* a, double* b);
147 
149 
152 
155 
156  double ScreenOffset;
157 
159 
160 
161 private:
162 
163  int TextUpsideDown;
164  int VisibleAtCurrentViewAngle;
165 
166  vtkAxisFollower(const vtkAxisFollower&); // Not implemented.
167  void operator =(const vtkAxisFollower&); // Not implemented.
168 
169  // hide the two parameter Render() method from the user and the compiler.
170  virtual void Render(vtkRenderer *, vtkMapper *) {}
171 
172  //Internal matrices to avoid New/Delete for performance reasons
173  vtkMatrix4x4 *InternalMatrix;
174 
175 };
176 
177 #endif // vtkAxisFollower_h
vtkRenderingAnnotationModule.h
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:46
vtkAxisFollower::IsTextUpsideDown
bool IsTextUpsideDown(double *a, double *b)
vtkAxisFollower::Axis
vtkWeakPointer< vtkAxisActor > Axis
Definition: vtkAxisFollower.h:158
vtkgl::b
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
vtkAxisActor
Create an axis with tick marks and labels.
Definition: vtkAxisActor.h:94
vtkAxisFollower::ExecuteViewAngleVisibility
void ExecuteViewAngleVisibility(double normal[3])
vtkAxisFollower::EnableViewAngleLOD
int EnableViewAngleLOD
Definition: vtkAxisFollower.h:153
vtkFollower::Render
virtual void Render(vtkRenderer *ren)
vtkAxisFollower::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
vtkAxisFollower::DistanceLODThreshold
double DistanceLODThreshold
Definition: vtkAxisFollower.h:151
vtkAxisFollower::ScreenOffset
double ScreenOffset
Definition: vtkAxisFollower.h:156
vtkFollower.h
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkAxisFollower::ViewAngleLODThreshold
double ViewAngleLODThreshold
Definition: vtkAxisFollower.h:154
vtkAxisFollower::ComputerAutoCenterTranslation
void ComputerAutoCenterTranslation(const double &autoScaleFactor, double translation[3])
vtkAxisFollower::AutoScale
static double AutoScale(vtkViewport *viewport, vtkCamera *camera, double screenSize, double position[3])
vtkX3D::position
@ position
Definition: vtkX3D.h:261
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkAxisFollower::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
vtkAxisFollower::CalculateOrthogonalVectors
void CalculateOrthogonalVectors(double Rx[3], double Ry[3], double Rz[3], vtkAxisActor *axis1, double *dop, vtkRenderer *ren)
vtkAxisFollower::AutoCenter
int AutoCenter
Definition: vtkAxisFollower.h:148
vtkMapper
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:90
vtkAxisFollower
a subclass of vtkFollower that ensures that data is always parallel to the axis defined by a vtkAxisA...
Definition: vtkAxisFollower.h:41
vtkAxisFollower::ComputeRotationAndTranlation
void ComputeRotationAndTranlation(vtkRenderer *ren, double translation[3], double Rx[3], double Ry[3], double Rz[3], vtkAxisActor *axis)
vtkAxisFollower::New
static vtkAxisFollower * New()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:39
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:49
vtkWeakPointer.h
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkAxisFollower::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkAxisFollower::ComputeTransformMatrix
virtual void ComputeTransformMatrix(vtkRenderer *ren)
vtkAxisFollower::TestDistanceVisibility
int TestDistanceVisibility()
vtkAxisFollower::SetAxis
virtual void SetAxis(vtkAxisActor *)
vtkgl::a
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkAxisFollower::vtkAxisFollower
vtkAxisFollower()
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkAxisFollower::~vtkAxisFollower
~vtkAxisFollower()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkAxisFollower::Render
virtual void Render(vtkRenderer *ren)
vtkAxisFollower::EnableDistanceLOD
int EnableDistanceLOD
Definition: vtkAxisFollower.h:150
vtkAxisFollower::GetAxis
virtual vtkAxisActor * GetAxis()
vtkX3D::translation
@ translation
Definition: vtkX3D.h:232
vtkAxisFollower::ShallowCopy
void ShallowCopy(vtkProp *prop)
vtkWeakPointer< vtkAxisActor >
VTKRENDERINGANNOTATION_EXPORT
#define VTKRENDERINGANNOTATION_EXPORT
Definition: vtkRenderingAnnotationModule.h:15