00001 #ifndef FBXFILESDK_FBXPROCESSORS_KFBXPROCESSORXREF_H
00002 #define FBXFILESDK_FBXPROCESSORS_KFBXPROCESSORXREF_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include <fbxfilesdk/fbxprocessors/fbxprocessors_def.h>
00040
00041 #include <fbxfilesdk/fbxprocessors/kfbxprocessor.h>
00042 #include <fbxfilesdk/components/kbaselib/klib/kmap.h>
00043
00044 namespace FBXPROCESSORS_NAMESPACE {
00045
00053 class KFBX_DLL KFbxProcessorXRefCopy : public KFbxProcessor
00054 {
00055 KFBXOBJECT_DECLARE(KFbxProcessorXRefCopy,KFbxProcessor);
00056
00057 class KFBX_DLL KFbxMissingUrlHandler
00058 {
00059 public:
00060 virtual ~KFbxMissingUrlHandler();
00061 virtual void MissingUrl(const KString& pUrl, const KFbxProperty&) = 0;
00062 };
00063
00068 public:
00069 KFbxTypedProperty<fbxString> OutputDirectory;
00070
00071
00072
00073 KFbxTypedProperty<fbxBool1> UpdateProperties;
00074
00075
00076
00077 KFbxTypedProperty<fbxBool1> TrackUpdatedProperties;
00078
00079
00080
00081
00082
00083
00084
00085 KFbxTypedProperty<fbxBool1> ForceCopy;
00086
00087
00088
00089 KFbxTypedProperty<fbxBool1> CopyFileTimes;
00091
00092
00093
00094
00095 KFbxMissingUrlHandler* MissingUrlHandler;
00096
00097
00098
00099
00100 struct KFbxPropertyUpdate
00101 {
00102 KFbxProperty mProperty;
00103 fbxString mOriginalValue;
00104
00105 inline KFbxPropertyUpdate() {}
00106 inline KFbxPropertyUpdate(const KFbxProperty& pProp, const fbxString& pVal) :
00107 mProperty(pProp), mOriginalValue(pVal) {}
00108
00109 inline bool operator <(const KFbxPropertyUpdate& pOther) const
00110 {
00111 return strcmp(mProperty.GetName(), pOther.mProperty.GetName()) < 0;
00112 }
00113 };
00114 typedef KSet2<KFbxPropertyUpdate> KFbxUpdateSet;
00115 typedef KMap<KFbxObject*, KFbxUpdateSet> KFbxPropertyUpdateMap;
00116
00117
00118
00119
00120
00121 KFbxPropertyUpdateMap& GetUpdatedProperties();
00122
00123
00124
00125 void RevertPropertyChanges();
00126
00127
00128
00129 struct KFBX_DLL KFbxAutoRevertPropertyChanges
00130 {
00131 KFbxAutoRevertPropertyChanges(KFbxProcessorXRefCopy* pCopy) : mXRefCopy(pCopy) {}
00132 ~KFbxAutoRevertPropertyChanges()
00133 {
00134 if( mXRefCopy )
00135 mXRefCopy->RevertPropertyChanges();
00136 }
00137
00138 KFbxProcessorXRefCopy* mXRefCopy;
00139 };
00140
00142
00143
00144
00146 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00147
00148 protected:
00149 KFbxPropertyUpdateMap mUpdatedProperties;
00150
00151
00152 protected:
00153 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00154 KFbxProcessorXRefCopy(KFbxSdkManager& pManager, char const* pName);
00155 ~KFbxProcessorXRefCopy();
00156 virtual void Construct (const KFbxProcessorXRefCopy* pFrom);
00157 virtual void Destruct (bool pRecursive, bool pDependents);
00158 bool ConstructProperties(bool pForceSet);
00159 KFbxProcessorXRefCopy& operator=(const KFbxProcessorXRefCopy&);
00160
00161
00162
00163 bool ShouldCopyFile(const KString& pTarget, const KString& pSource) const;
00164
00168 protected:
00169 virtual bool internal_ProcessCollectionBegin (KFbxCollection* pObject);
00170 virtual bool internal_ProcessCollectionEnd (KFbxCollection* pObject);
00171 virtual bool internal_ProcessObject (KFbxObject* pObject);
00172 bool ProcessPathProperty(KFbxProperty &pProperty);
00173 virtual bool ValidPropertyForXRefCopy(KFbxObject* pObject, KFbxProperty& lProperty) const;
00175
00176 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00177
00178 };
00179 }
00180
00181 #endif // FBXFILESDK_FBXPROCESSORS_KFBXPROCESSORXREF_H
00182