1SoTexture2(3IV)()                                            SoTexture2(3IV)()
2
3
4

NAME

6       SoTexture2 — texture mapping node
7

INHERITS FROM

9       SoBase > SoFieldContainer > SoNode > SoTexture2
10

SYNOPSIS

12       #include <Inventor/nodes/SoTexture2.h>
13
14     enum Model {
15          SoTexture2::MODULATE  The texture color is multiplied by the surface
16                                     color
17          SoTexture2::DECAL     The texture color replaces the surface color
18          SoTexture2::BLEND     Blends between the surface color and a  speci‐
19                                     fied blend color
20     }
21
22     enum Wrap {
23          SoTexture2::REPEAT  Repeats  texture  outside 0-1 texture coordinate
24                                   range
25          SoTexture2::CLAMP   Clamps texture coordinates  to  lie  within  0-1
26                                   range
27     }
28
29          Fields from class SoTexture2:
30
31     SoSFString          filename
32     SoSFImage           image
33     SoSFEnum            wrapS
34     SoSFEnum            wrapT
35     SoSFEnum            model
36     SoSFColor           blendColor
37
38          Methods from class SoTexture2:
39
40                         SoTexture2()
41     static SoType       getClassTypeId()
42
43          Methods from class SoNode:
44
45     void                setOverride(SbBool state)
46     SbBool              isOverride() const
47     SoNode *            copy(SbBool copyConnections = FALSE) const
48     virtual SbBool      affectsState() const
49     static SoNode *     getByName(const SbName &name)
50     static int          getByName(const SbName &name, SoNodeList &list)
51
52          Methods from class SoFieldContainer:
53
54     void                setToDefaults()
55     SbBool              hasDefaultValues() const
56     SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
57     void                copyFieldValues(const  SoFieldContainer  *fc,  SbBool
58                              copyConnections = FALSE)
59     SbBool              set(const char *fieldDataString)
60     void                get(SbString &fieldDataString)
61     virtual int         getFields(SoFieldList &resultList) const
62     virtual SoField *   getField(const SbName &fieldName) const
63     SbBool              getFieldName(const SoField *field, SbName &fieldName)
64                              const
65     SbBool              isNotifyEnabled() const
66     SbBool              enableNotify(SbBool flag)
67
68          Methods from class SoBase:
69
70     void                ref()
71     void                unref() const
72     void                unrefNoDelete() const
73     void                touch()
74     virtual SoType      getTypeId() const
75     SbBool              isOfType(SoType type) const
76     virtual void        setName(const SbName &name)
77     virtual SbName      getName() const
78
79

DESCRIPTION

81       This  property  node defines a texture map and parameters for that map.
82       This map is used to apply texture to subsequent shapes as they are ren‐
83       dered.
84
85       The  texture can be read from the file specified by the filename field.
86       Once the texture has been read, the image field  contains  the  texture
87       data.  However,  this  field  is marked so the image is not written out
88       when the texture node is written to a file. To turn off texturing,  set
89       the filename field to an empty string ("").
90
91       Textures  can also be specified in memory by setting the image field to
92       contain the texture data. Doing so resets the  filename  to  the  empty
93       string.
94
95       If  the  texture  image's  width  or height is not a power of 2, or the
96       image's width or height  is  greater  than  the  maximum  supported  by
97       OpenGL,  then  the image will be automatically scaled up or down to the
98       next power of 2 or the maximum texture size. For maximum speed,  point-
99       sampling is used to do the scale; if you want more accurate resampling,
100       pre-filter images to a power of 2 smaller than the maximum texture size
101       (use  the  OpenGL glGetIntegerv(GL_MAX_TEXTURE_SIZE...)  call to deter‐
102       mine maximum texture for a specific OpenGL implementation).
103
104       The quality of the texturing is affected by the textureQuality field of
105       the  SoComplexity  node.  The textureQuality field affects what kind of
106       filtering is done to the texture when it must be minified or magnified.
107       The  mapping  of  a  particular  texture  quality value to a particular
108       OpenGL filtering technique  is  implementation  dependent,  and  varies
109       based  on  the texturing performance.  If mipmap filtering is required,
110       mipmaps are automatically created using the simple box filter.
111

FIELDS

113     SoSFString          filename
114          Names file from which to read texture image. Currently only SGI .rgb
115          files  are  supported. If the filename is not an absolute path name,
116          the list of directories maintained by SoInput is  searched.  If  the
117          texture  is  not found in any of those directories, then the file is
118          searched for relative to the directory  from  which  the  SoTexture2
119          node was read. For example, if an SoTexture2 node with a filename of
120          "../tofu.rgb"  is  read  from  /usr/people/bob/models/food.iv,  then
121          /usr/people/bob/tofu.rgb will be read (assuming tofu.rgb isn't found
122          in the directories maintained by SoInput).
123
124     SoSFImage           image
125          Contains an in-memory representation  of  the  texture  map.  It  is
126          either  the  contents  of the file read from filename, an image read
127          directly from an Inventor file, or  an  image  set  programmatically
128          using the methods provided by SoSFImage.
129
130     SoSFEnum            wrapS
131     SoSFEnum            wrapT
132          Indicates  what to do when texture coordinates in the S (horizontal)
133          or T (vertical) direction lie outside the range 0-1.
134
135     SoSFEnum            model
136          Specifies how to map texture onto surface.
137
138     SoSFColor           blendColor
139          Color used for BLEND model.
140
141

METHODS

143                         SoTexture2()
144          Creates a texture node with default settings.
145
146     static SoType       getClassTypeId()
147          Returns type identifier for this class.
148
149

ACTION BEHAVIOR

151       SoGLRenderAction, SoCallbackAction
152          Sets current texture in state.
153
154

FILE FORMAT/DEFAULTS

156       Texture2 {
157          filename    ""
158          image       0 0 0
159          wrapS       REPEAT
160          wrapT       REPEAT
161          model       MODULATE
162          blendColor  0 0 0
163     }
164

SEE ALSO

166       SoComplexity,  SoMaterial,  SoTexture2Transform,  SoTextureCoordinate2,
167       SoTextureCoordinateBinding, SoTextureCoordinateFunction
168
169
170
171
172                                                             SoTexture2(3IV)()
Impressum