MNE-CPP  0.1.9
A Framework for Electrophysiology
networkmaterial.cpp
Go to the documentation of this file.
1 //=============================================================================================================
35 //=============================================================================================================
36 // INCLUDES
37 //=============================================================================================================
38 
39 #include "networkmaterial.h"
40 
41 //=============================================================================================================
42 // QT INCLUDES
43 //=============================================================================================================
44 
45 #include <Qt3DRender/qshaderprogram.h>
46 #include <QFilterKey>
47 
48 #include <QUrl>
49 #include <QVector3D>
50 #include <QVector4D>
51 
52 //=============================================================================================================
53 // USED NAMESPACES
54 //=============================================================================================================
55 
56 using namespace DISP3DLIB;
57 using namespace Qt3DRender;
58 
59 //=============================================================================================================
60 // DEFINE MEMBER METHODS
61 //=============================================================================================================
62 
63 NetworkMaterial::NetworkMaterial(bool bUseSortPolicy, QNode *parent)
64 : AbstractPhongAlphaMaterial(bUseSortPolicy, parent)
65 , m_pVertexGL3Shader(new QShaderProgram())
66 , m_pVertexES2Shader(new QShaderProgram())
67 {
68  init();
69  setShaderCode();
70 }
71 
72 //=============================================================================================================
73 
74 void NetworkMaterial::setShaderCode()
75 {
76  m_pVertexGL3Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/engine/model/materials/shaders/gl3/network.vert"))));
77  m_pVertexGL3Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/engine/model/materials/shaders/gl3/network.frag"))));
78 
79  m_pVertexES2Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/engine/model/materials/shaders/es2/network.vert"))));
80  m_pVertexES2Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/engine/model/materials/shaders/es2/network.frag"))));
81 
82  addShaderToRenderPass(QStringLiteral("pVertexGL3RenderPass"), m_pVertexGL3Shader);
83  addShaderToRenderPass(QStringLiteral("pVertexGL2RenderPass"), m_pVertexES2Shader);
84  addShaderToRenderPass(QStringLiteral("pVertexES2RenderPass"), m_pVertexES2Shader);
85 }
86 
87 //=============================================================================================================
DISP3DLIB::NetworkMaterial::NetworkMaterial
NetworkMaterial(bool bUseSortPolicy=false, Qt3DCore::QNode *parent=nullptr)
Definition: networkmaterial.cpp:63
networkmaterial.h
NetworkMaterial class declaration.
DISP3DLIB::AbstractPhongAlphaMaterial::init
virtual void init()
Definition: abstractphongalphamaterial.cpp:108
DISP3DLIB::AbstractPhongAlphaMaterial
This abstract class is used as a base class for all materials that are using the phong alpha lightini...
Definition: abstractphongalphamaterial.h:84
DISP3DLIB::AbstractPhongAlphaMaterial::addShaderToRenderPass
virtual void addShaderToRenderPass(const QString &sObjectName, Qt3DRender::QShaderProgram *pShaderProgramm)
Definition: abstractphongalphamaterial.cpp:161