Open Inventor Reference
SoShapeStyleElement.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) 1995-96 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 SoShapeStyleElement class.
48  | It takes values from the following:
49  | SoDrawStyleElement
50  | SoComplexityTypeElement
51  | SoGLTextureEnabledElement
52  | SoLazyElement
53  | TransparencyType field of SoGLRenderAction
54  | CoordType of SoTextureCoordinateElement
55  | number and value of SoTransparencyElement
56  | to determine
57  | whether to use fast-path rendering, and
58  | which fast-path rendering code to use
59  |
60  | Author(s) : Alan Norton, Gavin Bell
61  |
62  ______________ S I L I C O N G R A P H I C S I N C . ____________
63  _______________________________________________________________________
64  */
65 
66 #ifndef _SO_SHAPE_STYLE_ELEMENT
67 #define _SO_SHAPE_STYLE_ELEMENT
68 
71 
72 
73 
92 
94 
96 
97  public:
98 
102 
104  static const SoShapeStyleElement * get(SoState *state);
105 
107  bool mightNotRender() const { return delayFlags!=0; }
108 
110  bool needNormals() const { return needNorms; }
111 
113  bool needTexCoords() const
114  { return (texEnabled && (!texFunc)); }
115 
120  int getRenderCaseMask() const
121  { return renderCaseMask; }
122 
124 
125  static void setDrawStyle(SoState *state, int32_t value);
126  static void setComplexityType(SoState *state, int32_t value);
127  static void setTransparencyType(SoState *state, int32_t value);
128  static void setTextureEnabled(SoState *state, bool value);
129  static void setTextureFunction(SoState *state, bool value);
130  static void setLightModel(SoState *state, int32_t value);
133  static void setOverrides(SoState *state, bool value);
134 
135  static bool isScreenDoor(SoState *state);
136 
137  SoINTERNAL public:
138  bool isTextureFunction() const
139  {return texFunc;}
140  virtual void init(SoState *state);
141  virtual bool matches(const SoElement *elt) const;
142  virtual void push(SoState *state);
143  virtual SoElement *copyMatchInfo() const;
144  static void initClass();
145  virtual void print(FILE *fp) const;
146 
147  protected:
149 
150  private:
151  int delayFlags;
152  bool needNorms;
153  bool texEnabled, texFunc;
154  int renderCaseMask;
155 };
156 
157 #endif /* _SO_SHAPE_STYLE_ELEMENT */
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
Definition: SbBasic.h:154
#define SoINTERNAL
Definition: SbBasic.h:155
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Definition: SbSystem.h:81
signed int int32_t
Definition: SbTypeDefs.h:43
#define SO_ELEMENT_HEADER(className)
This one is for non-abstract element classes.
Definition: SoSubElement.h:112
This is the abstract base class for all state elements.
Definition: SoElement.h:96
This elements stores some information shapes need to quickly determine whether or not they should ren...
static void setTextureFunction(SoState *state, bool value)
static bool isScreenDoor(SoState *state)
static void setLightModel(SoState *state, int32_t value)
virtual SoElement * copyMatchInfo() const
Create a copy that we can put in a cache used list and call matches() on later.
virtual void init(SoState *state)
Initializes element.
static void setDrawStyle(SoState *state, int32_t value)
API USED BY OTHER ELEMENTS:
static void setComplexityType(SoState *state, int32_t value)
virtual void print(FILE *fp) const
Prints element (for debugging)
static void setTransparencyType(SoState *state, int32_t value)
static const SoShapeStyleElement * get(SoState *state)
API USED BY SHAPES:
static void setOverrides(SoState *state, bool value)
Set value is TRUE if either diffuse, transparency, or materialbinding are overridden; otherwise FALSE...
bool mightNotRender() const
Returns TRUE if shapes may not render for some reason:
static void initClass()
virtual ~SoShapeStyleElement()
static void setTextureEnabled(SoState *state, bool value)
bool needTexCoords() const
Returns TRUE if need texture coordinates:
virtual void push(SoState *state)
Pushes/pops element.
bool needNormals() const
Returns TRUE if need normals:
int getRenderCaseMask() const
Returns a mask that can be used by the SoVertexPropertyCache class (see SoVertexProperty....
virtual bool matches(const SoElement *elt) const
Returns TRUE if the element matches another element (of the same class, presumably) with respect to c...
bool isTextureFunction() const
An SoState collects and holds state while traversing a scene graph.
Definition: SoState.h:82