Overview     Modules     Class Hierarchy     Classes     Members  
tlp::GlSceneZoomAndPan Class Reference

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

#include <GlSceneZoomAndPan.h>

Collaboration diagram for tlp::GlSceneZoomAndPan:

List of all members.

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))
void setAdditionalGlSceneAnimation (AdditionalGlSceneAnimation *additionalAnimation)
int getNbAnimationsStep () const
void setNbAnimationSteps (const int nbAnimationSteps)
void zoomAndPanAnimationStep (int animationStep)

Protected Attributes

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

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 : 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-qt library instead to perform the animation.


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

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

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


Member Data Documentation

AdditionalGlSceneAnimation* tlp::GlSceneZoomAndPan::additionalAnimation
protected
double tlp::GlSceneZoomAndPan::b0
protected
double tlp::GlSceneZoomAndPan::b1
protected
Coord tlp::GlSceneZoomAndPan::camCenterEnd
protected
Coord tlp::GlSceneZoomAndPan::camCenterStart
protected
Camera& tlp::GlSceneZoomAndPan::camera
protected
bool tlp::GlSceneZoomAndPan::doZoomAndPan
protected
int tlp::GlSceneZoomAndPan::nbAnimationSteps
protected
bool tlp::GlSceneZoomAndPan::optimalPath
protected
double tlp::GlSceneZoomAndPan::p
protected
double tlp::GlSceneZoomAndPan::r0
protected
double tlp::GlSceneZoomAndPan::r1
protected
double tlp::GlSceneZoomAndPan::S
protected
double tlp::GlSceneZoomAndPan::sA
protected
double tlp::GlSceneZoomAndPan::sB
protected
double tlp::GlSceneZoomAndPan::u0
protected
double tlp::GlSceneZoomAndPan::u1
protected
Vector<int, 4> tlp::GlSceneZoomAndPan::viewport
protected
double tlp::GlSceneZoomAndPan::w0
protected
double tlp::GlSceneZoomAndPan::w1
protected
double tlp::GlSceneZoomAndPan::wm
protected
float tlp::GlSceneZoomAndPan::zoomAreaHeight
protected
float tlp::GlSceneZoomAndPan::zoomAreaWidth
protected


Tulip Software by LaBRI Visualization Team    2001 - 2012