API Documentation
Loading...
Searching...
No Matches
QTWidgetModel.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/Model.h>
4#include <NDEVR/MouseController.h>
5#include <QPixmap>
6#include <QWidget>
7#include <QTimer>
8#include <QMouseEvent>
9namespace NDEVR
10{
11 /**--------------------------------------------------------------------------------------------------
12 \brief A Qt compatible wrapper for an image for use with QWidgetModel.
13 **/
15 {
16 public:
17 QTWidgetImage(QWidget* widget, const String& image_id);
19 const String& imageID() const { return m_image_id; }
20 protected:
22 QPixmap* m_pixmap;
24 };
25 /**--------------------------------------------------------------------------------------------------
26 \brief A 3D Model that mirrors a QWidget object.
27 **/
29 {
30 public:
31 QWidgetModel(QWidget* widget, const Model& model, const void* lock);
33 QWidget* widget() const { return m_widget; }
34 protected:
35 void init();
36 void update();
37 protected:
38 const void* m_lock;
39 QTimer* m_timer;
40 QWidget* m_widget;
42 };
43#if NDEVR_VIEWPORT
44 /**--------------------------------------------------------------------------------------------------
45 \brief Allows the user to click a 3D object and have it converted into a rendering click.
46 **/
47 class NDEVR_API WidgetMouseController : public MouseControllerBase
48 {
49 public:
50 WidgetMouseController(QWidgetModel* model);
51 virtual bool processMouseEvent(const MouseEvent& event, DesignObjectLookup* lookup, Camera* camera) override;
52 bool processMouseEvent(const MouseEvent& event, DesignObjectLookup* lookup, SelectionInfo& info);
53 protected:
54 QWidgetModel* m_widget;
55 };
56#endif
57}
#define NDEVR_API
Definition DLLInfo.h:50
A core class where all Design Objects including models, materials, and geometries are stored....
Definition DesignObjectLookup.h:65
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
Definition Event.h:295
A Qt compatible wrapper for an image for use with QWidgetModel.
Definition QTWidgetModel.h:15
QPixmap * m_pixmap
Definition QTWidgetModel.h:22
QWidget * m_widget_to_paint
Definition QTWidgetModel.h:23
const String & imageID() const
Definition QTWidgetModel.h:19
String m_image_id
Definition QTWidgetModel.h:21
QTWidgetImage(QWidget *widget, const String &image_id)
A 3D Model that mirrors a QWidget object.
Definition QTWidgetModel.h:29
const void * m_lock
Definition QTWidgetModel.h:38
QTimer * m_timer
Definition QTWidgetModel.h:39
QWidget * widget() const
Definition QTWidgetModel.h:33
QWidgetModel(QWidget *widget, const Model &model, const void *lock)
QTWidgetImage * m_image
Definition QTWidgetModel.h:41
QWidget * m_widget
Definition QTWidgetModel.h:40
Responsible for turning a user interaction into a selection within a DesignObjectLookup.
Definition Selector.h:50
The core String class for the NDEVR API.
Definition String.h:69
Definition ACIColor.h:37