Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoBlendElement.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20
21#ifndef _SO_BLEND_ELEMENT_H
22#define _SO_BLEND_ELEMENT_H
23
27#include <Inventor/SbEnums.h>
28
39{
41
42public:
47 {
48 ZERO = SbEnums::BLEND_ZERO,
49 ONE = SbEnums::BLEND_ONE,
50 SRC_COLOR = SbEnums::BLEND_SRC_COLOR,
51 ONE_MINUS_SRC_COLOR = SbEnums::BLEND_ONE_MINUS_SRC_COLOR,
52 DST_COLOR = SbEnums::BLEND_DST_COLOR,
53 ONE_MINUS_DST_COLOR = SbEnums::BLEND_ONE_MINUS_DST_COLOR,
54 SRC_ALPHA = SbEnums::BLEND_SRC_ALPHA,
55 ONE_MINUS_SRC_ALPHA = SbEnums::BLEND_ONE_MINUS_SRC_ALPHA,
56 DST_ALPHA = SbEnums::BLEND_DST_ALPHA,
57 ONE_MINUS_DST_ALPHA = SbEnums::BLEND_ONE_MINUS_DST_ALPHA,
58 CONSTANT_COLOR = SbEnums::BLEND_CONSTANT_COLOR,
59 ONE_MINUS_CONSTANT_COLOR = SbEnums::BLEND_ONE_MINUS_CONSTANT_COLOR,
60 CONSTANT_ALPHA = SbEnums::BLEND_CONSTANT_ALPHA,
61 ONE_MINUS_CONSTANT_ALPHA = SbEnums::BLEND_ONE_MINUS_CONSTANT_ALPHA,
62 SRC_ALPHA_SATURATE = SbEnums::BLEND_SRC_ALPHA_SATURATE,
63 SRC1_COLOR = SbEnums::BLEND_SRC1_COLOR,
64 ONE_MINUS_SRC1_COLOR = SbEnums::BLEND_ONE_MINUS_SRC1_COLOR,
65 SRC1_ALPHA = SbEnums::BLEND_SRC1_ALPHA,
66 ONE_MINUS_SRC1_ALPHA = SbEnums::BLEND_ONE_MINUS_SRC1_ALPHA
67 };
68
73 {
74 FUNC_ADD = SbEnums::BLEND_FUNC_ADD,
75 FUNC_SUBTRACT = SbEnums::BLEND_FUNC_SUBTRACT,
76 FUNC_REVERSE_SUBTRACT = SbEnums::BLEND_FUNC_REVERSE_SUBTRACT,
77 MIN = SbEnums::BLEND_FUNC_MIN,
78 MAX = SbEnums::BLEND_FUNC_MAX
79 };
80
110
114 static void set( SoState* state, const BlendElementParameters& parameters );
115
119 static void setBlending( SoState* state, bool enabled );
120
125 static void setFunction( SoState* state, const BlendFactor source, const BlendFactor destination );
126
130 static void get( SoState* state, BlendElementParameters& parameter );
131
135 virtual void print( FILE* fp ) const;
136
140 virtual void push( SoState* state );
141
145 virtual void pop( SoState* state, const SoElement* prevTopElement );
146
147private:
148 virtual ~SoBlendElement();
149
151 virtual void init( SoState* state );
152
156 virtual void setElt( const BlendElementParameters& parameter );
157
161 virtual SbBool matches( const SoElement* element ) const;
162
166 virtual SoElement* copyMatchInfo() const;
167
168private:
169
171 static void initClass();
172
174 static void exitClass();
175
176private:
178 BlendElementParameters m_parameters;
179};
180
181#endif // _SO_BLEND_ELEMENT_H
static void init()
#define SO_ELEMENT_HEADER(className)
ColorRGBA vector class.
Definition SbColorRGBA.h:61
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Stores the curre...
BlendEquation
Blend Equation as defined by OpenGL's glBlendEquation.
static void setBlending(SoState *state, bool enabled)
Enable or disable blending.
static void setFunction(SoState *state, const BlendFactor source, const BlendFactor destination)
Sets the blending function.
virtual void print(FILE *fp) const
Prints element (for debugging).
virtual void push(SoState *state)
Override push() method to keep GL up to date.
BlendFactor
BlendFactor as defined by OpenGL's glBlendFunc.
static void set(SoState *state, const BlendElementParameters &parameters)
Sets the blending parameters.
virtual void pop(SoState *state, const SoElement *prevTopElement)
Override pop() method to keep GL up to date.
static void get(SoState *state, BlendElementParameters &parameter)
Retrieves the current blending parameters.
Abstract base class for all state elements.
Definition SoElement.h:102
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87
BlendElementParameters packages all the different blending parameters.
bool operator!=(const BlendElementParameters &other) const
bool operator==(const BlendElementParameters &other) const