AGX Dynamics  2.35.0.1
CameraListWidget.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
21 #include <QWidget>
22 #include <agxQt/ui_CameraList.h>
23 #include <QCloseEvent>
24 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
25 
26 #include <agx/TimeStamp.h>
27 #include <agx/agx.h>
28 #include <agxQt/export.h>
29 #include <iostream>
30 #include <agx/Vector.h>
31 #include <agx/String.h>
32 #include <agxQt/CameraViewSet.h>
33 
34 namespace agxQt
35 {
39  class CameraViewModel : public QAbstractListModel
40  {
41  Q_OBJECT
42 
43  public:
44  CameraViewModel(CameraDescriptionSet * cameraSet, QObject *parent = 0)
45  : QAbstractListModel(parent), m_cameraSet(cameraSet) {}
46 
47  int rowCount(const QModelIndex &parent = QModelIndex()) const;
48 
49  QVariant data(const QModelIndex &index, int role) const;
50 
51  QVariant headerData(int section, Qt::Orientation orientation,
52  int role = Qt::DisplayRole) const;
53 
54  Qt::ItemFlags flags(const QModelIndex &index) const;
55 
56  bool setData(const QModelIndex &index, const QVariant &value,
57  int role = Qt::EditRole);
58 
60 
61  private:
62  CameraDescriptionSet * m_cameraSet;
63  };
64 
68  class AGXQT_EXPORT CameraListWidget : public QWidget
69  {
70  Q_OBJECT
71 
72  public:
73 
74  explicit CameraListWidget(QWidget *parent = 0);
75 
76  virtual ~CameraListWidget();
77 
80 
81 public slots:
83 
84 signals:
88 
89  protected slots:
93 
94  protected:
95  virtual void closeEvent( QCloseEvent * event );
96 
98  // Variables
100  private:
101  Ui::CameraViewList * m_ui;
102  CameraViewModel * m_model;
103  };
104 }
105 
106 #endif
#define AGXQT_EXPORT
CameraViewSet is a class that handles and manages a set of cameras that the user should be able to sw...
Definition: CameraViewSet.h:60
Class used for showing and manipulating data regarding loaded camera views.
void signalShowCameraList(bool)
virtual void closeEvent(QCloseEvent *event)
void setupFromCameraDescriptionSet(CameraDescriptionSet *cameraSet)
Setup the view widget from a CameraDescriptionSet.
CameraListWidget(QWidget *parent=0)
Model used to access data from the camera view set (Model-view Design pattern)
int rowCount(const QModelIndex &parent=QModelIndex()) const
CameraDescriptionSet * getCameraDescriptionSet()
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
QVariant data(const QModelIndex &index, int role) const
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
CameraViewModel(CameraDescriptionSet *cameraSet, QObject *parent=0)
Qt::ItemFlags flags(const QModelIndex &index) const
Contains classes/utility functions for connecting AGX to QT with OSG.