This reference page is linked to from the following overview topics: Meshes, List of Python FBX classes.
This class complements the KFbxLayerElement class.
It provides interfaces to access the direct array and index array of different layer elements.
Definition at line 1052 of file kfbxlayer.h.
#include <kfbxlayer.h>
Public Types |
|
typedef Type | ArrayElementType |
typedef KFbxLayerElementArrayTemplate < Type > |
DirectArrayType |
typedef KFbxLayerElementArrayTemplate < int > |
IndexArrayType |
Public Member Functions |
|
KFbxLayerElementArrayTemplate < Type > & |
GetDirectArray () const |
Returns the direct array of Layer Elements.
|
|
KFbxLayerElementArrayTemplate < Type > & |
GetDirectArray () |
Returns the direct array of Layer Elements.
|
|
KFbxLayerElementArrayTemplate < int > & |
GetIndexArray () const |
Returns the index array of Layer Elements.
|
|
KFbxLayerElementArrayTemplate < int > & |
GetIndexArray () |
Returns the index array of Layer Elements.
|
|
bool | Clear () |
Removes all elements from the direct and the
index arrays. |
|
bool | operator== (const KFbxLayerElementTemplate &pOther) const |
Equivalence operator. |
|
KFbxLayerElementTemplate & | operator= (KFbxLayerElementTemplate const &pOther) |
Assignment operator. |
|
int | RemapIndexTo (KFbxLayerElement::EMappingMode pNewMapping) |
Changes the Mapping mode to the new one and
re-computes the index array. |
|
virtual int | MemorySize () const |
Queries the amount of memory used by this
object AND its content (does not consider the content pointed)
|
|
Public Attributes |
|
KFbxLayerElementArrayTemplate < Type > * |
mDirectArray |
KFbxLayerElementArrayTemplate < int > * |
mIndexArray |
Protected Member Functions |
|
KFbxLayerElementTemplate () | |
~KFbxLayerElementTemplate () | |
virtual void | AllocateArrays () |
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. |
typedef Type ArrayElementType |
Definition at line 1321 of file kfbxlayer.h.
typedef KFbxLayerElementArrayTemplate<Type> DirectArrayType |
Definition at line 1322 of file kfbxlayer.h.
typedef KFbxLayerElementArrayTemplate<int> IndexArrayType |
Definition at line 1323 of file kfbxlayer.h.
KFbxLayerElementTemplate | ( | ) | [inline, protected] |
Definition at line 1216 of file kfbxlayer.h.
{ mDirectArray = NULL; mIndexArray = NULL; }
~KFbxLayerElementTemplate | ( | ) | [inline, protected] |
Definition at line 1222 of file kfbxlayer.h.
KFbxLayerElementArrayTemplate<Type>& GetDirectArray | ( | ) | const [inline] |
Returns the direct array of Layer Elements.
Definition at line 1060 of file kfbxlayer.h.
{ K_ASSERT(mReferenceMode == KFbxLayerElement::eDIRECT || mReferenceMode == KFbxLayerElement::eINDEX_TO_DIRECT); return *mDirectArray; }
KFbxLayerElementArrayTemplate<Type>& GetDirectArray | ( | ) | [inline] |
Returns the direct array of Layer Elements.
Definition at line 1070 of file kfbxlayer.h.
{ K_ASSERT(mReferenceMode == KFbxLayerElement::eDIRECT || mReferenceMode == KFbxLayerElement::eINDEX_TO_DIRECT); return *mDirectArray; }
KFbxLayerElementArrayTemplate<int>& GetIndexArray | ( | ) | const [inline] |
Returns the index array of Layer Elements.
Definition at line 1080 of file kfbxlayer.h.
{ K_ASSERT(mReferenceMode == KFbxLayerElement::eINDEX || mReferenceMode == KFbxLayerElement::eINDEX_TO_DIRECT); return *mIndexArray; }
KFbxLayerElementArrayTemplate<int>& GetIndexArray | ( | ) | [inline] |
Returns the index array of Layer Elements.
Definition at line 1090 of file kfbxlayer.h.
{ K_ASSERT(mReferenceMode == KFbxLayerElement::eINDEX || mReferenceMode == KFbxLayerElement::eINDEX_TO_DIRECT); return *mIndexArray; }
bool Clear | ( | ) | [inline, virtual] |
Removes all elements from the direct and the index arrays.
True
if successful, false
if a lock
is present.Reimplemented from KFbxLayerElement.
Reimplemented in KFbxLayerElementUserData.
Definition at line 1100 of file kfbxlayer.h.
{ bool ret = true; mDirectArray->Clear(); ret = (mDirectArray->GetStatus() == LockAccessStatus::eSuccess); mIndexArray->Clear(); ret |= (mIndexArray->GetStatus() == LockAccessStatus::eSuccess); return ret; }
bool operator== | ( | const KFbxLayerElementTemplate< Type > & | pOther | ) | const [inline] |
Equivalence operator.
pOther | Another element compared to this object |
True
if equal, false
if unequal.Definition at line 1118 of file kfbxlayer.h.
{ bool ret = true; if (pOther.GetReferenceMode() == KFbxLayerElement::eDIRECT || pOther.GetReferenceMode() == KFbxLayerElement::eINDEX_TO_DIRECT) { const KFbxLayerElementArrayTemplate<Type>& directArray = pOther.GetDirectArray(); if( directArray.GetCount() != mDirectArray->GetCount() || !directArray.ReadLock() || !mDirectArray->ReadLock() ) { ret = false; } if( ret && !mDirectArray->IsEqual(directArray) ) ret = false; directArray.ReadUnlock(); mDirectArray->ReadUnlock(); } if (ret) { if (pOther.GetReferenceMode() == KFbxLayerElement::eINDEX || pOther.GetReferenceMode() == KFbxLayerElement::eINDEX_TO_DIRECT) { const KFbxLayerElementArrayTemplate<int>& indexArray = pOther.GetIndexArray(); if( indexArray.GetCount() != mIndexArray->GetCount() || !indexArray.ReadLock() || !mIndexArray->ReadLock() ) { ret = false; } if( ret && !mIndexArray->IsEqual(indexArray) ) ret = false; indexArray.ReadUnlock(); mIndexArray->ReadUnlock(); } } if (ret == false) return false; return KFbxLayerElement::operator==(pOther); }
KFbxLayerElementTemplate& operator= | ( | KFbxLayerElementTemplate< Type > const & | pOther | ) | [inline] |
Assignment operator.
pOther | Another element assigned to this one |
Definition at line 1168 of file kfbxlayer.h.
{ K_ASSERT(mDirectArray != NULL); K_ASSERT(mIndexArray != NULL); if (pOther.GetReferenceMode() == KFbxLayerElement::eDIRECT || pOther.GetReferenceMode() == KFbxLayerElement::eINDEX_TO_DIRECT) { const KFbxLayerElementArrayTemplate<Type>& directArray = pOther.GetDirectArray(); *mDirectArray = directArray; } if (pOther.GetReferenceMode() == KFbxLayerElement::eINDEX || pOther.GetReferenceMode() == KFbxLayerElement::eINDEX_TO_DIRECT) { const KFbxLayerElementArrayTemplate<int>& indexArray = pOther.GetIndexArray(); *mIndexArray = indexArray; } KFbxLayerElement* myself = (KFbxLayerElement*)this; KFbxLayerElement* myOther = (KFbxLayerElement*)&pOther; *myself = *myOther; return *this; }
int RemapIndexTo | ( | KFbxLayerElement::EMappingMode | pNewMapping | ) | [inline] |
Changes the Mapping mode to the new one and re-computes the index array.
pNewMapping | New mapping mode. |
Definition at line 1200 of file kfbxlayer.h.
{ return RemapIndexArrayTo(this, pNewMapping, mIndexArray); }
virtual void AllocateArrays | ( | ) | [inline, protected, virtual] |
Reimplemented in KFbxLayerElementMaterial, and KFbxLayerElementUserData.
Definition at line 1228 of file kfbxlayer.h.
{ mDirectArray = FbxSdkNew< KFbxLayerElementArrayTemplate<Type> >(mType->GetType()); mIndexArray = FbxSdkNew< KFbxLayerElementArrayTemplate<int> >(DTInteger.GetType()); }
virtual int MemorySize | ( | ) | const [inline, virtual] |
Queries the amount of memory used by this object AND its content (does not consider the content pointed)
Reimplemented from KFbxLayerElement.
Reimplemented in KFbxLayerElementUserData.
Definition at line 1235 of file kfbxlayer.h.
{ int size = KFbxLayerElement::MemorySize(); size += (mDirectArray->GetCount()*sizeof(Type)); size += (mIndexArray->GetCount()*sizeof(int)); return size; }
virtual bool ContentWriteTo | ( | KFbxStream & | pStream | ) | const [inline, virtual] |
Writes the content of this layer element to the given stream.
pStream | The destination stream. |
True
if the content is successfully processed by
the receiving stream, false
otherwise.Reimplemented from KFbxLayerElement.
Definition at line 1247 of file kfbxlayer.h.
{ void* a; int s,v; int count = 0; // direct array count = mDirectArray->GetCount(); s = pStream.Write(&count, sizeof(int)); if (s != sizeof(int)) return false; if (count > 0) { a = mDirectArray->GetLocked(); K_ASSERT(a != NULL); v = count*sizeof(Type); s = pStream.Write(a, v); mDirectArray->Release(&a); if (s != v) return false; } // index array count = mIndexArray->GetCount(); s = pStream.Write(&count, sizeof(int)); if (s != sizeof(int)) return false; if (count > 0) { a = mIndexArray->GetLocked(); K_ASSERT(a != NULL); v = count*sizeof(int); s = pStream.Write(a, v); mIndexArray->Release(&a); if (s != v) return false; } return KFbxLayerElement::ContentWriteTo(pStream); }
virtual bool ContentReadFrom | ( | const KFbxStream & | pStream | ) | [inline, virtual] |
Reads the content of this layer element from the given stream.
pStream | The source stream. |
True
if the object fills itself with the received
data from the stream successfully, false
otherwise.Reimplemented from KFbxLayerElement.
Definition at line 1284 of file kfbxlayer.h.
{ void* a; int s,v; int count = 0; // direct array s = pStream.Read(&count, sizeof(int)); if (s != sizeof(int)) return false; mDirectArray->Resize(count); if (count > 0) { a = mDirectArray->GetLocked(); K_ASSERT(a != NULL); v = count*sizeof(Type); s = pStream.Read(a, v); mDirectArray->Release(&a); if (s != v) return false; } // index array s = pStream.Read(&count, sizeof(int)); if (s != sizeof(int)) return false; mIndexArray->Resize(count); if (count > 0) { a = mIndexArray->GetLocked(); K_ASSERT(a != NULL); v = count*sizeof(int); s = pStream.Read(a, v); mIndexArray->Release(&a); if (s != v) return false; } return KFbxLayerElement::ContentReadFrom(pStream); }
Definition at line 1325 of file kfbxlayer.h.
Definition at line 1326 of file kfbxlayer.h.