Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
SoShaderGenerator.h
1 #ifndef COIN_SOSHADERGENERATOR_H
2 #define COIN_SOSHADERGENERATOR_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
36 #ifndef COIN_INTERNAL
37 #error this is a private header file
38 #endif /* !COIN_INTERNAL */
39 
40 #include <Inventor/SbString.h>
41 
42 class SbName;
43 
45 public:
46 
47  SoShaderGenerator(void);
49 
50  void reset(const SbBool freeoldstrings);
51 
52  void setVersion(const SbString & str);
53  void addDefine(const SbString & str, const SbBool checkexists);
54  void addDeclaration(const SbString & str, const SbBool checkexists);
55  void addFunction(const SbString & str, const SbBool checkexists);
56  void addNamedFunction(const SbName & name, const SbBool checkexists);
57 
58  void addMainStatement(const SbString & str);
59 
60  const SbString & getShaderProgram(void);
61 
62 private:
63  SbString version;
64  SbString defines;
65  SbString declarations;
66  SbString functions;
67  SbString main;
68 
69  SbBool dirty;
70  SbString combined;
71 };
72 
73 #endif // COIN_SOSHADERGENERATOR_H
~SoShaderGenerator()
Definition: SoShaderGenerator.cpp:60
void addDefine(const SbString &str, const SbBool checkexists)
Definition: SoShaderGenerator.cpp:88
void addFunction(const SbString &str, const SbBool checkexists)
Definition: SoShaderGenerator.cpp:114
void addMainStatement(const SbString &str)
Definition: SoShaderGenerator.cpp:145
The SoShaderGenerator class is used for simplifying the process of generating shader scripts...
Definition: SoShaderGenerator.h:44
void addDeclaration(const SbString &str, const SbBool checkexists)
Definition: SoShaderGenerator.cpp:101
const SbString & getShaderProgram(void)
Definition: SoShaderGenerator.cpp:156
SoShaderGenerator(void)
Definition: SoShaderGenerator.cpp:52
void addNamedFunction(const SbName &name, const SbBool checkexists)
Definition: SoShaderGenerator.cpp:127
The SbString class is a string class with convenience functions for string operations.This is the class used for storing and working with character strings. It automatically takes care of supporting all the "bookkeeping" tasks usually associated with working with character strings, like memory allocation and deallocation etc.
Definition: SbString.h:52
The SbName class stores strings by reference.The class is used by Coin for storing keywords...
Definition: SbName.h:40