fbxsdk/utils/fbxembeddedfilesaccumulator.h Source File
 
 
 
fbxsdk/utils/fbxembeddedfilesaccumulator.h
Go to the documentation of this file.
00001 /****************************************************************************************
00002  
00003    Copyright (C) 2013 Autodesk, Inc.
00004    All rights reserved.
00005  
00006    Use of this software is subject to the terms of the Autodesk license agreement
00007    provided at the time of installation or download, or which otherwise accompanies
00008    this software in either electronic or hard copy form.
00009  
00010 ****************************************************************************************/
00011 
00013 #ifndef _FBXSDK_UTILS_EMBEDDED_FILES_ACCUMULATOR_H_
00014 #define _FBXSDK_UTILS_EMBEDDED_FILES_ACCUMULATOR_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/utils/fbxprocessor.h>
00019 
00020 #include <fbxsdk/fbxsdk_nsbegin.h>
00021 
00027 class FBXSDK_DLL FbxEmbeddedFilesAccumulator : public FbxProcessor
00028 {
00029 public:
00038     struct PropertyUrlIndex
00039     {
00040         FbxString mPropName;
00041         int     mIndex;
00042 
00043         PropertyUrlIndex() : mIndex(0)
00044         {
00045         }
00046 
00047         PropertyUrlIndex(const FbxString& pUrl, int pIndex)
00048             : mPropName(pUrl)
00049             , mIndex(pIndex)
00050         {
00051         }
00052     };
00053 
00055     struct PropertyUrlIndexCompare
00056     {
00057         inline int operator()(const PropertyUrlIndex& pUrl1, const PropertyUrlIndex& pUrl2) const
00058         {
00059             if( pUrl1.mPropName < pUrl2.mPropName )
00060             {
00061                 return -1;
00062             }
00063             if( pUrl2.mPropName < pUrl1.mPropName )
00064             {
00065                 return 1;
00066             }
00067 
00068             if(pUrl1.mIndex < pUrl2.mIndex)
00069             {
00070                 return -1;
00071             }
00072             if(pUrl2.mIndex < pUrl1.mIndex)
00073             {
00074                 return 1;
00075             }
00076 
00077             return 0;                
00078         }
00079     };
00080 
00081     typedef FbxSet2<PropertyUrlIndex, PropertyUrlIndexCompare> PropertyUrlIndexSet;
00082 
00083     typedef FbxMap<FbxObject*, PropertyUrlIndexSet> ObjectPropertyMap;
00084 
00085     struct EmbeddedFileInfo
00086     {
00087         FbxString                 mOriginalPropertyUrl;
00088         ObjectPropertyMap   mConsumers;
00089     };
00091 
00098     typedef FbxMap<FbxString, EmbeddedFileInfo>     EmbeddedFilesMap;
00099 
00100     EmbeddedFilesMap   mEmbeddedFiles;
00102 
00103 public:
00104     
00114     FbxEmbeddedFilesAccumulator(FbxManager& pManager, const char* pName, FbxSet2<FbxString>& pPropertyFilter);
00115     virtual ~FbxEmbeddedFilesAccumulator();
00116 
00117 /*****************************************************************************************************************************
00118 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
00119 *****************************************************************************************************************************/
00120 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00121 private:
00122     virtual bool internal_ProcessObject(FbxObject* pObject);
00123     FbxSet2<FbxString>   mPropertyFilter;
00124 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
00125 };
00126 
00127 #include <fbxsdk/fbxsdk_nsend.h>
00128 
00129 #endif /* _FBXSDK_UTILS_EMBEDDED_FILES_ACCUMULATOR_H_ */