NDEVR
API Documentation
ModelFileDialog

Shows options related to an import or export that utilizes the IOFactory methods to write or read properties. More...

Inheritance diagram for ModelFileDialog:
[legend]
Collaboration diagram for ModelFileDialog:
[legend]

Public Member Functions

 ModelFileDialog (bool is_import, InfoPipe *log, QWidget *parent=0)
 Constructs the model file dialog for import or export settings.
bool canResetOptions () const
 Returns whether the options can be reset to factory defaults.
bool canRevertOptions () const
 Returns whether the options can be reverted to saved defaults.
void closeEvent (QCloseEvent *) override
 Handles the close event, treating it as a cancellation if not already accepted or canceled.
void dialogEnded (bool accepted)
 Emitted when the dialog is closed, indicating acceptance or cancellation.
FactoryOptions::IncludeProperties getGenerationPrecision () const
 Returns the generation precision setting from the current options.
FactoryOptions::IncludeProperties getReadPrecision () const
 Returns the read precision setting from the current options.
File iniFile () const
 Returns the INI settings file for the current format.
virtual void isOptionMode (bool is_options_mode)
 Switches the dialog between options-only mode and full import/export mode.
void ModelLoaded (const Scene *object)
 Emitted when a model has been loaded from the import.
FactoryOptions options () const
 Returns the current factory options.
void postUpdateUIRequest ()
 Posts a deferred request to update the UI on the next event loop cycle.
virtual void setFeatures (const FactoryFeatures &features)
 Sets the factory features and updates the UI accordingly.
void setFormat (const FactoryParameters &format)
 Sets the file format and parameters for this dialog.
void setWindingCalculation (WindingMode winding)
 Sets the winding calculation mode for mesh imports.
bool shouldShow () const
 Returns whether this dialog has settings that warrant showing it to the user.
virtual void updateFeatures ()
 Updates the UI to reflect the current factory feature set.
virtual void updateUINow ()
 Immediately updates the UI to reflect the current options state.

Static Public Member Functions

static File INISettingsFolder (bool is_import)
 Returns the folder where INI settings files are stored.
static void ResetAllExportOptionsToDefaults ()
 Resets all export options for all formats to factory defaults.
static void ResetAllImportOptionsToDefaults ()
 Resets all import options for all formats to factory defaults.

Protected Member Functions

const FactoryOptionsdefaultOptions ()
 Returns the default factory options for the current format.
virtual void onAccepted ()
 Called when the user accepts the dialog.
virtual void onCancelled ()
 Called when the user cancels the dialog.
void revertOptionsToFactoryDefault ()
 Reverts the current options to the original factory defaults.
void saveOptionsAsDefault ()
 Saves the current options as the default for this file format.
void setOptionsToDefault ()
 Resets the current options to the saved defaults.
void setShowOnEachImport ()
 Toggles whether the options dialog is shown on each import.
virtual void updateOptions (FactoryOptions &new_options)
 Updates the given factory options from the current UI state.

Protected Attributes

bool m_accepted
 Whether the dialog was accepted.
bool m_canceled
 Whether the dialog was canceled.
FactoryOptions m_default_options
 The default factory options for comparison.
UnitManager m_file_units
 The unit manager for file unit conversions.
Buffer< GenericOptionsGroup * > m_generic_options_widgets
 Widgets for format-specific generic options.
bool m_has_settings_change
 Whether settings have been modified from defaults.
File m_ini_file
 The INI file path for persisting options.
const bool m_is_import
 Whether this dialog is for importing (true) or exporting (false).
InfoPipem_log
 The logging pipe for status messages.
FactoryParameters m_params
 The current factory parameters including format and options.
bool m_ui_dirty = false
 Whether the UI needs to be refreshed.
Ui::ImportSettings * ui
 The auto-generated UI form.

Detailed Description

Shows options related to an import or export that utilizes the IOFactory methods to write or read properties.


Dialog allows user to edit settings related to one set of FactoryOptions

Definition at line 59 of file ModelFileDialog.h.

Constructor & Destructor Documentation

◆ ModelFileDialog()

ModelFileDialog::ModelFileDialog ( bool is_import,
InfoPipe * log,
QWidget * parent = 0 )

Constructs the model file dialog for import or export settings.

Parameters
[in]is_importTrue for import dialogs, false for export dialogs.
[in]logThe info pipe for logging messages.
[in]parentThe optional parent widget.

Member Function Documentation

◆ canResetOptions()

bool ModelFileDialog::canResetOptions ( ) const

Returns whether the options can be reset to factory defaults.

Returns
True if reset is possible.

◆ canRevertOptions()

bool ModelFileDialog::canRevertOptions ( ) const

Returns whether the options can be reverted to saved defaults.

Returns
True if revert is possible.

◆ defaultOptions()

const FactoryOptions & ModelFileDialog::defaultOptions ( )
protected

Returns the default factory options for the current format.

Returns
A reference to the default FactoryOptions.

◆ dialogEnded()

void ModelFileDialog::dialogEnded ( bool accepted)

Emitted when the dialog is closed, indicating acceptance or cancellation.

Parameters
[in]acceptedTrue if the dialog was accepted, false if canceled.

◆ getGenerationPrecision()

FactoryOptions::IncludeProperties ModelFileDialog::getGenerationPrecision ( ) const

Returns the generation precision setting from the current options.

Returns
The include properties setting for generation.

◆ getReadPrecision()

FactoryOptions::IncludeProperties ModelFileDialog::getReadPrecision ( ) const

Returns the read precision setting from the current options.

Returns
The include properties setting for reading.

◆ iniFile()

File ModelFileDialog::iniFile ( ) const

Returns the INI settings file for the current format.

Returns
The INI file path.

◆ INISettingsFolder()

File ModelFileDialog::INISettingsFolder ( bool is_import)
static

Returns the folder where INI settings files are stored.

Parameters
[in]is_importWhether to return the import or export settings folder.
Returns
The INI settings folder path.

◆ isOptionMode()

virtual void ModelFileDialog::isOptionMode ( bool is_options_mode)
virtual

Switches the dialog between options-only mode and full import/export mode.

Parameters
[in]is_options_modeWhether to show only options without accept/cancel actions.

◆ ModelLoaded()

void ModelFileDialog::ModelLoaded ( const Scene * object)

Emitted when a model has been loaded from the import.

Parameters
[in]objectThe loaded scene.

◆ options()

FactoryOptions ModelFileDialog::options ( ) const
inline

Returns the current factory options.

Returns
A copy of the current FactoryOptions.

Definition at line 202 of file ModelFileDialog.h.

References m_params.

Referenced by AsciiModelFileDialog::predictColumnType(), AsciiModelFileDialog::predictDelimiter(), and AsciiModelFileDialog::updateUIFromFile().

◆ setFeatures()

virtual void ModelFileDialog::setFeatures ( const FactoryFeatures & features)
virtual

Sets the factory features and updates the UI accordingly.

Parameters
[in]featuresThe factory features to apply.

◆ setFormat()

void ModelFileDialog::setFormat ( const FactoryParameters & format)

Sets the file format and parameters for this dialog.

Parameters
[in]formatThe factory parameters describing the file format.

◆ setWindingCalculation()

void ModelFileDialog::setWindingCalculation ( WindingMode winding)

Sets the winding calculation mode for mesh imports.

Parameters
[in]windingThe winding mode to apply.

◆ shouldShow()

bool ModelFileDialog::shouldShow ( ) const

Returns whether this dialog has settings that warrant showing it to the user.

Returns
True if the dialog should be shown.

◆ updateOptions()

virtual void ModelFileDialog::updateOptions ( FactoryOptions & new_options)
protectedvirtual

Updates the given factory options from the current UI state.

Parameters
[in]new_optionsThe options object to update.

Reimplemented in AsciiModelFileDialog, and AutoModelFileDialog.


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