API Documentation
Loading...
Searching...
No Matches
LibraryManager.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: LibraryManager
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/QTModelManager.h>
34#include <NDEVR/TranslatedString.h>
35namespace NDEVR
36{
37 class NDEVR_API LibraryManager : public QObject
38 {
39 Q_OBJECT
40 public:
41 LibraryManager(QTModelManager* manager, const File& library_folder);
42 String getIcon(const UUID& id) const;
43 TranslatedString getName(const UUID& id) const
44 {
45 return m_names.get(id);
46 }
47 String getType(const UUID& id) const
48 {
49 return m_types.get(id);
50 }
52 {
53 return m_search_terms.get(id);
54 }
55 Model loadObject(const UUID& id, bool center_model);
56 void centerModel(Model& model);
57 bool hasID(const UUID& id) const;
58 Buffer<UUID> getIDs() const { return m_ids; }
59 Buffer<String> getTypes() const;
60 Buffer<TranslatedString> getCategories() const;
61 Buffer<UUID> getIDsByCategory(const TranslatedString& category);
62 void updateFromArchive();
63 void addToLibrary(const UUID& object, UUID library_object);
64 void removeFromLibrary(const UUID& object);
65 void saveToArchiveFile(File file);
66 void pullFromArchiveFile(File file);
67 void saveAllImagesToFolder(File folder);
68 void addLayer(Model& model);
69 QTModelManager* manager() { return m_manager; }
70 void recomputeObject(UUID);
71 void recomputeAll();
72 protected:
73 void updateFromArchive(const UUID& file);
74 void updateFromArchive(const File& file);
75 bool writeToLibrary(const UUID& object_to_write, UUID library_id);
76 signals:
77 void modelAdded(UUID id);
79 protected:
88 };
89}
#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:64
decltype(auto) get(t_index_type index)
Definition Buffer.hpp:857
Definition DesignObjectLookup.h:61
Definition Dictionary.h:48
Definition File.h:47
Definition LibraryManager.h:38
void modelAdded(UUID id)
QTModelManager * manager()
Definition LibraryManager.h:69
String getType(const UUID &id) const
Definition LibraryManager.h:47
Dictionary< UUID, String > m_types
Definition LibraryManager.h:83
Dictionary< UUID, TranslatedString > m_categories
Definition LibraryManager.h:84
Buffer< UUID > m_ids
Definition LibraryManager.h:81
Dictionary< UUID, TranslatedString > m_search_terms
Definition LibraryManager.h:85
void modelRemoved(UUID id)
QTModelManager * m_manager
Definition LibraryManager.h:86
Buffer< UUID > getIDs() const
Definition LibraryManager.h:58
Dictionary< UUID, TranslatedString > m_names
Definition LibraryManager.h:82
File m_archive_path
Definition LibraryManager.h:87
TranslatedString getName(const UUID &id) const
Definition LibraryManager.h:43
DesignObjectLookup m_library_lookup
Definition LibraryManager.h:80
TranslatedString getSearchTerms(const UUID &id) const
Definition LibraryManager.h:51
Definition Model.h:54
Definition QTModelManager.h:94
Definition String.h:40
Definition TranslatedString.h:9
Definition UUID.h:66
Definition ACIColor.h:37