AGX Dynamics  2.37.3.2
CameraListWidget.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXQT_CAMERALISTWIDGET_H
18 #define AGXQT_CAMERALISTWIDGET_H
19 
20 #include <agx/TimeStamp.h>
21 #include <agx/agx.h>
22 #include <agxQt/export.h>
23 #include <iostream>
24 #include <agx/Vector.h>
25 #include <agx/String.h>
26 
27 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
28 #include <QWidget>
29 #include <agxQt/ui_CameraList.h>
30 #include <QCloseEvent>
31 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
32 
33 #include <agxQt/CameraViewSet.h>
34 
35 namespace agxQt
36 {
40  class CameraViewModel : public QAbstractListModel
41  {
42  Q_OBJECT
43 
44  public:
45  CameraViewModel(CameraDescriptionSet * cameraSet, QObject *parent = 0)
46  : QAbstractListModel(parent), m_cameraSet(cameraSet) {}
47 
48  int rowCount(const QModelIndex &parent = QModelIndex()) const;
49 
50  QVariant data(const QModelIndex &index, int role) const;
51 
52  QVariant headerData(int section, Qt::Orientation orientation,
53  int role = Qt::DisplayRole) const;
54 
55  Qt::ItemFlags flags(const QModelIndex &index) const;
56 
57  bool setData(const QModelIndex &index, const QVariant &value,
58  int role = Qt::EditRole);
59 
61 
62  private:
63  CameraDescriptionSet * m_cameraSet;
64  };
65 
69  class AGXQT_EXPORT CameraListWidget : public QWidget
70  {
71  Q_OBJECT
72 
73  public:
74 
75  explicit CameraListWidget(QWidget *parent = 0);
76 
77  virtual ~CameraListWidget();
78 
80  void setupFromCameraDescriptionSet(CameraDescriptionSet * cameraSet);
81 
82 public slots:
83  void slotUpdateSelectedViewInList();
84 
85 signals:
86  void signalSetActiveView();
87  void signalStoreCamera();
88  void signalShowCameraList(bool);
89 
90  protected slots:
91  void slotDeleteButtonPressed();
92  void slotSetViewButtonPressed();
93  void slotStoreViewButtonPressed();
94 
95  protected:
96  virtual void closeEvent( QCloseEvent * event );
97 
99  // Variables
101  private:
102  Ui::CameraViewList * m_ui;
103  CameraViewModel * m_model;
104  };
105 }
106 
107 #endif
CameraDescriptionSet * getCameraDescriptionSet()
#define AGXQT_EXPORT
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Qt::ItemFlags flags(const QModelIndex &index) const
Contains classes/utility functions for connecting AGX to QT with OSG.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
int rowCount(const QModelIndex &parent=QModelIndex()) const
Model used to access data from the camera view set (Model-view Design pattern)
Class used for showing and manipulating data regarding loaded camera views.
CameraViewModel(CameraDescriptionSet *cameraSet, QObject *parent=0)
CameraViewSet is a class that handles and manages a set of cameras that the user should be able to sw...
Definition: CameraViewSet.h:59
QVariant data(const QModelIndex &index, int role) const