API Documentation
Loading...
Searching...
No Matches
DesignObjectChooser.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: DesignObjectChooser
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/DesignObjectGallery.h>
34#include <NDEVR/Dictionary.h>
35namespace Ui
36{
37 class DesignObjectChooserUI;
38}
39namespace NDEVR
40{
41 /**--------------------------------------------------------------------------------------------------
42 \brief Provides a screen of buttons that allow the user to pick a Model for an action.
43 **/
44 class NDEVR_API DesignObjectChooser : public QWidget
45 {
46 Q_OBJECT
47 public:
48 DesignObjectChooser(QWidget* parent = nullptr);
49 DesignObjectChooser(QTModelManager* manager, QWidget* parent = nullptr);
50 DesignObjectChooser(LibraryManager* manager, QWidget* parent = nullptr);
51 void addCategory(const String& name, const Buffer<UUID>& items);
52 void removeCategory(const String& name);
54 void showActiveModelsCategory(bool show);
57 void clear();
58 void updateFromArchive(bool show_active_models, bool show_active_materials, bool refresh_archive_files);
59 void updateFromArchive(bool refresh_archive_files);
62 void filter(const String& keyword_search);
64 void setSelected(const Buffer<UUID>& id);
65 void setCategory(const String& category);
66 void addButton(Button* button);
69 protected:
70 void init();
71 void initContextMenu(Button* button);
72 void showFileMenu(bool is_save);
74 signals:
76 protected slots:
78 protected:
81 bool m_is_library = false;
88 Ui::DesignObjectChooserUI* ui;
89 };
90}
#define NDEVR_API
Definition DLLInfo.h:50
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A core widget that allows the user to click one of many button types.
Definition Button.h:66
Provides a screen of buttons that allow the user to pick a Model for an action.
Definition DesignObjectChooser.h:45
DesignObjectChooser(QWidget *parent=nullptr)
bool m_is_material_chooser
Definition DesignObjectChooser.h:79
DesignObjectChooser(LibraryManager *manager, QWidget *parent=nullptr)
void setModelManager(QTModelManager *manager)
Dictionary< String, Buffer< UUID > > m_keywords
Definition DesignObjectChooser.h:82
void updateFromArchive(bool refresh_archive_files)
void setLibraryManager(LibraryManager *manager)
DesignObjectChooser(QTModelManager *manager, QWidget *parent=nullptr)
void showFileMenu(bool is_save)
void initContextMenu(Button *button)
void showActiveModelsCategory(bool show)
bool m_is_model_chooser
Definition DesignObjectChooser.h:80
void updateFromArchive(bool show_active_models, bool show_active_materials, bool refresh_archive_files)
Ui::DesignObjectChooserUI * ui
Definition DesignObjectChooser.h:88
void setCategory(const String &category)
const Buffer< UUID > & currentSelection() const
void filter(const String &keyword_search)
LibraryManager * m_library_manager
Definition DesignObjectChooser.h:86
void onSelectedSignal(Buffer< UUID > id)
void addButton(Button *button)
QTModelManager * m_manager
Definition DesignObjectChooser.h:85
Dictionary< String, Buffer< UUID > > m_categories
Definition DesignObjectChooser.h:83
void addCategory(const String &name, const Buffer< UUID > &items)
Buffer< String > m_category_list
Definition DesignObjectChooser.h:84
void showActiveMaterialsCategory(bool show)
void setSelectionMode(DesignObjectGallery::SelectionMode selection_mode)
void setSelected(const Buffer< UUID > &id)
String m_keyword_search
Definition DesignObjectChooser.h:87
void removeCategory(const String &name)
Buffer< Model > getCurrentSelectedModels() const
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Manages loading Models from a group that is stored either on a remote server or locally on the disk i...
Definition LibraryManager.h:42
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
The core String class for the NDEVR API.
Definition String.h:69
Definition ACIColor.h:37
Definition FontEditor.h:6