MorphoGraphX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PathEditorDlg.hpp
1 #ifndef PATHEDITORDLG_HPP
2 #define PATHEDITORDLG_HPP
3 
4 #include <Config.hpp>
5 
6 #include <ui_PathEditorDlg.h>
7 
8 namespace qglviewer {
10 } // namespace qglviewer
11 
12 class MGXCamera;
13 
15  Q_OBJECT
16 public:
17  PathEditorModel(MGXCamera* c, QObject* parent);
18 
19  int rowCount(const QModelIndex& parent = QModelIndex()) const;
20 
21  int columnCount(const QModelIndex& /*parent*/ = QModelIndex()) const {
22  return 1;
23  }
24 
25  QVariant data(const QModelIndex& index, int role) const;
26 
27  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
28 
29  Qt::ItemFlags flags(const QModelIndex& index) const;
30 
31  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
32 
33  QModelIndex parent(const QModelIndex& index) const;
34 
35  bool isPath(const QModelIndex& idx) const;
36 
37  bool isKeyframe(const QModelIndex& idx) const;
38 
39  quint32 pathId(const QModelIndex& idx) const;
40 
41  quint32 keyframeId(const QModelIndex& idx) const;
42 
43  qglviewer::KeyFrameInterpolator* path(const QModelIndex& idx) const;
44 
45  void moveTo(const QModelIndex& idx) const;
46 
47  MGXCamera* camera;
48 };
49 
50 class PathEditorDlg : public QDialog {
51  Q_OBJECT
52 public:
53  PathEditorDlg(QWidget* parent, MGXCamera* camera);
54 
55 protected slots:
56  void on_buttonBox_clicked(QAbstractButton* button);
57  void on_pathsView_clicked(const QModelIndex& idx);
58  void on_pathsView_doubleClicked(const QModelIndex& idx);
59 
60 private:
61  Ui_PathEditorDlg ui;
62  mutable MGXCamera* camera;
63  PathEditorModel* model;
64 };
65 
66 #endif // PATHEDITORDLG_HPP
Definition: PathEditorDlg.hpp:14
rowCount(const QModelIndex &parent=QModelIndex()
Definition: MorphoViewer.hpp:51
Definition: PathEditorDlg.hpp:50
columnCount(const QModelIndex &parent=QModelIndex()