MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
SoSamplerInfoElement.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, 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_SAMPLER_INFO_ELEMENT_H
14#define SO_SAMPLER_INFO_ELEMENT_H
15
16
18
19#include "SoShaderSystem.h"
20#include <Inventor/elements/SoAccumulatedElement.h>
21#include <climits>
22#include <list>
23
26{
27public:
33
40
42 {
43 valid = FALSE;
44 }
46 {
47 this->valid = TRUE;
48 this->name = aName;
49 this->type = aType;
50 }
51
53 {
54 return valid;
55 }
56
57 int operator==(const SbSamplerInfo& i) const
58 {
59 return (name == i.name);
60 }
61};
62
64class INVENTOR_SHADER_API SoSamplerInfoElement : public SoAccumulatedElement
65{
66 typedef SoAccumulatedElement inherited;
67
68 SO_ELEMENT_HEADER(SoSamplerInfoElement);
69
70public:
72 void init(SoState* state) override;
73
75 static void add(SoState* state, SoNode* node, const SbSamplerInfo& info);
76
78 static void set(SoState* state, SoNode* node, const SbSamplerInfo& info);
79
81 static void clear(SoState* state, SoNode* node);
82
84 static const SbSamplerInfo& get(SoState* state);
85
87 void push(SoState* state) override;
88
90
92 static void initClass();
93
94protected:
96 std::list<SbSamplerInfo> _info;
97};
98
99#endif // _SO_SAMPLER_INFO_ELEMENT_
Open Inventor data type and element to store information about a (list of) SbSampler.
SbBool isValid() const
TextureType
Texture type.
int operator==(const SbSamplerInfo &i) const
TextureType type
Texture type.
SbString name
Sampler name.
SbBool valid
Default is invalid.
SbSamplerInfo(const SbString &aName, TextureType aType)
Element stores information about all current sampler nodes.
static void add(SoState *state, SoNode *node, const SbSamplerInfo &info)
Add info about sampler to list.
static void clear(SoState *state, SoNode *node)
Clear list.
void push(SoState *state) override
Override push() method.
static void set(SoState *state, SoNode *node, const SbSamplerInfo &info)
Truncate info list to zero length and set only this info.
static const SbSamplerInfo & get(SoState *state)
Returns last sampler info.
std::list< SbSamplerInfo > _info
sampler info.
static void initClass()
Initialize class with runtime type system.
void init(SoState *state) override
Initialize element.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.