API Documentation
Loading...
Searching...
No Matches
ModelFileDialog.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: ModelFileDialog
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/IOFactory.h>
35#include <NDEVR/File.h>
36#include <NDEVR/Buffer.h>
37
38#include <QWidget>
39class QPushButton;
40class QComboBox;
41class QLabel;
42namespace Ui
43{
44 class ImportSettings;
45}
46namespace NDEVR
47{
48 class Button;
49 class QTModelManager;
50 class BasicResourceListener;
51 class INIFactory;
52 class Scene;
53 class GenericOptionsGroup;
54 class FactoryFeatures;
55 /**--------------------------------------------------------------------------------------------------
56 \brief Shows options related to an import or export that utilizes the IOFactory methods to write or
57 read properties. Dialog allows user to edit settings related to one set of FactoryOptions
58 **/
59 class NDEVR_API ModelFileDialog : public QWidget
60 {
61 Q_OBJECT
62 public:
63 ModelFileDialog(bool is_import, ProgressInfo* log, QWidget *parent = 0);
65 virtual void updateUINow();
67 bool shouldShow() const
68 {
69 return m_show_on_each_import;
70 }
71 void closeEvent(QCloseEvent*) override
72 {
73 if (!m_accepted && !m_canceled)
74 onCancelled();
75 };
76 virtual void isOptionMode(bool is_options_mode);
77 void setFormat(const FactoryParameters& format);
79 virtual void setGeometriesAndFeatures(const FactoryFeatures& features);
80
81 protected:
83 virtual void onCancelled();
84 virtual void onAccepted();
85 signals:
86 void dialogEnded(bool accepted);
87 void ModelLoaded(const Scene* object);
88 protected slots:
89 //void setToDefaultUnits();
94 public:
95 bool canRevertOptions() const;
96 bool canResetOptions() const;
99 static File INISettingsFolder(bool is_import);
100 File iniFile() const;
103 FactoryOptions options() const { return m_params.options; }
104
105 protected:
106 virtual void updateOptions(FactoryOptions& new_options);
109 Ui::ImportSettings* ui;
114 const bool m_is_import;
116 bool m_ui_dirty = false;
121 };
122}
#define NDEVR_API
Definition DLLInfo.h:50
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Allows IOFactories to report what features they support to make the import/export dialogs easier to s...
Definition FactoryFeatures.h:44
User-defined options that define preferences for importing and exporting using IOFactory objects.
Definition FactoryOptions.h:49
IncludeProperties
Definition FactoryOptions.h:60
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
Shows options related to an import or export that utilizes the IOFactory methods to write or read pro...
Definition ModelFileDialog.h:60
virtual void onCancelled()
void setWindingCalculation(WindingMode winding)
bool m_original_show_on_each_import
Definition ModelFileDialog.h:111
File m_ini_file
Definition ModelFileDialog.h:107
FactoryParameters m_params
Definition ModelFileDialog.h:117
bool m_show_on_each_import
Definition ModelFileDialog.h:110
void setFormat(const FactoryParameters &format)
void closeEvent(QCloseEvent *) override
Definition ModelFileDialog.h:71
virtual void isOptionMode(bool is_options_mode)
bool shouldShow() const
Definition ModelFileDialog.h:67
FactoryOptions options() const
Definition ModelFileDialog.h:103
void ModelLoaded(const Scene *object)
void dialogEnded(bool accepted)
const FactoryOptions & defaultOptions()
static File INISettingsFolder(bool is_import)
Ui::ImportSettings * ui
Definition ModelFileDialog.h:109
bool canRevertOptions() const
bool m_canceled
Definition ModelFileDialog.h:113
virtual void setGeometriesAndFeatures(const FactoryFeatures &features)
UnitManager m_file_units
Definition ModelFileDialog.h:108
bool canResetOptions() const
FactoryOptions::IncludeProperties getReadPrecision() const
ModelFileDialog(bool is_import, ProgressInfo *log, QWidget *parent=0)
ProgressInfo * m_log
Definition ModelFileDialog.h:119
static void ResetAllImportOptionsToDefaults()
bool m_accepted
Definition ModelFileDialog.h:112
bool m_has_settings_change
Definition ModelFileDialog.h:115
void revertOptionsToFactoryDefault()
virtual void updateOptions(FactoryOptions &new_options)
FactoryOptions m_default_options
Definition ModelFileDialog.h:118
FactoryOptions::IncludeProperties getGenerationPrecision() const
const bool m_is_import
Definition ModelFileDialog.h:114
virtual void updateGeometriesAndFeatures()
virtual void updateUINow()
static void ResetAllExportOptionsToDefaults()
virtual void onAccepted()
Buffer< GenericOptionsGroup * > m_generic_options_widgets
Definition ModelFileDialog.h:120
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
The root Model that is responsible for storing the underlying data for all Scene Models.
Definition Model.h:492
Handles a grouping of units that can describe any number of data categories.
Definition UnitManager.h:143
Definition ACIColor.h:37
WindingMode
Definition DesignObjectBase.h:97
Definition FontEditor.h:6
A container of input information that is to be filled with output information by an IOFactory.
Definition IOFactory.h:61