MorphoGraphX  2.0-1-227
PathEditorDlg.hpp
Go to the documentation of this file.
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
19 {
21 }
22 
23 class MGXCamera;
24 
25 class PathEditorModel : public QAbstractItemModel
26 {
27  Q_OBJECT
28 public:
29  PathEditorModel(MGXCamera* c, QObject* parent);
30 
31  int rowCount(const QModelIndex& parent = QModelIndex()) const;
32 
33  int columnCount(const QModelIndex& /*parent*/ = QModelIndex()) const {
34  return 1;
35  }
36 
37  QVariant data(const QModelIndex& index, int role) const;
38 
39  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
40 
41  Qt::ItemFlags flags(const QModelIndex& index) const;
42 
43  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
44 
45  QModelIndex parent(const QModelIndex& index) const;
46 
47  bool isPath(const QModelIndex& idx) const;
48 
49  bool isKeyframe(const QModelIndex& idx) const;
50 
51  quint32 pathId(const QModelIndex& idx) const;
52 
53  quint32 keyframeId(const QModelIndex& idx) const;
54 
55  qglviewer::KeyFrameInterpolator* path(const QModelIndex& idx) const;
56 
57  void moveTo(const QModelIndex& idx) const;
58 
60 };
61 
62 class PathEditorDlg : public QDialog
63 {
64  Q_OBJECT
65 public:
66  PathEditorDlg(QWidget* parent, MGXCamera* camera);
67 
68 protected slots:
69  void on_buttonBox_clicked(QAbstractButton* button);
70  void on_pathsView_clicked(const QModelIndex& idx);
71  void on_pathsView_doubleClicked(const QModelIndex& idx);
72 
73 private:
74  Ui_PathEditorDlg ui;
75  mutable MGXCamera* camera;
76  PathEditorModel* model;
77 };
78 
79 #endif
PathEditorModel::moveTo
void moveTo(const QModelIndex &idx) const
PathEditorModel::PathEditorModel
PathEditorModel(MGXCamera *c, QObject *parent)
PathEditorModel
Definition: PathEditorDlg.hpp:25
PathEditorModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
PathEditorModel::parent
QModelIndex parent(const QModelIndex &index) const
PathEditorModel::camera
MGXCamera * camera
Definition: PathEditorDlg.hpp:59
PathEditorModel::columnCount
int columnCount(const QModelIndex &=QModelIndex()) const
Definition: PathEditorDlg.hpp:33
PathEditorModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
PathEditorModel::data
QVariant data(const QModelIndex &index, int role) const
qglviewer
Definition: PathEditorDlg.hpp:18
PathEditorModel::keyframeId
quint32 keyframeId(const QModelIndex &idx) const
PathEditorModel::isPath
bool isPath(const QModelIndex &idx) const
PathEditorModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
PathEditorDlg::on_pathsView_clicked
void on_pathsView_clicked(const QModelIndex &idx)
MGXCamera
Definition: MGXCamera.hpp:34
PathEditorDlg
Definition: PathEditorDlg.hpp:62
PathEditorModel::path
qglviewer::KeyFrameInterpolator * path(const QModelIndex &idx) const
PathEditorModel::isKeyframe
bool isKeyframe(const QModelIndex &idx) const
PathEditorModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const
PathEditorModel::pathId
quint32 pathId(const QModelIndex &idx) const
PathEditorDlg::on_pathsView_doubleClicked
void on_pathsView_doubleClicked(const QModelIndex &idx)
PathEditorDlg::on_buttonBox_clicked
void on_buttonBox_clicked(QAbstractButton *button)
PathEditorDlg::PathEditorDlg
PathEditorDlg(QWidget *parent, MGXCamera *camera)
qglviewer::KeyFrameInterpolator