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 
21 class SoShaderGLSL;
22 class ShaderPipelineInclude;
24 class SoView2DShaderCustomInclude: public ShaderPipelineInclude
25 {
26 public:
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 
47 private:
48  std::string _value;
49  bool _containsDefines;
50 };
51 
54 {
55 
56  class IncludeFunction;
57  class StructFunction;
58 
61  {
62  public:
63 
66 
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 }
static const std::string NamePrefix
Variables for names of the built-in includes.
~IncludeContainer()
Destructor. Clears the container.
void clear()
Deletes all contained includes.
const std::vector< const ShaderPipelineInclude * > & getIncludes()
Access to the includes stored in this container.
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)
const std::string & getValue() const
void appendDefinition(std::stringstream &str) const override
All includes implemented by the GVR itself shall be included in this namespace.