Open Inventor Reference
SoGLTextureCoordinateElement.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  | Subclass of TextureCoordinateElement that also support GL
48  | rendering-- it has send() methods, and has a getType() that can
49  | return NONE, meaning shapes don't have to do anything to get
50  | texture coordinates generated for them (the GL's TexGen will do
51  | it for them).
52  |
53  | Author(s) : Gavin Bell
54  |
55  ______________ S I L I C O N G R A P H I C S I N C . ____________
56  _______________________________________________________________________
57  */
58 
59 #ifndef _SO_GL_TEXTURE_COORDINATE_ELEMENT
60 #define _SO_GL_TEXTURE_COORDINATE_ELEMENT
61 
62 #include <Inventor/SbLinear.h>
64 
73 
83 typedef void SoTexCoordTexgenCB(void *userdata);
84 
87 
89 
90  public:
92  virtual void init(SoState *state);
93 
103  static void setTexGen(SoState *state, SoNode *node,
104  SoTexCoordTexgenCB *texGenFunc, void *texGenData = NULL,
105  SoTextureCoordinateFunctionCB *func = NULL,
106  void *funcData = NULL);
107 
109  virtual CoordType getType() const;
110 
116 
118 
119  void send(int index) const;
120 
122  virtual void push(SoState *state);
123 
125  virtual void pop(SoState *state, const SoElement *prevTopElement);
126 
127  SoINTERNAL public:
129  static void initClass();
130 
131  protected:
132  void setElt(SoTexCoordTexgenCB *function,
133  void *userData = NULL);
134 
136 
137  private:
138  SoTexCoordTexgenCB *texgenCB;
139  void *texgenCBData;
140  SoState *copiedFromParent;
141 };
142 
143 #endif /* _SO_GL_TEXTURE_COORDINATE_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
void SoTexCoordTexgenCB(void *userdata)
The TextureCoordinateFunction nodes that use the GL texgen function to generate texture coordinates m...
#define SO_ELEMENT_HEADER(className)
This one is for non-abstract element classes.
Definition: SoSubElement.h:112
const SbVec4f & SoTextureCoordinateFunctionCB(void *userdata, const SbVec3f &point, const SbVec3f &normal)
Function that TextureCoordinateFunction nodes register to compute texture coordinates.
This is the abstract base class for all state elements.
Definition: SoElement.h:96
Element storing the current gltexture coordinates.
virtual void push(SoState *state)
Override push() method to set up new instance.
virtual CoordType getType() const
Returns code indicating what has been set in state/element.
virtual void init(SoState *state)
Initializes element.
static void initClass()
Initializes the SoGLTextureCoordinateElement class.
virtual void pop(SoState *state, const SoElement *prevTopElement)
Override pop() method to maintain GL state.
static void setTexGen(SoState *state, SoNode *node, SoTexCoordTexgenCB *texGenFunc, void *texGenData=NULL, SoTextureCoordinateFunctionCB *func=NULL, void *funcData=NULL)
TextureCoordinateFunction nodes that use texgen must define and register a callback that makes the ap...
static const SoGLTextureCoordinateElement * getInstance(SoState *state)
Returns the top (current) instance of the element in the state.
void setElt(SoTexCoordTexgenCB *function, void *userData=NULL)
void send(int index) const
Send routine for EXPLICIT case:
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
Element storing the current texture coordinates.
CoordType
The (seemingly random) choice of values is for compatibility with Inventor 2.0 binary format files: