Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes
omni::ui::Export Class Reference

#include <Export.h>

Inheritance diagram for omni::ui::Export:
Inheritance graph
[legend]
Collaboration diagram for omni::ui::Export:
Collaboration graph
[legend]

Public Slots

void exportToFile ()
 
void renderPreview ()
 
void selectPlainImage (bool)
 
void selectOmniCalibration (bool)
 
void getExportSettings ()
 

Signals

void dataModelChanged ()
 

Public Member Functions

 Export (QWidget *=nullptr)
 
 ~Export ()
 
- Public Member Functions inherited from omni::ui::mixin::DataModel< DATAMODEL, SHARED >
 DataModel ()
 
void setDataModel (pointer_type _dataModel)
 Set new data model. More...
 
pointer_type dataModel ()
 Return pointer to data model. More...
 
const pointer_type dataModel () const
 Return pointer to data model (const version) More...
 
virtual void updateFrontend ()
 Push data to frontend widgets and all child widgets. More...
 
virtual void updateDataModel ()
 Update the data model interface. More...
 

Private Member Functions

void dataToFrontend ()
 Pure virtual method which determines how data model is represented in frontend. More...
 
bool frontendToData ()
 Return true if data has changed by front end. More...
 
void setup ()
 

Private Attributes

std::unique_ptr< Ui::Export > ui_
 

Additional Inherited Members

- Public Types inherited from omni::ui::mixin::DataModel< DATAMODEL, SHARED >
typedef DATAMODEL data_model_type
 Data type. More...
 
typedef DataModel
< data_model_type, SHARED > 
type
 This type. More...
 
typedef detail::PointerType
< data_model_type, SHARED > 
pointer_type_handler
 Pointer type handler. More...
 
typedef pointer_type_handler::type pointer_type
 Derived pointer type. More...
 
- Protected Member Functions inherited from omni::ui::mixin::Locked
template<typename F >
void locked (F f)
 Lock widget and execute given functor. More...
 
bool isLocked () const
 Return true if widget is locked. More...
 

Constructor & Destructor Documentation

omni::ui::Export::Export ( QWidget *  _parent = nullptr)
32  :
33  QWidget(_parent),
34  ui_(new Ui::Export)
35  {
36  setup();
37  }
std::unique_ptr< Ui::Export > ui_
Definition: Export.h:65
void setup()
Definition: Export.cpp:127
omni::ui::Export::~Export ( )
40  {}

Member Function Documentation

void omni::ui::Export::dataModelChanged ( )
signal
void omni::ui::Export::dataToFrontend ( )
privatevirtual

Pure virtual method which determines how data model is represented in frontend.

Implements omni::ui::mixin::DataModel< DATAMODEL, SHARED >.

121  {
122  ui_->outputPreview->setDataModel(dataModel());
123 
124  renderPreview();
125  }
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
void renderPreview()
Definition: Export.cpp:85
std::unique_ptr< Ui::Export > ui_
Definition: Export.h:65
void omni::ui::Export::exportToFile ( )
slot
43  {
44  if (!dataModel()) return;
45 
46  using namespace render;
47 
48  QString _filename;
49 
50  switch(dataModel()->exportSettings().outputType()) {
51  case OutputType::OMNI_CALIBRATION:
52  {
53  Renderer _renderer(*dataModel());
54  _filename = QFileDialog::getSaveFileName(this,
55  "Save Calibration...",
56  ".",
57  "Omni Calibration (*.omnic)");
58  if (_filename.isEmpty()) return;
59  _renderer.renderOmniCalibration(_filename);
60  }
61  break;
62 
63  case OutputType::PLAIN_IMAGE:
64  {
65  _filename = QFileDialog::getSaveFileName(this,
66  "Save Calibration Image...",
67  ".",
68  "Calibration Images (*.png)");
69  if (_filename.isEmpty()) return;
70  dataModel()->renderToFile(_filename);
71  }
72  break;
73  }
74 
75  ui_->editExportFilename->setText(_filename);
76 
77  QMessageBox::information(this, "Calibration data exported.",
78  QString(
79  "Calibration data has been exported to '%1'").arg(
80  _filename));
81 
82 
83  }
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
std::unique_ptr< Ui::Export > ui_
Definition: Export.h:65
bool omni::ui::Export::frontendToData ( )
inlineprivatevirtual

Return true if data has changed by front end.

Implements omni::ui::mixin::DataModel< DATAMODEL, SHARED >.

59  {
60  return false;
61  }
void omni::ui::Export::getExportSettings ( )
slot
91  {
92  if (!dataModel()) return;
93 
94  using namespace omni::render;
95  auto& _exportSettings = dataModel()->exportSettings();
96 
97  _exportSettings.setExcludeUnassignedProjectors(
98  ui_->chkExcludeNonSelectedScreens->isChecked());
99 
100  if (ui_->rbOmniCalibration->isChecked()) {
101  _exportSettings.setOutputType(OutputType::OMNI_CALIBRATION);
102  } else
103  if (ui_->rbPlainImage->isChecked()) {
104  _exportSettings.setOutputType(OutputType::PLAIN_IMAGE);
105  }
106 
107  if (ui_->rbSepNone->isChecked())
108  {
109  _exportSettings.setSeparationMode(SeparationMode::NONE);
110  } else
111  if (ui_->rbSepScreens->isChecked())
112  {
113  _exportSettings.setSeparationMode(SeparationMode::SCREENS);
114  } else
115  if (ui_->rbSepProj->isChecked())
116  {
117  _exportSettings.setSeparationMode(SeparationMode::PROJECTORS);
118  }
119  }
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
std::unique_ptr< Ui::Export > ui_
Definition: Export.h:65
void omni::ui::Export::renderPreview ( )
slot
85  {
87  ui_->outputPreview->triggerUpdate();
88  }
void getExportSettings()
Definition: Export.cpp:90
std::unique_ptr< Ui::Export > ui_
Definition: Export.h:65
void omni::ui::Export::selectOmniCalibration ( bool  _selected)
slot
154  {
155  ui_->lbSeparateOutput->setVisible(!_selected);
156  ui_->frameSeparation->setVisible(!_selected);
157  renderPreview();
158  }
void renderPreview()
Definition: Export.cpp:85
std::unique_ptr< Ui::Export > ui_
Definition: Export.h:65
void omni::ui::Export::selectPlainImage ( bool  _selected)
slot
148  {
149  ui_->lbSeparateOutput->setVisible(_selected);
150  ui_->frameSeparation->setVisible(_selected);
151  renderPreview();
152  }
void renderPreview()
Definition: Export.cpp:85
std::unique_ptr< Ui::Export > ui_
Definition: Export.h:65
void omni::ui::Export::setup ( )
private
127  {
128  ui_->setupUi(this);
129  connect(ui_->btnExport, SIGNAL(clicked()), this,
130  SLOT(exportToFile()));
131 
132  connect(ui_->rbOmniCalibration, SIGNAL(clicked(bool)), this,
133  SLOT(selectOmniCalibration(bool)));
134  connect(ui_->rbPlainImage, SIGNAL(clicked(bool)), this,
135  SLOT(selectPlainImage(bool)));
136 
137  for (auto& _widget :
138  std::vector<QWidget *>({ ui_->chkExcludeNonSelectedScreens,
139  ui_->rbSepNone,
140  ui_->rbSepScreens,
141  ui_->rbSepProj })) {
142  connect(_widget, SIGNAL(clicked()), this, SLOT(renderPreview()));
143  }
144 
145  selectOmniCalibration(true);
146  }
void exportToFile()
Definition: Export.cpp:42
void renderPreview()
Definition: Export.cpp:85
void selectOmniCalibration(bool)
Definition: Export.cpp:154
std::unique_ptr< Ui::Export > ui_
Definition: Export.h:65
void selectPlainImage(bool)
Definition: Export.cpp:148

Field Documentation

std::unique_ptr<Ui::Export> omni::ui::Export::ui_
private

The documentation for this class was generated from the following files: