Tulip  4.6.0
Better Visualization Through Research
library/tulip-gui/include/tulip/ProcessingAnimationItem.h
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 ///@cond DOXYGEN_HIDDEN
00020 
00021 #ifndef PROCESSINGANIMATIONITEM_H
00022 #define PROCESSINGANIMATIONITEM_H
00023 
00024 #include <QGraphicsPixmapItem>
00025 #include <QTimer>
00026 #include <QObject>
00027 #include <QBrush>
00028 
00029 class ProcessingAnimationItem : public QObject, public QGraphicsPixmapItem {
00030   Q_OBJECT
00031 
00032   QVector<QPixmap> _pixmaps;
00033   QTimer _animationTimer;
00034   unsigned int _currentFrame;
00035   QBrush _brush;
00036 
00037 public:
00038   explicit ProcessingAnimationItem(const QPixmap& pixmap, const QSize& size, QGraphicsItem* parent=NULL);
00039   virtual ~ProcessingAnimationItem();
00040 
00041   QBrush brush() const {
00042     return _brush;
00043   }
00044   void setBrush(const QBrush& brush) {
00045     _brush = brush;
00046   }
00047 
00048 protected slots:
00049   void animationTimeout();
00050   void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
00051 };
00052 
00053 #endif // PROCESSINGANIMATIONITEM_H
00054 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties