MorphoGraphX
PathEditorDlg.hpp
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef PATHEDITORDLG_HPP
12 #define PATHEDITORDLG_HPP
13 
14 #include <Config.hpp>
15 
16 #include <ui_PathEditorDlg.h>
17 
18 namespace qglviewer {
20 } // namespace qglviewer
21 
22 class MGXCamera;
23 
25  Q_OBJECT
26 public:
27  PathEditorModel(MGXCamera* c, QObject* parent);
28 
29  int rowCount(const QModelIndex& parent = QModelIndex()) const;
30 
31  int columnCount(const QModelIndex& /*parent*/ = QModelIndex()) const {
32  return 1;
33  }
34 
35  QVariant data(const QModelIndex& index, int role) const;
36 
37  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
38 
39  Qt::ItemFlags flags(const QModelIndex& index) const;
40 
41  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
42 
43  QModelIndex parent(const QModelIndex& index) const;
44 
45  bool isPath(const QModelIndex& idx) const;
46 
47  bool isKeyframe(const QModelIndex& idx) const;
48 
49  quint32 pathId(const QModelIndex& idx) const;
50 
51  quint32 keyframeId(const QModelIndex& idx) const;
52 
53  qglviewer::KeyFrameInterpolator* path(const QModelIndex& idx) const;
54 
55  void moveTo(const QModelIndex& idx) const;
56 
57  MGXCamera* camera;
58 };
59 
60 class PathEditorDlg : public QDialog {
61  Q_OBJECT
62 public:
63  PathEditorDlg(QWidget* parent, MGXCamera* camera);
64 
65 protected slots:
66  void on_buttonBox_clicked(QAbstractButton* button);
67  void on_pathsView_clicked(const QModelIndex& idx);
68  void on_pathsView_doubleClicked(const QModelIndex& idx);
69 
70 private:
71  Ui_PathEditorDlg ui;
72  mutable MGXCamera* camera;
73  PathEditorModel* model;
74 };
75 
76 #endif // PATHEDITORDLG_HPP
Definition: PathEditorDlg.hpp:24
Definition: PathEditorDlg.hpp:18
Definition: MorphoViewer.hpp:61
Definition: PathEditorDlg.hpp:60