API Documentation
Loading...
Searching...
No Matches
SceneTree.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: SceneTree
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/QTModelManagerView.h>
35#include <QTreeWidget>
36#include <QItemDelegate>
37class QPoint;
38class QPropertyAnimation;
39namespace NDEVR
40{
41 class Button;
42 class FileChooserDialog;
43 class ProxyModelViewFilter;
44 class CameraLocationCombo;
45 class TouchScrollManager;
46 class DesignObjectVisibleButton;
47 class SceneTree;
48 class SceneTreeModelDelegate;
49 class NDEVR_API SceneTree : public QTreeView
50 {
51 Q_OBJECT
52 public:
53 explicit SceneTree(QTModelManager* manager, QWidget* parent = nullptr);
54 explicit SceneTree(QTModelManagerView* view, QWidget* parent = nullptr);
55 void initialize();
56 bool event(QEvent* e) override;
58 void setVisibleFilter(const std::function<bool(const Model&)>& filter);
59 void setIsRootFilter(const std::function<bool(const Model&)>& filter);
60 void selectionChanged(const QItemSelection& selected, const QItemSelection&) override;
61 void setCustomHeader(const TranslatedString& header_title, const String& header_icon = String(), bool allow_click = true);
62 void setRootModels(const Buffer<UUID>& ids);
63 void setCustomSizeHint(const QSize& size);
64 void resizeEvent(QResizeEvent* size) override;
65 void creatContextMenu(const UUID& id, const QPoint &pos);
66 public slots:
67 void updateFocus(UUID id, bool focussed);
68 void updateModel(UUID id);
69 void updateExpanded(const QModelIndex& index);
70 //bool isIndexHidden(const QModelIndex & index) const override;
71 void updateSelection(Buffer<UUID> ids, bool selected);
72 void contextMenu(const QPoint &pos);
73 protected slots:
74 void onExpandedSlot(const QModelIndex& index);
75 void onCollapsedSlot(const QModelIndex& index);
76 protected:
77 void setup();
78 QSize sizeHint() const override;
79 private:
80 QSize m_custom_size_hint;
81 ProxyModelViewFilter* m_design_model = nullptr;
82 SceneTreeModelDelegate* m_model_delegate = nullptr;
83 Button* m_project_settings_button = nullptr;
84 bool auto_expanding = false;
85 bool m_allow_header_click = true;
86 bool m_ignore_expand_signal = false;
87 };
88}
#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
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
Filters and sorts Models from a ModelManager for views such as in a table or in a tree view.
Definition ProxyModelViewFilter.h:46
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
A Qt compatible ItemModel for interfacing with a DesignObjectLookup.
Definition QTModelManagerView.h:44
Definition SceneTree.h:50
SceneTree(QTModelManagerView *view, QWidget *parent=nullptr)
void onExpandedSlot(const QModelIndex &index)
void setCustomHeader(const TranslatedString &header_title, const String &header_icon=String(), bool allow_click=true)
void updateFocus(UUID id, bool focussed)
void contextMenu(const QPoint &pos)
void onCollapsedSlot(const QModelIndex &index)
QSize sizeHint() const override
void setVisibleFilter(const std::function< bool(const Model &)> &filter)
void updateSelection(Buffer< UUID > ids, bool selected)
SceneTree(QTModelManager *manager, QWidget *parent=nullptr)
QTModelManager * manager() const
void updateModel(UUID id)
void setRootModels(const Buffer< UUID > &ids)
bool event(QEvent *e) override
void updateExpanded(const QModelIndex &index)
void creatContextMenu(const UUID &id, const QPoint &pos)
void selectionChanged(const QItemSelection &selected, const QItemSelection &) override
void setIsRootFilter(const std::function< bool(const Model &)> &filter)
void resizeEvent(QResizeEvent *size) override
void setCustomSizeHint(const QSize &size)
Responsible for rendering an entry into a SceneTree widget.
Definition SceneTreeModelDelegate.h:60
The core String class for the NDEVR API.
Definition String.h:69
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