Open Inventor Reference
SoShininessElement.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 * Copyright (C) 1990,91 Silicon Graphics, Inc.
39 *
40 _______________________________________________________________________
41 ______________ S I L I C O N G R A P H I C S I N C . ____________
42 |
43 | $Revision: 1.1.1.1 $
44 |
45 | Description:
46 | This file defines the SoShininessElement class.
47 |
48 | Author(s) : Paul S. Strauss
49 |
50 ______________ S I L I C O N G R A P H I C S I N C . ____________
51 _______________________________________________________________________
52 */
53#ifdef IV_STRICT
54#error SoShininessElement is obsolete. See SoLazyElement.h instead.
55#endif /*IV_STRICT*/
56#ifndef _SO_SHININESS_ELEMENT
57#define _SO_SHININESS_ELEMENT
58
59
63
73
75
76
77 public:
78
80 static void set(SoState *state, SoNode *,
81 int32_t numShininesses, const float *shininesses)
82 {
83 SoLazyElement::setShininess(state, *shininesses);
84#ifdef DEBUG
85 if(numShininesses>1){
86 SoDebugError::post("SoShininessElement::set",
87 "multiple shininess not supported");
88 }
89#endif /*DEBUG*/
90 }
91
93 static const SoShininessElement * getInstance(SoState *state)
94 {
96 se->saveState = state;
97 return(se);
98 }
99
101 int32_t getNum() const { return 1; }
102
104 float get(int index) const
105 {
106#ifdef DEBUG
107 if(index >1)
108 SoDebugError::post("SoShininessElement::get",
109 "multiple shininess values not supported");
110#endif /*DEBUG*/
111 return(SoLazyElement::getShininess(saveState));
112 }
113
114
116 static float getDefault()
118
119
120 private:
121 SoState * saveState;
122};
123
124#endif /* _SO_SHININESS_ELEMENT */
125
#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
static void post(const char *methodName, const char *formatString ...)
Posts an error.
static void setShininess(SoState *state, float value)
static float getDefaultShininess()
static float getShininess(SoState *)
Abstract base class for all database nodes.
Definition SoNode.h:103
Mostly superceded by SoLazyElement.
float get(int index) const
Returns the indexed shininess from an element.
static void set(SoState *state, SoNode *, int32_t numShininesses, const float *shininesses)
Sets the current shininess(es)
int32_t getNum() const
Returns the number of shininess values in an instance.
static const SoShininessElement * getInstance(SoState *state)
Returns the top (current) instance of the element in the state.
static float getDefault()
Returns the default shininess.
An SoState collects and holds state while traversing a scene graph.
Definition SoState.h:82