v2.0.0
Loading...
Searching...
No Matches
abstracttreeitem.cpp
Go to the documentation of this file.
1//=============================================================================================================
12
13//=============================================================================================================
14// INCLUDES
15//=============================================================================================================
16
17#include "abstracttreeitem.h"
18
19namespace DISP3DLIB
20{
21
23: QStandardItem(text)
24, m_type(type)
25{
26 // Set default values
27 setData(true, VisibleRole); // Visible by default
28 setData(QMatrix4x4(), TransformRole); // Identity
29 setData(QColor(Qt::white), ColorRole);
30 setData(1.0f, AlphaRole);
31}
32
34{
35 return itemTypeId(static_cast<ItemType>(m_type));
36}
37
39{
40 setData(visible, VisibleRole);
41}
42
44{
45 return data(VisibleRole).toBool();
46}
47
49{
50 setData(transform, TransformRole);
51}
52
54{
55 return data(TransformRole).value<QMatrix4x4>();
56}
57
59{
60 setData(color, ColorRole);
61}
62
64{
65 return data(ColorRole).value<QColor>();
66}
67
69{
70 setData(alpha, AlphaRole);
71}
72
74{
75 return data(AlphaRole).toFloat();
76}
77
78} // namespace DISP3DLIB
Base QStandardItem with check-state, visibility, transform, colour and alpha roles shared by every di...
3-D brain visualisation using the Qt RHI rendering backend.
void setColor(const QColor &color)
AbstractTreeItem(const QString &text="", int type=AbstractItem)
void setTransform(const QMatrix4x4 &transform)
static constexpr int itemTypeId(ItemType type)