MeVisLab Resolution Independence API
SoBlendMode.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#ifndef SO_BLEND_MODE_H
14#define SO_BLEND_MODE_H
15
16#include "SoShaderSystem.h"
17#include <Inventor/nodes/SoSubNode.h>
18#include <Inventor/fields/SoSFBool.h>
19#include <Inventor/fields/SoSFEnum.h>
20#include <Inventor/fields/SoSFFloat.h>
21#include <Inventor/fields/SoSFColor.h>
22#include <Inventor/system/SbOpenGL.h>
23
25class INVENTOR_SHADER_API SoBlendMode : public SoNode
26{
27 typedef SoNode inherited;
28
29 SO_NODE_HEADER(SoBlendMode);
30
31 public:
44
45 enum Equation {
46 ADD = GL_FUNC_ADD,
47 SUBTRACT = GL_FUNC_SUBTRACT,
48 REVERSE_SUBTRACT = GL_FUNC_REVERSE_SUBTRACT
49 };
50
51 enum Function {
52 ZERO = GL_ZERO,
53 ONE = GL_ONE,
54 SRC_COLOR = GL_SRC_COLOR,
55 ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR,
56 DST_COLOR = GL_DST_COLOR,
57 ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR,
58 SRC_ALPHA = GL_SRC_ALPHA,
59 ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA,
60 DST_ALPHA = GL_DST_ALPHA,
61 ONE_MINUS_DST_ALPHA = GL_ONE_MINUS_DST_ALPHA,
62 CONSTANT_COLOR = GL_CONSTANT_COLOR,
63 ONE_MINUS_CONSTANT_COLOR = GL_ONE_MINUS_CONSTANT_COLOR,
64 CONSTANT_ALPHA = GL_CONSTANT_ALPHA,
65 ONE_MINUS_CONSTANT_ALPHA = GL_ONE_MINUS_CONSTANT_ALPHA,
66 SRC_ALPHA_SATURATE = GL_SRC_ALPHA_SATURATE
67 };
68
69 SoSFBool enabled;
70 SoSFEnum blendMode;
71
72 SoSFEnum blendEquation;
77
80
83
84 SoEXTENDER public:
85
87 void GLRender(SoGLRenderAction *action) override;
88
89 SoINTERNAL public:
90
92 static void initClass();
93};
94
95#endif
#define INVENTOR_SHADER_API
Define class export specifier.
Class SoBlendMode to manage the blending state in an Open Inventor node.
Definition SoBlendMode.h:26
SoSFEnum blendMode
Definition SoBlendMode.h:70
SoSFEnum blendEquation
Definition SoBlendMode.h:72
SoBlendMode()
Constructor.
SoSFEnum blendFunctionSrc
Definition SoBlendMode.h:73
SoSFEnum blendFunctionDst
Definition SoBlendMode.h:74
static void initClass()
Initialize class with runtime type system.
SoSFEnum alphaBlendFunctionSrc
Definition SoBlendMode.h:75
SoSFEnum alphaBlendFunctionDst
Definition SoBlendMode.h:76
SoSFColor constantBlendColor
Definition SoBlendMode.h:78
@ BLEND_PREMULTIPLIED_BLEND
Definition SoBlendMode.h:40
SoSFBool enabled
Definition SoBlendMode.h:69
void GLRender(SoGLRenderAction *action) override
Add this node to element in state.
SoSFFloat constantBlendAlpha
Definition SoBlendMode.h:79