MeVisLab Toolbox Reference
SoView2DShaderDiagnosis.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2015, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#pragma once
14
15#include <Inventor/nodes/SoSubNode.h>
16#include <Inventor/fields/SoSFEnum.h>
17#include <Inventor/fields/SoSFString.h>
18#include <Inventor/fields/SoSFBool.h>
20
22
23class ShaderPipeline;
24
25class SoView2DShaderDiagnosis: public SoNode
26{
27 SO_NODE_HEADER(SoView2DShaderDiagnosis);
28
29public:
31
33
35 static void initClass();
36
38
39 struct Settings
40 {
42 }
44 std::string customVertexShader;
45 };
46
49 {
50 public:
52 fragmentPipeline = nullptr;
53 }
54
55 std::string fragmentShader;
56 std::string vertexShader;
57 std::string fragmentShaderLog;
58 std::string vertexShaderLog;
59 std::string programLog;
63
64 std::vector<ml::OpenGL::TypeInfo> activeUniforms;
65 std::vector<ml::OpenGL::TypeInfo> availableBuiltInUniforms;
66 std::vector<ml::OpenGL::TypeInfo> availableExternalUniforms;
67 std::vector<ml::OpenGL::TypeInfo> availableFragmentShaderStateMembers;
68 std::vector<ml::OpenGL::TypeInfo> availableVaryingMembers;
69 std::vector<ml::OpenGL::TypeInfo> availableIncludes;
70
72
73 };
74
76
78
80
85
87
91
96
100
104
106
111
113
118
120
121
122private:
123 void setNamesToField(const std::vector<ml::OpenGL::TypeInfo>& list, SoSFString& field);
124 void addVariablesToString(const std::vector<ml::OpenGL::TypeInfo>& list, const std::string& type, std::string& result);
125 void addNamesToString(const std::vector<ml::OpenGL::TypeInfo>& list, std::string& names);
126 void setStringToField(const std::string& value, SoSFString& field);
127 void addTypesToString(const std::vector<ml::OpenGL::TypeInfo>& list, std::string& names);
128 void setTypesToField(const std::vector<ml::OpenGL::TypeInfo>& list, SoSFString& field);
129 void addSizesToString(const std::vector<ml::OpenGL::TypeInfo>& list, std::string& names);
130 void setSizesToField(const std::vector<ml::OpenGL::TypeInfo>& list, SoSFString& field);
131 void setPipelineToField(ShaderPipeline* pipeline, SoSFString& field);
132};
class that is used for returning advanced shader diagnosis
std::vector< ml::OpenGL::TypeInfo > activeUniforms
std::vector< ml::OpenGL::TypeInfo > availableIncludes
std::vector< ml::OpenGL::TypeInfo > availableFragmentShaderStateMembers
std::vector< ml::OpenGL::TypeInfo > availableBuiltInUniforms
std::vector< ml::OpenGL::TypeInfo > availableVaryingMembers
std::vector< ml::OpenGL::TypeInfo > availableExternalUniforms
virtual void setupDiagnosisSettings(Settings &settings)
void GLRender(SoGLRenderAction *action) override
static void initClass()
Initialization of inventor runtime system.
~SoView2DShaderDiagnosis() override
virtual void diagnosisResult(const ShaderDiagnosis &diagnosis)
Target mlrange_cast(Source arg)
Generic version of checked ML casts.