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

KFbxLayerElement 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 (KFbxLayer).

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

See also:
KFbxLayer
KFbxLayerElement::EMappingMode
KFbxLayerElement::EReferenceMode

Definition at line 56 of file kfbxlayer.h.

#include <kfbxlayer.h>

Inheritance diagram for KFbxLayerElement:
Inheritance graph
[legend]

List of all members.

Public Types

enum   ELayerElementType {
  eUNDEFINED, eNORMAL, eBINORMAL, eTANGENT,
  eMATERIAL, ePOLYGON_GROUP, eUV, eVERTEX_COLOR,
  eSMOOTHING, eVERTEX_CREASE, eEDGE_CREASE, eHOLE,
  eUSER_DATA, eVISIBILITY, eDIFFUSE_TEXTURES, eDIFFUSE_FACTOR_TEXTURES,
  eEMISSIVE_TEXTURES, eEMISSIVE_FACTOR_TEXTURES, eAMBIENT_TEXTURES, eAMBIENT_FACTOR_TEXTURES,
  eSPECULAR_TEXTURES, eSPECULAR_FACTOR_TEXTURES, eSHININESS_TEXTURES, eNORMALMAP_TEXTURES,
  eBUMP_TEXTURES, eTRANSPARENT_TEXTURES, eTRANSPARENCY_FACTOR_TEXTURES, eREFLECTION_TEXTURES,
  eREFLECTION_FACTOR_TEXTURES, eDISPLACEMENT_TEXTURES, eVECTOR_DISPLACEMENT_TEXTURES, eLAST_ELEMENT_TYPE
}
 

Layer Element type identifier.

More...
enum   EMappingMode {
  eNONE, eBY_CONTROL_POINT, eBY_POLYGON_VERTEX, eBY_POLYGON,
  eBY_EDGE, eALL_SAME
}
 

Determines how the element is mapped to a surface.

More...
enum   EReferenceMode { eDIRECT, eINDEX, eINDEX_TO_DIRECT }
 

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 KFbxLayerElement &pOther) const
  Equivalence operator.
KFbxLayerElement operator= (KFbxLayerElement 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 KFbxDataType *pType)
const KFbxLayerContainer 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 (KFbxStream &pStream) const
  Writes the content of this layer element to the given stream.
virtual bool  ContentReadFrom (const KFbxStream &pStream)
  Reads the content of this layer element from the given stream.

Static Public Attributes

static const int  LAYERELEMENT_TYPE_TEXTURE_START_INDEX = int(eDIFFUSE_TEXTURES)
  The start index of texture type layer elements.
static const int  LAYERELEMENT_TYPE_TEXTURE_END_INDEX = int(eLAST_ELEMENT_TYPE) - 1
  The end index of texture type layer elements.
static const int  LAYERELEMENT_TYPE_TEXTURE_COUNT = LAYERELEMENT_TYPE_TEXTURE_END_INDEX - LAYERELEMENT_TYPE_TEXTURE_START_INDEX + 1
  The count of texture type layer elements.
static const int  LAYERELEMENT_TYPE_NON_TEXTURE_START_INDEX = int(eNORMAL)
  The start index of non-texture type layer elements.
static const int  LAYERELEMENT_TYPE_NON_TEXTURE_END_INDEX = int(eVISIBILITY)
  The end index of non-texture type layer elements.
static const int  LAYERELEMENT_TYPE_NON_TEXTURE_COUNT = LAYERELEMENT_TYPE_NON_TEXTURE_END_INDEX - LAYERELEMENT_TYPE_NON_TEXTURE_START_INDEX + 1
  The count of non-texture type layer elements.
static const char *const  TEXTURE_NAMES []
  Array of names of texture type layer elements.
static const char *const  TEXTURE_UV_NAMES []
  Array of names of UV layer elements.
static const char *const  NON_TEXTURE_NAMES []
  Array of names of non-texture type layer elements.
static const KFbxDataType  TEXTURE_TYPES []
  Array of texture types.
static const char *const  TEXTURE_CHANNEL_NAMES []
  Array of texture channels.

Protected Member Functions

  KFbxLayerElement ()
virtual  ~KFbxLayerElement ()
void  Destruct ()
virtual void  SetOwner (KFbxLayerContainer *pOwner)

Protected Attributes

EMappingMode  mMappingMode
EReferenceMode  mReferenceMode
KString  mName
const KFbxDataType mType
KFbxLayerContainer mOwner

Friends

class  KFbxLayerContainer

Member Enumeration Documentation

Layer Element type identifier.

Enumerator:
eUNDEFINED 
eNORMAL 
eBINORMAL 
eTANGENT 
eMATERIAL 
ePOLYGON_GROUP 
eUV 
eVERTEX_COLOR 
eSMOOTHING 
eVERTEX_CREASE 
eEDGE_CREASE 
eHOLE 
eUSER_DATA 
eVISIBILITY 
eDIFFUSE_TEXTURES 
eDIFFUSE_FACTOR_TEXTURES 
eEMISSIVE_TEXTURES 
eEMISSIVE_FACTOR_TEXTURES 
eAMBIENT_TEXTURES 
eAMBIENT_FACTOR_TEXTURES 
eSPECULAR_TEXTURES 
eSPECULAR_FACTOR_TEXTURES 
eSHININESS_TEXTURES 
eNORMALMAP_TEXTURES 
eBUMP_TEXTURES 
eTRANSPARENT_TEXTURES 
eTRANSPARENCY_FACTOR_TEXTURES 
eREFLECTION_TEXTURES 
eREFLECTION_FACTOR_TEXTURES 
eDISPLACEMENT_TEXTURES 
eVECTOR_DISPLACEMENT_TEXTURES 
eLAST_ELEMENT_TYPE 

Definition at line 95 of file kfbxlayer.h.

Determines how the element is mapped to a surface.

  • eNONE The mapping is undetermined.
  • eBY_CONTROL_POINT There will be one mapping coordinate for each surface control point/vertex.
  • eBY_POLYGON_VERTEX 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.
  • eBY_POLYGON There can be only one mapping coordinate for the whole polygon.
  • eBY_EDGE There will be one mapping coordinate for each unique edge in the mesh. This is meant to be used with smoothing layer elements.
  • eALL_SAME There can be only one mapping coordinate for the whole surface.
Enumerator:
eNONE 
eBY_CONTROL_POINT 
eBY_POLYGON_VERTEX 
eBY_POLYGON 
eBY_EDGE 
eALL_SAME 

Definition at line 189 of file kfbxlayer.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 KFbxLayerElementTemplate::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 eINDEX_TO_DIRECT.
  • eINDEX_TO_DIRECT This indicates that the KFbxLayerElementTemplate::mIndexArray contains, for the n'th element, an index in the KFbxLayerElementTemplate::mDirectArray array of mapping elements. eINDEX_TO_DIRECT is usually useful for storing eBY_POLYGON_VERTEX 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 KFbxLayerElementTemplate::mDirectArray
Enumerator:
eDIRECT 
eINDEX 
eINDEX_TO_DIRECT 

Definition at line 212 of file kfbxlayer.h.


Constructor & Destructor Documentation

KFbxLayerElement ( ) [inline, protected]

Definition at line 297 of file kfbxlayer.h.

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

Definition at line 305 of file kfbxlayer.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:
ExportDocument/main.cxx, ExportScene02/main.cxx, ExportScene03/main.cxx, Instances/main.cxx, Layers/main.cxx, ProceduralTexture/main.cxx, UIExamples/CubeCreator/SDK_Utility.cxx, and UserProperties/main.cxx.

Definition at line 223 of file kfbxlayer.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/GlFunctions.cxx.

Definition at line 233 of file kfbxlayer.h.

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

Returns the Reference Mode.

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

Definition at line 238 of file kfbxlayer.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 243 of file kfbxlayer.h.

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

Returns the name of this object.

Returns:
The current name of this LayerElement object.

Definition at line 248 of file kfbxlayer.h.

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

Equivalence operator.

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

Definition at line 254 of file kfbxlayer.h.

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

Assignment operator.

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

Definition at line 265 of file kfbxlayer.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 KFbxDataType pType ) [inline]

Definition at line 293 of file kfbxlayer.h.

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

Definition at line 294 of file kfbxlayer.h.

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

Definition at line 316 of file kfbxlayer.h.

{ FbxSdkDelete(this); }
virtual void SetOwner ( KFbxLayerContainer pOwner ) [protected, virtual]
virtual int MemorySize ( ) const [inline, virtual]
virtual bool ContentWriteTo ( KFbxStream pStream ) const [virtual]
virtual bool ContentReadFrom ( const KFbxStream 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 KFbxLayerElementTemplate< Type >, KFbxLayerElementTemplate< double >, KFbxLayerElementTemplate< int >, KFbxLayerElementTemplate< KFbxColor >, KFbxLayerElementTemplate< KFbxVector4 >, KFbxLayerElementTemplate< KFbxVector2 >, KFbxLayerElementTemplate< void * >, KFbxLayerElementTemplate< bool >, and KFbxLayerElementTemplate< KFbxSurfaceMaterial * >.


Friends And Related Function Documentation

friend class KFbxLayerContainer [friend]

Reimplemented in KFbxLayerElementMaterial.

Definition at line 320 of file kfbxlayer.h.


Member Data Documentation

const int LAYERELEMENT_TYPE_TEXTURE_START_INDEX = int(eDIFFUSE_TEXTURES) [static]

The start index of texture type layer elements.

Definition at line 145 of file kfbxlayer.h.

const int LAYERELEMENT_TYPE_TEXTURE_END_INDEX = int(eLAST_ELEMENT_TYPE) - 1 [static]

The end index of texture type layer elements.

Definition at line 148 of file kfbxlayer.h.

The count of texture type layer elements.

Definition at line 151 of file kfbxlayer.h.

const int LAYERELEMENT_TYPE_NON_TEXTURE_START_INDEX = int(eNORMAL) [static]

The start index of non-texture type layer elements.

Definition at line 154 of file kfbxlayer.h.

const int LAYERELEMENT_TYPE_NON_TEXTURE_END_INDEX = int(eVISIBILITY) [static]

The end index of non-texture type layer elements.

Definition at line 157 of file kfbxlayer.h.

The count of non-texture type layer elements.

Definition at line 160 of file kfbxlayer.h.

const char* const TEXTURE_NAMES[] [static]

Array of names of texture type layer elements.

Definition at line 165 of file kfbxlayer.h.

const char* const TEXTURE_UV_NAMES[] [static]

Array of names of UV layer elements.

Definition at line 168 of file kfbxlayer.h.

const char* const NON_TEXTURE_NAMES[] [static]

Array of names of non-texture type layer elements.

Definition at line 171 of file kfbxlayer.h.

const KFbxDataType TEXTURE_TYPES[] [static]

Array of texture types.

Definition at line 174 of file kfbxlayer.h.

const char* const TEXTURE_CHANNEL_NAMES[] [static]

Array of texture channels.

Examples:
ImportScene/DisplayTexture.cxx.

Definition at line 177 of file kfbxlayer.h.

Definition at line 309 of file kfbxlayer.h.

Definition at line 310 of file kfbxlayer.h.

KString mName [protected]

Definition at line 312 of file kfbxlayer.h.

const KFbxDataType* mType [protected]

Definition at line 313 of file kfbxlayer.h.

KFbxLayerContainer* mOwner [protected]

Definition at line 314 of file kfbxlayer.h.


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

KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement
KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement KFbxLayerElement