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;
54 /**--------------------------------------------------------------------------------------------------
55 Class: AsciiModelFileDialog
56
57 \brief Default dialog shown when the user exports an ascii-or custom column style file.
58 *-----------------------------------------------------------------------------------------------**/
60 {
61 Q_OBJECT
62 public:
68 AsciiModelFileDialog(bool is_import, ProgressInfo* log, QWidget* parent = nullptr);
70
71 virtual void setRequests(const Buffer<FactoryParameters>& file) override;
72 bool checkValidity();
73 void enabledFormatChoosing(bool enabled);
75 void updateOptions(FactoryOptions& new_options) override;
76
77 virtual void setUUIDs(Buffer<UUID> models) override;
78 protected:
79 QSize sizeHint() const override;
82 void predictFirstLine(uint04& line, uint04& row_count) const;
83 bool predictHasHeaders() const;
84 void setupColumnHeaders();
85 void setColumn(uint04 index, const DesignParameter& params);
86 bool existsOutsideOf(uint04 index, const DesignParameter& params) const;
87 bool existsBefore(uint04 index, const DesignParameter& params) const;
91 virtual void filterModelsToExport() override;
92 File templateFolder() const;
96 QMenu* createColumnMenu();
99 void insertNewColumn(uint04 index);
100 void updateUINow() override;
101 public slots:
102 void updateFromUISlot();
103 void showColumnContextMenu(const QPoint& point);
104 void selectColumn(uint04 column);
108 protected:
109 Ui::AsciiImportUI* ascii_ui;
113 QMenu* m_field_menu = nullptr;
114 bool m_ignore_update = false;
115 bool m_pulling_template = false;
117 };
118}
Default dialog shown when the user exports an ascii-or custom column style file.
Definition AsciiModelFileDialog.h:60
AsciiError updateUIFromFile(AsciiOptions &options)
Definition AsciiModelFileDialog.cpp:940
void onFieldChooserDeleted()
Definition AsciiModelFileDialog.cpp:1185
void updateColumnsFromParams()
Definition AsciiModelFileDialog.cpp:269
Buffer< DesignParameter > getChannelWhitelist() const
Definition AsciiModelFileDialog.cpp:719
uint04 m_selected_column
Definition AsciiModelFileDialog.h:112
QSize sizeHint() const override
Definition AsciiModelFileDialog.cpp:413
File templateFolder() const
Definition AsciiModelFileDialog.cpp:926
void predictDelimiter(AsciiOptions &options) const
Definition AsciiModelFileDialog.cpp:420
void predictFirstLine(uint04 &line, uint04 &row_count) const
Definition AsciiModelFileDialog.cpp:447
void predictColumnType(AsciiOptions &options)
Definition AsciiModelFileDialog.cpp:559
void showColumnContextMenu(const QPoint &point)
Definition AsciiModelFileDialog.cpp:213
static FileFormat AsciiTemplateFormat()
Definition AsciiModelFileDialog.cpp:855
Buffer< DesignParameter > getPossibleChannels(const String &option)
Definition AsciiModelFileDialog.cpp:606
virtual void setUUIDs(Buffer< UUID > models) override
Definition AsciiModelFileDialog.cpp:872
void updateOptions(FactoryOptions &new_options) override
Definition AsciiModelFileDialog.cpp:865
DynamicPointer< Scanner > m_scanner
Definition AsciiModelFileDialog.h:116
virtual void setRequests(const Buffer< FactoryParameters > &file) override
Definition AsciiModelFileDialog.cpp:373
AsciiError
Definition AsciiModelFileDialog.h:64
@ e_file_is_empty
Definition AsciiModelFileDialog.h:66
@ e_valid
Definition AsciiModelFileDialog.h:65
void onFieldChooserEdited()
Definition AsciiModelFileDialog.cpp:1164
Buffer< DesignParameter > getAvailableChannels(const Buffer< UUID > &models)
Definition AsciiModelFileDialog.cpp:824
void updateUINow() override
Definition AsciiModelFileDialog.cpp:323
void setupDelimiterCombo()
Definition AsciiModelFileDialog.cpp:219
bool m_ignore_update
Definition AsciiModelFileDialog.h:114
AsciiModelFileDialog(bool is_import, ProgressInfo *log, QWidget *parent=nullptr)
Definition AsciiModelFileDialog.cpp:26
virtual void filterModelsToExport() override
Definition AsciiModelFileDialog.cpp:849
void setColumn(uint04 index, const DesignParameter &params)
Definition AsciiModelFileDialog.cpp:1101
bool predictHasHeaders() const
Definition AsciiModelFileDialog.cpp:474
AsciiOptions asciiOptions() const
Definition AsciiModelFileDialog.cpp:281
uint04 m_line_preview_count
Definition AsciiModelFileDialog.h:111
~AsciiModelFileDialog()
Definition AsciiModelFileDialog.cpp:211
void onFieldChooserAccepted()
Definition AsciiModelFileDialog.cpp:1174
bool existsOutsideOf(uint04 index, const DesignParameter &params) const
Definition AsciiModelFileDialog.cpp:1113
QMenu * m_field_menu
Definition AsciiModelFileDialog.h:113
void insertNewColumn(uint04 index)
Definition AsciiModelFileDialog.cpp:310
Buffer< ColumnDetails > m_column_details
Definition AsciiModelFileDialog.h:110
Ui::AsciiImportUI * ascii_ui
Definition AsciiModelFileDialog.h:109
bool existsBefore(uint04 index, const DesignParameter &params) const
Definition AsciiModelFileDialog.cpp:1127
AsciiError updateExportPreview()
Definition AsciiModelFileDialog.cpp:1021
void setupColumnHeaders()
Definition AsciiModelFileDialog.cpp:1063
QMenu * createColumnMenu()
Definition AsciiModelFileDialog.cpp:239
void enabledFormatChoosing(bool enabled)
Definition AsciiModelFileDialog.cpp:1139
void selectColumn(uint04 column)
Definition AsciiModelFileDialog.cpp:883
bool m_pulling_template
Definition AsciiModelFileDialog.h:115
void updateFromUISlot()
Definition AsciiModelFileDialog.cpp:364
bool checkValidity()
Definition AsciiModelFileDialog.cpp:499
Storage class for all options related to an Ascii file output used by an IOFactory.
Definition AsciiOptions.h:44
Dialog that allows user to choose import or export options while simultaniously automatically.
Definition AutoModelFileDialog.h:50
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition DesignParameter.h:42
Definition Pointer.hpp:303
Definition FactoryOptions.h:46
Definition FileFormat.h:38
Definition File.h:47
FactoryOptions options() const
Definition ModelFileDialog.h:99
Definition ProgressInfo.hpp:43
Definition String.h:40
Definition TypeInfo.h:39
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:120
Definition FontEditor.h:6
Definition AsciiModelFileDialog.h:48
TypeInfo type_info
Definition AsciiModelFileDialog.h:51
Buffer< DesignParameter > available_options
Definition AsciiModelFileDialog.h:50
DesignParameter selected_option
Definition AsciiModelFileDialog.h:49
bool has_decimals
Definition AsciiModelFileDialog.h:52