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 class NDEVR_API DesignObjectChooser : public QWidget
42 {
43 Q_OBJECT
44 public:
45 DesignObjectChooser(QWidget* parent = nullptr);
46 DesignObjectChooser(QTModelManager* manager, QWidget* parent = nullptr);
47 DesignObjectChooser(LibraryManager* manager, QWidget* parent = nullptr);
48 void addCategory(const String& name, const Buffer<UUID>& items);
49 void removeCategory(const String& name);
50 void showActiveMaterialsCategory(bool show);
51 void showActiveModelsCategory(bool show);
52 void setModelManager(QTModelManager* manager);
53 void setLibraryManager(LibraryManager* manager);
54 void clear();
55 void updateFromArchive(bool show_active_models, bool show_active_materials, bool refresh_archive_files);
56 void updateFromArchive(bool refresh_archive_files);
57 void filterFromManager();
58 void filterFromArchive();
59 void filter(const String& keyword_search);
60 void setSelectionMode(DesignObjectGallery::SelectionMode selection_mode);
61 void setSelected(const Buffer<UUID>& id);
62 void setCategory(const String& category);
63 void addButton(Button* button);
64 const Buffer<UUID>& currentSelection() const;
65 Buffer<Model> getCurrentSelectedModels() const;
66 protected:
67 void init();
68 void initContextMenu(Button* button);
69 void showFileMenu(bool is_save);
70 void exportImages();
71 signals:
73 protected slots:
74 void onCategoryChanged();
75 protected:
78 bool m_is_library = false;
85 Ui::DesignObjectChooserUI* ui;
86 };
87}
#define NDEVR_API
Definition DLLInfo.h:67
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:59
Definition Button.h:60
Definition DesignObjectChooser.h:42
bool m_is_material_chooser
Definition DesignObjectChooser.h:76
Dictionary< String, Buffer< UUID > > m_keywords
Definition DesignObjectChooser.h:79
bool m_is_model_chooser
Definition DesignObjectChooser.h:77
Ui::DesignObjectChooserUI * ui
Definition DesignObjectChooser.h:85
LibraryManager * m_library_manager
Definition DesignObjectChooser.h:83
void onSelectedSignal(Buffer< UUID > id)
QTModelManager * m_manager
Definition DesignObjectChooser.h:82
Dictionary< String, Buffer< UUID > > m_categories
Definition DesignObjectChooser.h:80
Buffer< String > m_category_list
Definition DesignObjectChooser.h:81
String m_keyword_search
Definition DesignObjectChooser.h:84
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:59
Definition LibraryManager.h:38
Definition QTModelManager.h:94
The core String class for the software.
Definition String.h:47
Definition ACIColor.h:37
Definition FontEditor.h:6