IFXIterators |
The iterator classes allow you to access or modify the individual mesh attributes. They behave much like conventional pointers in Visual C§:
ptr.Next() is like ptr++;
ptr.Index(i) is like ptr[i];
x = ptr.Get() is like x = ptr;
ptr.PointAt(mysample) is like ptr = mysample
Note: ptr and mysample must have same stride.
To use an iterator, first instantiate it as a local variable, then pass a pointer from the iterator to one of the get() iterator methods, such as GetPositionIter(), from an IFXMesh class. The get() iterator methods initialize the iterator by calling SetStride() and PointAt() with the correct stride and base pointer values.
The IFXVector2Iter, IFXFaceIter, and U32Iter are the same as IFXVector3Iter, which is detailed, except for the datatype accessed.
The IFXVertexIter is a special iterator that allows access to the position, normal, diffuse color, and texture coordinate(s) properties of a vertex through one iterator.
|
Interface Method |
Description |
|
Initializes the stride |
|
|
Points to the location specified by "ptr" argument |
|
|
Gets value at current location |
|
|
Gets value at offset from the current location |
|
|
Gets current value and sets current to next location |
|
|
Makes this iterator like pSrcIter |
Note:This method should be called only from IFXMesh to initialize the stride.
Parameters:
|
stride |
Stride number to be initialized |
Return Values:
None
This method makes the iterator point to the location specified by "ptr" argument.
Note: Both iterators must have been initialized by the same IFXMesh, cloned, or guaranteed to have the same stride.
Parameters:
|
ptr |
Pointer to IFXVector3 |
Return Values:
None
This method gets the value at current location.
Parameters:
|
ptr |
Pointer to IFXVector3 |
Return Values:
IFXVector3*
This method gets the value at offset from the current location.
Parameters:
|
index |
Index number |
Return Values:
IFXVector3*
This method gets the current value and sets current to next location.
Parameters:
None
Return Values:
IFXVector3*
This method makes this iterator like pSrcIter.
Parameters:
|
pSrcIter |
Pointer to IFXVector3Iter |
Return Values:
None
void SetStride( U32 stride)
void PointAt( IFXVector2* ptr)
IFXVector2* Get()
IFXVector2* Index( U32 index)
IFXVector2* Next()
void Clone(IFXVector2Iter* pSrcIter)
void SetStride( U32 stride)
void PointAt( IFXFace* ptr)
IFXFace* Get()
IFXFace* Index( U32 index)
IFXFace* Next()
void Clone(IFXFaceIter* pSrcIter)
(For use with pencil sketch algorithm.)
void SetStride( U32 stride)
void PointAt( IFXFace** ptr)
IFXFace** Get()
IFXFace** Next()
void Clone(IFXFacePoolIter* pSrcIter)
void SetStride( U32 stride)
void PointAt( U32* ptr)
U32* Get()
U32* Index( U32 index)
U32* Next()
void Clone(U32Iter* pSrcIter)
Note: IFXVertexIter is no longer used, having been replaced by IFXVector3Iter or IFXVector2Iter. It is here for backward compatibility. This is a special iterator/pointer that abstracts access to the fields of a vertex record.
void PointAt(void* ptr)
void* Get()
void* Index(U32 index)
void* Next()
void Clone(IFXVertexIter* pSrcIter)
IFXVertexAttributes GetAttributes()
U32 GetNumTextureLayers()
Note: These methods are used in combination with GetPostion(), GetNormal(), GetDiffuseColor(), and GetTexCoord() to determine if the results are valid.
IFXVector3* GetPosition()
Checks GetAttributeLayout for hasPosition
IFXVector3* GetNormal()
Checks GetAttributeLayout for hasNormal
U32* GetDiffuseColor()
Checks GetAttributeLayout for hasDiffuseColor
IFXVector2* GetTexCoord(U8 layer = 0)
Checks GetAttributeLayout for hasTexCoords and GetNumTextureLayers for number of texture layers
§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.