13 #ifndef _FBXSDK_FILEIO_FBX_IO_H_ 
   14 #define _FBXSDK_FILEIO_FBX_IO_H_ 
  123 #define FBX_FILE_VERSION_2000       2000    //FBX 2.0 
  124 #define FBX_FILE_VERSION_2001       2001    //FBX 2.01 
  125 #define FBX_FILE_VERSION_3000       3000    //FBX 3.0 
  126 #define FBX_FILE_VERSION_3001       3001    //FBX 3.01 
  127 #define FBX_FILE_VERSION_4000       4000    //FBX 4.0 
  128 #define FBX_FILE_VERSION_4001       4001    //FBX 4.01 
  129 #define FBX_FILE_VERSION_4050       4050    //FBX 4.5 
  130 #define FBX_FILE_VERSION_5000       5000    //FBX 5.0 
  131 #define FBX_FILE_VERSION_5800       5800    //FBX 5.8 
  132 #define FBX_FILE_VERSION_6000       6000    //FBX 6.0 
  133 #define FBX_FILE_VERSION_6100       6100    //FBX 6.1 (guarantee compatibility with Autodesk 2010 products) 
  134 #define FBX_FILE_VERSION_7000       7000    //Compatible with 7.1, and taken as such 
  135 #define FBX_FILE_VERSION_7099       7099    //Compatible with 7.1, and taken as such 
  136 #define FBX_FILE_VERSION_7100       7100    //FBX 7.1 (guarantee compatibility with Autodesk 2011 products) 
  137 #define FBX_FILE_VERSION_7200       7200    //FBX 7.2 (guarantee compatibility with Autodesk 2012 products) 
  138 #define FBX_FILE_VERSION_7300       7300    //FBX 7.3 (guarantee compatibility with Autodesk 2013 products) 
  139 #define FBX_FILE_VERSION_7400       7400    //FBX 7.4 (guarantee compatibility with Autodesk 2014/2015 products) 
  140 #define FBX_FILE_VERSION_7500       7500    //FBX 7.5 (guarantee compatibility with Autodesk 2016 products) 
  143 #define FBX_53_MB55_COMPATIBLE      "FBX53_MB55" 
  144 #define FBX_60_COMPATIBLE           "FBX60_MB60" 
  145 #define FBX_2005_08_COMPATIBLE      "FBX200508_MB70" 
  146 #define FBX_2006_02_COMPATIBLE      "FBX200602_MB75" 
  147 #define FBX_2006_08_COMPATIBLE      "FBX200608" 
  148 #define FBX_2006_11_COMPATIBLE      "FBX200611" 
  149 #define FBX_2009_00_COMPATIBLE      "FBX200900" 
  150 #define FBX_2009_00_V7_COMPATIBLE   "FBX200900v7" 
  151 #define FBX_2010_00_COMPATIBLE      "FBX201000" 
  152 #define FBX_2011_00_COMPATIBLE      "FBX201100" 
  153 #define FBX_2012_00_COMPATIBLE      "FBX201200" 
  154 #define FBX_2013_00_COMPATIBLE      "FBX201300" 
  155 #define FBX_2014_00_COMPATIBLE      "FBX201400" 
  156 #define FBX_2016_00_COMPATIBLE      "FBX201600" 
  159 #define FBX_DEFAULT_FILE_VERSION        FBX_FILE_VERSION_7500 
  160 #define FBX_DEFAULT_FILE_COMPATIBILITY  FBX_2016_00_COMPATIBLE 
  243     virtual void                Reset();
 
  248     virtual bool                ReadExtendedHeaderInformation(
FbxIO*);
 
  422     bool ProjectOpenDirect(
const char* pName, 
FbxReader* pReader, 
bool pCheckCRC = 
false, 
bool pOpenMainSection = 
true, 
FbxIOFileHeaderInfo* pFileHeaderInfo = 
NULL);
 
  474     bool ProjectCreateEmpty(
const char* pName, 
FbxWriter* pWriter, 
int pVersion, 
bool pBinary, 
bool pEncrypted);
 
  485     bool ProjectCreateEmpty(
FbxStream* pStream, 
void* pStreamData, 
FbxWriter* pWriter, 
int pVersion, 
bool pBinary, 
bool pEncrypted);
 
  490     bool ProjectWrite_BeginFileHeader();
 
  495     bool ProjectWrite_BeginExtendedHeader();
 
  506     bool ProjectWrite_EndExtendedHeader();
 
  511     bool ProjectWrite_EndFileHeader();
 
  518     bool ProjectClose(
void** pData=0, 
size_t* pSize=0);
 
  544     bool ProjectCreateEmbeddedFolder(
const FbxXRefManager& pXRefManager, 
FbxString& pCreatedFolder, 
const char* pUserDefinedFolder = 
NULL); 
 
  549     void SetEmbedded(
bool pValue);
 
  554     void SetEmbeddingExtractionFolder(
const char* pExtractionFolder);
 
  558     const char* GetEmbeddingExtractionFolder();
 
  563     bool IsEmbedded() 
const;
 
  568     bool IsBinary() 
const;
 
  573     bool IsEncrypted () 
const;
 
  609     bool Fbx7Support() 
const;
 
  614     void Fbx7Support(
bool pSupport);
 
  617     bool CompressArrays() 
const;
 
  622     void CompressArrays(
bool pCompress);
 
  625     int  CompressMinimumSize() 
const;
 
  630     void CompressMinimumSize(
int pSize);
 
  633     int  CompressLevel() 
const;
 
  640     void CompressLevel(
int pLevel);
 
  652     bool ProjectOpenMainSection();
 
  657     int ProjectGetExtensionSectionCount() 
const;
 
  663     bool ProjectOpenExtensionSection(
int pExtensionSectionIndex);
 
  669     bool ProjectCreateExtensionSection(
bool pOverwriteLastExtensionSection = 
false);
 
  673     void ProjectCloseSection();
 
  678     int ProjectGetCurrentSection() 
const;
 
  683     int ProjectGetCurrentSectionMode() 
const;
 
  688     int ProjectGetCurrentSectionVersion() 
const;
 
  697     int ProjectGetSectionVersion(
int pSection) 
const;
 
  705     static void ProjectConvertVersionNumber(
int pVersion, 
int& pMajor, 
int& pMinor, 
int& pRevision);
 
  710     bool IsPasswordProtected() 
const;
 
  717     bool CheckPassword(
const char* pPassword);
 
  725     bool WritePassword(
const char* pPassword);
 
  737     const char* GetFilename() 
const;
 
  743     FbxString GetDataDirectory(
bool pAutoCreate = 
true);
 
  753     FbxString GetMediaDirectory(
bool pCreate = 
false, 
const char* pUserDefinedFolder = 
NULL);
 
  760     FbxString GetContainerTemplateDirectory(
const char* pTemplateName, 
bool pCreate);
 
  766     char* GetRelativePath(
const char* pPath);
 
  772     char* GetRelativeFilePath(
const char* pFilePath);
 
  778     char* GetFullPath(
const char* pRelativePath);
 
  784     char* GetFullFilePath(
const char* pRelativeFilePath);
 
  790     char* GetTmpProjectName(
const char* pName) 
const;
 
  798     bool SwapFromTmpProject(
const char* pName, 
char* pError=
NULL, 
int pErrorSize=0);
 
  810     void FieldReadResetPosition();
 
  815     int FieldGetCount() 
const;
 
  821     const char* FieldGetName(
int pFieldIndex) 
const;
 
  827     int FieldGetInstanceCount(
const char* pFieldName) 
const;
 
  834     bool FieldReadBegin(
int pFieldIndex, 
int pInstance);
 
  840     bool FieldReadBegin(
const char* pFieldName);
 
  847     bool FieldReadBegin(
const char* pFieldName, 
int pInstance);
 
  853     bool FieldReadIsBlock();
 
  856     bool FieldReadBlockBegin();
 
  859     void FieldReadBlockEnd();
 
  862     int FieldReadGetCount() 
const;
 
  865     int FieldReadGetRemain() 
const;
 
  868     char FieldReadGetType() 
const;
 
  877     char FieldReadCH(
const char* pFieldName, 
char pDefault=0);
 
  880     const char* FieldReadC();
 
  886     const char* FieldReadC(
const char* pFieldName, 
const char* pDefault=
"");
 
  889     const char* FieldReadS();
 
  895     const char* FieldReadS(
const char* pFieldName, 
const char* pDefault=
"");
 
  904     bool FieldReadB(
const char* pFieldName, 
bool pDefault = 
false);
 
  908 int FieldReadI(
const char* pFieldName, 
int pDefault=0);
 
  930     float FieldReadF(
const char* pFieldName, 
float pDefault=0);
 
  939     double FieldReadD(
const char* pFieldName, 
double pDefault=0);
 
  944     FbxTime FieldReadT(
const char* pFieldName);
 
  961     void FieldReadFn(
float* pValue, 
FbxUInt pn);
 
  966     void FieldRead3F(
float* pValue);
 
  971     void FieldRead4F(
float* pValue);
 
  979     void FieldReadFn(
const char* pFieldName, 
float* pValue, 
const float *pDefault, 
FbxUInt pn);
 
  986     void FieldRead3F(
const char* pFieldName, 
float* pValue, 
const float* pDefault=
NULL);
 
  993     void FieldRead4F(
const char* pFieldName, 
float* pValue, 
const float* pDefault=
NULL);
 
  999     void FieldReadDn(
double* pValue, 
FbxUInt pn);
 
 1004     void FieldRead3D(
double* pValue);
 
 1009     void FieldRead4D(
double* pValue);
 
 1017     void FieldReadDn(
const char* pFieldName, 
double* pValue, 
const double *pDefault, 
FbxUInt pn);
 
 1024     void FieldRead3D(
const char* pFieldName, 
double* pValue, 
const double* pDefault=
NULL);
 
 1031     void FieldRead4D(
const char* pFieldName, 
double* pValue, 
const double* pDefault=
NULL);
 
 1036     void* FieldReadR(
int* pByteSize);
 
 1042     void* FieldReadR(
const char* pFieldName,
int* pByteSize);
 
 1055     FbxChar FieldReadByte(
const char* pFieldName, 
FbxChar pDefault=0);
 
 1085     unsigned int FieldReadUI();
 
 1091     unsigned int FieldReadUI(
const char* pFieldName, 
unsigned int pDefault=0);
 
 1105     const FbxChar*      FieldReadArraySBytes( 
int &pCount );
 
 1109     const FbxShort*     FieldReadArrayShort ( 
int &pCount );
 
 1113     const FbxUShort*        FieldReadArrayUShort( 
int &pCount );
 
 1117     const unsigned int* FieldReadArrayUI    ( 
int &pCount );
 
 1141     const unsigned int* FieldReadArray(
int &pCount, 
const unsigned int*);
 
 1156     virtual bool FieldReadEmbeddedFile (
FbxString& pFileName, 
FbxString& pRelativeFileName, 
const char* pEmbeddedMediaDirectory = 
"", 
bool *pIsFileCreated=
NULL);
 
 1161     const double*   FieldReadArrayD( 
int &pCount );
 
 1165     const float*    FieldReadArrayF( 
int &pCount );
 
 1169     const int*      FieldReadArrayI( 
int &pCount );
 
 1177     const bool*     FieldReadArrayB( 
int &pCount );
 
 1181     const FbxUChar*   FieldReadArrayBytes( 
int &pCount );
 
 1186     const int*    FieldReadArray(
int& pCount, 
const int*);
 
 1190     const float*  FieldReadArray(
int& pCount, 
const float*);
 
 1194     const double* FieldReadArray(
int& pCount, 
const double*);
 
 1202     const bool* FieldReadArray(
int& pCount, 
const bool*);
 
 1219     void FieldWriteBegin(
const char* pFieldName);
 
 1222     void FieldWriteEnd();
 
 1225     void FieldWriteBlockBegin();
 
 1232     void FieldWriteObjectBegin(
const char* pObjectType, 
const char* pName, 
const char* pSubType=
NULL);
 
 1235     void FieldWriteObjectEnd();
 
 1241     void FieldWriteBlockBegin(
const char* pFileName);
 
 1244     void FieldWriteBlockEnd ();
 
 1249     void FieldWriteCH(
char pValue);
 
 1255     void FieldWriteCH(
const char* pFieldName, 
char pValue);
 
 1260     void FieldWriteC(
const char* pValue);
 
 1266     void FieldWriteC(
const char* pFieldName, 
const char* pValue);
 
 1271     void FieldWriteS(
const char* pValue);
 
 1276     void FieldWriteS(
const FbxString& pValue);
 
 1282     void FieldWriteS(
const char* pFieldName, 
const char* pValue);
 
 1288     void FieldWriteS(
const char* pFieldName, 
const FbxString& pValue);
 
 1293     void FieldWriteB(
bool pValue);
 
 1299     void FieldWriteB(
const char* pFieldName, 
bool pValue);
 
 1304     void FieldWriteI(
int pValue);
 
 1310     void FieldWriteI(
const char* pFieldName, 
int pValue);
 
 1321     void FieldWriteLL(
const char* pFieldName, 
FbxLongLong pValue);
 
 1327     void FieldWriteF(
float pValue);
 
 1334     void FieldWriteF(
const char* pFieldName, 
float pValue);
 
 1339     void FieldWriteD(
double  pValue);
 
 1345     void FieldWriteD(
const char* pFieldName, 
double pValue);
 
 1350     void FieldWriteT(
FbxTime pTime);
 
 1356     void FieldWriteT(
const char* pFieldName,
FbxTime pValue);
 
 1367     void FieldWriteTS(
const char* pFieldName,
FbxTimeSpan pValue);
 
 1373     void FieldWriteFn(
const float* pValue, 
FbxUInt pn);
 
 1380     void FieldWriteFn(
const char* pFieldName, 
const float* pValue, 
FbxUInt pn);
 
 1385     void FieldWrite3F(
const float* pValue);
 
 1391     void FieldWrite3F(
const char* pFieldName, 
const float* pValue);
 
 1396     void FieldWrite4F(
const float* pValue);
 
 1402     void FieldWrite4F(
const char* pFieldName, 
const float* pValue);
 
 1408     void FieldWriteDn(
const double* pValue, 
FbxUInt pn);
 
 1415     void FieldWriteDn(
const char* pFieldName, 
const double* pValue, 
FbxUInt pn);
 
 1420     void FieldWrite3D(
const double* pValue);
 
 1426     void FieldWrite3D(
const char* pFieldName, 
const double* pValue);
 
 1431     void FieldWrite4D(
const double* pValue);
 
 1437     void FieldWrite4D(
const char* pFieldName, 
const double* pValue);
 
 1450     void FieldWriteArrayD( 
int n, 
const double*     pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1457     void FieldWriteArrayF( 
int n, 
const float*      pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1464     void FieldWriteArrayI( 
int n, 
const int*        pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1471     void FieldWriteArrayLL(
int n, 
const FbxLongLong*  pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1478     void FieldWriteArrayB( 
int n, 
const bool*       pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1485     void FieldWriteArrayBytes( 
int n, 
const FbxUChar* pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1491     void FieldWriteR(
const void* pRawData, 
int pByteSize);
 
 1498     void FieldWriteR(
const char* pFieldName, 
const void* pRawData, 
int pByteSize);
 
 1508     void FieldWriteByte(
FbxChar pValue);
 
 1514     void FieldWriteByte(
const char* pFieldName, 
FbxChar pValue);
 
 1519     void FieldWriteUByte(
FbxUChar pValue);
 
 1525     void FieldWriteUByte(
const char* pFieldName, 
FbxUChar pValue);
 
 1530     void FieldWriteShort(
FbxShort pValue);
 
 1536     void FieldWriteShort(
const char* pFieldName, 
FbxShort pValue);
 
 1541     void FieldWriteUShort(
FbxUShort pValue);
 
 1547     void FieldWriteUShort(
const char* pFieldName, 
FbxUShort pValue);
 
 1552     void FieldWriteUI(
unsigned int pValue);
 
 1558     void FieldWriteUI(
const char* pFieldName, 
unsigned int pValue);
 
 1570     void FieldWriteULL(
const char* pFieldName, 
FbxULongLong pValue);
 
 1578     void FieldWriteArraySBytes( 
int n, 
const FbxChar* pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1585     void FieldWriteArrayShort( 
int n, 
const FbxShort* pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1592     void FieldWriteArrayUShort( 
int n, 
const FbxUShort* pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1599     void FieldWriteArrayUI( 
int n, 
const unsigned int*        pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1606     void FieldWriteArrayULL(
int n, 
const FbxULongLong*  pValue, 
int pSize = 1, 
int pStride = 0 );
 
 1612     int GetFieldRMaxChunkSize() 
const;
 
 1617     void FieldWriteObjectReference(
const char* pName);
 
 1623     void FieldWriteObjectReference(
const char* pFieldName, 
const char* pName);
 
 1636     void WriteComments(
const char* pFieldName);
 
 1652     bool GetHaveLoadedEmbededFile() 
const;
 
 1658     void GetMemoryFileInfo(
void** pMemPtr, 
size_t& pSize) 
const;
 
 1663     bool    IsBeforeVersion6() 
const;
 
 1668     void    SetIsBeforeVersion6(
bool pIsBeforeVersion6);
 
 1673 #ifndef DOXYGEN_SHOULD_SKIP_THIS 
 1682     struct InternalImpl;
 
 1683     struct InternalImpl32;
 
 1684     struct InternalImpl64;
 
 1685     InternalImpl* mImpl;
 
 1689     void ProjectClear();
 
 1690     void ProjectReset();
 
 1692     bool ProjectReadHeader(
bool pCheckASCIIHeader, 
bool pCheckCRC, 
bool pOpenMainSection, 
FbxIOFileHeaderInfo* pFileHeaderInfo);
 
 1694     bool BinaryReadHeader();
 
 1695     bool BinaryReadSectionPosition();
 
 1696     bool ASCIIReadHeader();
 
 1697     bool ASCIIReadSectionPosition();
 
 1701     void BinaryWriteHeader();
 
 1702     void ASCIIWriteHeader();
 
 1704     void ReadEncryptionKey(
char* pEncryptionKey);
 
 1705     void WriteEncryptionKey(
char* pEncryptionKey);
 
 1709     bool ProjectClearSection();
 
 1710     bool ProjectOpenSection(
int pSection);
 
 1711     bool BinaryReadSectionHeader();
 
 1712     FbxInt64 BinaryReadSectionFooter(
char* pSourceCheck);
 
 1714     void BinaryReadSectionPassword();
 
 1716     bool ProjectWriteSectionHeader();
 
 1717     void BinaryWriteSectionFooter();
 
 1718     bool BinaryWriteExtensionCode(
FbxInt64 pSectionStart, 
FbxUInt32 pSectionVersion);
 
 1721     void SetCreationTime(
FbxString pCreationTime);
 
 1722     void CreateSourceCheck(
char* lSourceCheck);
 
 1723     bool TestSourceCheck(
char* pSourceCheck, 
char* pSourceCompany);
 
 1725     void EncryptSourceCheck(
char* pSourceCheck, 
char* pEncryptionData);
 
 1726     void DecryptSourceCheck(
char* pSourceCheck, 
const char* pEncryptionData);
 
 1733     void CheckValidityOfFieldName(
const char* pFieldName);
 
 1737     FbxString GetDirectory(
bool pAutoCreate, 
const char* pExtension);
 
FbxAutoResetXRefManager(FbxIO *pFbx, FbxXRefManager &pXRefManager)
Default constructor. 
 
FBX SDK environment definition. 
 
~FbxAutoResetXRefManager()
Destructor. 
 
FbxString mResolutionMode
resolution mode. 
 
Abstract class for implementing I/O operations through a stream of data. 
 
Utility class to manipulate strings. 
 
Base class of other readers used internally. 
 
This class facilitates the testing/reporting of errors. 
 
double mResolutionW
resolution width. 
 
int FbxFileVersionStrToInt(const char *pFileVersion)
Convert the FBX file version string to an integral number for <= or="">= tests purposes. =>
 
void ProjectSetXRefManager(const FbxXRefManager *)
Provide the XRef Manager to use to create the .fbm folder. 
 
Class to encapsulate time units. 
 
Render and resolution information. 
 
indicate not in a valid section 
 
Base class of other writers used internally. 
 
This class manages external references to files. 
 
static FbxIO * Create(BinaryType pBinaryType, FbxStatus &pStatus)
Creation function for this FbxIO class. 
 
const FbxXRefManager * ProjectGetXRefManager() const 
Get the XRef Manager to use. 
 
const FbxXRefManager * mXRefManager
 
double mResolutionH
resolution height. 
 
indicate currently in the main section 
 
signed long long FbxInt64
 
indicate currently in the extention section 0 
 
FbxIO represents an FBX file. 
 
FbxString mCameraName
camera name. 
 
Class for interfacing with files, providing a similar interface for files independant of the OS or fi...
 
Class to encapsulate time intervals. 
 
bool mIsOK
If the resolution data is ready.