API Documentation
Loading...
Searching...
No Matches
DesignObjectGallery.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: DesignObjectGallery
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/QTModelManager.h>
34#include <NDEVR/LibraryManager.h>
35#include <NDEVR/ButtonGallery.h>
36#include <NDEVR/Button.h>
37#include <QWidget>
38namespace NDEVR
39{
40 class Ribbon;
41 /**--------------------------------------------------------------------------------------------------
42 \brief Shows a series of Buttons with large icons that represent DesignObjects that allow the user
43 to choose one.
44 **/
46 {
47 Q_OBJECT
48 public:
55 DesignObjectGallery(QWidget* parent = nullptr);
57 void clear() override;
58 const Buffer<UUID>& ids() const
59 {
60 return m_objects;
61 }
62 void setButtonVisible(const UUID& id, bool visible)
63 {
64 m_buttons.get(id)->setVisible(visible);
65 }
67 {
68
69 std::sort(m_objects.begin(), m_objects.end(), [this](const UUID& a, const UUID& b)
70 {
71 return m_object_names[a].translation() > m_object_names[b].translation();
72 });
73 }
74 void setObjects(const Buffer<UUID>& objects);
75 void setSelected(const Buffer<UUID>& id);
80 void setSelectionMode(SelectionMode selection_mode);
83 protected slots:
85 protected:
87 void updateFromManager(const UUID& id);
88 void updateFromLibrary(const UUID& id);
89 void resizeEvent(QResizeEvent *resize_event) override
90 {
91 ButtonGallery::resizeEvent(resize_event);
92 /*for (auto button : m_buttons)
93 {
94 //button.second->setIconSize(getMax(128, width() / 4));
95 }*/
96 }
97 const QTModelManager* manager() { return m_manager; }
98 signals:
100 protected:
111 };
112
113}
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
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 UI ribbon is a horizontal menu bar typically located at the top of the application interface or a...
Definition Ribbon.h:54
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37