MeVisLab Resolution Independence API
Toggle main menu visibility
Loading...
Searching...
No Matches
SoGLVertexAttributeElement.h
Go to the documentation of this file.
1
/*************************************************************************************
2
**
3
** Copyright 2011, 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_GLVERTEX_ATTRIBUTE_ELEMENT_H
14
#define SO_GLVERTEX_ATTRIBUTE_ELEMENT_H
15
16
18
19
#include "
SoShaderSystem.h
"
20
#include <Inventor/elements/SoAccumulatedElement.h>
21
#include <Inventor/SoLists.h>
22
#include <Inventor/misc/SoVBO.h>
23
#include <vector>
24
26
struct
INVENTOR_SHADER_API
SoVertexAttributeInfo
27
{
28
public
:
29
SoVertexAttributeInfo
();
30
32
SbString
_name
;
33
35
SoNode*
_node
;
36
38
const
void
*
_data
;
40
uint32_t
_numBytes
;
42
uint32_t
_numValues
;
43
45
bool
_perInstance
;
46
48
GLenum
_type
;
50
int
_numComponents
;
52
bool
_normalized
;
53
55
SoVBO
_vbo
;
56
59
GLint
_index
;
60
62
bool
_shouldFlipRGBAOnLittleEndian
;
63
};
64
65
class
SoVertexShape;
66
class
SoGLRenderAction;
67
69
class
INVENTOR_SHADER_API
SoGLVertexAttributeElement
:
public
SoAccumulatedElement
70
{
71
typedef
SoAccumulatedElement inherited;
72
73
SO_ELEMENT_HEADER(
SoGLVertexAttributeElement
);
74
75
public
:
76
typedef
std::vector<SoVertexAttributeInfo*>
AttributeList
;
77
79
void
init
(SoState* state)
override
;
80
82
static
void
add
(SoState* state,
SoVertexAttributeInfo
* info);
83
85
static
void
clear
(SoState* state, SoNode* node);
86
88
static
const
AttributeList
&
get
(SoState* state);
89
91
void
push
(SoState* state)
override
;
92
93
SoINTERNAL public :
94
96
static
void
initClass
();
97
98
protected
:
99
static
void
enableVertexAttributesCB
(SoNode* shape, SoGLRenderAction* action,
bool
useVbo, uint32_t numVertices);
100
static
void
disableVertexAttributesCB
(SoNode* shape, SoGLRenderAction* action,
bool
useVbo, uint32_t numVertices);
101
103
AttributeList
_attributes
;
104
};
105
106
#endif
SoShaderSystem.h
INVENTOR_SHADER_API
#define INVENTOR_SHADER_API
Define class export specifier.
Definition
SoShaderSystem.h:20
SoGLVertexAttributeElement
Open Inventor element storing a list of shader parameter nodes.
Definition
SoGLVertexAttributeElement.h:70
SoGLVertexAttributeElement::initClass
static void initClass()
Initialize class with runtime type system.
SoGLVertexAttributeElement::_attributes
AttributeList _attributes
List of vertex attributes.
Definition
SoGLVertexAttributeElement.h:103
SoGLVertexAttributeElement::get
static const AttributeList & get(SoState *state)
Returns the current list of vertex attributes from the state.
SoGLVertexAttributeElement::init
void init(SoState *state) override
Initialize element.
SoGLVertexAttributeElement::add
static void add(SoState *state, SoVertexAttributeInfo *info)
Add vertex attribute info to the list (replacing an info with the same name).
SoGLVertexAttributeElement::AttributeList
std::vector< SoVertexAttributeInfo * > AttributeList
Definition
SoGLVertexAttributeElement.h:76
SoGLVertexAttributeElement::push
void push(SoState *state) override
Overrides push() method to copy values from next instance in the stack.
SoGLVertexAttributeElement::enableVertexAttributesCB
static void enableVertexAttributesCB(SoNode *shape, SoGLRenderAction *action, bool useVbo, uint32_t numVertices)
SoGLVertexAttributeElement::disableVertexAttributesCB
static void disableVertexAttributesCB(SoNode *shape, SoGLRenderAction *action, bool useVbo, uint32_t numVertices)
SoGLVertexAttributeElement::clear
static void clear(SoState *state, SoNode *node)
Clear list.
SoVertexAttributeInfo
Open Inventor element storing a list of vertex attributes.
Definition
SoGLVertexAttributeElement.h:27
SoVertexAttributeInfo::_perInstance
bool _perInstance
set if data should be used for instanced rendering
Definition
SoGLVertexAttributeElement.h:45
SoVertexAttributeInfo::_name
SbString _name
the name of the attribute
Definition
SoGLVertexAttributeElement.h:32
SoVertexAttributeInfo::_numBytes
uint32_t _numBytes
the number of bytes in _data
Definition
SoGLVertexAttributeElement.h:40
SoVertexAttributeInfo::_shouldFlipRGBAOnLittleEndian
bool _shouldFlipRGBAOnLittleEndian
indicates the 4ub data should be flipped
Definition
SoGLVertexAttributeElement.h:62
SoVertexAttributeInfo::_node
SoNode * _node
the node that holds the attribute
Definition
SoGLVertexAttributeElement.h:35
SoVertexAttributeInfo::_data
const void * _data
a pointer to the data (not owned by this object)
Definition
SoGLVertexAttributeElement.h:38
SoVertexAttributeInfo::_normalized
bool _normalized
a flag if the attribute should be normalized by GL
Definition
SoGLVertexAttributeElement.h:52
SoVertexAttributeInfo::_numValues
uint32_t _numValues
the number of values in _data
Definition
SoGLVertexAttributeElement.h:42
SoVertexAttributeInfo::_index
GLint _index
Definition
SoGLVertexAttributeElement.h:59
SoVertexAttributeInfo::_vbo
SoVBO _vbo
a VBO to manage the data
Definition
SoGLVertexAttributeElement.h:55
SoVertexAttributeInfo::_numComponents
int _numComponents
the number of components for GL
Definition
SoGLVertexAttributeElement.h:50
SoVertexAttributeInfo::_type
GLenum _type
the GL data type to use for sending
Definition
SoGLVertexAttributeElement.h:48
SoVertexAttributeInfo::SoVertexAttributeInfo
SoVertexAttributeInfo()
MeVisLab
Standard
Sources
Inventor
SoShader
Inventor
elements
SoGLVertexAttributeElement.h
Generated by
1.18.0