13 #ifndef _FBXSDK_SCENE_GEOMETRY_LAYER_H_
14 #define _FBXSDK_SCENE_GEOMETRY_LAYER_H_
118 const static int sTypeTextureStartIndex = int(eTextureDiffuse);
119 const static int sTypeTextureEndIndex = int(eTypeCount) - 1;
120 const static int sTypeTextureCount = sTypeTextureEndIndex - sTypeTextureStartIndex + 1;
121 const static int sTypeNonTextureStartIndex = int(eNormal);
122 const static int sTypeNonTextureEndIndex = int(eVisibility);
123 const static int sTypeNonTextureCount = sTypeNonTextureEndIndex - sTypeNonTextureStartIndex + 1;
124 static const char*
const sTextureNames[];
125 static const char*
const sTextureUVNames[];
126 static const char*
const sNonTextureNames[];
128 static const char*
const sTextureChannelNames[];
207 return (mName == pOther.mName) &&
208 (mMappingMode == pOther.mMappingMode) &&
209 (mReferenceMode == pOther.mReferenceMode);
218 mMappingMode = pOther.mMappingMode;
219 mReferenceMode = pOther.mReferenceMode;
237 #ifndef DOXYGEN_SHOULD_SKIP_THIS
238 void SetType(
const FbxDataType* pType) { mType = pType; }
243 void IncRefCount() { mRefCount++; }
244 int DecRefCount() { mRefCount--;
if (mRefCount < 0) { mRefCount = 0; }
return mRefCount; }
248 : mMappingMode(eNone)
249 , mReferenceMode(eDirect)
260 EMappingMode mMappingMode;
261 EReferenceMode mReferenceMode;
268 void Destruct() {
if (DecRefCount() == 0) {
FbxDelete(
this); } }
274 virtual int MemorySize()
const {
return 0; }
275 virtual bool ContentWriteTo(
FbxStream& pStream)
const;
276 virtual bool ContentReadFrom(
const FbxStream& pStream);
387 bool IsInUse()
const;
392 int ReadLock()
const;
397 int ReadUnlock()
const;
403 bool WriteLock()
const;
407 void WriteUnlock()
const;
413 bool ReadWriteLock()
const;
417 void ReadWriteUnlock()
const;
444 virtual void* GetLocked(ELockMode pLockMode,
EFbxType pDataType);
482 virtual void Release(
void** pDataPtr,
EFbxType pDataType);
505 template <
class T>
inline void Release(T** pDataPtr, T* dummy)
507 T*** voidPtr = &pDataPtr;
508 Release((
void**)*voidPtr,
FbxTypeOf(*dummy));
513 virtual size_t GetStride()
const;
521 int GetCount()
const;
550 int Add(
const void* pItem,
EFbxType pValueType);
559 int InsertAt(
int pIndex,
const void* pItem,
EFbxType pValueType);
567 void SetAt(
int pIndex,
const void* pItem,
EFbxType pValueType);
574 void SetLast(
const void* pItem,
EFbxType pValueType);
582 void RemoveAt(
int pIndex,
void** pItem,
EFbxType pValueType);
589 void RemoveLast(
void** pItem,
EFbxType pValueType);
596 bool RemoveIt(
void** pItem,
EFbxType pValueType);
605 bool GetAt(
int pIndex,
void** pItem,
EFbxType pValueType)
const;
612 bool GetFirst(
void** pItem,
EFbxType pValueType)
const;
619 bool GetLast(
void** pItem,
EFbxType pValueType)
const;
627 int Find(
const void* pItem,
EFbxType pValueType)
const;
636 int FindAfter(
int pAfterIndex,
const void* pItem,
EFbxType pValueType)
const;
645 int FindBefore(
int pBeforeIndex,
const void* pItem,
EFbxType pValueType)
const;
657 template <
class T>
inline int Add(T
const& pItem) {
return Add((
const void*)&pItem,
FbxTypeOf(pItem)); }
672 template <
class T>
inline void SetAt(
int pIndex, T
const& pItem) {
SetAt(pIndex, (
const void*)&pItem,
FbxTypeOf(pItem)); }
685 template <
class T>
inline void RemoveAt(
int pIndex, T* pItem)
687 T** voidPtr = &pItem;
688 RemoveAt(pIndex, (
void**)voidPtr,
FbxTypeOf(*pItem));
697 T** voidPtr = &pItem;
698 RemoveLast((
void**)voidPtr,
FbxTypeOf(*pItem));
707 T** voidPtr = &pItem;
708 return RemoveIt((
void**)voidPtr,
FbxTypeOf(*pItem));
717 template <
class T>
inline bool GetAt(
int pIndex, T* pItem)
const
719 T** voidPtr = &pItem;
720 return GetAt(pIndex, (
void**)voidPtr,
FbxTypeOf(*pItem));
727 template <
class T>
inline bool GetFirst(T* pItem)
const
729 T** voidPtr = &pItem;
730 return GetFirst((
void**)voidPtr,
FbxTypeOf(*pItem));
737 template <
class T>
inline bool GetLast(T* pItem)
const
739 T** voidPtr = &pItem;
740 return GetLast((
void**)voidPtr,
FbxTypeOf(*pItem));
748 template <
class T>
inline int Find(T
const& pItem)
const {
return Find((
const void*)&pItem,
FbxTypeOf(pItem)); }
756 template <
class T>
inline int FindAfter(
int pAfterIndex, T
const& pItem)
const {
return FindAfter(pAfterIndex, (
const void*)&pItem,
FbxTypeOf(pItem)); }
764 template <
class T>
inline int FindBefore(
int pBeforeIndex, T
const& pItem)
const {
return FindBefore(pBeforeIndex, (
const void*)&pItem,
FbxTypeOf(pItem)); }
783 for (
int i = 0; i < GetCount(); i++)
785 if (GetAt(i, (
void**)&srcPtr, mDataType))
796 void* GetReference(
int pIndex,
EFbxType pValueType);
797 void GetReferenceTo(
int pIndex,
void** pRef,
EFbxType pValueType);
804 void SetImplementation(
void* pImplementation);
806 virtual void ConvertDataType(
EFbxType pDataType,
void** pDataPtr,
size_t* pStride);
815 void* mImplementation;
818 bool mDirectAccessOn;
827 template <
typename T>
845 mArray.
Release((
void **) &mLockedData);
980 memcpy(lDst, lSrc,
sizeof(T) * pArrayTemplate.GetCount());
995 if (
this != &pArrayTemplate )
1004 memcpy(lDst, lSrc,
sizeof(T) * pArrayTemplate.
GetCount());
1053 return *mDirectArray;
1063 return *mDirectArray;
1073 return *mIndexArray;
1083 return *mIndexArray;
1093 mDirectArray->Clear();
1096 mIndexArray->Clear();
1116 if( directArray.
GetCount() != mDirectArray->GetCount() ||
1117 !directArray.
ReadLock() || !mDirectArray->ReadLock() )
1122 if( ret && !mDirectArray->IsEqual(directArray) )
1126 mDirectArray->ReadUnlock();
1135 if( indexArray.
GetCount() != mIndexArray->GetCount() ||
1136 !indexArray.
ReadLock() || !mIndexArray->ReadLock() )
1141 if( ret && !mIndexArray->IsEqual(indexArray) )
1145 mIndexArray->ReadUnlock();
1160 FBX_ASSERT(mDirectArray !=
NULL);
1161 FBX_ASSERT(mIndexArray !=
NULL);
1167 *mDirectArray = directArray;
1174 *mIndexArray = indexArray;
1198 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1202 mDirectArray =
NULL;
1212 virtual void AllocateArrays()
1214 mDirectArray = FbxNew< FbxLayerElementArrayTemplate<Type> >(mType->
GetType());
1215 mIndexArray = FbxNew< FbxLayerElementArrayTemplate<int> >(
FbxIntDT.
GetType());
1219 virtual int MemorySize()
const
1221 int size = FbxLayerElement::MemorySize();
1222 size += (mDirectArray->GetCount()*
sizeof(Type));
1223 size += (mIndexArray->GetCount()*
sizeof(int));
1231 virtual bool ContentWriteTo(
FbxStream& pStream)
const
1239 count = mDirectArray->GetCount();
1240 s = pStream.
Write(&count,
sizeof(
int));
1241 if (s !=
sizeof(
int))
return false;
1244 a = mDirectArray->GetLocked();
1245 FBX_ASSERT(a !=
NULL);
1246 v = count*
sizeof(Type);
1247 s = pStream.
Write(a, v);
1248 mDirectArray->Release(&a);
1249 if (s != v)
return false;
1253 count = mIndexArray->GetCount();
1254 s = pStream.
Write(&count,
sizeof(
int));
1255 if (s !=
sizeof(
int))
return false;
1258 a = mIndexArray->GetLocked();
1259 FBX_ASSERT(a !=
NULL);
1260 v = count*
sizeof(int);
1261 s = pStream.
Write(a, v);
1262 mIndexArray->Release(&a);
1263 if (s != v)
return false;
1266 return FbxLayerElement::ContentWriteTo(pStream);
1269 virtual bool ContentReadFrom(
const FbxStream& pStream)
1277 s = pStream.
Read(&count,
sizeof(
int));
1278 if (s !=
sizeof(
int))
return false;
1279 mDirectArray->Resize(count);
1282 a = mDirectArray->GetLocked();
1283 FBX_ASSERT(a !=
NULL);
1284 v = count*
sizeof(Type);
1285 s = pStream.
Read(a, v);
1286 mDirectArray->Release(&a);
1287 if (s != v)
return false;
1291 s = pStream.
Read(&count,
sizeof(
int));
1292 if (s !=
sizeof(
int))
return false;
1293 mIndexArray->Resize(count);
1296 a = mIndexArray->GetLocked();
1297 FBX_ASSERT(a !=
NULL);
1298 v = count*
sizeof(int);
1299 s = pStream.
Read(a, v);
1300 mIndexArray->Release(&a);
1301 if (s != v)
return false;
1303 return FbxLayerElement::ContentReadFrom(pStream);
1307 typedef Type ArrayElementType;
1316 #define FBXSDK_LAYER_ELEMENT_CREATE_DECLARE(classDesc) \
1317 FBXSDK_FRIEND_NEW(); \
1318 static Fbx##classDesc* Create(FbxLayerContainer* pOwner, const char* pName);
1443 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1444 virtual void AllocateArrays();
1446 virtual void SetInstance(
int pInstance ) { SetOwner( mOwner, pInstance ); }
1455 return ParentClass::GetDirectArray();
1460 return ParentClass::GetDirectArray();
1572 if (pStatus) *pStatus =
true;
1577 if( pStatus ) *pStatus =
false;
1578 FBX_ASSERT_NOW(
"Index out of bounds");
1592 if (pStatus) *pStatus =
true;
1597 if( pStatus ) *pStatus =
false;
1598 FBX_ASSERT_NOW(
"Index out of bounds");
1612 for(
int i = 0; i < mDataNames.GetCount(); ++i )
1614 if( *mDataNames[i] == lName )
1615 return GetDirectArrayVoid(i, pStatus);
1618 if (pStatus) *pStatus =
false;
1630 for(
int i = 0; i < mDataNames.GetCount(); ++i )
1632 if( *mDataNames[i] == lName )
1633 return GetDirectArrayVoid(i, pStatus);
1636 if (pStatus) *pStatus =
false;
1646 if( pIndex < 0 || pIndex >= mDataTypes.GetCount() )
1649 return mDataTypes[pIndex];
1660 for(
int i = 0; i < mDataNames.GetCount(); ++i )
1662 if( *mDataNames[i] == lName )
1663 return mDataTypes[i];
1675 if( pIndex >= 0 && pIndex < mDataNames.GetCount() )
1676 return mDataNames[pIndex]->Buffer();
1688 switch( mDataTypes[i].GetType() )
1690 case eFbxBool: FbxGetDirectArray<bool>(
this,i).Resize( pSize ) ;
break;
1691 case eFbxInt: FbxGetDirectArray<int>(
this,i).Resize( pSize ) ;
break;
1692 case eFbxFloat: FbxGetDirectArray<float>(
this,i).Resize( pSize ) ;
break;
1693 case eFbxDouble: FbxGetDirectArray<double>(
this,i).Resize( pSize );
break;
1698 FBX_ASSERT_NOW(
"unknown type" );
break;
1710 switch( mDataTypes[i].GetType() )
1712 case eFbxBool: FbxGetDirectArray<bool>(
this,i).RemoveAt( pIndex ) ;
break;
1713 case eFbxInt: FbxGetDirectArray<int>(
this,i).RemoveAt( pIndex ) ;
break;
1714 case eFbxFloat: FbxGetDirectArray<float>(
this,i).RemoveAt( pIndex ) ;
break;
1715 case eFbxDouble: FbxGetDirectArray<double>(
this,i).RemoveAt( pIndex );
break;
1720 FBX_ASSERT_NOW(
"unknown type" );
break;
1733 switch( mDataTypes[pIndex].GetType() )
1735 case eFbxBool:
return FbxGetDirectArray<bool>(
this,pIndex).GetCount();
1736 case eFbxInt:
return FbxGetDirectArray<int>(
this,pIndex).GetCount();
1737 case eFbxFloat:
return FbxGetDirectArray<float>(
this,pIndex).GetCount();
1738 case eFbxDouble:
return FbxGetDirectArray<double>(
this,pIndex).GetCount();
1743 FBX_ASSERT_NOW(
"Unknown type" );
break;
1767 if (
this == &pOther)
1773 mDataTypes = pOther.mDataTypes;
1774 mDataNames.Resize(pOther.mDataNames.GetCount());
1775 for(
int i = 0; i < pOther.mDataNames.GetCount(); ++i)
1776 mDataNames.SetAt(i, FbxNew< FbxString >( *pOther.mDataNames[i] ) );
1781 switch (mDataTypes[i].GetType())
1784 FbxGetDirectArray<bool>(
this, i) = FbxGetDirectArray<bool>(&pOther, i);
1788 FbxGetDirectArray<int>(
this, i) = FbxGetDirectArray<int>(&pOther, i);
1792 FbxGetDirectArray<float>(
this, i) = FbxGetDirectArray<float>(&pOther, i);
1796 FbxGetDirectArray<double>(
this, i) = FbxGetDirectArray<double>(&pOther, i);
1800 FBX_ASSERT_NOW(
"Unknown type" );
1825 for( i = 0; directArray !=
NULL && i < lCount; ++i )
1827 if( directArray[i] )
1832 for( i = 0; i < mDataNames.GetCount(); ++i )
1851 size +=
sizeof(mId);
1853 for(
int i = 0; i < mDataTypes.GetCount(); i++)
1855 size +=
sizeof(mDataTypes[i]);
1857 size += (mDataNames.GetCount() *
sizeof(
FbxString*));
1865 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1879 mDataTypes( pDataTypes )
1881 FBX_ASSERT( pDataTypes.GetCount() == pDataNames.GetCount() );
1882 for(
int i = 0; i < pDataNames.GetCount(); ++i )
1884 mDataNames.Add( FbxNew< FbxString >( pDataNames[i] ) );
1893 for (
int lIndex = 0; lIndex < pOther.mDataNames.GetCount(); ++lIndex)
1895 mDataNames.Add(FbxNew<FbxString>(*(pOther.mDataNames[lIndex])));
1903 switch (mDataTypes[i].GetType())
1906 FbxGetDirectArray<bool>(
this, i) = FbxGetDirectArray<bool>(&pOther, i);
1910 FbxGetDirectArray<int>(
this, i) = FbxGetDirectArray<int>(&pOther, i);
1914 FbxGetDirectArray<float>(
this, i) = FbxGetDirectArray<float>(&pOther, i);
1918 FbxGetDirectArray<double>(
this, i) = FbxGetDirectArray<double>(&pOther, i);
1922 FBX_ASSERT_NOW(
"Unknown type" );
1943 virtual void AllocateArrays()
1958 for( i = 0; i < mDataTypes.GetCount(); ++i )
1960 FbxHandle** dst =
NULL;
1964 switch( mDataTypes[i].GetType() )
1971 FBX_ASSERT_NOW(
"Trying to assign an unknown type" );
break;
1973 FbxHandle*** ptr = &dst;
2065 FBX_ASSERT_NOW(
"Smoothing layer elements must be direct mapped" );
2073 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2105 FBX_ASSERT_NOW(
"Crease layer elements must be direct mapped" );
2113 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2145 FBX_ASSERT_NOW(
"hole layer elements must be direct mapped" );
2153 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2176 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2292 else if (pAlpha < 0.0)
2311 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2312 virtual int MemorySize()
const
2315 size +=
sizeof(mBlendMode);
2316 size +=
sizeof(mAlpha);
2332 EBlendMode mBlendMode;
2477 int GetUVSetCount()
const;
2732 void Clone(
FbxLayer const& pSrcLayer);
2737 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2766 virtual int MemoryUsage()
const;
2773 #define FBXSDK_FOR_EACH_TEXTURE(lLayerIndex) for((lLayerIndex)=0;(lLayerIndex)<FbxLayerElement::sTypeTextureCount;(lLayerIndex)++)
2778 #define FBXSDK_FOR_EACH_NON_TEXTURE(lLayerIndex) for((lLayerIndex)=0;(lLayerIndex)<FbxLayerElement::sTypeNonTextureCount;(lLayerIndex)++)
2783 #define FBXSDK_TEXTURE_INDEX(ElementType) (int(ElementType)-FbxLayerElement::sTypeTextureStartIndex)
2788 #define FBXSDK_TEXTURE_TYPE(TextureIndex) (FbxLayerElement::EType((TextureIndex)+FbxLayerElement::sTypeTextureStartIndex))
2793 #define FBXSDK_NON_TEXTURE_INDEX(ElementType) (int(ElementType)-FbxLayerElement::sTypeNonTextureStartIndex)
2798 #define FBXSDK_NON_TEXTURE_TYPE(Index) (FbxLayerElement::EType((Index)+FbxLayerElement::sTypeNonTextureStartIndex))
2826 #undef FBXSDK_LAYER_ELEMENT_CREATE_DECLARE
int RemapIndexArrayTo(FbxLayerElement *pLayerEl, FbxLayerElement::EMappingMode pNewMapping, FbxLayerElementArrayTemplate< int > *pIndexArray)
Remap the index array to a new EMappingMode.
int GetId() const
Queries the this layer element's ID.
FbxDataType FbxLayerElementUserDataDT
FbxLayerElementArrayTemplate< int > & GetIndexArray() const
Returns the index array of Layer Elements.
Layer element for mapping Tangents to a geometry.
bool RemoveIt(T const &pItem)
Removes one item from the data buffer.
int GetReadLockCount() const
Retrieves the read lock count.
FbxLayerElement & operator=(FbxLayerElement const &pOther)
Assignment operator.
void * GetReference(int pIndex, EFbxType pValueType)
void ReadWriteUnlock() const
Releases the write lock on this array.
int GetArrayCount(int pIndex) const
Returns the direct array count for the attribute at pIndex.
FBX SDK environment definition.
void * GetImplementation()
int FindAfter(int pAfterIndex, T const &pItem) const
Searches for an item after the specified index in the data buffer.
void SetReferenceMode(EReferenceMode pReferenceMode)
Sets the Reference Mode.
#define FBXSDK_FRIEND_NEW()
FbxLayer class provides a base for the layering mechanism.
Layer element for mapping materials (FbxSurfaceMaterial) to a geometry.
FbxLayerElementArrayTemplate< void * > * GetDirectArrayVoid(const char *pName, bool *pStatus=((void *) 0))
Returns the direct array with the specified attribute name.
FbxLayerElementArrayTemplate(EFbxType pDataType)
Constructor.
void RemoveLast(void **pItem, EFbxType pValueType)
Removes the last item from the data buffer.
static const int sTypeTextureCount
The count of texture type layer elements.
bool Clear()
Removes all elements from the direct and the index arrays.
const T * GetData() const
bool IsWriteLocked() const
Returns whether write is locked.
FbxLayerElementBinormal FbxGeometryElementBinormal
FbxLayerElementNormal FbxGeometryElementNormal
FbxLayerElementArrayTemplate provides data array manipulation of the data buffer for FbxLayerElement...
const char * GetDataName(int pIndex) const
Returns the attribute name at the specified index.
EReferenceMode
Determines how the mapping information is stored in the array of coordinates.
void SetReferenceMode(FbxLayerElement::EReferenceMode pMode)
Sets the Reference Mode.
Abstract class for implementing I/O operations through a stream of data.
Double width floating point value.
T RemoveAt(int pIndex)
Removes the specified item from the data buffer.
EMappingMode GetMappingMode() const
Returns the Mapping Mode.
int FindBefore(int pBeforeIndex, T const &pItem)
Searches for one item before the specified index in the data buffer.
FbxLayerElementArrayTemplate< Type > & GetDirectArray() const
Returns the direct array of Layer Elements.
This class contains material settings.
Utility class to manipulate strings.
void RemoveAt(int pIndex, T *pItem)
Removes the specified item from the data buffer.
FbxDataType FbxUndefinedDT
void SetLast(T const &pItem)
Sets the value of the last item.
Layer element for mapping custom user data to a geometry.
Contains a collection of FbxLayer objects.
virtual size_t Write(const void *, FbxUInt64)=0
Writes a memory block.
int GetDirectArrayCount() const
Returns this layer element's direct array count.
Layer element for indicating if specified components are shown/hidden.
void SetAt(int pIndex, const void *pItem, EFbxType pValueType)
Sets the value for the specified item.
Layer element for mapping Vertex Colors to a geometry.
int RemapIndexTo(FbxLayerElement::EMappingMode pNewMapping)
Changes the Mapping mode to the new one and re-computes the index array.
int Find(const void *pItem, EFbxType pValueType) const
Searches for an item in the data buffer.
bool GetLast(T *pItem) const
Returns the last item's value.
void SetAt(int pIndex, T const &pItem)
Sets the value of the specified item.
void SetMappingMode(EMappingMode pMappingMode)
Sets the Mapping Mode.
FbxLayerElementVertexColor FbxGeometryElementVertexColor
void SetName(const char *pName)
Sets the name of this object.
Layer element for mapping UVs to a geometry.
void FbxDelete(T *p)
Deletion policy for pointer template classes that uses the FbxDelete() function.
Layer element for mapping Normals to a geometry.
int Find(T const &pItem)
Searches for an item in the data buffer.
This class is the base class for textures, ie classes FbxFileTexture, FbxLayeredTexture and FbxProced...
FbxLayerElementCrease FbxGeometryElementCrease
void SetReferenceMode(FbxLayerElement::EReferenceMode pMode)
Sets the Reference Mode.
void SetReferenceMode(FbxLayerElement::EReferenceMode pMode)
Sets the Reference Mode.
bool operator==(const FbxLayerElement &pOther) const
Equivalence operator.
int ReadLock() const
Increments the number of read locks on this array.
int InsertAt(int pIndex, T const &pItem)
Inserts a new item at the specified position of the data buffer.
bool RemoveIt(T *pItem)
Removes one item from the data buffer.
ELockMode
Identifies the access mode to the data buffer.
void SetLast(const void *pItem, EFbxType pValueType)
Sets the value of the last item.
const char * GetName() const
Returns the name of this object.
FbxLayerElementVisibility FbxGeometryElementVisibility
FbxSurfaceMaterial * FbxSurfaceMaterialPtr
FbxLayerElementArrayTemplate< Type > & GetDirectArray()
Returns the direct array of Layer Elements.
FbxLayerElementTemplate< FbxSurfaceMaterial * > ParentClass
const FbxLayerElementArrayTemplate< void * > * GetDirectArrayVoid(const char *pName, bool *pStatus=((void *) 0)) const
Returns the direct array with the specified attribute name.
T GetAt(int pIndex) const
Returns the specified item's value.
void Clear()
Reset the number of element to zero and free the memory allocated.
int InsertAt(int pIndex, T const &pItem)
Inserts a new item at the specified position of the data buffer.
void SetAlpha(double pAlpha)
Sets the transparency level between multiple texture levels.
bool operator==(const FbxLayerElementTemplate &pOther) const
Equivalence operator.
FbxLayerElementArray & operator=(const FbxArray< T > &pArrayTemplate)
Assignment operator.
FbxDataType GetDataType(const char *pName) const
Returns the specified attribute data type.
virtual size_t Read(void *, FbxUInt64) const =0
Read bytes from the stream and store them in the memory block.
bool GetFirst(T *pItem) const
Returns the first item's value.
int FindBefore(int pBeforeIndex, T const &pItem) const
Searches for one item before the specified index in the data buffer.
LockAccessStatus::ELockAccessStatus GetStatus() const
Retrieves the access state.
FbxLayerElementMaterial FbxGeometryElementMaterial
T RemoveLast()
Removes the last item from the data buffer.
FbxLayerElementTangent FbxGeometryElementTangent
FbxLayerElementTemplate & operator=(FbxLayerElementTemplate const &pOther)
Assignment operator.
FbxLayerElementArray is the base class for FbxLayerElementArrayTemplate, it provides lock handling an...
EFbxType
Type identifier constants.
void SetAt(int pIndex, T const &pItem)
Sets the value of the specified item.
This class complements the FbxLayerElement class.
bool RemoveIt(void **pItem, EFbxType pValueType)
Removes one item from the data buffer.
FbxTexture * FbxTexturePtr
virtual bool Clear()
Clears all the data from this layer element.
int GetCount() const
Returns the count of items in the data buffer.
EMappingMode
Determines how the element is mapped to a surface.
#define FBXSDK_LAYER_ELEMENT_CREATE_DECLARE(classDesc)
Layer element for indicating hole of polygon of a geometry.
void ClearStatus()
Clears the access state and sets it to eSuccess.
void SetAt(const int pIndex, const T &pElement)
Set the element at given position in the array.
int Add(T const &pItem)
Appends a new item to the end of the data buffer.
int Find(T const &pItem) const
Searches for an item in the data buffer.
FbxLayerElementUserData & operator=(FbxLayerElementUserData const &pOther)
Assignment operator which performs a deep copy.
EFbxType FbxTypeOf(const FbxRefPtr &)
static const int sTypeNonTextureCount
The count of non-texture type layer elements.
void SetLast(T const &pItem)
Sets the value of the last item.
void RemoveAt(int pIndex, void **pItem, EFbxType pValueType)
Removes the specified item from the data buffer.
FbxLayerElementArrayReadLock(FbxLayerElementArray &pArray)
int InsertAt(int pIndex, const void *pItem, EFbxType pValueType)
Inserts a new item at the specified position of the data buffer.
virtual bool ContentReadFrom(const FbxStream &pStream)
Reads the content of the object from the given stream.
FbxLayerElementArrayTemplate< FbxSurfaceMaterial * > ParentClass
EFbxType GetType() const
Retrieve this data type.
virtual void * GetLocked(ELockMode pLockMode, EFbxType pDataType)
Grants a locked access to the data buffer.
void Release(void **pDataPtr)
Unlock the data buffer.
Layer element for indicating smoothness of components of a geometry.
double GetAlpha() const
Returns the transparency level between multiple levels of textures.
Layer element for indicating crease of components of a geometry.
T GetLast() const
Returns the last item's value.
FbxLayerElementUserData FbxGeometryElementUserData
virtual void Release(void **pDataPtr, EFbxType pDataType)
Unlock the data buffer.
FbxLayerElementSmoothing FbxGeometryElementSmoothing
bool Resize(const int pSize, bool pPreserveCapacityIfPossible=false)
Inserts or erases elements at the end such that Size() becomes pSize, increasing capacity if needed...
void Release(T **pDataPtr, T *dummy)
Unlock the data buffer.
void RemoveFromAllDirectArrays(int pIndex)
Removes a single element at pIndex from every direct array.
Layer element for mapping Textures to a geometry.
EType
Layer Element type identifier.
bool ReadWriteLock() const
Locks this array for writing.
T operator[](int pIndex) const
Returns the specified item's value.
int ReadUnlock() const
Releases a read lock on this array.
FbxLayerElementUV FbxGeometryElementUV
FbxLayerElementArray * FbxLayerElementArrayPtr
bool Clear()
Removes all data from this layer element.
int FindAfter(int pAfterIndex, T const &pItem)
Searches for an item after the specified index in the data buffer.
FbxLayerElementArrayTemplate< T > & FbxGetDirectArray(FbxLayerElementUserData *pLayerElement, int pIndex, bool *pStatus=((void *) 0))
Returns the direct array with the given attribute index.
int Add(T const &pItem)
Appends a new item to the end of the data buffer.
#define FBX_SAFE_DELETE(p)
void * GetLocked(ELockMode pLockMode=eReadWriteLock)
Grants a locked access to the data buffer.
T * GetLocked(T *, ELockMode pLockMode=eReadWriteLock)
Grants a locked access to the data buffer.
Reference to object or property.
void RemoveLast(T *pItem)
Removes the last item from the data buffer.
bool SetCount(int pCount, EFbxMemoryClearMode pInitializeMode=eClearToZero)
Sets the count of items in the data buffer.
FbxLayerElementPolygonGroup FbxGeometryElementPolygonGroup
FbxDataType GetDataType(int pIndex) const
Returns the data type for the specified index.
int FindAfter(int pAfterIndex, const void *pItem, EFbxType pValueType) const
Searches for an item after the specified index in the data buffer.
bool GetAt(int pIndex, void **pItem, EFbxType pValueType) const
Returns the specified item's value.
const FbxLayerElementArrayTemplate< void * > * GetDirectArrayVoid(int pIndex, bool *pStatus=((void *) 0)) const
Returns the direct array with the specified attribute index.
FbxLayerElementArrayTemplate< int > & GetIndexArray()
Returns the index array of Layer Elements.
EBlendMode GetBlendMode() const
Returns the way Textures blend between layers.
FbxLayerElementHole FbxGeometryElementHole
Layer element for grouping related polygons together.
FbxLayerElement FbxGeometryElement
Defines geometry element classes.
~FbxLayerElementArrayReadLock()
void CopyTo(FbxArray< T > &pDst)
Copies the items in the data buffer to an array.
EReferenceMode GetReferenceMode() const
Returns the Reference Mode.
void ResizeAllDirectArrays(int pSize)
Resizes all direct arrays to the specified size.
FbxLayerElementArrayTemplate< void * > * GetDirectArrayVoid(int pIndex, bool *pStatus=((void *) 0))
Returns the direct array with the specified attribute index.
FbxLayerElementArrayTemplate< T > & operator=(const FbxLayerElementArrayTemplate< T > &pArrayTemplate)
Assignment operator.
EBlendMode
Lets you control how textures are combined when you apply multiple layers of texture to a surface...
void SetStatus(LockAccessStatus::ELockAccessStatus pVal) const
bool GetFirst(void **pItem, EFbxType pValueType) const
Returns the first item's value.
bool GetAt(int pIndex, T *pItem) const
Returns the specified item's value.
int Add(const void *pItem, EFbxType pValueType)
Appends a new item to the end of the data buffer.
bool GetLast(void **pItem, EFbxType pValueType) const
Returns the last item's value.
Base class for elements of layers (FbxLayer).
virtual int MemorySize() const
Queries the amount of memory used by this object as well as its content.
virtual bool ContentWriteTo(FbxStream &pStream) const
Writes the content of the object to the given stream.
Class for array of basic elements such as pointers and basic types.
int FindBefore(int pBeforeIndex, const void *pItem, EFbxType pValueType) const
Searches for an item before the specified index in the data buffer.
void SetBlendMode(EBlendMode pBlendMode)
Sets the way Textures blend between layers.
T GetFirst() const
Returns the first item's value.
Layer element for mapping Binormals to a geometry.