| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

SoMultiTextureEnabledElement.h
1 #ifndef COIN_SOMULTITEXTUREENABLEDELEMENT_H
2 #define COIN_SOMULTITEXTUREENABLEDELEMENT_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/elements/SoElement.h>
28 #include <Inventor/elements/SoSubElement.h>
29
30 class SoMultiTextureEnabledElementP;
31
32 class COIN_DLL_API SoMultiTextureEnabledElement : public SoElement {
33 typedef SoElement inherited;
34
35 SO_ELEMENT_HEADER(SoMultiTextureEnabledElement);
36 public:
37 static void initClass(void);
38 protected:
39 virtual ~SoMultiTextureEnabledElement();
40
41 public:
42 enum Mode {
43 DISABLED,
44 TEXTURE2D,
45 RECTANGLE,
46 CUBEMAP,
47 TEXTURE3D
48 };
49
50 virtual void init(SoState * state);
51 static void set(SoState * state, SoNode * node,
52 const int unit,
53 const SbBool enabled);
54
55 static SbBool get(SoState * state, const int unit);
56
57 virtual void setElt(const int unit, const int mode);
58
59 virtual void push(SoState * state);
60 virtual SbBool matches(const SoElement * elem) const;
61 SoElement * copyMatchInfo(void) const;
62
63 static const SbBool * getEnabledUnits(SoState * state,
64 int & lastenabled);
65 static const Mode * getActiveUnits(SoState * state,
66 int & lastenabled);
67
68 static void enableRectangle(SoState * state, SoNode * node, const int unit);
69 static void enableCubeMap(SoState * state, SoNode * node, const int unit);
70 static Mode getMode(SoState * state, const int unit);
71 static void disableAll(SoState * state);
72
73 protected:
74 SbBool isEnabled(const int unit) const;
75 Mode getMode(const int unit) const;
76
77 private:
78 SoMultiTextureEnabledElementP * pimpl;
79 };
80
81 #endif // !COIN_SOMULTITEXTUREENABLEDELEMENT_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.