42#include "../common/metatreeitem.h"
43#include "../../3dhelpers/renderable3Dentity.h"
44#include "../../materials/pervertexphongalphamaterial.h"
45#include "../../materials/shownormalsmaterial.h"
46#include "../../3dhelpers/custommesh.h"
65using namespace DISP3DLIB;
75, m_sColorInfoOrigin(
"Color from curvature")
84 this->setToolTip(
"Brain hemisphere surface item");
92 QList<QStandardItem*> list;
104 data.setValue(QColor(50,50,50));
118 data.setValue(QColor(125,125,125));
137 Qt3DRender::QGeometryRenderer::Triangles);
143 data.setValue(matCurvatureColor);
144 this->
setData(data, Data3DTreeModelItemRoles::SurfaceCurrentColorVert);
146 data.setValue(tSurface.
curv());
147 this->
setData(data, Data3DTreeModelItemRoles::SurfaceCurv);
149 data.setValue(tSurface.
rr().rows());
150 this->
setData(data, Data3DTreeModelItemRoles::NumberVertices);
153 QList<QStandardItem*> list;
156 itemSurfFileName->setEditable(
false);
158 list << itemSurfFileName;
159 list <<
new QStandardItem(itemSurfFileName->toolTip());
160 this->appendRow(list);
162 itemSurfFileName->
setData(data, MetaTreeItemRoles::SurfaceFileName);
190 const QColor& colSulci,
191 const QColor& colGyri)
193 MatrixX4f colors(curvature.rows(), 4);
195 for(
int i = 0; i < colors.rows(); ++i) {
197 if(curvature(i) >= 0) {
198 colors(i,0) = colSulci.redF();
199 colors(i,1) = colSulci.greenF();
200 colors(i,2) = colSulci.blueF();
201 colors(i,3) = colSulci.alphaF();
203 colors(i,0) = colGyri.redF();
204 colors(i,1) = colGyri.greenF();
205 colors(i,2) = colGyri.blueF();
206 colors(i,3) = colGyri.alphaF();
219 MatrixX4f matNewVertColor;
223 QColor colorSulci =
m_pItemSurfColSulci->data(MetaTreeItemRoles::SurfaceColorSulci).value<QColor>();
224 QColor colorGyri =
m_pItemSurfColGyri->data(MetaTreeItemRoles::SurfaceColorGyri).value<QColor>();
226 matNewVertColor =
createCurvatureVertColor(this->data(Data3DTreeModelItemRoles::SurfaceCurv).value<VectorXf>(), colorSulci, colorGyri);
228 data.setValue(matNewVertColor);
229 this->
setData(data, Data3DTreeModelItemRoles::SurfaceCurrentColorVert);
237 for(
int i = 0; i < this->QStandardItem::parent()->rowCount(); ++i) {
238 if(this->QStandardItem::parent()->child(i,0)->type() == Data3DTreeModelItemTypes::AnnotationItem) {
239 matNewVertColor = this->QStandardItem::parent()->child(i,0)->data(Data3DTreeModelItemRoles::AnnotColors).value<MatrixX4f>();
242 data.setValue(matNewVertColor);
243 this->
setData(data, Data3DTreeModelItemRoles::SurfaceCurrentColorVert);
Surface class declaration.
FsSurfaceTreeItem class declaration.
virtual void setPosition(const QVector3D &position)
void setAlpha(float fAlpha)
QPointer< MetaTreeItem > m_pItemAppearanceOptions
Provides a generic mesh tree item.
virtual void setData(const QVariant &value, int role=Qt::UserRole+1)
QPointer< CustomMesh > m_pCustomMesh
QPointer< Qt3DRender::QMaterial > m_pMaterial
Provides a generic brain tree item.
void dataChanged(const QVariant &data)
void setData(const QVariant &value, int role=Qt::UserRole+1)
void addData(const FSLIB::Surface &tSurface)
QPointer< MetaTreeItem > m_pItemSurfColGyri
QPointer< MetaTreeItem > m_pItemSurfColSulci
FsSurfaceTreeItem(Qt3DCore::QEntity *p3DEntityParent=0, int iType=Data3DTreeModelItemTypes::SurfaceItem, const QString &text="Surface")
static Eigen::MatrixX4f createCurvatureVertColor(const Eigen::VectorXf &curvature, const QColor &colSulci=QColor(50, 50, 50), const QColor &colGyri=QColor(125, 125, 125))
void onColorInfoOriginOrCurvColorChanged()
QString m_sColorInfoOrigin
void onAnnotationVisibilityChanged(bool isVisible)
PerVertexPhongAlphaMaterial is provides a Qt3D material with own shader support.
const Eigen::MatrixX3f & nn() const
const Eigen::Vector3f & offset() const
const Eigen::MatrixX3f & rr() const
const Eigen::VectorXf & curv() const
const Eigen::MatrixX3i & tris() const