AnnotationObjectManager.qt.H
00001 #ifndef ANNOTATIONOBJECTMANAGER_H
00002 #define ANNOTATIONOBJECTMANAGER_H
00003
00004 #include <QtCore/qabstractitemmodel.h>
00005
00006 #include "NeovisionII/NeoAnnotate/AnnotationObject.qt.H"
00007
00008 class AnnotationObjectManager : public QAbstractTableModel
00009 {
00010 Q_OBJECT
00011
00012 public:
00013
00014 AnnotationObjectManager(QObject * parent = 0);
00015
00016
00017 int rowCount(const QModelIndex &parent = QModelIndex()) const;
00018
00019
00020 int columnCount(const QModelIndex &parent = QModelIndex()) const;
00021
00022
00023 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
00024
00025
00026 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00027
00028
00029 bool setData(const QModelIndex &index, const QVariant &value, int role);
00030
00031
00032 Qt::ItemFlags flags(const QModelIndex &index) const;
00033
00034
00035 bool addObject(AnnotationObject * object);
00036
00037
00038 AnnotationObject* getObjectById(int id);
00039
00040
00041 void setAnimationView(QTableView *animationView);
00042
00043
00044 void constructAnimationContextMenu(QPoint globalPos, int row, int column);
00045
00046
00047 void clear();
00048
00049 void setAnimationRowSelected(int rowIdx);
00050
00051 void setLastAnimViewClick(const QModelIndex & pos);
00052
00053 std::map<int, std::map<int, AnnotationObjectFrame> > renderAnimations();
00054
00055 QList<AnnotationObject *> getAnnotationObjects() { return itsObjects; }
00056
00057 signals:
00058
00059
00060 void selectingObject(int);
00061
00062 public slots:
00063
00064
00065
00066 void select(const QModelIndex & index);
00067
00068
00069
00070 void objectSelected(int itemId);
00071
00072
00073 void addVertex(QPointF);
00074
00075
00076 void removeVertex(QPointF);
00077
00078
00079 void removeObject();
00080
00081
00082 void frameChanged(int fnum);
00083
00084
00085 void selectAnimationRow(int rowIdx);
00086
00087
00088 void setOpacity(int opacity);
00089
00090 private:
00091
00092 void selectObject(int rowIdx);
00093
00094
00095 void deselectObject(int rowIdx);
00096
00097 int itsCurrentFrame;
00098
00099 QList<AnnotationObject *> itsObjects;
00100
00101 int itsCurrentSelectedRow;
00102
00103
00104 int itsOpacity;
00105
00106 QTableView * itsAnimationView;
00107
00108 };
00109
00110 #endif //ANNOTATIONOBJECTMANAGER_H
00111
00112