+ #pragma warning(disable : 4345) //warning C4345: behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized
+ inline int FBXSDK_sprintf(char* dst, size_t dstsize, const char* format, ...){ va_list vl; va_start(vl, format); int ret = vsprintf(dst, format, vl); va_end(vl); return ret; }
+ inline int FBXSDK_snprintf(char* dst, size_t dstsize, const char* format, ...){ va_list vl; va_start(vl, format); int ret = vsnprintf(dst, dstsize, format, vl); va_end(vl); return ret; }
+ inline int FBXSDK_vsprintf(char* dst, size_t dstsize, const char* format, va_list vl){ return vsprintf(dst, format, vl); }
+ inline int FBXSDK_vsnprintf(char* dst, size_t dstsize, const char* format, va_list vl){ return vsnprintf(dst, dstsize, format, vl); }
+ /** Append an element at the end of the array, growing the array by one element if capacity is not sufficient.
+ * \param pElement Element to append to the array.
+ * \return -1 if add failed, otherwise the position of the added element in the array. */
+ inline int AddCompact(const T& pElement)
+ {
+ return InsertAt(mSize, pElement, true);
+ }
+
+ /** Retrieve the number of element contained in the array. To increase the capacity without increasing the size, please use Reserve().
+ * \return The number of element in the array.
+ * \remark The size of the array cannot exceed its capacity. */
+ inline int Size() const { return mSize; }
+
+ /** Retrieve the current allocated memory capacity of the array.
+ * \return The capacity of the array in number of element.
+ * \remark The capacity will always be greater or equal to its size. */
+ inline int Capacity() const { return mCapacity; }
+
+ /** Retrieve a reference of the element at given index position in the array.
+ * \param pIndex Position of element in the array.
+ * \return A reference to the element at the specified position in the array.
+ * \remark No error will be thrown if the index is out of bounds. */
+ inline T& operator[](const int pIndex) const
+ {
+ #ifdef _DEBUG
+ FBX_ASSERT_MSG(pIndex >= 0, "Index is out of range!");
+ if( pIndex >= mSize )
+ {
+ if( pIndex < mCapacity )
+ {
+ FBX_ASSERT_NOW("Index is out of range, but not outside of capacity! Call SetAt() to use reserved memory.");
+ }
+ else FBX_ASSERT_NOW("Index is out of range!");
+ }
+ #endif
+ return (T&)mArray[pIndex];
+ }
+
+ /** Retrieve a copy of the element at given index position in the array.
+ * \param pIndex Position of element in the array.
+ * \return The value of the element at the specified position in the array.
+ * \remark No error will be thrown if the index is out of bounds. */
+ inline T GetAt(const int pIndex) const
+ {
+ return operator[](pIndex);
+ }
+
+ /** Retrieve a copy of the first element.
+ * \return Copy of the first element.
+ * \remark The array should have at least one element and no error will be thrown if the array is empty. */
+ inline T GetFirst() const
+ {
+ return GetAt(0);
+ }
+
+ /** Retrieve a copy of the last element.
+ * \return Copy of the last element.
+ * \remark The array should have at least one element and no error will be thrown if the array is empty. */
+ inline T GetLast() const
+ {
+ return GetAt(mSize-1);
+ }
+
+ /** Find first matching element, from first to last.
+ * \param pElement The element to be compared to each of the elements.
+ * \param pStartIndex The position to start searching from.
+ * \return Position of first matching element or -1 if there is no matching element. */
+ inline int Find(const T& pElement, const int pStartIndex=0) const
+ {
+ FBX_ASSERT_RETURN_VALUE(pStartIndex >= 0, -1);
+ for( int i = pStartIndex; i < mSize; ++i )
+ {
+ if( operator[](i) == pElement ) return i;
+ }
+ return -1;
+ }
+
+ /** Find first matching element, from last to first.
+ * \param pElement The element to be compared to each of the elements.
+ * \param pStartIndex The position to start searching from.
+ * \return Position of first matching element or -1 if there is no matching element. */
+ inline int FindReverse(const T& pElement, const int pStartIndex=FBXSDK_INT_MAX) const
+ {
+ for( int i = FbxMin(pStartIndex, mSize-1); i >= 0; --i )
+ {
+ if( operator[](i) == pElement ) return i;
+ }
+ return -1;
+ }
+
+ /** Request for allocation of additional memory without inserting new elements. After the memory has been reserved, please use SetAt() to initialize elements.
+ * \param pCapacity The number of additional element memory allocation requested.
+ * \return \c true if the memory allocation succeeded or if the capacity is unchanged, \c false otherwise.
+ * \remark If the requested capacity is less than or equal to the current capacity, this call has no effect. In either case, Size() is unchanged. */
+ /** Inserts or erases elements at the end such that Size() becomes pSize, increasing capacity if needed. Please use SetAt() to initialize any new elements.
+ * \param pSize The new count of elements to set the array to. Must be greater or equal to zero.
+ * \return \c true if the memory (re)allocation succeeded, \c false otherwise.
+ * \remark If the requested element count is less than or equal to the current count, elements are freed from memory. Otherwise, the array grows and elements are unchanged. */
+ /** Memory pool destructor. Upon destruction, all memory blocks of the pool will be de-allocated. */
+ ~FbxMemoryPool();
+
+ /** Free memory of all memory blocks from this memory pool, also effectively resetting the block count to zero.
+ * \remark The block size and alignment/resize/concurrent support will remain unchanged. */
+ void Reset();
+
+ /** Allocate or lock a memory block for usage.
+ * \return An memory block pointer that can be NULL if the memory pool cannot grow in size and no blocks are available. */
+ void* Allocate();
+
+ /** Dispose or unlock a memory block.
+ * \param pMemBlock A pointer to the memory block to release. This will not free the block's memory, instead simply putting it back in the available stack. */
+ * \return The class identification string name. */
+ const char* GetName() const;
+
+ /** Retrieve the parent ClassId.
+ * \return The parent ClassId. */
+ FbxClassId GetParent() const;
+
+ /** Create an instance of this class.
+ * \param pManager The FBX SDK Manager to be used to instantiate this object. This allow the object to use the same memory manager as the provided manager.
+ * \param pName The name to assign to this new object instance.
+ * \param pFrom An object to clone if it matches the same ClassId. This is an optional parameter.
+ * \return The newly created instance of this class. */
+ /** Test if this class is a hierarchical children of the specified class type. This is the standard method to differentiate object classes.
+ * \param pId The class type to test against self.
+ * \return True if the object is a hierarchical children of the type specified.
+ * \remark This function will perform a complete search until it reaches the top level class, but it will stop as soon as one ClassId matches the test. */
+ bool Is(const FbxClassId& pId) const;
+
+ /** Equivalence operator.
+ * \param pClassId The class type to test against self.
+ * \return \c true if the ClassId is exactly the same, \c false otherwise.
+ * \remark This function only perform direct equality test, and doesn't test hierarchic children. */
+/** Frees the loaded module and, if necessary, decrements its reference count.
+ * \param pModuleHandle A valid module handle.
+ * \return \c true on success, \c false otherwise.
+ * \remark When the reference count reaches zero, the module is unloaded from the address space of the calling process and the handle is no longer valid.
+ /** Virtual function called once after the FBX SDK read an FBX file. Users can re-implement it in their plug-in if they need
+ * to perform tasks at that moment. The scene provided in parameter can be altered. If not re-implemented, this function does nothing.
+ * \param pScene The scene that was read in the FBX file.
+ */
+ virtual void ReadEnd(FbxScene& pScene);
+
+ /** Accessor to the plug-in definition structure that contains basic information on the plug-in like its name or version. This is
+ * the only method available to differentiate plug-ins.
+ * \return The definition structure for this plug-in.
+ */
+ const FbxPluginDef& GetDefinition() const;
+
+ /** Retrieve the module address pointer for this plug-in. With this module instance handle, for example someone can query procedures addresses,
+ * allowing more complex interactions, as well as other operating system module specific functions.
+ */
+ FbxModule GetModuleHdl();
+
+protected:
+ /** Use the Create() and Destroy() methods declared and implemented in the FBXSDK_PLUGIN_DECLARE and FBXSDK_PLUGIN_IMPLEMENT macros to construct and destroy FbxPlugin objects.
+ * \param pDefinition The definition associated with this plug-in. Each plug-in must have its own definition to differentiate it with other plug-ins.
+ * \param pModuleHandle A pointer to the plug-in module address.
+ /** This compares whether two FbxQuery are the same, NOT whether the query matches or not. It's strictly the equivalent of an operator==, but virtual.
+//! A plug-in loading strategy that loads all DLLs with a specific extension from a specific directory. When this class is destroyed all of the plug-ins are unloaded.
+class FBXSDK_DLL FbxScopedLoadingDirectory : public FbxLoadingStrategy
+{
+public:
+ /** Constructor, which also load plug-ins in the folder specified.
+ * \param pDirectoryPath The directory path.
+ * \param pPluginExtension The plug-in extension. */
+ * Matrices are defined using the Column Major scheme. When a FbxAMatrix represents a transformation (translation, rotation and scale),
+ * the last row of the matrix represents the translation part of the transformation.
+ *
+ * \remarks It is important to realize that an affine matrix must respect a certain structure. To be sure the structure is respected,
+ * use SetT, SetR, SetS, SetQ, SetTRS or SetTQS. If by mistake bad data is entered in this affine matrix, some functions such as
+ * Inverse() will yield wrong results. If a matrix is needed to hold values that aren't associate with an affine matrix, please use FbxMatrix instead.
+ */
+class FBXSDK_DLL FbxAMatrix : public FbxDouble4x4