Coin  4.0.10
Coin3D core library
Loading...
Searching...
No Matches
SoGLMultiTextureImageElement.h
1#ifndef COIN_SOGLMULTITEXTUREIMAGEELEMENT_H
2#define COIN_SOGLMULTITEXTUREIMAGEELEMENT_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#include <Inventor/elements/SoMultiTextureImageElement.h>
37#include <cstdlib>
38
39class SoGLImage;
40class SoGLDisplayList;
41class SoGLMultiTextureImageElementP;
42
45
46 SO_ELEMENT_HEADER(SoGLMultiTextureImageElement);
47public:
48 static void initClass(void);
49protected:
51
52public:
53 void init(SoState * state) override;
54 void push(SoState * state) override;
55 void pop(SoState * state, const SoElement * prevTopElement) override;
56
57 static void set(SoState * const state, SoNode * const node,
58 const int unit,
59 SoGLImage * image, const Model model,
60 const SbColor & blendColor);
61
62 static void restore(SoState * state, const int unit);
63
64 static SoGLImage * get(SoState * state,
65 const int unit,
66 Model & model,
67 SbColor & blendcolor);
68
69 class GLUnitData {
70 public:
71 GLUnitData() : glimage(NULL) {}
72 GLUnitData(const GLUnitData & org) : glimage(org.glimage) {}
73 SoGLImage * glimage;
74 };
75
76 static SbBool hasTransparency(SoState * state);
77
78 protected:
79 SbBool hasTransparency(const int unit = 0) const override;
80
81private:
82 void updateGL(const int unit);
83 SoGLMultiTextureImageElementP * pimpl;
84
85 public: // Coin-3 support
86
87 static void set(SoState * const state, SoNode * const node,
88 SoGLImage * image, const Model model,
89 const SbColor & blendColor) {
90 set(state, node, 0, image, model, blendColor);
91 }
92
93 static SoGLImage * get(SoState * state, Model & model,
94 SbColor & blendcolor) {
95 return get(state, 0, model, blendcolor);
96 }
97 static int32_t getMaxGLTextureSize(void);
98};
99
100#endif // !COIN_SOGLMULTITEXTUREIMAGEELEMENT_H
The SbColor class contains the red, green and blue components which make up a color value.
Definition SbColor.h:39
SoElement is the abstract base class for all elements.
Definition SoElement.h:43
virtual void pop(SoState *state, const SoElement *prevTopElement)
Definition SoElement.cpp:585
The SoGLDisplayList class stores and manages OpenGL display lists.
Definition SoGLDisplayList.h:43
The SoGLImage class is used to handle OpenGL 2D/3D textures.
Definition SoGLImage.h:53
Definition SoGLMultiTextureImageElement.h:69
The SoGLMultiTextureImageElement class is used to control the current GL texture for texture units.
Definition SoGLMultiTextureImageElement.h:43
The SoMultiTextureImageElement class is yet to be documented.
Definition SoMultiTextureImageElement.h:44
void push(SoState *state) override
Definition SoMultiTextureImageElement.cpp:340
static void initClass(void)
Definition SoMultiTextureImageElement.cpp:84
static void set(SoState *const state, SoNode *const node, const int unit, const SbVec2s &size, const int numComponents, const unsigned char *bytes, const Wrap wrapS, const Wrap wrapT, const Model model, const SbColor &blendColor)
FIXME: write doc.
Definition SoMultiTextureImageElement.cpp:123
virtual SbBool hasTransparency(const int unit=0) const
Definition SoMultiTextureImageElement.cpp:292
void init(SoState *state) override
Definition SoMultiTextureImageElement.cpp:103
static const unsigned char * get(SoState *const state, const int unit, SbVec2s &size, int &numComponents, Wrap &wrapS, Wrap &wrapT, Model &model, SbColor &blendColor)
FIXME: write doc.
Definition SoMultiTextureImageElement.cpp:168
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:56
The SoState class manages the Coin scene graph traversal state data.
Definition SoState.h:44