Tulip
5.0.0
Large graphs analysis and drawing
|
#include <GlSceneZoomAndPan.h>
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 | |
AdditionalGlSceneAnimation * | additionalAnimation |
double | b0 |
double | b1 |
Coord | camCenterEnd |
Coord | camCenterStart |
Camera & | camera |
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 |
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.
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
glScene | the Tulip OpenGL scene on which to perform zooming and panning |
boundingBox | the 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. |
layerName | The name of the layer animation should be done on |
nbAnimationSteps | the number of steps to perform during the animation |
optimalPath | if 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 |
p | zoom/pan trade-off parameter, adjust it according to your needs |
|
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
additionalAnimation | The animation to add |
|
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