NDEVR
API Documentation
AutoModelFileDialog.h
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: AutoModelFileDialog
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/ModelFileDialog.h>
35#if NDEVR_SUPPORTS_THREADING
36 #include <NDEVR/CachedFactoryIOThread.h>
37#endif
38namespace NDEVR
39{
40 struct PopupInfo;
41 class ModelFactory;
48 class NDEVR_API AutoModelFileDialog : public ModelFileDialog
49 {
50 Q_OBJECT
51 public:
58 AutoModelFileDialog(bool is_import, InfoPipe* log, QWidget *parent = nullptr);
64 virtual void setRequests(const Buffer<FactoryParameters>& file);
69 virtual void updateOptions(FactoryOptions& new_options) override;
79 virtual void setUUIDs(Buffer<UUID> models);
91 virtual void filterModelsToExport();
95 virtual void reset();
99 virtual void beginProcess();
104 void setIsValid(bool is_valid);
109 void setPositionOnEnd(bool position_on_end);
114 QSize sizeHint() const override;
115 private:
120 bool loadOrSaveFile();
124 void processWarnings();
129 void onOperationFinished(bool success);
133 void onSuccessfulSave();
137 void onSuccessfulImport();
141 virtual void onCancelled() override;
145 virtual void onAccepted() override;
150 ModelFactory* factory() const;
151 signals:
155 void loaded();
156 protected:
157#if NDEVR_SUPPORTS_THREADING
159#endif
163 private:
164 bool m_is_valid;
165 bool m_share_on_end;
166 bool m_position_on_end;
167 };
168}
virtual void onAccepted() override
Called when the user accepts the dialog, finalizing the operation.
virtual void beginProcess()
Begins the import or export process using the current settings.
Buffer< UUID > IDs() const
Returns the UUIDs of the models currently selected in the dialog.
void selectDefaultToExport()
Selects the default set of models for export.
virtual void filterModelsToExport()
Filters the model list to show only those appropriate for export.
bool m_show_error_dialog
Whether to display an error dialog on failure.
virtual void onCancelled() override
Called when the user cancels the dialog, aborting any active operation.
Buffer< FactoryParameters > m_files
The file parameters for the current operation.
QSize sizeHint() const override
Returns the recommended size for this dialog.
ModelSelectionTree * m_selection_tree
The tree widget for selecting models to import or export.
CachedFactoryIOThread m_factory_thread
The background thread managing cached file I/O.
virtual void reset()
Resets the dialog to its initial state.
void setPositionOnEnd(bool position_on_end)
Sets whether the camera should reposition to the imported data on completion.
void loaded()
Emitted when the file has been successfully loaded or saved.
virtual void setUUIDs(Buffer< UUID > models)
Sets the UUIDs of models available for selection in the dialog.
virtual void updateOptions(FactoryOptions &new_options) override
Updates the given factory options with the current dialog settings.
AutoModelFileDialog(bool is_import, InfoPipe *log, QWidget *parent=nullptr)
Constructs the AutoModelFileDialog.
void setIsValid(bool is_valid)
Sets whether the current dialog configuration is valid for processing.
void selectAllVisible()
Selects all visible models in the selection tree.
virtual void setRequests(const Buffer< FactoryParameters > &file)
Sets the file requests to be processed, starting background I/O if possible.
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A thread designed to read and write files using the FactoryIO interface.
User-defined options that define preferences for importing and exporting using IOFactory objects.
A light-weight base class for Log that allows processes to update, without the need for additional in...
The core logic for importing and exporting files from the model hierarchy.
ModelFileDialog(bool is_import, InfoPipe *log, QWidget *parent=0)
Constructs the model file dialog for import or export settings.
A tree view widget for displaying and selecting Models from the scene.
The primary namespace for the NDEVR SDK.
Class which is used to pass arguments and requests for creating a popup dialog or widget.
Definition PopupInfo.h:16