Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends

FbxLayerElement Class Reference

This reference page is linked to from the following overview topics: Meshes, Materials and Textures, Meshes, Layered Textures, List of Python Fbx classes.


Search for all occurrences

Detailed Description

Base class for elements of layers (FbxLayer).

A layer element type is identified by EType. A FbxLayerElement describes how the layer element is mapped to a geometry surface and how the mapping information is arranged in memory. A FbxLayerElement contains Normals, UVs or other kind of information.

See also:
FbxLayer
FbxLayerElement::EMappingMode
FbxLayerElement::EReferenceMode

Definition at line 52 of file fbxlayer.h.

#include <fbxlayer.h>

Inheritance diagram for FbxLayerElement:
Inheritance graph
[legend]

List of all members.

Public Types

enum   EType {
  eUnknown, eNormal, eBiNormal, eTangent,
  eMaterial, ePolygonGroup, eUV, eVertexColor,
  eSmoothing, eVertexCrease, eEdgeCrease, eHole,
  eUserData, eVisibility, eTextureDiffuse, eTextureDiffuseFactor,
  eTextureEmissive, eTextureEmissiveFactor, eTextureAmbient, eTextureAmbientFactor,
  eTextureSpecular, eTextureSpecularFactor, eTextureShininess, eTextureNormalMap,
  eTextureBump, eTextureTransparency, eTextureTransparencyFactor, eTextureReflection,
  eTextureReflectionFactor, eTextureDisplacement, eTextureDisplacementVector, eTypeCount
}
 

Layer Element type identifier.

More...
enum   EMappingMode {
  eNone, eByControlPoint, eByPolygonVertex, eByPolygon,
  eByEdge, eAllSame
}
 

Determines how the element is mapped to a surface.

More...
enum   EReferenceMode { eDirect, eIndex, eIndexToDirect }
 

Determines how the mapping information is stored in the array of coordinates.

More...

Public Member Functions

void  SetMappingMode (EMappingMode pMappingMode)
  Sets the Mapping Mode.
void  SetReferenceMode (EReferenceMode pReferenceMode)
  Sets the Reference Mode.
EMappingMode  GetMappingMode () const
  Returns the Mapping Mode.
EReferenceMode  GetReferenceMode () const
  Returns the Reference Mode.
void  SetName (const char *pName)
  Sets the name of this object.
const char *  GetName () const
  Returns the name of this object.
bool  operator== (const FbxLayerElement &pOther) const
  Equivalence operator.
FbxLayerElement operator= (FbxLayerElement const &pOther)
  Assignment operator.
void  Destroy ()
  Removes this layer element from its owner and delete it.
virtual bool  Clear ()
  Clears all the data from this layer element.
void  SetType (const FbxDataType *pType)
const FbxLayerContainer GetOwner () const
virtual int  MemorySize () const
  Queries the amount of memory used by this object AND its content (does not consider the content pointed)
Serialization section
virtual bool  ContentWriteTo (FbxStream &pStream) const
  Writes the content of this layer element to the given stream.
virtual bool  ContentReadFrom (const FbxStream &pStream)
  Reads the content of this layer element from the given stream.

Static Public Attributes

static const int  sTypeTextureStartIndex = int(eTextureDiffuse)
  The start index of texture type layer elements.
static const int  sTypeTextureEndIndex = int(eTypeCount) - 1
  The end index of texture type layer elements.
static const int  sTypeTextureCount = sTypeTextureEndIndex - sTypeTextureStartIndex + 1
  The count of texture type layer elements.
static const int  sTypeNonTextureStartIndex = int(eNormal)
  The start index of non-texture type layer elements.
static const int  sTypeNonTextureEndIndex = int(eVisibility)
  The end index of non-texture type layer elements.
static const int  sTypeNonTextureCount = sTypeNonTextureEndIndex - sTypeNonTextureStartIndex + 1
  The count of non-texture type layer elements.
static const char *const  sTextureNames []
  Array of names of texture type layer elements.
static const char *const  sTextureUVNames []
  Array of names of UV layer elements.
static const char *const  sNonTextureNames []
  Array of names of non-texture type layer elements.
static const FbxDataType  sTextureDataTypes []
  Array of texture types.
static const char *const  sTextureChannelNames []
  Array of texture channels.

Protected Member Functions

  FbxLayerElement ()
virtual  ~FbxLayerElement ()
void  Destruct ()
virtual void  SetOwner (FbxLayerContainer *pOwner)
  FBXSDK_FRIEND_NEW ()

Protected Attributes

EMappingMode  mMappingMode
EReferenceMode  mReferenceMode
FbxString  mName
const FbxDataType mType
FbxLayerContainer mOwner

Friends

class  FbxLayerContainer

Member Enumeration Documentation

enum EType

Layer Element type identifier.

Enumerator:
eUnknown 
eNormal 
eBiNormal 
eTangent 
eMaterial 
ePolygonGroup 
eUV 
eVertexColor 
eSmoothing 
eVertexCrease 
eEdgeCrease 
eHole 
eUserData 
eVisibility 
eTextureDiffuse 
eTextureDiffuseFactor 
eTextureEmissive 
eTextureEmissiveFactor 
eTextureAmbient 
eTextureAmbientFactor 
eTextureSpecular 
eTextureSpecularFactor 
eTextureShininess 
eTextureNormalMap 
eTextureBump 
eTextureTransparency 
eTextureTransparencyFactor 
eTextureReflection 
eTextureReflectionFactor 
eTextureDisplacement 
eTextureDisplacementVector 
eTypeCount 

Definition at line 89 of file fbxlayer.h.

Determines how the element is mapped to a surface.

  • eNone The mapping is undetermined.
  • eByControlPoint There will be one mapping coordinate for each surface control point/vertex.
  • eByPolygonVertex There will be one mapping coordinate for each vertex, for every polygon of which it is a part. This means that a vertex will have as many mapping coordinates as polygons of which it is a part.
  • eByPolygon There can be only one mapping coordinate for the whole polygon.
  • eByEdge There will be one mapping coordinate for each unique edge in the mesh. This is meant to be used with smoothing layer elements.
  • eAllSame There can be only one mapping coordinate for the whole surface.
Enumerator:
eNone 
eByControlPoint 
eByPolygonVertex 
eByPolygon 
eByEdge 
eAllSame 

Definition at line 154 of file fbxlayer.h.

Determines how the mapping information is stored in the array of coordinates.

  • eDirect This indicates that the mapping information for the n'th element is found in the n'th place of FbxLayerElementTemplate::mDirectArray.
  • eIndex, This symbol is kept for backward compatibility with FBX v5.0 files. In FBX v6.0 and higher, this symbol is replaced with eIndexToDirect.
  • eIndexToDirect This indicates that the FbxLayerElementTemplate::mIndexArray contains, for the n'th element, an index in the FbxLayerElementTemplate::mDirectArray array of mapping elements. eIndexToDirect is usually useful for storing eByPolygonVertex mapping mode elements coordinates. Since the same coordinates are usually repeated many times, this saves spaces by storing the coordinate only one time and then referring to them with an index. Materials and Textures are also referenced with this mode and the actual Material/Texture can be accessed via the FbxLayerElementTemplate::mDirectArray
Enumerator:
eDirect 
eIndex 
eIndexToDirect 

Definition at line 177 of file fbxlayer.h.


Constructor & Destructor Documentation

FbxLayerElement ( ) [inline, protected]

Definition at line 262 of file fbxlayer.h.

virtual ~FbxLayerElement ( ) [inline, protected, virtual]

Definition at line 270 of file fbxlayer.h.

    {
    }

Member Function Documentation

void SetMappingMode ( EMappingMode  pMappingMode ) [inline]

Sets the Mapping Mode.

Parameters:
pMappingMode Specifies the way that layer element is mapped to a surface.
Examples:
Common/GeometryUtility.cxx, ExportDocument/main.cxx, ExportScene02/main.cxx, ExportScene03/main.cxx, Instances/main.cxx, Layers/main.cxx, ProceduralTexture/main.cxx, and UserProperties/main.cxx.

Definition at line 188 of file fbxlayer.h.

{ mMappingMode = pMappingMode; }
void SetReferenceMode ( EReferenceMode  pReferenceMode ) [inline]
EMappingMode GetMappingMode ( ) const [inline]

Returns the Mapping Mode.

Returns:
The current Mapping Mode.
Examples:
ImportScene/DisplayMesh.cxx, Normals/main.cxx, UVSample/main.cxx, and ViewScene/SceneCache.cxx.

Definition at line 198 of file fbxlayer.h.

{ return mMappingMode; }
EReferenceMode GetReferenceMode ( ) const [inline]

Returns the Reference Mode.

Returns:
The current Reference Mode.
Examples:
ImportScene/DisplayMesh.cxx, Normals/main.cxx, UVSample/main.cxx, and ViewScene/SceneCache.cxx.

Definition at line 203 of file fbxlayer.h.

{ return mReferenceMode; }
void SetName ( const char *  pName ) [inline]

Sets the name of this object.

Parameters:
pName Specifies the name of this LayerElement object.

Definition at line 208 of file fbxlayer.h.

{ mName = FbxString(pName); }
const char* GetName ( ) const [inline]

Returns the name of this object.

Returns:
The current name of this LayerElement object.

Definition at line 213 of file fbxlayer.h.

{ return ((FbxLayerElement*)this)->mName.Buffer(); }
bool operator== ( const FbxLayerElement pOther ) const [inline]

Equivalence operator.

Parameters:
pOther Layer element to be compared.
Returns:
True if equal, false otherwise.

Definition at line 219 of file fbxlayer.h.

    {
        return (mName == pOther.mName) && 
               (mMappingMode == pOther.mMappingMode) &&
               (mReferenceMode == pOther.mReferenceMode);
    }
FbxLayerElement& operator= ( FbxLayerElement const &  pOther ) [inline]

Assignment operator.

Parameters:
pOther Layer element assigned to this one.
Returns:
This layer element after assignment.

Definition at line 230 of file fbxlayer.h.

    {
        mMappingMode = pOther.mMappingMode;
        mReferenceMode = pOther.mReferenceMode;
        // name, type and owner should not be copied because they are
        // initialized when this object is created
        return *this;
    }
void Destroy ( )

Removes this layer element from its owner and delete it.

virtual bool Clear ( ) [inline, virtual]
void SetType ( const FbxDataType pType ) [inline]

Definition at line 258 of file fbxlayer.h.

{ mType = pType; }
const FbxLayerContainer* GetOwner ( ) const [inline]

Definition at line 259 of file fbxlayer.h.

{ return mOwner; }
void Destruct ( ) [inline, protected]

Definition at line 281 of file fbxlayer.h.

{ FbxDelete(this); }
virtual void SetOwner ( FbxLayerContainer pOwner ) [protected, virtual]
FBXSDK_FRIEND_NEW ( ) [protected]
virtual int MemorySize ( ) const [inline, virtual]
virtual bool ContentWriteTo ( FbxStream pStream ) const [virtual]

Writes the content of this layer element to the given stream.

Parameters:
pStream The destination stream.
Returns:
True if the content is successfully processed by the receiving stream, false otherwise.

Reimplemented in FbxLayerElementTemplate< Type >, FbxLayerElementTemplate< double >, FbxLayerElementTemplate< int >, FbxLayerElementTemplate< FbxSurfaceMaterial * >, FbxLayerElementTemplate< FbxColor >, FbxLayerElementTemplate< void * >, FbxLayerElementTemplate< bool >, FbxLayerElementTemplate< FbxVector4 >, and FbxLayerElementTemplate< FbxVector2 >.

virtual bool ContentReadFrom ( const FbxStream pStream ) [virtual]

Reads the content of this layer element from the given stream.

Parameters:
pStream The source stream.
Returns:
True if the object fills itself with the received data from the stream successfully, false otherwise.

Reimplemented in FbxLayerElementTemplate< Type >, FbxLayerElementTemplate< double >, FbxLayerElementTemplate< int >, FbxLayerElementTemplate< FbxSurfaceMaterial * >, FbxLayerElementTemplate< FbxColor >, FbxLayerElementTemplate< void * >, FbxLayerElementTemplate< bool >, FbxLayerElementTemplate< FbxVector4 >, and FbxLayerElementTemplate< FbxVector2 >.


Friends And Related Function Documentation

friend class FbxLayerContainer [friend]

Reimplemented in FbxLayerElementMaterial.

Definition at line 285 of file fbxlayer.h.


Member Data Documentation

const int sTypeTextureStartIndex = int(eTextureDiffuse) [static]

The start index of texture type layer elements.

Definition at line 132 of file fbxlayer.h.

const int sTypeTextureEndIndex = int(eTypeCount) - 1 [static]

The end index of texture type layer elements.

Definition at line 133 of file fbxlayer.h.

The count of texture type layer elements.

Definition at line 134 of file fbxlayer.h.

const int sTypeNonTextureStartIndex = int(eNormal) [static]

The start index of non-texture type layer elements.

Definition at line 135 of file fbxlayer.h.

const int sTypeNonTextureEndIndex = int(eVisibility) [static]

The end index of non-texture type layer elements.

Definition at line 136 of file fbxlayer.h.

The count of non-texture type layer elements.

Definition at line 137 of file fbxlayer.h.

const char* const sTextureNames[] [static]

Array of names of texture type layer elements.

Definition at line 138 of file fbxlayer.h.

const char* const sTextureUVNames[] [static]

Array of names of UV layer elements.

Definition at line 139 of file fbxlayer.h.

const char* const sNonTextureNames[] [static]

Array of names of non-texture type layer elements.

Definition at line 140 of file fbxlayer.h.

const FbxDataType sTextureDataTypes[] [static]

Array of texture types.

Definition at line 141 of file fbxlayer.h.

const char* const sTextureChannelNames[] [static]

Array of texture channels.

Examples:
ImportScene/DisplayTexture.cxx.

Definition at line 142 of file fbxlayer.h.

Definition at line 274 of file fbxlayer.h.

Definition at line 275 of file fbxlayer.h.

FbxString mName [protected]

Definition at line 277 of file fbxlayer.h.

const FbxDataType* mType [protected]

Definition at line 278 of file fbxlayer.h.

FbxLayerContainer* mOwner [protected]

Definition at line 279 of file fbxlayer.h.


The documentation for this class was generated from the following file:

FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement
FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement FbxLayerElement