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 class ImageReportOptions : public QMenu
23 {
24 public:
25 ImageReportOptions(ImageReportType type, QWidget* parent = nullptr);
26 ImageReportType reportType() const;
27 protected:
28 QCustomComboBox* m_type_combo;
29 };
30 //This class Handles creating a report. If
31 class NDEVR_API ImageReportHandler : public ReportHandler
32 {
33 public:
34 ImageReportHandler();
35 //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.
36 //Returned IDs will be stored, then used with canHandle, getReport, and createReportJSON
37 virtual Buffer<UUID> defaultReportIDs(const Buffer<UUID>& objects_to_report, QTModelManager* manager) const override;
38
39 //Returns true if report can handle this ID
40 virtual bool canHandle(UUID id, QTModelManager* manager) const override;
41
42 //Can be nullptr if cannot generate report
43 virtual QWidget* getReport(const UUID& id, QTModelManager* manager, const QRect& requested_geometry) const override;
44
45 ImageReportType reportType() const;
46 //Allowed to be no-op
47 virtual void createReportJSON(const UUID& id, JSONNode& parent, ReportJSONMaker& maker) const override;
48 virtual QMenu* popupOptions() const override;
49 protected:
50 mutable ImageReportOptions* m_report_options;
51 mutable ImageReport* m_report = nullptr;
52 static ApplicationOption<ImageReportType> s_report_type;
53 };
54
55 class ImageReport : public QWidget
56 {
57 public:
58 ImageReport(QWidget* parent = nullptr);
59 ~ImageReport();
60 void setReportType(ImageReportType report_type);
61 void setImage(const DynamicPointer<QTDesignObject>& deployment);
62 void setProject(const Project& project);
63 void resizeEvent(QResizeEvent* event);
64 protected:
65 void updateName();
66 void updateUI();
67 protected:
68 Ui::ImageReportUI* ui;
69 Time m_survey_time;
70 ImageReportType m_report_type = ImageReportType::e_best_fit;
71 };
72}
73#endif
#define NDEVR_API
Definition DLLInfo.h:67
Definition ACIColor.h:37
@ e_horizontal
Definition RibbonLayoutMode.hpp:39
@ e_vertical
Definition RibbonLayoutMode.hpp:38
Definition FontEditor.h:6