FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxLayerElement Class Reference

#include <fbxlayer.h>

Class 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 38 of file fbxlayer.h.

+ Inheritance diagram for FbxLayerElement:

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. More...
 
void SetReferenceMode (EReferenceMode pReferenceMode)
 Sets the Reference Mode. More...
 
EMappingMode GetMappingMode () const
 Returns the Mapping Mode. More...
 
EReferenceMode GetReferenceMode () const
 Returns the Reference Mode. More...
 
void SetName (const char *pName)
 Sets the name of this object. More...
 
const char * GetName () const
 Returns the name of this object. More...
 
bool operator== (const FbxLayerElement &pOther) const
 Equivalence operator. More...
 
FbxLayerElementoperator= (FbxLayerElement const &pOther)
 Assignment operator. More...
 
void Destroy ()
 Removes this layer element from its owner and delete it. More...
 
virtual bool Clear ()
 Clears all the data from this layer element. More...
 

Static Public Attributes

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

Member Enumeration Documentation

◆ EType

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 75 of file fbxlayer.h.

76  {
77  eUnknown,
78 
79  //Non-Texture layer element types
80  //Note: Make sure to update static index below if you change this enum!
81  eNormal,
82  eBiNormal,
83  eTangent,
84  eMaterial,
86  eUV,
88  eSmoothing,
91  eHole,
92  eUserData,
94 
95  //Texture layer element types
96  //Note: Make sure to update static index below if you change this enum!
107  eTextureBump,
114 
115  eTypeCount
116  };

◆ EMappingMode

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 140 of file fbxlayer.h.

◆ EReferenceMode

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 163 of file fbxlayer.h.

Member Function Documentation

◆ SetMappingMode()

void SetMappingMode ( EMappingMode  pMappingMode)
inline

Sets the Mapping Mode.

Parameters
pMappingModeSpecifies 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 174 of file fbxlayer.h.

174 { mMappingMode = pMappingMode; }

◆ SetReferenceMode()

void SetReferenceMode ( EReferenceMode  pReferenceMode)
inline

Sets the Reference Mode.

Parameters
pReferenceModeSpecifies the reference mode.
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 179 of file fbxlayer.h.

179 { mReferenceMode = pReferenceMode; }

◆ GetMappingMode()

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 184 of file fbxlayer.h.

184 { return mMappingMode; }

◆ GetReferenceMode()

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 189 of file fbxlayer.h.

189 { return mReferenceMode; }

◆ SetName()

void SetName ( const char *  pName)
inline

Sets the name of this object.

Parameters
pNameSpecifies the name of this LayerElement object.

Definition at line 194 of file fbxlayer.h.

194 { mName = FbxString(pName); }
Utility class to manipulate strings.
Definition: fbxstring.h:66

◆ GetName()

const char* GetName ( ) const
inline

Returns the name of this object.

Returns
The current name of this LayerElement object.

Definition at line 199 of file fbxlayer.h.

199 { return ((FbxLayerElement*)this)->mName.Buffer(); }
Base class for elements of layers (FbxLayer).
Definition: fbxlayer.h:38

◆ operator==()

bool operator== ( const FbxLayerElement pOther) const
inline

Equivalence operator.

Parameters
pOtherLayer element to be compared.
Returns
True if equal, false otherwise.

Definition at line 205 of file fbxlayer.h.

206  {
207  return (mName == pOther.mName) &&
208  (mMappingMode == pOther.mMappingMode) &&
209  (mReferenceMode == pOther.mReferenceMode);
210  }

◆ operator=()

FbxLayerElement& operator= ( FbxLayerElement const &  pOther)
inline

Assignment operator.

Parameters
pOtherLayer element assigned to this one.
Returns
This layer element after assignment.

Definition at line 216 of file fbxlayer.h.

217  {
218  mMappingMode = pOther.mMappingMode;
219  mReferenceMode = pOther.mReferenceMode;
220  // name, type and owner should not be copied because they are
221  // initialized when this object is created
222  return *this;
223  }

◆ Destroy()

void Destroy ( )

Removes this layer element from its owner and delete it.

◆ Clear()

Member Data Documentation

◆ sTypeTextureStartIndex

const int sTypeTextureStartIndex = int(eTextureDiffuse)
static

The start index of texture type layer elements.

Definition at line 118 of file fbxlayer.h.

◆ sTypeTextureEndIndex

const int sTypeTextureEndIndex = int(eTypeCount) - 1
static

The end index of texture type layer elements.

Definition at line 119 of file fbxlayer.h.

◆ sTypeTextureCount

const int sTypeTextureCount = sTypeTextureEndIndex - sTypeTextureStartIndex + 1
static

The count of texture type layer elements.

Definition at line 120 of file fbxlayer.h.

◆ sTypeNonTextureStartIndex

const int sTypeNonTextureStartIndex = int(eNormal)
static

The start index of non-texture type layer elements.

Definition at line 121 of file fbxlayer.h.

◆ sTypeNonTextureEndIndex

const int sTypeNonTextureEndIndex = int(eVisibility)
static

The end index of non-texture type layer elements.

Definition at line 122 of file fbxlayer.h.

◆ sTypeNonTextureCount

const int sTypeNonTextureCount = sTypeNonTextureEndIndex - sTypeNonTextureStartIndex + 1
static

The count of non-texture type layer elements.

Definition at line 123 of file fbxlayer.h.

◆ sTextureNames

const char* const sTextureNames[]
static

Array of names of texture type layer elements.

Definition at line 124 of file fbxlayer.h.

◆ sTextureUVNames

const char* const sTextureUVNames[]
static

Array of names of UV layer elements.

Definition at line 125 of file fbxlayer.h.

◆ sNonTextureNames

const char* const sNonTextureNames[]
static

Array of names of non-texture type layer elements.

Definition at line 126 of file fbxlayer.h.

◆ sTextureDataTypes

const FbxDataType sTextureDataTypes[]
static

Array of texture types.

Definition at line 127 of file fbxlayer.h.

◆ sTextureChannelNames

const char* const sTextureChannelNames[]
static

Array of texture channels.

Examples:
ImportScene/DisplayTexture.cxx.

Definition at line 128 of file fbxlayer.h.


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