API Documentation
Loading...
Searching...
No Matches
ImageReport.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/ReportIterator.h>
3#include <NDEVR/QTDesignObject.h>
4#include <NDEVR/ApplicationOptions.h>
5#include <QMenu>
6#if NDEVR_IMAGE_MODEL
7namespace Ui
8{
9 class ImageReportUI;
10}
11namespace NDEVR
12{
13 class ImageReport;
14 class Project;
15 class QCustomComboBox;
16 enum class ImageReportType
17 {
18 e_best_fit
21 };
22 /**--------------------------------------------------------------------------------------------------
23 \brief Options for the Image report
24 **/
25 class ImageReportOptions : public QMenu
26 {
27 public:
28 ImageReportOptions(ImageReportType type, QWidget* parent = nullptr);
29 ImageReportType reportType() const;
30 protected:
31 QCustomComboBox* m_type_combo;
32 };
33 /**--------------------------------------------------------------------------------------------------
34 \brief Creates a simple Image report
35 **/
36 class NDEVR_API ImageReportHandler : public ReportHandler
37 {
38 public:
39 ImageReportHandler();
40 //Given a list of model objects, returns report IDs it requests to handle. Note report ID's can be Model IDs, or unique to this object.
41 //Returned IDs will be stored, then used with canHandle, getReport, and createReportJSON
42 virtual Buffer<UUID> defaultReportIDs(const Buffer<UUID>& objects_to_report, QTModelManager* manager) const override;
43
44 //Returns true if report can handle this ID
45 virtual bool canHandle(UUID id, QTModelManager* manager) const override;
46
47 //Can be nullptr if cannot generate report
48 virtual QWidget* getReport(const UUID& id, QTModelManager* manager, const QRect& requested_geometry) const override;
49
50 ImageReportType reportType() const;
51 //Allowed to be no-op
52 virtual void createReportJSON(const UUID& id, JSONNode& parent, ReportJSONMaker& maker) const override;
53 virtual QMenu* popupOptions() const override;
54 protected:
55 mutable ImageReportOptions* m_report_options;
56 mutable ImageReport* m_report = nullptr;
57 static ApplicationOption<ImageReportType> s_report_type;
58 };
59
60 class ImageReport : public QWidget
61 {
62 public:
63 ImageReport(QWidget* parent = nullptr);
64 ~ImageReport();
65 void setReportType(ImageReportType report_type);
66 void setImage(const DynamicPointer<QTDesignObject>& deployment);
67 void setProject(const Project& project);
68 void resizeEvent(QResizeEvent* event);
69 protected:
70 void updateName();
71 void updateUI();
72 protected:
73 Ui::ImageReportUI* ui;
74 Time m_survey_time;
75 ImageReportType m_report_type = ImageReportType::e_best_fit;
76 };
77}
78#endif
#define NDEVR_API
Definition DLLInfo.h:50
Definition ACIColor.h:37
@ e_horizontal
Definition RibbonLayoutMode.hpp:42
@ e_vertical
Definition RibbonLayoutMode.hpp:41
Definition FontEditor.h:6