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)
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);
381 bool IsInUse()
const;
386 int ReadLock()
const;
391 int ReadUnlock()
const;
397 bool WriteLock()
const;
401 void WriteUnlock()
const;
407 bool ReadWriteLock()
const;
411 void ReadWriteUnlock()
const;
476 virtual void Release(
void** pDataPtr,
EFbxType pDataType);
499 template <
class T>
inline void Release(T** pDataPtr, T* dummy)
501 T*** voidPtr = &pDataPtr;
502 Release((
void**)*voidPtr,
FbxTypeOf(*dummy));
507 virtual size_t GetStride()
const;
515 int GetCount()
const;
520 void SetCount(
int pCount);
528 void Resize(
int pItemCount);
533 void AddMultiple(
int pItemCount);
540 int Add(
const void* pItem,
EFbxType pValueType);
549 int InsertAt(
int pIndex,
const void* pItem,
EFbxType pValueType);
557 void SetAt(
int pIndex,
const void* pItem,
EFbxType pValueType);
564 void SetLast(
const void* pItem,
EFbxType pValueType);
572 void RemoveAt(
int pIndex,
void** pItem,
EFbxType pValueType);
579 void RemoveLast(
void** pItem,
EFbxType pValueType);
586 bool RemoveIt(
void** pItem,
EFbxType pValueType);
595 bool GetAt(
int pIndex,
void** pItem,
EFbxType pValueType)
const;
602 bool GetFirst(
void** pItem,
EFbxType pValueType)
const;
609 bool GetLast(
void** pItem,
EFbxType pValueType)
const;
617 int Find(
const void* pItem,
EFbxType pValueType)
const;
626 int FindAfter(
int pAfterIndex,
const void* pItem,
EFbxType pValueType)
const;
635 int FindBefore(
int pBeforeIndex,
const void* pItem,
EFbxType pValueType)
const;
647 template <
class T>
inline int Add(T
const& pItem) {
return Add((
const void*)&pItem,
FbxTypeOf(pItem)); }
662 template <
class T>
inline void SetAt(
int pIndex, T
const& pItem) {
SetAt(pIndex, (
const void*)&pItem,
FbxTypeOf(pItem)); }
675 template <
class T>
inline void RemoveAt(
int pIndex, T* pItem)
677 T** voidPtr = &pItem;
678 RemoveAt(pIndex, (
void**)voidPtr,
FbxTypeOf(*pItem));
687 T** voidPtr = &pItem;
688 RemoveLast((
void**)voidPtr,
FbxTypeOf(*pItem));
697 T** voidPtr = &pItem;
698 return RemoveIt((
void**)voidPtr,
FbxTypeOf(*pItem));
707 template <
class T>
inline bool GetAt(
int pIndex, T* pItem)
const 709 T** voidPtr = &pItem;
710 return GetAt(pIndex, (
void**)voidPtr,
FbxTypeOf(*pItem));
717 template <
class T>
inline bool GetFirst(T* pItem)
const 719 T** voidPtr = &pItem;
720 return GetFirst((
void**)voidPtr,
FbxTypeOf(*pItem));
727 template <
class T>
inline bool GetLast(T* pItem)
const 729 T** voidPtr = &pItem;
730 return GetLast((
void**)voidPtr,
FbxTypeOf(*pItem));
738 template <
class T>
inline int Find(T
const& pItem)
const {
return Find((
const void*)&pItem,
FbxTypeOf(pItem)); }
746 template <
class T>
inline int FindAfter(
int pAfterIndex, T
const& pItem)
const {
return FindAfter(pAfterIndex, (
const void*)&pItem,
FbxTypeOf(pItem)); }
754 template <
class T>
inline int FindBefore(
int pBeforeIndex, T
const& pItem)
const {
return FindBefore(pBeforeIndex, (
const void*)&pItem,
FbxTypeOf(pItem)); }
773 for (
int i = 0; i < GetCount(); i++)
775 if (GetAt(i, (
void**)&srcPtr, mDataType))
786 void* GetReference(
int pIndex,
EFbxType pValueType);
787 void GetReferenceTo(
int pIndex,
void** pRef,
EFbxType pValueType);
794 void SetImplementation(
void* pImplementation);
796 virtual void ConvertDataType(
EFbxType pDataType,
void** pDataPtr,
size_t* pStride);
805 void* mImplementation;
808 bool mDirectAccessOn;
817 template <
typename T>
835 mArray.Release((
void **) &mLockedData);
966 SetCount(pArrayTemplate.GetCount());
967 for (
int i = 0; i < pArrayTemplate.GetCount(); i++)
968 SetAt(i, pArrayTemplate.
GetAt(i));
980 if (
this != &pArrayTemplate )
985 SetCount(pArrayTemplate.
GetCount());
986 for (
int i = 0; i < pArrayTemplate.
GetCount(); i++)
987 SetAt(i, pArrayTemplate.
GetAt(i));
1033 return *mDirectArray;
1043 return *mDirectArray;
1053 return *mIndexArray;
1063 return *mIndexArray;
1073 mDirectArray->Clear();
1076 mIndexArray->Clear();
1096 if( directArray.
GetCount() != mDirectArray->GetCount() ||
1097 !directArray.
ReadLock() || !mDirectArray->ReadLock() )
1102 if( ret && !mDirectArray->IsEqual(directArray) )
1106 mDirectArray->ReadUnlock();
1115 if( indexArray.
GetCount() != mIndexArray->GetCount() ||
1116 !indexArray.
ReadLock() || !mIndexArray->ReadLock() )
1121 if( ret && !mIndexArray->IsEqual(indexArray) )
1125 mIndexArray->ReadUnlock();
1140 FBX_ASSERT(mDirectArray !=
NULL);
1141 FBX_ASSERT(mIndexArray !=
NULL);
1147 *mDirectArray = directArray;
1154 *mIndexArray = indexArray;
1178 #ifndef DOXYGEN_SHOULD_SKIP_THIS 1182 mDirectArray =
NULL;
1192 virtual void AllocateArrays()
1194 mDirectArray = FbxNew< FbxLayerElementArrayTemplate<Type> >(mType->GetType());
1195 mIndexArray = FbxNew< FbxLayerElementArrayTemplate<int> >(
FbxIntDT.
GetType());
1199 virtual int MemorySize()
const 1201 int size = FbxLayerElement::MemorySize();
1202 size += (mDirectArray->GetCount()*
sizeof(Type));
1203 size += (mIndexArray->GetCount()*
sizeof(int));
1211 virtual bool ContentWriteTo(
FbxStream& pStream)
const 1218 count = mDirectArray->GetCount();
1219 s = pStream.
Write(&count,
sizeof(
int));
1220 if (s !=
sizeof(
int))
return false;
1223 a = mDirectArray->GetLocked();
1224 FBX_ASSERT(a !=
NULL);
1225 v = count*
sizeof(Type);
1226 s = pStream.
Write(a, v);
1227 mDirectArray->Release(&a);
1228 if (s != v)
return false;
1232 count = mIndexArray->GetCount();
1233 s = pStream.
Write(&count,
sizeof(
int));
1234 if (s !=
sizeof(
int))
return false;
1237 a = mIndexArray->GetLocked();
1238 FBX_ASSERT(a !=
NULL);
1239 v = count*
sizeof(int);
1240 s = pStream.
Write(a, v);
1241 mIndexArray->Release(&a);
1242 if (s != v)
return false;
1245 return FbxLayerElement::ContentWriteTo(pStream);
1248 virtual bool ContentReadFrom(
const FbxStream& pStream)
1255 s = pStream.
Read(&count,
sizeof(
int));
1256 if (s !=
sizeof(
int))
return false;
1257 mDirectArray->Resize(count);
1260 a = mDirectArray->GetLocked();
1261 FBX_ASSERT(a !=
NULL);
1262 v = count*
sizeof(Type);
1263 s = pStream.
Read(a, v);
1264 mDirectArray->Release(&a);
1265 if (s != v)
return false;
1269 s = pStream.
Read(&count,
sizeof(
int));
1270 if (s !=
sizeof(
int))
return false;
1271 mIndexArray->Resize(count);
1274 a = mIndexArray->GetLocked();
1275 FBX_ASSERT(a !=
NULL);
1276 v = count*
sizeof(int);
1277 s = pStream.
Read(a, v);
1278 mIndexArray->Release(&a);
1279 if (s != v)
return false;
1281 return FbxLayerElement::ContentReadFrom(pStream);
1285 typedef Type ArrayElementType;
1294 #define FBXSDK_LAYER_ELEMENT_CREATE_DECLARE(classDesc) \ 1295 FBXSDK_FRIEND_NEW(); \ 1296 static Fbx##classDesc* Create(FbxLayerContainer* pOwner, const char* pName); 1421 #ifndef DOXYGEN_SHOULD_SKIP_THIS 1422 virtual void AllocateArrays();
1424 virtual void SetInstance(
int pInstance ) { SetOwner( mOwner, pInstance ); }
1433 return ParentClass::GetDirectArray();
1438 return ParentClass::GetDirectArray();
1548 if( pIndex >= 0 || pIndex < GetDirectArray().GetCount() )
1550 if (pStatus) *pStatus =
true;
1555 if( pStatus ) *pStatus =
false;
1556 FBX_ASSERT_NOW(
"Index out of bounds");
1568 if( pIndex >= 0 || pIndex < GetDirectArray().GetCount() )
1570 if (pStatus) *pStatus =
true;
1575 if( pStatus ) *pStatus =
false;
1576 FBX_ASSERT_NOW(
"Index out of bounds");
1590 for(
int i = 0; i < mDataNames.GetCount(); ++i )
1592 if( *mDataNames[i] == lName )
1593 return GetDirectArrayVoid(i, pStatus);
1596 if (pStatus) *pStatus =
false;
1608 for(
int i = 0; i < mDataNames.GetCount(); ++i )
1610 if( *mDataNames[i] == lName )
1611 return GetDirectArrayVoid(i, pStatus);
1614 if (pStatus) *pStatus =
false;
1624 if( pIndex < 0 || pIndex >= mDataTypes.GetCount() )
1627 return mDataTypes[pIndex];
1638 for(
int i = 0; i < mDataNames.GetCount(); ++i )
1640 if( *mDataNames[i] == lName )
1641 return mDataTypes[i];
1653 if( pIndex >= 0 && pIndex < mDataNames.GetCount() )
1654 return mDataNames[pIndex]->Buffer();
1664 for(
int i = 0; i < GetDirectArray().GetCount(); ++i )
1666 switch( mDataTypes[i].GetType() )
1668 case eFbxBool: FbxGetDirectArray<bool>(
this,i).Resize( pSize ) ;
break;
1669 case eFbxInt: FbxGetDirectArray<int>(
this,i).Resize( pSize ) ;
break;
1670 case eFbxFloat: FbxGetDirectArray<float>(
this,i).Resize( pSize ) ;
break;
1671 case eFbxDouble: FbxGetDirectArray<double>(
this,i).Resize( pSize );
break;
1676 FBX_ASSERT_NOW(
"unknown type" );
break;
1686 for(
int i = 0; i < GetDirectArray().GetCount(); ++i )
1688 switch( mDataTypes[i].GetType() )
1690 case eFbxBool: FbxGetDirectArray<bool>(
this,i).RemoveAt( pIndex ) ;
break;
1691 case eFbxInt: FbxGetDirectArray<int>(
this,i).RemoveAt( pIndex ) ;
break;
1692 case eFbxFloat: FbxGetDirectArray<float>(
this,i).RemoveAt( pIndex ) ;
break;
1693 case eFbxDouble: FbxGetDirectArray<double>(
this,i).RemoveAt( pIndex );
break;
1698 FBX_ASSERT_NOW(
"unknown type" );
break;
1709 if( pIndex >= 0 && pIndex < GetDirectArray().GetCount() )
1711 switch( mDataTypes[pIndex].GetType() )
1713 case eFbxBool:
return FbxGetDirectArray<bool>(
this,pIndex).GetCount();
1714 case eFbxInt:
return FbxGetDirectArray<int>(
this,pIndex).GetCount();
1715 case eFbxFloat:
return FbxGetDirectArray<float>(
this,pIndex).GetCount();
1716 case eFbxDouble:
return FbxGetDirectArray<double>(
this,pIndex).GetCount();
1721 FBX_ASSERT_NOW(
"Unknown type" );
break;
1745 if (
this == &pOther)
1751 mDataTypes = pOther.mDataTypes;
1752 mDataNames.Resize(pOther.mDataNames.GetCount());
1753 for(
int i = 0; i < pOther.mDataNames.GetCount(); ++i)
1754 mDataNames.SetAt(i, FbxNew< FbxString >( *pOther.mDataNames[i] ) );
1759 switch (mDataTypes[i].GetType())
1762 FbxGetDirectArray<bool>(
this, i) = FbxGetDirectArray<bool>(&pOther, i);
1766 FbxGetDirectArray<int>(
this, i) = FbxGetDirectArray<int>(&pOther, i);
1770 FbxGetDirectArray<float>(
this, i) = FbxGetDirectArray<float>(&pOther, i);
1774 FbxGetDirectArray<double>(
this, i) = FbxGetDirectArray<double>(&pOther, i);
1778 FBX_ASSERT_NOW(
"Unknown type" );
1800 const int lCount = GetDirectArray().GetCount();
1802 directArray = GetDirectArray().
GetLocked(directArray);
1803 for( i = 0; directArray !=
NULL && i < lCount; ++i )
1805 if( directArray[i] )
1809 GetDirectArray().
Release((
void**)ptr);
1810 for( i = 0; i < mDataNames.GetCount(); ++i )
1829 size +=
sizeof(mId);
1831 for(
int i = 0; i < mDataTypes.GetCount(); i++)
1833 size +=
sizeof(mDataTypes[i]);
1835 size += (mDataNames.GetCount() *
sizeof(
FbxString*));
1843 #ifndef DOXYGEN_SHOULD_SKIP_THIS 1857 mDataTypes( pDataTypes )
1859 FBX_ASSERT( pDataTypes.GetCount() == pDataNames.GetCount() );
1860 for(
int i = 0; i < pDataNames.GetCount(); ++i )
1862 mDataNames.Add( FbxNew< FbxString >( pDataNames[i] ) );
1871 for (
int lIndex = 0; lIndex < pOther.mDataNames.GetCount(); ++lIndex)
1873 mDataNames.Add(FbxNew<FbxString>(*(pOther.mDataNames[lIndex])));
1881 switch (mDataTypes[i].GetType())
1884 FbxGetDirectArray<bool>(
this, i) = FbxGetDirectArray<bool>(&pOther, i);
1888 FbxGetDirectArray<int>(
this, i) = FbxGetDirectArray<int>(&pOther, i);
1892 FbxGetDirectArray<float>(
this, i) = FbxGetDirectArray<float>(&pOther, i);
1896 FbxGetDirectArray<double>(
this, i) = FbxGetDirectArray<double>(&pOther, i);
1900 FBX_ASSERT_NOW(
"Unknown type" );
1921 virtual void AllocateArrays()
1933 GetDirectArray().Resize( mDataTypes.GetCount() );
1936 for( i = 0; i < mDataTypes.GetCount(); ++i )
1938 FbxHandle** dst =
NULL;
1939 dst = GetDirectArray().GetLocked(dst);
1942 switch( mDataTypes[i].GetType() )
1949 FBX_ASSERT_NOW(
"Trying to assign an unknown type" );
break;
1951 FbxHandle*** ptr = &dst;
1952 GetDirectArray().Release((
void**)ptr);
2043 FBX_ASSERT_NOW(
"Smoothing layer elements must be direct mapped" );
2051 #ifndef DOXYGEN_SHOULD_SKIP_THIS 2083 FBX_ASSERT_NOW(
"Crease layer elements must be direct mapped" );
2091 #ifndef DOXYGEN_SHOULD_SKIP_THIS 2123 FBX_ASSERT_NOW(
"hole layer elements must be direct mapped" );
2131 #ifndef DOXYGEN_SHOULD_SKIP_THIS 2154 #ifndef DOXYGEN_SHOULD_SKIP_THIS 2270 else if (pAlpha < 0.0)
2289 #ifndef DOXYGEN_SHOULD_SKIP_THIS 2290 virtual int MemorySize()
const 2293 size +=
sizeof(mBlendMode);
2294 size +=
sizeof(mAlpha);
2305 mReferenceMode = eIndexToDirect;
2455 int GetUVSetCount()
const;
2710 void Clone(
FbxLayer const& pSrcLayer);
2715 #ifndef DOXYGEN_SHOULD_SKIP_THIS 2744 virtual int MemoryUsage()
const;
2751 #define FBXSDK_FOR_EACH_TEXTURE(lLayerIndex) for((lLayerIndex)=0;(lLayerIndex)<FbxLayerElement::sTypeTextureCount;(lLayerIndex)++) 2756 #define FBXSDK_FOR_EACH_NON_TEXTURE(lLayerIndex) for((lLayerIndex)=0;(lLayerIndex)<FbxLayerElement::sTypeNonTextureCount;(lLayerIndex)++) 2761 #define FBXSDK_TEXTURE_INDEX(ElementType) (int(ElementType)-FbxLayerElement::sTypeTextureStartIndex) 2766 #define FBXSDK_TEXTURE_TYPE(TextureIndex) (FbxLayerElement::EType((TextureIndex)+FbxLayerElement::sTypeTextureStartIndex)) 2771 #define FBXSDK_NON_TEXTURE_INDEX(ElementType) (int(ElementType)-FbxLayerElement::sTypeNonTextureStartIndex) 2776 #define FBXSDK_NON_TEXTURE_TYPE(Index) (FbxLayerElement::EType((Index)+FbxLayerElement::sTypeNonTextureStartIndex)) 2804 #undef FBXSDK_LAYER_ELEMENT_CREATE_DECLARE
int GetReadLockCount() const
Retrieves the read lock count.
int RemapIndexArrayTo(FbxLayerElement *pLayerEl, FbxLayerElement::EMappingMode pNewMapping, FbxLayerElementArrayTemplate< int > *pIndexArray)
Remap the index array to a new EMappingMode.
FbxDataType FbxLayerElementUserDataDT
Layer element for mapping Tangents to a geometry.
bool RemoveIt(T const &pItem)
Removes one item from the data buffer.
FbxDataType GetDataType(const char *pName) const
Returns the specified attribute data type.
FbxLayerElement & operator=(FbxLayerElement const &pOther)
Assignment operator.
void * GetReference(int pIndex, EFbxType pValueType)
const FbxLayerElementArrayTemplate< void * > * GetDirectArrayVoid(int pIndex, bool *pStatus=((void *) 0)) const
Returns the direct array with the specified attribute index.
FBX SDK environment definition.
void * GetImplementation()
void SetStatus(LockAccessStatus::ELockAccessStatus pVal) const
void SetReferenceMode(EReferenceMode pReferenceMode)
Sets the Reference Mode.
#define FBXSDK_FRIEND_NEW()
FbxLayer class provides a base for the layering mechanism.
int FindBefore(int pBeforeIndex, const void *pItem, EFbxType pValueType) const
Searches for an item before the specified index in the data buffer.
int FindBefore(int pBeforeIndex, T const &pItem) const
Searches for one item before the specified index in the data buffer.
Layer element for mapping materials (FbxSurfaceMaterial) to a geometry.
virtual bool ContentWriteTo(FbxStream &pStream) const
Writes the content of the object to the given stream.
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.
FbxLayerElementBinormal FbxGeometryElementBinormal
FbxLayerElementNormal FbxGeometryElementNormal
FbxLayerElementArrayTemplate provides data array manipulation of the data buffer for FbxLayerElement...
EReferenceMode
Determines how the mapping information is stored in the array of coordinates.
int ReadUnlock() const
Releases a read lock on this array.
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.
bool IsWriteLocked() const
Returns whether write is locked.
T RemoveAt(int pIndex)
Removes the specified item from the data buffer.
int FindBefore(int pBeforeIndex, T const &pItem)
Searches for one item before the specified index in the data buffer.
virtual int Read(void *, int) const =0
Read bytes from the stream and store them in the memory block.
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.
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.
EFbxType GetType() const
Retrieve this data type.
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.
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.
bool GetAt(int pIndex, T *pItem) const
Returns the specified item's value.
FbxLayerElementVisibility FbxGeometryElementVisibility
FbxSurfaceMaterial * FbxSurfaceMaterialPtr
FbxLayerElementArrayTemplate< Type > & GetDirectArray()
Returns the direct array of Layer Elements.
EBlendMode GetBlendMode() const
Returns the way Textures blend between layers.
FbxLayerElementTemplate< FbxSurfaceMaterial * > ParentClass
LockAccessStatus::ELockAccessStatus GetStatus() const
Retrieves the access state.
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.
FbxLayerElementArray & operator=(const FbxArray< T > &pArrayTemplate)
Assignment operator.
int GetCount() const
Returns the count of items in the data buffer.
const T * GetData() const
bool GetLast(T *pItem) const
Returns the last item's value.
T GetAt(const int pIndex) const
Retrieve a copy of the element at given index position in the array.
FbxLayerElementMaterial FbxGeometryElementMaterial
T RemoveLast()
Removes the last item from the data buffer.
FbxLayerElementTangent FbxGeometryElementTangent
FbxLayerElementTemplate & operator=(FbxLayerElementTemplate const &pOther)
Assignment operator.
double GetAlpha() const
Returns the transparency level between multiple levels of textures.
FbxLayerElementArray is the base class for FbxLayerElementArrayTemplate, it provides lock handling an...
T GetLast() const
Returns the last item's value.
EFbxType
Type identifier constants.
void SetAt(int pIndex, T const &pItem)
Sets the value of the specified item.
This class complements the FbxLayerElement class.
T GetAt(int pIndex) const
Returns the specified item's value.
int ReadLock() const
Increments the number of read locks on this array.
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.
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.
EMappingMode GetMappingMode() const
Returns the Mapping Mode.
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.
const char * GetDataName(int pIndex) const
Returns the attribute name at the specified index.
int FindAfter(int pAfterIndex, T const &pItem) const
Searches for an item after the specified index 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.
int GetDirectArrayCount() const
Returns this layer element's direct array count.
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.
virtual int Write(const void *, int)=0
Writes a memory block.
FbxLayerElementArrayTemplate< FbxSurfaceMaterial * > ParentClass
virtual void * GetLocked(ELockMode pLockMode, EFbxType pDataType)
Grants a locked access to the data buffer.
FbxLayerElementArrayTemplate< int > & GetIndexArray() const
Returns the index array of Layer Elements.
bool GetFirst(void **pItem, EFbxType pValueType) const
Returns the first item's value.
int Find(const void *pItem, EFbxType pValueType) const
Searches for an item in the data buffer.
void Release(void **pDataPtr)
Unlock the data buffer.
Layer element for indicating smoothness of components of a geometry.
FbxLayerElementArrayTemplate< Type > & GetDirectArray() const
Returns the direct array of Layer Elements.
Layer element for indicating crease of components of a geometry.
FbxLayerElementUserData FbxGeometryElementUserData
virtual void Release(void **pDataPtr, EFbxType pDataType)
Unlock the data buffer.
FbxLayerElementSmoothing FbxGeometryElementSmoothing
bool operator==(const FbxLayerElementTemplate &pOther) const
Equivalence operator.
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.
T operator[](int pIndex) const
Returns the specified item's value.
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.
FbxLayerElementPolygonGroup FbxGeometryElementPolygonGroup
EReferenceMode GetReferenceMode() const
Returns the Reference Mode.
T GetFirst() const
Returns the first item's value.
virtual int MemorySize() const
Queries the amount of memory used by this object as well as its content.
FbxLayerElementArrayTemplate< int > & GetIndexArray()
Returns the index array of Layer Elements.
bool Resize(const int pSize)
Inserts or erases elements at the end such that Size() becomes pSize, increasing capacity if needed...
FbxLayerElementHole FbxGeometryElementHole
Layer element for grouping related polygons together.
FbxLayerElement FbxGeometryElement
Defines geometry element classes.
int Find(T const &pItem) const
Searches for an item in the data buffer.
~FbxLayerElementArrayReadLock()
void CopyTo(FbxArray< T > &pDst)
Copies the items in the data buffer to an array.
bool GetLast(void **pItem, EFbxType pValueType) const
Returns the last item's value.
int GetArrayCount(int pIndex) const
Returns the direct array count for the attribute at pIndex.
bool GetAt(int pIndex, void **pItem, EFbxType pValueType) const
Returns the specified item's value.
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.
const FbxLayerElementArrayTemplate< void * > * GetDirectArrayVoid(const char *pName, bool *pStatus=((void *) 0)) const
Returns the direct array with the specified attribute name.
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...
const char * GetName() const
Returns the name of this object.
int Add(const void *pItem, EFbxType pValueType)
Appends a new item to the end of the data buffer.
Base class for elements of layers (FbxLayer).
int GetId() const
Queries the this layer element's ID.
int FindAfter(int pAfterIndex, const void *pItem, EFbxType pValueType) const
Searches for an item after the specified index in the data buffer.
bool operator==(const FbxLayerElement &pOther) const
Equivalence operator.
Class for array of basic elements such as pointers and basic types.
FbxDataType GetDataType(int pIndex) const
Returns the data type for the specified index.
void SetBlendMode(EBlendMode pBlendMode)
Sets the way Textures blend between layers.
bool GetFirst(T *pItem) const
Returns the first item's value.
Layer element for mapping Binormals to a geometry.