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;
57 QTModelManager* manager() const;
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:67
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition Button.h:60
Definition Model.h:54
Definition ProxyModelViewFilter.h:43
Definition QTModelManager.h:94
Definition QTModelManagerView.h:41
Definition SceneTree.h:50
Definition SceneTreeModelDelegate.h:53
Definition String.h:40
Definition TranslatedString.h:9
Definition UUID.h:66
Definition ACIColor.h:37