v2.0.0
Loading...
Searching...
No Matches
DISP3DLIB::ElectrodeObject Class Reference

Data model for stereotactic depth electrode (sEEG) visualization. More...

#include <electrodeobject.h>

Classes

struct  GpuBuffers

Public Member Functions

 ElectrodeObject ()
 ~ElectrodeObject ()
void setShafts (const QVector< ElectrodeShaft > &shafts)
const QVector< ElectrodeShaft > & shafts () const
int totalContactCount () const
void setContactValues (const QMap< QString, float > &values, const QColor &minColor=Qt::blue, const QColor &maxColor=Qt::red)
void selectContact (const QString &name)
void clearSelection ()
QString selectedContact () const
void generateShaftGeometry (QVector< float > &vertices, QVector< unsigned int > &indices, int cylinderSides=16) const
void generateContactInstances (QVector< float > &instanceData) const
QVector3D boundingBoxMin () const
QVector3D boundingBoxMax () const
void updateBuffers (QRhi *rhi, QRhiResourceUpdateBatch *u)
QRhiBuffer * vertexBuffer () const
QRhiBuffer * indexBuffer () const
QRhiBuffer * instanceBuffer () const
uint32_t shaftIndexCount () const
uint32_t contactInstanceCount () const

Detailed Description

Data model for stereotactic depth electrode (sEEG) visualization.

Holds electrode shaft definitions and contact metadata, and generates CPU-side geometry (vertices/indices) that a QRhi-based renderer can upload to the GPU.

Definition at line 101 of file electrodeobject.h.

Constructor & Destructor Documentation

◆ ElectrodeObject()

ElectrodeObject::ElectrodeObject ( )

Definition at line 71 of file electrodeobject.cpp.

◆ ~ElectrodeObject()

ElectrodeObject::~ElectrodeObject ( )
default

Member Function Documentation

◆ boundingBoxMax()

QVector3D ElectrodeObject::boundingBoxMax ( ) const
Returns
Axis-aligned bounding box maximum corner (with contact-radius padding).

Definition at line 332 of file electrodeobject.cpp.

◆ boundingBoxMin()

QVector3D ElectrodeObject::boundingBoxMin ( ) const
Returns
Axis-aligned bounding box minimum corner (with contact-radius padding).

Definition at line 325 of file electrodeobject.cpp.

◆ clearSelection()

void ElectrodeObject::clearSelection ( )

Clear all contact selections.

Definition at line 169 of file electrodeobject.cpp.

◆ contactInstanceCount()

uint32_t ElectrodeObject::contactInstanceCount ( ) const
Returns
Number of contact instances for instanced draw.

Definition at line 489 of file electrodeobject.cpp.

◆ generateContactInstances()

void ElectrodeObject::generateContactInstances ( QVector< float > & instanceData) const

Generate per-instance data for contact spheres. Per instance: position (3) + radius (1) + color RGBA (4) + selected flag (1) = 9 floats.

Parameters
[out]instanceDataFlat float buffer.

Definition at line 298 of file electrodeobject.cpp.

◆ generateShaftGeometry()

void ElectrodeObject::generateShaftGeometry ( QVector< float > & vertices,
QVector< unsigned int > & indices,
int cylinderSides = 16 ) const

Generate interleaved vertex + index data for all shaft cylinders. Each vertex: position (3 floats) + normal (3 floats) = 6 floats.

Parameters
[out]verticesVertex buffer (position + normal interleaved).
[out]indicesIndex buffer (triangles).
[in]cylinderSidesNumber of sides for the cylinder cross-section.

Definition at line 188 of file electrodeobject.cpp.

◆ indexBuffer()

QRhiBuffer * ElectrodeObject::indexBuffer ( ) const
Returns
Shaft index buffer.

Definition at line 468 of file electrodeobject.cpp.

◆ instanceBuffer()

QRhiBuffer * ElectrodeObject::instanceBuffer ( ) const
Returns
Contact instance buffer (9 floats/instance).

Definition at line 475 of file electrodeobject.cpp.

◆ selectContact()

void ElectrodeObject::selectContact ( const QString & name)

Select a contact by name. Clears the previous selection.

Parameters
[in]nameContact name to select.

Definition at line 146 of file electrodeobject.cpp.

◆ selectedContact()

QString ElectrodeObject::selectedContact ( ) const
Returns
Name of the currently selected contact, or empty string if none.

Definition at line 181 of file electrodeobject.cpp.

◆ setContactValues()

void ElectrodeObject::setContactValues ( const QMap< QString, float > & values,
const QColor & minColor = Qt::blue,
const QColor & maxColor = Qt::red )

Apply per-contact scalar overlay values and map them to a color gradient.

Parameters
[in]valuesMap of contact name -> scalar value.
[in]minColorColor for the minimum value (default: blue).
[in]maxColorColor for the maximum value (default: red).

Definition at line 115 of file electrodeobject.cpp.

◆ setShafts()

void ElectrodeObject::setShafts ( const QVector< ElectrodeShaft > & shafts)

Set electrode data from shaft definitions.

Parameters
[in]shaftsVector of electrode shafts.

Definition at line 88 of file electrodeobject.cpp.

◆ shaftIndexCount()

uint32_t ElectrodeObject::shaftIndexCount ( ) const
Returns
Number of shaft indices for drawIndexed.

Definition at line 482 of file electrodeobject.cpp.

◆ shafts()

const QVector< ElectrodeShaft > & ElectrodeObject::shafts ( ) const
Returns
Const reference to the current shafts.

Definition at line 98 of file electrodeobject.cpp.

◆ totalContactCount()

int ElectrodeObject::totalContactCount ( ) const
Returns
Total number of contacts across all shafts.

Definition at line 105 of file electrodeobject.cpp.

◆ updateBuffers()

void ElectrodeObject::updateBuffers ( QRhi * rhi,
QRhiResourceUpdateBatch * u )

Update GPU buffers (shaft vertex/index, contact instance) via QRhi.

Parameters
[in]rhiPointer to QRhi instance.
[in]uResource update batch.

Definition at line 390 of file electrodeobject.cpp.

◆ vertexBuffer()

QRhiBuffer * ElectrodeObject::vertexBuffer ( ) const
Returns
Shaft vertex buffer (position + normal interleaved, 6 floats/vertex).

Definition at line 461 of file electrodeobject.cpp.


The documentation for this class was generated from the following files: