NDEVR
API Documentation
AsciiModelFileDialog

Default dialog shown when the user exports an ascii-or custom column style file. More...

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

Public Types

enum  AsciiError { e_valid , e_file_is_empty }
 Error codes for ASCII file validation. More...

Public Member Functions

 AsciiModelFileDialog (bool is_import, InfoPipe *log, QWidget *parent=nullptr)
 Constructs the ASCII model file dialog.
bool checkValidity ()
 Validates the current dialog settings and column assignments.
void enabledFormatChoosing (bool enabled)
 Enables or disables the format chooser controls in the dialog.
void onFieldChooserAccepted ()
 Slot invoked when the field chooser selection is accepted.
void onFieldChooserDeleted ()
 Slot invoked when the field chooser selection is deleted.
void onFieldChooserEdited ()
 Slot invoked when the field chooser value is edited by the user.
void selectColumn (uint04 column)
 Selects and highlights the specified column in the preview table.
virtual void setRequests (const Buffer< FactoryParameters > &file) override
 Sets the file requests to be processed by the dialog.
virtual void setUUIDs (Buffer< UUID > models) override
 Sets the UUIDs of models to export.
void showColumnContextMenu (const QPoint &point)
 Displays a context menu for the column at the given position.
void updateFromUISlot ()
 Slot invoked when the user modifies any UI control, triggering a preview refresh.
void updateOptions (FactoryOptions &new_options) override
 Updates the given factory options with the current dialog settings.
Public Member Functions inherited from AutoModelFileDialog
 AutoModelFileDialog (bool is_import, InfoPipe *log, QWidget *parent=nullptr)
 Constructs the AutoModelFileDialog.
virtual void beginProcess ()
 Begins the import or export process using the current settings.
Buffer< UUIDIDs () const
 Returns the UUIDs of the models currently selected in the dialog.
void loaded ()
 Emitted when the file has been successfully loaded or saved.
virtual void reset ()
 Resets the dialog to its initial state.
void selectAllVisible ()
 Selects all visible models in the selection tree.
void selectDefaultToExport ()
 Selects the default set of models for export.
void setIsValid (bool is_valid)
 Sets whether the current dialog configuration is valid for processing.
void setPositionOnEnd (bool position_on_end)
 Sets whether the camera should reposition to the imported data on completion.
QSize sizeHint () const override
 Returns the recommended size for this dialog.
Public Member Functions inherited from ModelFileDialog
 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.

Static Public Member Functions

static FileFormat AsciiTemplateFormat ()
 Returns the file format descriptor for ASCII template files.
Static Public Member Functions inherited from ModelFileDialog
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

AsciiOptions asciiOptions () const
 Returns the current ASCII options as configured by the dialog.
QMenu * createColumnMenu ()
 Creates a context menu for column operations.
bool existsBefore (uint04 index, const DesignParameter &params) const
 Checks whether a design parameter is assigned to any column before the specified index.
bool existsOutsideOf (uint04 index, const DesignParameter &params) const
 Checks whether a design parameter is assigned to any column other than the specified one.
virtual void filterModelsToExport () override
 Filters the list of models to export based on current dialog settings.
Buffer< DesignParametergetAvailableChannels (const Buffer< UUID > &models)
 Returns the available design parameter channels for the given models.
Buffer< DesignParametergetChannelWhitelist () const
 Returns the whitelist of allowed design parameter channels.
Buffer< DesignParametergetPossibleChannels (const String &option)
 Returns the possible design parameter channels matching the given option string.
void insertNewColumn (uint04 index)
 Inserts a new column at the specified index.
void predictColumnType (AsciiOptions &options)
 Attempts to automatically detect column types from the file content.
void predictDelimiter (AsciiOptions &options) const
 Attempts to automatically detect the column delimiter from the file content.
void predictFirstLine (uint04 &line, uint04 &row_count) const
 Predicts the first data line and total row count from the file content.
bool predictHasHeaders () const
 Predicts whether the file contains column header names.
void setColumn (uint04 index, const DesignParameter &params)
 Assigns a design parameter to a specific column.
void setupColumnHeaders ()
 Populates the column header UI based on the current ASCII options.
void setupDelimiterCombo ()
 Populates the delimiter combo box with available delimiter choices.
QSize sizeHint () const override
 Returns the recommended size for this dialog.
File templateFolder () const
 Returns the folder path where ASCII templates are stored.
void updateColumnsFromParams ()
 Updates the column UI widgets from the current parameter assignments.
AsciiError updateExportPreview ()
 Updates the export preview table based on current settings.
AsciiError updateUIFromFile (AsciiOptions &options)
 Updates the dialog UI from the given file using the specified ASCII options.
void updateUINow () override
 Immediately refreshes the dialog UI to reflect current settings.
Protected Member Functions inherited from ModelFileDialog
const FactoryOptionsdefaultOptions ()
 Returns the default factory options for the current format.
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.

Protected Attributes

Ui::AsciiImportUI * ascii_ui
 The auto-generated UI form for ASCII import/export.
Buffer< ColumnDetailsm_column_details
 Details for each column in the file.
QMenu * m_field_menu = nullptr
 The context menu for column field operations.
bool m_ignore_update = false
 Whether to suppress UI update callbacks temporarily.
uint04 m_line_preview_count = 60
 The number of lines to show in the preview table.
bool m_pulling_template = false
 Whether a template is currently being loaded.
DynamicPointer< Scannerm_scanner
 The scanner used for reading file content.
uint04 m_selected_column = 0
 The index of the currently selected column.
Protected Attributes inherited from AutoModelFileDialog
CachedFactoryIOThread m_factory_thread
 The background thread managing cached file I/O.
Buffer< FactoryParametersm_files
 The file parameters for the current operation.
ModelSelectionTreem_selection_tree
 The tree widget for selecting models to import or export.
bool m_show_error_dialog
 Whether to display an error dialog on failure.
Protected Attributes inherited from ModelFileDialog
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

Default dialog shown when the user exports an ascii-or custom column style file.


Definition at line 60 of file AsciiModelFileDialog.h.

Member Enumeration Documentation

◆ AsciiError

Error codes for ASCII file validation.

Enumerator
e_valid 

The file is valid and can be processed.

e_file_is_empty 

The file contains no data.

Definition at line 67 of file AsciiModelFileDialog.h.

Constructor & Destructor Documentation

◆ AsciiModelFileDialog()

AsciiModelFileDialog::AsciiModelFileDialog ( bool is_import,
InfoPipe * log,
QWidget * parent = nullptr )

Constructs the ASCII model file dialog.

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

References AsciiModelFileDialog().

Referenced by AsciiModelFileDialog().

Member Function Documentation

◆ asciiOptions()

AsciiOptions AsciiModelFileDialog::asciiOptions ( ) const
protected

Returns the current ASCII options as configured by the dialog.

Returns
The current AsciiOptions.

◆ AsciiTemplateFormat()

FileFormat AsciiModelFileDialog::AsciiTemplateFormat ( )
static

Returns the file format descriptor for ASCII template files.

Returns
The FileFormat for ASCII templates.

◆ checkValidity()

bool AsciiModelFileDialog::checkValidity ( )

Validates the current dialog settings and column assignments.

Returns
True if the configuration is valid for processing.

◆ createColumnMenu()

QMenu * AsciiModelFileDialog::createColumnMenu ( )
protected

Creates a context menu for column operations.

Returns
The newly created column context menu.

◆ enabledFormatChoosing()

void AsciiModelFileDialog::enabledFormatChoosing ( bool enabled)

Enables or disables the format chooser controls in the dialog.

Parameters
[in]enabledWhether format selection should be enabled.

◆ existsBefore()

bool AsciiModelFileDialog::existsBefore ( uint04 index,
const DesignParameter & params ) const
protected

Checks whether a design parameter is assigned to any column before the specified index.

Parameters
[in]indexThe column index threshold.
[in]paramsThe design parameter to search for.
Returns
True if the parameter exists in an earlier column.

◆ existsOutsideOf()

bool AsciiModelFileDialog::existsOutsideOf ( uint04 index,
const DesignParameter & params ) const
protected

Checks whether a design parameter is assigned to any column other than the specified one.

Parameters
[in]indexThe column index to exclude from the check.
[in]paramsThe design parameter to search for.
Returns
True if the parameter exists in another column.

◆ getAvailableChannels()

Buffer< DesignParameter > AsciiModelFileDialog::getAvailableChannels ( const Buffer< UUID > & models)
protected

Returns the available design parameter channels for the given models.

Parameters
[in]modelsThe buffer of model UUIDs to query.
Returns
A buffer of available design parameters.

◆ getChannelWhitelist()

Buffer< DesignParameter > AsciiModelFileDialog::getChannelWhitelist ( ) const
protected

Returns the whitelist of allowed design parameter channels.

Returns
A buffer of whitelisted design parameters.

◆ getPossibleChannels()

Buffer< DesignParameter > AsciiModelFileDialog::getPossibleChannels ( const String & option)
protected

Returns the possible design parameter channels matching the given option string.

Parameters
[in]optionThe option string to match against.
Returns
A buffer of matching design parameters.

◆ insertNewColumn()

void AsciiModelFileDialog::insertNewColumn ( uint04 index)
protected

Inserts a new column at the specified index.

Parameters
[in]indexThe position at which to insert the column.

◆ predictColumnType()

void AsciiModelFileDialog::predictColumnType ( AsciiOptions & options)
protected

Attempts to automatically detect column types from the file content.

Parameters
[in]optionsThe ASCII options to update with predicted column types.

References ModelFileDialog::options().

◆ predictDelimiter()

void AsciiModelFileDialog::predictDelimiter ( AsciiOptions & options) const
protected

Attempts to automatically detect the column delimiter from the file content.

Parameters
[in]optionsThe ASCII options to update with the predicted delimiter.

References ModelFileDialog::options().

◆ predictFirstLine()

void AsciiModelFileDialog::predictFirstLine ( uint04 & line,
uint04 & row_count ) const
protected

Predicts the first data line and total row count from the file content.

Parameters
[in]lineReceives the predicted first data line index.
[in]row_countReceives the predicted number of data rows.

◆ predictHasHeaders()

bool AsciiModelFileDialog::predictHasHeaders ( ) const
protected

Predicts whether the file contains column header names.

Returns
True if headers are likely present.

◆ selectColumn()

void AsciiModelFileDialog::selectColumn ( uint04 column)

Selects and highlights the specified column in the preview table.

Parameters
[in]columnThe column index to select.

◆ setColumn()

void AsciiModelFileDialog::setColumn ( uint04 index,
const DesignParameter & params )
protected

Assigns a design parameter to a specific column.

Parameters
[in]indexThe column index to set.
[in]paramsThe design parameter to assign.

◆ setRequests()

virtual void AsciiModelFileDialog::setRequests ( const Buffer< FactoryParameters > & file)
overridevirtual

Sets the file requests to be processed by the dialog.

Parameters
[in]fileThe buffer of factory parameters describing the files to import or export.

Reimplemented from AutoModelFileDialog.

◆ setUUIDs()

virtual void AsciiModelFileDialog::setUUIDs ( Buffer< UUID > models)
overridevirtual

Sets the UUIDs of models to export.

Parameters
[in]modelsThe buffer of model UUIDs.

Reimplemented from AutoModelFileDialog.

◆ showColumnContextMenu()

void AsciiModelFileDialog::showColumnContextMenu ( const QPoint & point)

Displays a context menu for the column at the given position.

Parameters
[in]pointThe position in widget coordinates.

◆ sizeHint()

QSize AsciiModelFileDialog::sizeHint ( ) const
overrideprotected

Returns the recommended size for this dialog.

Returns
The preferred size hint.

◆ templateFolder()

File AsciiModelFileDialog::templateFolder ( ) const
protected

Returns the folder path where ASCII templates are stored.

Returns
The template folder path.

◆ updateExportPreview()

AsciiError AsciiModelFileDialog::updateExportPreview ( )
protected

Updates the export preview table based on current settings.

Returns
An AsciiError code indicating the result.

◆ updateOptions()

void AsciiModelFileDialog::updateOptions ( FactoryOptions & new_options)
overridevirtual

Updates the given factory options with the current dialog settings.

Parameters
[in]new_optionsThe factory options to update.

Reimplemented from AutoModelFileDialog.

◆ updateUIFromFile()

AsciiError AsciiModelFileDialog::updateUIFromFile ( AsciiOptions & options)
protected

Updates the dialog UI from the given file using the specified ASCII options.

Parameters
[in]optionsThe ASCII options describing the file format.
Returns
An AsciiError code indicating the result.

References ModelFileDialog::options().


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