This reference page is linked to from the following overview topics: Meshes, List of Python Fbx classes.
This class complements the FbxLayerElement class.
It provides interfaces to access the direct array and index array of different layer elements.
Definition at line 1029 of file fbxlayer.h.
#include <fbxlayer.h>

Public Types |
|
| typedef Type | ArrayElementType |
|
typedef FbxLayerElementArrayTemplate < Type > |
DirectArrayType |
|
typedef FbxLayerElementArrayTemplate < int > |
IndexArrayType |
Public Member Functions |
|
| FbxLayerElementArrayTemplate < Type > & |
GetDirectArray () const |
| Returns the direct array of Layer Elements.
|
|
| FbxLayerElementArrayTemplate < Type > & |
GetDirectArray () |
| Returns the direct array of Layer Elements.
|
|
| FbxLayerElementArrayTemplate < int > & |
GetIndexArray () const |
| Returns the index array of Layer Elements.
|
|
| FbxLayerElementArrayTemplate < int > & |
GetIndexArray () |
| Returns the index array of Layer Elements.
|
|
| bool | Clear () |
| Removes all elements from the direct and the
index arrays. |
|
| bool | operator== (const FbxLayerElementTemplate &pOther) const |
| Equivalence operator. |
|
| FbxLayerElementTemplate & | operator= (FbxLayerElementTemplate const &pOther) |
| Assignment operator. |
|
| int | RemapIndexTo (FbxLayerElement::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 |
|
| FbxLayerElementArrayTemplate < Type > * |
mDirectArray |
| FbxLayerElementArrayTemplate < int > * |
mIndexArray |
Protected Member Functions |
|
| FbxLayerElementTemplate () | |
| ~FbxLayerElementTemplate () | |
| virtual void | AllocateArrays () |
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. |
|
| typedef Type ArrayElementType |
Definition at line 1298 of file fbxlayer.h.
| typedef FbxLayerElementArrayTemplate<Type> DirectArrayType |
Definition at line 1299 of file fbxlayer.h.
| typedef FbxLayerElementArrayTemplate<int> IndexArrayType |
Definition at line 1300 of file fbxlayer.h.
| FbxLayerElementTemplate | ( | ) | [inline, protected] |
Definition at line 1193 of file fbxlayer.h.
{
mDirectArray = NULL;
mIndexArray = NULL;
}
| ~FbxLayerElementTemplate | ( | ) | [inline, protected] |
Definition at line 1199 of file fbxlayer.h.
{
FbxDelete(mDirectArray);
FbxDelete(mIndexArray);
}
| FbxLayerElementArrayTemplate<Type>& GetDirectArray | ( | ) | const [inline] |
Returns the direct array of Layer Elements.
Definition at line 1037 of file fbxlayer.h.
{
FBX_ASSERT(mReferenceMode == FbxLayerElement::eDirect || mReferenceMode == FbxLayerElement::eIndexToDirect);
return *mDirectArray;
}
| FbxLayerElementArrayTemplate<Type>& GetDirectArray | ( | ) | [inline] |
Returns the direct array of Layer Elements.
Definition at line 1047 of file fbxlayer.h.
{
FBX_ASSERT(mReferenceMode == FbxLayerElement::eDirect || mReferenceMode == FbxLayerElement::eIndexToDirect);
return *mDirectArray;
}
| FbxLayerElementArrayTemplate<int>& GetIndexArray | ( | ) | const [inline] |
Returns the index array of Layer Elements.
Definition at line 1057 of file fbxlayer.h.
{
FBX_ASSERT(mReferenceMode == FbxLayerElement::eIndex || mReferenceMode == FbxLayerElement::eIndexToDirect);
return *mIndexArray;
}
| FbxLayerElementArrayTemplate<int>& GetIndexArray | ( | ) | [inline] |
Returns the index array of Layer Elements.
Definition at line 1067 of file fbxlayer.h.
{
FBX_ASSERT(mReferenceMode == FbxLayerElement::eIndex || mReferenceMode == FbxLayerElement::eIndexToDirect);
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 FbxLayerElement.
Reimplemented in FbxLayerElementUserData.
Definition at line 1077 of file fbxlayer.h.
{
bool ret = true;
mDirectArray->Clear();
ret = (mDirectArray->GetStatus() == LockAccessStatus::eSuccess);
mIndexArray->Clear();
ret |= (mIndexArray->GetStatus() == LockAccessStatus::eSuccess);
return ret;
}
| bool operator== | ( | const FbxLayerElementTemplate< Type > & | pOther | ) | const [inline] |
Equivalence operator.
| pOther | Another element compared to this object |
True if equal, false if unequal.Definition at line 1095 of file fbxlayer.h.
{
bool ret = true;
if (pOther.GetReferenceMode() == FbxLayerElement::eDirect ||
pOther.GetReferenceMode() == FbxLayerElement::eIndexToDirect)
{
const FbxLayerElementArrayTemplate<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() == FbxLayerElement::eIndex ||
pOther.GetReferenceMode() == FbxLayerElement::eIndexToDirect)
{
const FbxLayerElementArrayTemplate<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 FbxLayerElement::operator==(pOther);
}
| FbxLayerElementTemplate& operator= | ( | FbxLayerElementTemplate< Type > const & | pOther | ) | [inline] |
Assignment operator.
| pOther | Another element assigned to this one |
Definition at line 1145 of file fbxlayer.h.
{
FBX_ASSERT(mDirectArray != NULL);
FBX_ASSERT(mIndexArray != NULL);
if (pOther.GetReferenceMode() == FbxLayerElement::eDirect ||
pOther.GetReferenceMode() == FbxLayerElement::eIndexToDirect)
{
const FbxLayerElementArrayTemplate<Type>& directArray = pOther.GetDirectArray();
*mDirectArray = directArray;
}
if (pOther.GetReferenceMode() == FbxLayerElement::eIndex ||
pOther.GetReferenceMode() == FbxLayerElement::eIndexToDirect)
{
const FbxLayerElementArrayTemplate<int>& indexArray = pOther.GetIndexArray();
*mIndexArray = indexArray;
}
FbxLayerElement* myself = (FbxLayerElement*)this;
FbxLayerElement* myOther = (FbxLayerElement*)&pOther;
*myself = *myOther;
return *this;
}
| int RemapIndexTo | ( | FbxLayerElement::EMappingMode | pNewMapping | ) | [inline] |
Changes the Mapping mode to the new one and re-computes the index array.
| pNewMapping | New mapping mode. |
Definition at line 1177 of file fbxlayer.h.
{
return RemapIndexArrayTo(this, pNewMapping, mIndexArray);
}
| virtual void AllocateArrays | ( | ) | [inline, protected, virtual] |
Reimplemented in FbxLayerElementMaterial, and FbxLayerElementUserData.
Definition at line 1205 of file fbxlayer.h.
{
mDirectArray = FbxNew< FbxLayerElementArrayTemplate<Type> >(mType->GetType());
mIndexArray = FbxNew< FbxLayerElementArrayTemplate<int> >(FbxIntDT.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 FbxLayerElement.
Reimplemented in FbxLayerElementUserData.
Definition at line 1212 of file fbxlayer.h.
{
int size = FbxLayerElement::MemorySize();
size += (mDirectArray->GetCount()*sizeof(Type));
size += (mIndexArray->GetCount()*sizeof(int));
return size;
}
| virtual bool ContentWriteTo | ( | FbxStream & | 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 FbxLayerElement.
Definition at line 1224 of file fbxlayer.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();
FBX_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();
FBX_ASSERT(a != NULL);
v = count*sizeof(int);
s = pStream.Write(a, v);
mIndexArray->Release(&a);
if (s != v) return false;
}
return FbxLayerElement::ContentWriteTo(pStream);
}
| virtual bool ContentReadFrom | ( | const FbxStream & | 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 FbxLayerElement.
Definition at line 1261 of file fbxlayer.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();
FBX_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();
FBX_ASSERT(a != NULL);
v = count*sizeof(int);
s = pStream.Read(a, v);
mIndexArray->Release(&a);
if (s != v) return false;
}
return FbxLayerElement::ContentReadFrom(pStream);
}
Definition at line 1302 of file fbxlayer.h.
Definition at line 1303 of file fbxlayer.h.