v2.0.0
Loading...
Searching...
No Matches
networkobject.h
Go to the documentation of this file.
1//=============================================================================================================
24
25#ifndef NETWORKOBJECT_H
26#define NETWORKOBJECT_H
27
28//=============================================================================================================
29// INCLUDES
30//=============================================================================================================
31
32#include "../disp3D_global.h"
33
34#include "../core/rendertypes.h"
35
36#include <QMatrix4x4>
37#include <QVector3D>
38#include <QColor>
39#include <vector>
40#include <memory>
41
43
44
45namespace DISP3DLIB
46{
47
48//=============================================================================================================
58{
59public:
60 //=========================================================================================================
65
66 //=========================================================================================================
71
72 //=========================================================================================================
79 void load(const CONNECTIVITYLIB::Network& network, const QString& sColormap = "Viridis");
80
81 //=========================================================================================================
87 void setThreshold(double dThreshold);
88
89 //=========================================================================================================
95 void setColormap(const QString& sColormap);
96
97 //=========================================================================================================
102
107
110 {
111 return m_nodeInstanceCount;
112 }
113
116 {
117 return m_edgeInstanceCount;
118 }
119
124 {
125 return m_nodeRenderKey;
126 }
128 {
129 return m_edgeRenderKey;
130 }
131
132 // ── Visibility ──────────────────────────────────────────────────────
133 bool isVisible() const
134 {
135 return m_visible;
136 }
137 void setVisible(bool visible)
138 {
139 m_visible = visible;
140 }
141
142 bool hasData() const
143 {
144 return !m_network.isEmpty();
145 }
146
147private:
151 // Instance data: identical layout to DipoleObject for shader compatibility
152 // Model Matrix (4x4) + Color (vec4) + isSelected (float)
153 struct InstanceData
154 {
155 float model[16];
156 float color[4];
157 float isSelected; // Always 0.0 for networks
158 };
159
163 struct VertexData
164 {
165 float x, y, z;
166 float nx, ny, nz;
167 };
168
169 void createNodeGeometry();
170 void createEdgeGeometry();
171 void buildNodeInstances();
172 void buildEdgeInstances();
173
174 // ── Network data ────────────────────────────────────────────────────
175 CONNECTIVITYLIB::Network m_network;
176 QString m_colormap = "Viridis";
177
178 // ── Node GPU resources ──────────────────────────────────────────────
179 RenderKey m_nodeRenderKey;
180 RenderKey m_edgeRenderKey;
181
182 QByteArray m_nodeVertexData;
183 QByteArray m_nodeIndexData;
184 QByteArray m_nodeInstanceData;
185 int m_nodeIndexCount = 0;
186 int m_nodeInstanceCount = 0;
187 quint64 m_nodeGeometryGeneration = 0;
188 quint64 m_nodeInstanceGeneration = 0;
189
190 // ── Edge GPU resources ──────────────────────────────────────────────
191 QByteArray m_edgeVertexData;
192 QByteArray m_edgeIndexData;
193 QByteArray m_edgeInstanceData;
194 int m_edgeIndexCount = 0;
195 int m_edgeInstanceCount = 0;
196 quint64 m_edgeGeometryGeneration = 0;
197 quint64 m_edgeInstanceGeneration = 0;
198
199 bool m_visible = true;
200};
201
202} // namespace DISP3DLIB
203
204#endif // NETWORKOBJECT_H
Library export/import macros and namespace marker for the disp3D library.
#define DISP3DSHARED_EXPORT
Lightweight render-related enums (ShaderMode, VisualizationMode) shared across disp3D.
Graph container that stores the result of one functional-connectivity metric as nodes (sources/sensor...
3-D brain visualisation using the Qt RHI rendering backend.
Graph container for one connectivity metric; nodes + weighted edges + threshold/visualisation state.
Definition network.h:106
CPU streams of an instanced mesh: one shape (vertices, indices) drawn once per instance.
Identity of a renderable in the renderer's GPU resource cache.
InstancedStreams edgeStreams() const
const RenderKey & nodeRenderKey() const
InstancedStreams nodeStreams() const
void load(const CONNECTIVITYLIB::Network &network, const QString &sColormap="Viridis")
void setThreshold(double dThreshold)
void setColormap(const QString &sColormap)
const RenderKey & edgeRenderKey() const
void setVisible(bool visible)