Tulip
4.6.0
Better Visualization Through Research
|
00001 /* 00002 * 00003 * This file is part of Tulip (www.tulip-software.org) 00004 * 00005 * Authors: David Auber and the Tulip development Team 00006 * from LaBRI, University of Bordeaux 00007 * 00008 * Tulip is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation, either version 3 00011 * of the License, or (at your option) any later version. 00012 * 00013 * Tulip is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * See the GNU General Public License for more details. 00017 * 00018 */ 00019 00020 #ifndef QTGLSCENEZOOMANDPANANIMATOR_H_ 00021 #define QTGLSCENEZOOMANDPANANIMATOR_H_ 00022 00023 #include <QObject> 00024 00025 #include <tulip/GlSceneZoomAndPan.h> 00026 00027 namespace tlp { 00028 00029 class GlMainWidget; 00030 00031 /** 00032 * \brief A convenient class to perform a Zoom and Pan animation on a GlMainWidget 00033 * 00034 * This class allows to perform a Zoom and Pan animation on the Tulip OpenGL scene associated with a GlMainWidget 00035 * 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" 00036 * For more details, the paper can be downloaded at the following url : www.win.tue.nl/~vanwijk/zoompan.pdf 00037 */ 00038 class TLP_QT_SCOPE QtGlSceneZoomAndPanAnimator : public QObject, public GlSceneZoomAndPan { 00039 00040 Q_OBJECT 00041 00042 public : 00043 00044 /** 00045 * QtGlSceneZoomAndPanAnimator constructor 00046 * 00047 * \param glWidget The Tulip OpenGL widget on which to perform the animation 00048 * * \param boundingBox the bounding box in scene coordinates on which the Tulip OpenGL scene has to be zoomed and panned. 00049 * At the end of the animation, the viewport will be zoomed and centered on the content of that bounding box. 00050 * \param 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 00051 * \param layerName name of the layer zoom animation should be done on 00052 * \param velocity animation speed parameter, adjust it according to your needs 00053 * \param p zoom/pan trade-off parameter, adjust it according to your needs 00054 */ 00055 QtGlSceneZoomAndPanAnimator(GlMainWidget *glWidget, const BoundingBox &boundingBox, const double duration=1000., const std::string &layerName = "Main", const bool optimalPath = true, const double velocity = 1.1, const double p = sqrt(1.6)); 00056 00057 /** 00058 * Method to call to start the Zoom and Pan animation 00059 */ 00060 void animateZoomAndPan(); 00061 00062 protected slots : 00063 00064 virtual void zoomAndPanAnimStepSlot(int animationStep); 00065 00066 protected : 00067 00068 GlMainWidget *glWidget; 00069 double animationDurationMsec; 00070 00071 }; 00072 00073 } 00074 00075 00076 #endif /* QTGLSCENEZOOMANDPANANIMATOR_H_ */