ObjectAnimation.qt.H
00001 #ifndef OBJECTANIMATION_QT_H
00002 #define OBJECTANIMATION_QT_H
00003
00004 #include <QtGui/QtGui>
00005 #include "Media/FrameRange.H"
00006 #include "Util/log.H"
00007 #include <utility>
00008
00009 #include "NeovisionII/NeoAnnotate/AnimationDelegate.qt.H"
00010
00011 class ObjectAnimation : public QObject
00012 {
00013 Q_OBJECT
00014
00015 public:
00016
00017
00018 struct FrameState
00019 {
00020 QPointF pos;
00021 bool visible;
00022 bool is_keyframe;
00023 };
00024
00025
00026
00027
00028 ObjectAnimation(int frameNum, FrameRange masterFrameRange, QPointF initialPos);
00029
00030
00031 FrameState getFrameState(int frameNum);
00032
00033
00034 bool moveKeyframe(int from_fnum, int to_fnum);
00035
00036
00037 void setPosition(int frameNum, QPointF pos, bool visible=true);
00038
00039
00040 void constructContextMenu(QPoint pos, int column);
00041
00042
00043 FrameRange getFrameRange() const { return itsMasterFrameRange; }
00044
00045
00046
00047
00048 std::pair<QMap<int, FrameState>::const_iterator,
00049 QMap<int, FrameState>::const_iterator>
00050 getBoundingKeyframes(int fnum);
00051
00052 AnimationDelegate::FrameType getFrameType(int fnum);
00053
00054 QMap<int, FrameState>& getKeyFrames() { return itsKeyFrames; }
00055
00056
00057 void clear();
00058 signals:
00059 void animationChanged();
00060
00061 private:
00062 QMap<int, FrameState> itsKeyFrames;
00063
00064 FrameRange itsMasterFrameRange;
00065 };
00066
00067 #endif //OBJECTANIMATION_QT_H
00068