MeVisLab Toolbox Reference
SoView2DShaderBuiltInIncludes.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 <vector>
16#include <string>
17
18#include <ShaderPipeline/ShaderPipelineInclude.h>
20
21class SoShaderGLSL;
22class ShaderPipelineInclude;
24class SoView2DShaderCustomInclude: public ShaderPipelineInclude
25{
26public:
28 _containsDefines = false;
29 }
30
32
33 void appendDefinition(std::stringstream& str) const override
34 {
35 str << _value;
36 }
37
38 void setValue(const std::string& value) { _value = value; }
39
40 void setContainsDefines(bool containsDefines) { _containsDefines = containsDefines; }
41
42 const std::string& getValue() const { return _value; }
43
45 bool containsDefines() const override { return _containsDefines; }
46
47private:
48 std::string _value;
49 bool _containsDefines;
50};
51
54{
55
56 class IncludeFunction;
57 class StructFunction;
58
60 class IncludeContainer
61 {
62 public:
63
65 IncludeContainer();
66
68 ~IncludeContainer();
69
72 static const std::string NamePrefix;
73 static const std::string FetchOverlayCubic;
75
77 const std::vector<const ShaderPipelineInclude*>& getIncludes() { return _includes; }
78
80 void setup();
81
83 void clear();
84
85 private:
86
88 IncludeFunction* addFunction(const std::string& returnType,
89 const std::string& name,
90 const std::string& parameterString,
91 const std::string& body);
92
93 StructFunction* addStruct(const std::string& name, const std::string& members);
94
96 std::vector<const ShaderPipelineInclude*> _includes;
97 };
98}
The helper class for the include which is added to the GVR.
bool containsDefines() const override
Defines are places on the top of the shader.
void setValue(const std::string &value)
void setContainsDefines(bool containsDefines)
void appendDefinition(std::stringstream &str) const override
All includes implemented by the GVR itself shall be included in this namespace.