API Documentation
Loading...
Searching...
No Matches
AsciiModelFileDialog.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: AsciiModelFileDialog
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/AutoModelFileDialog.h>
34#include <NDEVR/DesignParameter.h>
35class QPushButton;
36class QComboBox;
37class QLabel;
38namespace Ui
39{
40 class AsciiImportUI;
41}
42namespace NDEVR
43{
44 class File;
45 class FieldChooser;
46 class INIFactory;
47 /**--------------------------------------------------------------------------------------------------
48 \brief Stores the data for AsciiModelFileDialog user specified columns
49 **/
57 /**--------------------------------------------------------------------------------------------------
58 \brief Default dialog shown when the user exports an ascii-or custom column style file.
59 **/
61 {
62 Q_OBJECT
63 public:
69 AsciiModelFileDialog(bool is_import, ProgressInfo* log, QWidget* parent = nullptr);
71
72 virtual void setRequests(const Buffer<FactoryParameters>& file) override;
74 void enabledFormatChoosing(bool enabled);
76 void updateOptions(FactoryOptions& new_options) override;
77
78 virtual void setUUIDs(Buffer<UUID> models) override;
79 protected:
80 QSize sizeHint() const override;
83 void predictFirstLine(uint04& line, uint04& row_count) const;
84 bool predictHasHeaders() const;
86 void setColumn(uint04 index, const DesignParameter& params);
87 bool existsOutsideOf(uint04 index, const DesignParameter& params) const;
88 bool existsBefore(uint04 index, const DesignParameter& params) const;
92 virtual void filterModelsToExport() override;
101 void updateUINow() override;
102 public slots:
104 void showColumnContextMenu(const QPoint& point);
105 void selectColumn(uint04 column);
109 protected:
110 Ui::AsciiImportUI* ascii_ui;
114 QMenu* m_field_menu = nullptr;
115 bool m_ignore_update = false;
116 bool m_pulling_template = false;
118 };
119}
Default dialog shown when the user exports an ascii-or custom column style file.
Definition AsciiModelFileDialog.h:61
Buffer< DesignParameter > getChannelWhitelist() const
uint04 m_selected_column
Definition AsciiModelFileDialog.h:113
QSize sizeHint() const override
AsciiError updateUIFromFile(AsciiOptions &options)
void predictDelimiter(AsciiOptions &options) const
void predictFirstLine(uint04 &line, uint04 &row_count) const
virtual void filterModelsToExport() override
void predictColumnType(AsciiOptions &options)
AsciiError updateExportPreview()
void showColumnContextMenu(const QPoint &point)
Buffer< DesignParameter > getPossibleChannels(const String &option)
static FileFormat AsciiTemplateFormat()
void updateOptions(FactoryOptions &new_options) override
DynamicPointer< Scanner > m_scanner
Definition AsciiModelFileDialog.h:117
AsciiError
Definition AsciiModelFileDialog.h:65
@ e_file_is_empty
Definition AsciiModelFileDialog.h:67
@ e_valid
Definition AsciiModelFileDialog.h:66
Buffer< DesignParameter > getAvailableChannels(const Buffer< UUID > &models)
void updateUINow() override
virtual void setUUIDs(Buffer< UUID > models) override
bool m_ignore_update
Definition AsciiModelFileDialog.h:115
AsciiModelFileDialog(bool is_import, ProgressInfo *log, QWidget *parent=nullptr)
void setColumn(uint04 index, const DesignParameter &params)
AsciiOptions asciiOptions() const
uint04 m_line_preview_count
Definition AsciiModelFileDialog.h:112
bool existsOutsideOf(uint04 index, const DesignParameter &params) const
QMenu * m_field_menu
Definition AsciiModelFileDialog.h:114
void insertNewColumn(uint04 index)
Buffer< ColumnDetails > m_column_details
Definition AsciiModelFileDialog.h:111
Ui::AsciiImportUI * ascii_ui
Definition AsciiModelFileDialog.h:110
bool existsBefore(uint04 index, const DesignParameter &params) const
void enabledFormatChoosing(bool enabled)
void selectColumn(uint04 column)
virtual void setRequests(const Buffer< FactoryParameters > &file) override
bool m_pulling_template
Definition AsciiModelFileDialog.h:116
Storage class for all IO options related to an Ascii file output used by an IOFactory services that w...
Definition AsciiOptions.h:43
Dialog that allows user to choose import or export options while simultaniously automatically writing...
Definition AutoModelFileDialog.h:49
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A definition of data that is logically stored in the Model heirarchy. Data could be a property of a M...
Definition DesignParameter.h:46
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
User-defined options that define preferences for importing and exporting using IOFactory objects.
Definition FactoryOptions.h:49
Data that describes a particular file format and how to use the format with the program....
Definition FileFormat.h:43
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
FactoryOptions options() const
Definition ModelFileDialog.h:103
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
The core String class for the NDEVR API.
Definition String.h:69
Stores information about a type, relevant for certain templated functions. To get information about a...
Definition TypeInfo.h:43
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
Definition FontEditor.h:6
Stores the data for AsciiModelFileDialog user specified columns.
Definition AsciiModelFileDialog.h:51
TypeInfo type_info
Definition AsciiModelFileDialog.h:54
Buffer< DesignParameter > available_options
Definition AsciiModelFileDialog.h:53
DesignParameter selected_option
Definition AsciiModelFileDialog.h:52
bool has_decimals
Definition AsciiModelFileDialog.h:55