Open Inventor Reference
SoEmissiveColorElement.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
27 * Mountain View, CA 94043, or:
28 *
29 * http://www.sgi.com
30 *
31 * For further information regarding this notice, see:
32 *
33 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
34 *
35 */
36
37
38/*
39 * Copyright (C) 1990,91 Silicon Graphics, Inc.
40 *
41 _______________________________________________________________________
42 ______________ S I L I C O N G R A P H I C S I N C . ____________
43 |
44 | $Revision: 1.1.1.1 $
45 |
46 | Description:
47 | This file defines the SoEmissiveColorElement class.
48 |
49 | Author(s) : Paul S. Strauss
50 |
51 ______________ S I L I C O N G R A P H I C S I N C . ____________
52 _______________________________________________________________________
53 */
54#ifdef IV_STRICT
55#error SoEmissiveColorElement is obsolete. See SoLazyElement instead.
56#endif /*IV_STRICT*/
57#ifndef _SO_EMISSIVE_COLOR_ELEMENT
58#define _SO_EMISSIVE_COLOR_ELEMENT
59
60
61#include <Inventor/SbColor.h>
65
77
79
80
81 public:
82
84 static void set(SoState *state, SoNode *,
85 int32_t numColors, const SbColor *colors)
86 {
87 SoLazyElement::setEmissive(state,colors);
88#ifdef DEBUG
89 if(numColors>1){
90 SoDebugError::post("SoEmissiveColorElement::set",
91 "multiple emissive colors not supported");
92 }
93#endif /*DEBUG*/
94 }
95
96
99 {
101 ece->saveState = state;
102 return(ece);
103 }
104
105
107 int32_t getNum() const { return 1; }
108
110 const SbColor & get(int index) const
111 {
112#ifdef DEBUG
113 if(index >1)
114 SoDebugError::post("SoEmissiveColorElement::get",
115 "multiple emissive colors not supported");
116#endif /*DEBUG*/
117 return(SoLazyElement::getEmissive(saveState));
118 }
119
123
124 private:
125 SoState* saveState;
126};
127
128#endif /* _SO_EMISSIVE_COLOR_ELEMENT */
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
Definition SbBasic.h:154
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Definition SbSystem.h:77
signed int int32_t
Definition SbTypeDefs.h:43
Color vector class.
Definition SbColor.h:84
static void post(const char *methodName, const char *formatString ...)
Posts an error.
This class is being superceded by the SoLazyElement class.
static const SoEmissiveColorElement * getInstance(SoState *state)
Returns the top (current) instance of the element in the state.
const SbColor & get(int index) const
Returns the current emissive color.
int32_t getNum() const
Returns the number of emissive colors in any instance.
static SbColor getDefault()
Returns the default emissive color.
static void set(SoState *state, SoNode *, int32_t numColors, const SbColor *colors)
Sets the current emissive color(s)
static const SbColor & getEmissive(SoState *)
static SbColor getDefaultEmissive()
static void setEmissive(SoState *state, const SbColor *color)
Abstract base class for all database nodes.
Definition SoNode.h:103
An SoState collects and holds state while traversing a scene graph.
Definition SoState.h:82