Tulip  4.4.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
tlp::GlSceneZoomAndPan Class Reference

#include <GlSceneZoomAndPan.h>

Inherited by tlp::QtGlSceneZoomAndPanAnimator.

Public Member Functions

 GlSceneZoomAndPan (GlScene *glScene, const BoundingBox &boundingBox, const std::string &layerName="Main", const int nbAnimationSteps=50, const bool optimalPath=true, const double p=sqrt(1.6))
 
int getNbAnimationsStep () const
 
void setAdditionalGlSceneAnimation (AdditionalGlSceneAnimation *additionalAnimation)
 
void setNbAnimationSteps (const int nbAnimationSteps)
 
void zoomAndPanAnimationStep (int animationStep)
 

Protected Attributes

AdditionalGlSceneAnimationadditionalAnimation
 
double b0
 
double b1
 
Coord camCenterEnd
 
Coord camCenterStart
 
Cameracamera
 
bool doZoomAndPan
 
int nbAnimationSteps
 
bool optimalPath
 
double p
 
double r0
 
double r1
 
double S
 
double sA
 
double sB
 
double u0
 
double u1
 
Vector< int, 4 > viewport
 
double w0
 
double w1
 
double wm
 
float zoomAreaHeight
 
float zoomAreaWidth
 

Detailed Description

A convenient class to perform Zoom and Pan animation on Tulip OpenGL scene.

This class allow to perform a smooth and efficient zooming and panning on Tulip OpenGL scene. The algorithm used to perform this task is the one published in: Jarke J. van Wijk and Wim A.A. Nuij, "Smooth and efficient zooming and panning" For more details, the paper can be downloaded at the following url: http://www.win.tue.nl/~vanwijk/zoompan.pdf Even if this class contains the whole Zoom and Pan implementation, it is not aimed to be used directly because its role is only to compute new camera parameters. Use the derived class QtGlSceneZoomAndPanAnimator in the tulip-gui library instead to perform the animation.

Definition at line 71 of file GlSceneZoomAndPan.h.

Constructor & Destructor Documentation

tlp::GlSceneZoomAndPan::GlSceneZoomAndPan ( GlScene glScene,
const BoundingBox boundingBox,
const std::string &  layerName = "Main",
const int  nbAnimationSteps = 50,
const bool  optimalPath = true,
const double  p = sqrt(1.6) 
)

GlSceneZoomAndPan constructor

Parameters
glScenethe Tulip OpenGL scene on which to perform zooming and panning
boundingBoxthe bounding box in scene coordinates on which the Tulip OpenGL scene has to be zoomed and panned. At the end of the animation, the viewport will be zoomed and centered on the content of that bounding box.
layerNameThe name of the layer animation should be done on
nbAnimationStepsthe number of steps to perform during the animation
optimalPathif true zooming and panning will be combined at each step of the animation, if false the scene will be zoomed out/in, panned then zoomed in/out
pzoom/pan trade-off parameter, adjust it according to your needs

Member Function Documentation

int tlp::GlSceneZoomAndPan::getNbAnimationsStep ( ) const
inline

Method which return the number of animation steps

Definition at line 100 of file GlSceneZoomAndPan.h.

void tlp::GlSceneZoomAndPan::setAdditionalGlSceneAnimation ( AdditionalGlSceneAnimation additionalAnimation)

Method to add an additional scene animation while zooming and panning

Parameters
additionalAnimationThe animation to add
void tlp::GlSceneZoomAndPan::setNbAnimationSteps ( const int  nbAnimationSteps)
inline

Method to set the number of animation steps

Definition at line 107 of file GlSceneZoomAndPan.h.

void tlp::GlSceneZoomAndPan::zoomAndPanAnimationStep ( int  animationStep)

Method which performs the zoom and pan animation. Its role is to compute new camera parameters at step animationStep. The scene is not redrawn with this method, you have to call the draw method on the associated GlScene object