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;
42 {
43 Q_OBJECT
44 public:
51 DesignObjectGallery(QWidget* parent = nullptr);
53 void clear() override;
54 const Buffer<UUID>& ids() const
55 {
56 return m_objects;
57 }
58 void setButtonVisible(const UUID& id, bool visible)
59 {
60 m_buttons.get(id)->setVisible(visible);
61 }
63 {
64
65 std::sort(m_objects.begin(), m_objects.end(), [this](const UUID& a, const UUID& b)
66 {
67 return m_object_names[a].translation() > m_object_names[b].translation();
68 });
69 }
70 void setObjects(const Buffer<UUID>& objects);
71 void setSelected(const Buffer<UUID>& id);
73 void fillWithMaterials();
74 void fillWithModels();
76 void setSelectionMode(SelectionMode selection_mode);
79 protected slots:
80 void updateObject(UUID id);
81 protected:
82 TranslatedString getObjectName(const UUID& id) const;
83 void updateFromManager(const UUID& id);
84 void updateFromLibrary(const UUID& id);
85 void resizeEvent(QResizeEvent *resize_event) override
86 {
87 ButtonGallery::resizeEvent(resize_event);
88 /*for (auto button : m_buttons)
89 {
90 //button.second->setIconSize(getMax(128, width() / 4));
91 }*/
92 }
93 const QTModelManager* manager() { return m_manager; }
94 signals:
96 protected:
107 };
108
109}
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition Dictionary.h:48
Definition LibraryManager.h:38
Definition QTModelManager.h:94
Definition Ribbon.h:47
Definition TranslatedString.h:9
Definition UUID.h:66
Definition ACIColor.h:37
SelectionMode
Definition SelectionArea.hpp:43