fbxsdk/utils/fbxprocessorxref.h Source File

fbxprocessorxref.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_UTILS_PROCESSOR_XREF_H_
14 #define _FBXSDK_UTILS_PROCESSOR_XREF_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
27 {
29 
30 public:
32  {
33  public:
34  virtual ~MissingUrlHandler();
35  virtual void MissingUrl(const FbxString& pUrl, const FbxProperty&) = 0;
36  };
37 
43 
48 
53 
62 
68 
74 
80  {
83 
84  inline PropertyUpdate() {}
85  inline PropertyUpdate(const FbxProperty& pProp, const FbxString& pVal) :
86  mProperty(pProp), mOriginalValue(pVal) {}
87 
88  inline bool operator <(const PropertyUpdate& pOther) const
89  {
90  return strcmp(mProperty.GetName(), pOther.mProperty.GetName()) < 0;
91  }
92  };
95 
101  PropertyUpdateMap& GetUpdatedProperties();
102 
106  void RevertPropertyChanges();
107 
112  {
113  AutoRevertPropertyChanges(FbxProcessorXRefCopy* pCopy) : mXRefCopy(pCopy) {}
115  {
116  if( mXRefCopy )
117  mXRefCopy->RevertPropertyChanges();
118  }
119 
121  };
122 
123 /*****************************************************************************************************************************
124 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
125 *****************************************************************************************************************************/
126 #ifndef DOXYGEN_SHOULD_SKIP_THIS
127 protected:
128  virtual void Construct(const FbxObject* pFrom);
129  virtual void ConstructProperties(bool pForceSet);
130 
131  PropertyUpdateMap mUpdatedProperties;
132 
133  // Implements the rules specified for the ForceCopy property.
134  // Also checks the ForceCopy property.
135  bool ShouldCopyFile(const FbxString& pTarget, const FbxString& pSource) const;
136 
137  virtual bool internal_ProcessCollectionBegin (FbxCollection* pObject);
138  virtual bool internal_ProcessCollectionEnd (FbxCollection* pObject);
139  virtual bool internal_ProcessObject (FbxObject* pObject);
140  bool ProcessPathProperty(FbxProperty &pProperty);
141  virtual bool ValidPropertyForXRefCopy(FbxObject* pObject, FbxProperty& lProperty) const;
142 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
143 };
144 
145 #include <fbxsdk/fbxsdk_nsend.h>
146 
147 #endif /* _FBXSDK_UTILS_PROCESSOR_XREF_H_ */
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
FBX SDK environment definition.
This is just a safety net to make sure RevertPropertyChanges is called when this goes out of scope...
PropertyUpdate(const FbxProperty &pProp, const FbxString &pVal)
FbxPropertyT< FbxBool > ForceCopy
Default to TRUE – when not set, files are only copied if one of the following conditions is met: ...
FbxPropertyT< FbxBool > TrackUpdatedProperties
Default to FALSE – when set, this informs the processor to track every properties that were modified...
Utility class to manipulate strings.
Definition: fbxstring.h:66
FbxMap< FbxObject *, UpdateSet > PropertyUpdateMap
FbxSet< PropertyUpdate > UpdateSet
FbxString GetName() const
Returns the internal name of the property.
Since FbxProperty is an opaque type, we can't do an efficient operator < on="" it,="" and="" must="" keep="" the="" />
This class implements an efficient map based on key comparison, which stores key-value pairs...
Definition: fbxmap.h:68
FbxPropertyT< FbxBool > CopyFileTimes
Default to TRUE – when copying a file, also copy its modification time.
The base class of most FBX objects.
Definition: fbxobject.h:157
This class implements an efficient set based on value comparison, which stores values.
Definition: fbxset.h:25
MissingUrlHandler * MissingUrlHandler
Optional callback; when set, this will be called when an Url cannot be be copied because the source i...
AutoRevertPropertyChanges(FbxProcessorXRefCopy *pCopy)
The class and its derived classes(e.g.
Definition: fbxprocessor.h:27
Class to hold user properties.
Definition: fbxproperty.h:37
A FbxObject derived container for FbxObject.
Definition: fbxcollection.h:28
#define FBXSDK_DLL
Definition: fbxarch.h:173
This class contains objects This class also provides access to global settings and take information...
FbxPropertyT< FbxString > OutputDirectory
FbxPropertyT< FbxBool > UpdateProperties
As we resolve xref and copy assets, do we update properties to now use this relative path...