MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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 {
29 _containsDefines = false;
30 }
31
34
35 void appendDefinition(std::stringstream& str) const override
36 {
37 str << _value;
38 }
39
40 void setValue(const std::string& value)
41 {
42 _value = value;
43 }
44
46 {
47 _containsDefines = containsDefines;
48 }
49
50 const std::string& getValue() const
51 {
52 return _value;
53 }
54
56 bool containsDefines() const override
57 {
58 return _containsDefines;
59 }
60
61private:
62 std::string _value;
63 bool _containsDefines;
64};
65
68{
69
70 class IncludeFunction;
71 class StructFunction;
72
75 {
76 public:
79
82
85 static const std::string NamePrefix;
86 static const std::string FetchOverlayCubic;
88
90 const std::vector<const ShaderPipelineInclude*>& getIncludes()
91 {
92 return _includes;
93 }
94
96 void setup();
97
99 void clear();
100
101 private:
103 IncludeFunction* addFunction(const std::string& returnType, const std::string& name,
104 const std::string& parameterString, const std::string& body);
105
106 StructFunction* addStruct(const std::string& name, const std::string& members);
107
109 std::vector<const ShaderPipelineInclude*> _includes;
110 };
111} // namespace SoView2DShaderBuiltInIncludes
static const std::string NamePrefix
Variables for names of the built-in includes.
const std::vector< const ShaderPipelineInclude * > & getIncludes()
Access to the includes stored in this container.
~IncludeContainer()
Destructor. Clears the container.
void clear()
Deletes all contained includes.
void setup()
Initialize the container.
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
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
All includes implemented by the GVR itself shall be included in this namespace.