13 #ifndef _FBXSDK_CORE_OBJECT_H_
14 #define _FBXSDK_CORE_OBJECT_H_
35 class FbxUserDataRecord;
36 class FbxConnectEvent;
39 #define FBXSDK_CLASS_DECLARE(Class, Parent)\
42 Class& operator=(const Class&);\
46 static FbxClassId ClassId;\
47 virtual FbxClassId GetClassId() const { return ClassId; }\
48 friend class FBXSDK_NAMESPACE::FbxManager;\
49 typedef Parent ParentClass;\
50 static Class* Create(FbxManager* pManager, const char* pName);\
52 #define FBXSDK_FBXOBJECT_DECLARE(Class, Parent)\
54 FBXSDK_CLASS_DECLARE(Class, Parent)\
56 static Class* Create(FbxObject* pContainer, const char* pName);\
58 static Class* Allocate(FbxManager* pManager, const char* pName, const Class* pFrom);\
60 #define FBXSDK_OBJECT_DECLARE(Class, Parent)\
62 FBXSDK_FBXOBJECT_DECLARE(Class, Parent)\
64 Class(FbxManager& pManager, const char* pName) : Parent(pManager, pName){};\
67 #define FBXSDK_ABSTRACT_OBJECT_DECLARE(Class, Parent)\
69 FBXSDK_CLASS_DECLARE(Class, Parent)\
71 static FbxObjectCreateProc Allocate;\
72 Class(FbxManager& pManager, const char* pName) : Parent(pManager, pName){};\
75 #define FBXSDK_OBJECT_IMPLEMENT(Class)\
77 FbxClassId Class::ClassId;\
78 Class* Class::Create(FbxManager* pManager, const char* pName)\
80 return (Class*)pManager->CreateNewObjectFromClassId(Class::ClassId, pName);\
82 Class* Class::Create(FbxObject* pContainer, const char* pName)\
84 FBX_ASSERT_RETURN_VALUE(pContainer && pContainer->GetFbxManager(), NULL);\
85 return (Class*)pContainer->GetFbxManager()->CreateNewObjectFromClassId(Class::ClassId, pName, pContainer);\
87 Class* Class::Allocate(FbxManager* pManager, const char* pName, const Class* pFrom)\
89 Class* lNewObject = FbxNew<Class>(*pManager, pName);\
90 lNewObject->Construct(pFrom);\
91 lNewObject->SetObjectFlags(FbxObject::eInitialized, true);\
95 #define FBXSDK_ABSTRACT_OBJECT_IMPLEMENT(Class)\
97 FbxClassId Class::ClassId;\
98 FbxObjectCreateProc Class::Allocate = 0;\
99 Class* Class::Create(FbxManager* pManager, const char* pName)\
101 return (Class*)pManager->CreateNewObjectFromClassId(Class::ClassId, pName);\
168 FBX_DEPRECATED
inline bool Is(
const FbxClassId& pClassId)
const {
return GetClassId().Is(pClassId); }
173 template <
class T>
inline bool Is()
const {
return GetClassId().Is(T::ClassId); }
194 void Destroy(
bool pRecursive=
false);
197 void ResetProperties();
206 eInitialized = 1 << 0,
211 eContentLoaded = 1 << 5,
212 eDontLocalize = 1 << 6,
213 eCopyCalledByClone = 1 << 16
219 void SetObjectFlags(EObjectFlag pFlags,
bool pValue);
224 bool GetObjectFlags(EObjectFlag pFlags)
const;
229 void SetAllObjectFlags(
FbxUInt pFlags);
233 FbxUInt GetAllObjectFlags()
const;
271 bool IsAReferenceTo()
const;
279 bool IsReferencedBy()
const;
283 int GetReferencedByCount()
const;
288 FbxObject* GetReferencedBy(
int pIndex)
const;
298 void SetName(
const char* pName);
303 const char* GetName()
const;
308 FbxString GetNameWithoutNameSpacePrefix()
const;
313 FbxString GetNameWithNameSpacePrefix()
const;
318 void SetInitialName(
const char* pName);
323 const char* GetInitialName()
const;
355 static FbxString RemovePrefix(
char* pName);
367 static FbxString StripPrefix(
const char* pName);
380 virtual bool GetSelected();
385 virtual void SetSelected(
bool pSelected);
398 void SetUserDataPtr(
const FbxUInt64& pUserID,
void* pUserData);
404 void* GetUserDataPtr(
const FbxUInt64& pUserID)
const;
728 return RootProperty.
Find(pName, pCaseSensitive );
739 return RootProperty.
Find(pName, pDataType, pCaseSensitive );
875 bool ContentIsLoaded()
const;
880 void ContentDecrementLockCount();
885 void ContentIncrementLockCount();
893 bool ContentIsLocked()
const;
900 virtual bool ContentWriteTo(
FbxStream& pStream)
const;
907 virtual bool ContentReadFrom(
const FbxStream& pStream);
918 void EmitMessage(FbxMessage* pMessage)
const;
931 virtual const char* Localize(
const char* pID,
const char* pDefault=
NULL)
const;
960 bool HasDefaultImplementation(
void)
const;
1004 virtual bool SetUrl(
char* pUrl);
1011 void SetRuntimeClassId(
const FbxClassId& pClassId);
1021 bool IsRuntime(
const FbxClassId& pClassId)
const;
1025 bool IsRuntimePlug()
const;
1030 virtual void Compact();
1039 virtual void Construct(
const FbxObject* pFrom);
1044 virtual void ConstructProperties(
bool pForceSet);
1049 virtual void Destruct(
bool pRecursive);
1053 virtual void ContentClear();
1063 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1065 virtual bool Compare(
FbxObject* pOtherObject);
1070 bool operator==(
const FbxObject& pObject);
1071 bool operator!=(
const FbxObject& pObject);
1075 inline FbxPropertyHandle& GetPropertyHandle() {
return RootProperty.mPropertyHandle; }
1080 virtual const char* GetTypeName()
const;
1086 void WipeAllConnections();
1089 static void SetWipeMode(
bool pState);
1090 static bool GetWipeMode();
1095 enum EPropertyNotifyType
1097 ePropertySetRequest,
1102 virtual bool ConnectNotify(
const FbxConnectEvent& pEvent);
1103 virtual bool PropertyNotify(EPropertyNotifyType pType,
FbxProperty& pProperty);
1104 bool Copyable(
const FbxObject& pObject);
1107 void CopyPropertiesFrom(
const FbxObject& pFrom);
1108 void SetClassRootProperty(
FbxProperty& lProperty);
1109 int GetFlatPropertyCount()
const;
1113 FbxUserDataRecord* mUserData;
1120 static bool mWipeMode;
1358 mProperty(pProperty),
1372 mProperty(pObject->RootProperty),
1440 while (mIndex>mSize) mIndex--;
1531 #define FBX_TYPE(class) ((const class*)0)
1541 return pObject && pObject->
Is<T>() ? (T*)pObject : 0;
1552 return pObject && pObject->
Is<T>() ? (
const T*)pObject : 0;
1556 #define FbxForEach(Iterator, Object) for((Object)=(Iterator).GetFirst();(Object)!=0;(Object)=(Iterator).GetNext())
1559 #define FbxForEachReverse(Iterator, Object) for(Object=(Iterator).GetLast();(Object)!=0;Object=(Iterator).GetPrevious())
1564 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1591 inline EType GetType()
const {
return mType; }
1592 inline EDirection GetDirection()
const {
return mDirection; }
1593 inline FbxProperty& GetSrc()
const {
return *mSrc; }
1594 inline FbxProperty& GetDst()
const {
return *mDst; }
1595 template <
class T>
inline T* GetSrcIfObject()
const {
return mSrc->
IsRoot() ? FbxCast<T>(mSrc->GetFbxObject()) : (T*)0; }
1596 template <
class T>
inline T* GetDstIfObject()
const {
return mDst->IsRoot() ? FbxCast<T>(mDst->GetFbxObject()) : (T*)0; }
1600 EDirection mDirection;
1605 class FbxObjectPropertyChanged :
public FbxEvent<FbxObjectPropertyChanged>
1610 FbxObjectPropertyChanged(
FbxProperty pProp) : mProp(pProp) {}
FbxProperty GetNextProperty(const FbxProperty &pProperty) const
Returns the next property of this object that follows the specified property.
int mSize
The class ID specifies the type of the source objects to be retrieved.
Class to manage property handle.
FBX SDK environment definition.
T * FindDstObject(const FbxCriteria &pCriteria, const char *pName, int pStartIndex=0) const
Searches the destination object with the specified name that is the specified class type and that sat...
FbxProperty GetNextDescendent(const FbxProperty &pProperty) const
Returns the property that follows pProperty that is a descendant of this property.
FbxIteratorSrcBase(FbxObject *pObject, FbxClassId pClassId)
Constructor.
FbxObject * FindSrcObject(const char *pName, int pStartIndex=0) const
Searches the source object with the specified name, starting at the specified index.
const FbxProperty & GetFirst()
Get the first property of the object.
bool DisconnectDstObject(FbxObject *pObject)
Disconnects this object from the destination object.
T * GetSrcObject(int pIndex=0) const
Returns the source object of the specified class type at the specified index.
void ResetToEnd()
Reset the iterate index to the end.
FbxIteratorDst(FbxProperty &pProperty)
Constructor.
Type * GetSafeNext()
Get next destination object that connects to the property or object.
FbxProperty GetFirstProperty() const
Returns the first property of this object.
const FbxProperty & GetNext()
Get next property of the object.
int GetSrcObjectCount(const FbxCriteria &pCriteria) const
Returns the number of source objects that satisfy the given criteria with which this object connects...
FbxObject * GetDstObject(const int pIndex=0) const
Returns the destination object at the specified index with which this property connects.
int GetDstPropertyCount() const
Returns the number of destination properties with which this object connects.
FBX_DEPRECATED FbxObject * GetDstObject(FbxClassId pClassId, int pIndex=0) const
Returns the destination object of the specified class type with which this object connects at the spe...
FbxIteratorSrc(FbxProperty &pProperty)
Constructor.
FBX_DEPRECATED FbxObject * FindDstObject(FbxClassId pClassId, const char *pName, int pStartIndex=0) const
Searches the destination object with the specified name which is the specified class type...
void * GetUserDataPtr() const
Returns the data pointer of the user data record whose ID is the object ID.
Type * GetLast()
Get the last source object that connects to the property or object.
FbxClassId mClassId
The property to iterate. If iterate an object, this is the root property of the object.
#define FBXSDK_FBXOBJECT_DECLARE(Class, Parent)
unsigned long long FbxUInt64
bool DisconnectAllSrcObject()
Disconnects this object from all source objects of the specified class type.
bool DisconnectDstProperty(const FbxProperty &pProperty)
Disconnects this object from the specified destination property.
T * GetDstObject(int pIndex=0) const
Returns the destination object with which this object connects that is the specified class type at th...
Abstract class for implementing I/O operations through a stream of data.
FbxProperty GetDstProperty(const int pIndex=0) const
Returns the destination property at the specified index with which this property connects.
FbxProperty FindSrcProperty(const char *pName, const int pStartIndex=0) const
Searches the source property with the specified name, starting with the specified index with which th...
Type * GetFirst()
Get the first destination object that connects to the property or object.
Array that stores pairs of FbxString and a pointer.
ECloneType
Types of clones that can be created for FbxObject.
Utility class to manipulate strings.
FbxObject * GetSrcObject(const int pIndex=0) const
Returns the source object at the specified index with which this property connects.
void ResetToBegin()
Reset the iterate index to the beginning.
FbxProperty FindPropertyHierarchical(const char *pName, const FbxDataType &pDataType, bool pCaseSensitive=true) const
Searches a property by full name and data type.
int mIndex
The number of source objects whose type is specified by mClassId.
FbxObject * GetPrevious()
Get previous source object that connects to the property or object.
FbxDocument is a base class for FbxScene and FbxLibrary classes.
FbxIteratorDstBase(FbxObject *pObject, FbxClassId pClassId)
Constructor.
T * FindDstObject(const char *pName, int pStartIndex=0) const
Searches the destination object with the specified name which is of the specified class type...
bool IsConnectedDstObject(const FbxObject *pObject) const
Judges whether this object connects with the destination object.
bool IsConnectedDstProperty(const FbxProperty &pProperty)
Determines if this object connects with the specified destination property.
bool ConnectSrcProperty(const FbxProperty &pProperty)
Connects this object to a source property.
FbxObject * GetSafePrevious()
Get previous destination object that connects to the property or object.
FbxObject * FindDstObject(const FbxCriteria &pCriteria, const char *pName, int pStartIndex=0) const
Searches the destination object with the specified name which satisfies the given criteria...
FBX_DEPRECATED bool DisconnectAllDstObject(FbxClassId pClassId)
Disconnects this object from all destination objects of the specified class type. ...
FbxObject * GetDstObject(int pIndex=0) const
Returns the destination object at the specified index with which this object connects.
FbxProperty GetSrcProperty(const int pIndex=0) const
Returns the source property at the specified index with which this property connects.
A utility class for iterating over the properties (FbxProperty) of any FbxObject. ...
FbxIteratorSrcBase(FbxProperty &pProperty, FbxClassId pClassId)
Constructor.
This object represents the shading node implementation.
FBX_DEPRECATED int GetDstObjectCount(FbxClassId pClassId) const
Returns the number of destination objects of the specified class type with which this object connects...
FbxProperty FindProperty(const char *pName, const FbxDataType &pDataType, bool pCaseSensitive=true) const
Searches a property by name and data type.
FbxProperty GetSrcProperty(int pIndex=0) const
Returns the source property at the specified index with which this object connects.
T * GetSrcObject(const FbxCriteria &pCriteria, int pIndex=0) const
Returns the source object that is the specified class type and that satisfies the given criteria at t...
T * GetDstObject(const FbxCriteria &pCriteria, int pIndex=0) const
Returns the destination object with which this object connects that is the specified class type and t...
bool DisconnectAllDstObject(const FbxCriteria &pCriteria)
Disconnects this object from all destination objects that satisfy given criteria. ...
Type * GetSafePrevious()
Get previous source object that connects to the property or object.
FbxObject * GetLast()
Get the last destination object that connects to the property or object.
FBX_DEPRECATED bool Is(const FbxClassId &pClassId) const
Test if this class is a hierarchical children of the specified class type.
FbxProperty GetFirstDescendent() const
Returns the first property that is a descendant of this property.
FbxObject * GetSafePrevious()
Get previous source object that connects to the property or object.
bool DisconnectSrcProperty(const FbxProperty &pProperty)
Disconnects this object from the specified source property.
void ResetToEnd()
Reset the iterate index to the end.
static FbxCriteria ObjectType(const FbxClassId &pClassId)
Creates a new query criteria that only selects objects which have a specific class ID or derive from ...
int GetSrcObjectCount() const
Returns the number of source objects with which this object connects.
A deep copy of the object.
FbxObject * GetSafeNext()
Get next destination object that connects to the property or object.
bool IsConnectedSrcObject(const FbxObject *pObject) const
Judges whether this object connects with the source object.
bool IsConnectedSrcProperty(const FbxProperty &pProperty)
Determines whether this object connects with the specified source property.
int GetDstObjectCount() const
Returns the number of destination objects with which this object connects.
The base class of most FBX objects.
void ResetToBegin()
Reset the iterate index to the beginning.
This object represents a shading node filter criteria based on the shading node implementation.
FBX_DEPRECATED int GetSrcObjectCount(FbxClassId pClassId) const
Returns the number of source objects of the specific class type with which this object connects...
T * FindSrcObject(const FbxCriteria &pCriteria, const char *pName, int pStartIndex=0) const
Searches the source object with the specified name that is the specified class type and that satisfie...
FbxProperty RootProperty
The root property that holds all children property for this object.
bool ConnectDstProperty(const FbxProperty &pProperty)
Connects this object to a destination property.
Type * GetSafePrevious()
Get previous destination object that connects to the property or object.
FbxObject * GetSafeNext()
Get next source object that connects to the property or object.
int GetDstObjectCount(const FbxCriteria &pCriteria) const
Returns the number of destination objects with which this object connects that satisfy the given crit...
bool ConnectSrcObject(FbxObject *pObject, FbxConnection::EType pType=FbxConnection::eNone)
Connects this object to a source object.
This class contains the description of a 3D scene.
FbxObject * GetSrcObject(const FbxCriteria &pCriteria, int pIndex=0) const
Returns the source object that satisfies the criteria at the specified index with which this object c...
int GetSrcPropertyCount() const
Returns the number of source properties with which this object connects.
FbxProperty FindDstProperty(const char *pName, int pStartIndex=0) const
Searches a destination property with which this object connects that has a specific name...
int mSize
The number of destination objects whose type is specified by mClassId.
void SetUserDataPtr(void *pUserData)
Sets the data pointer for the user data record whose ID is the object ID.
bool IsRoot() const
Judges if this property is the root property.
const FbxImplementation * GetImplementation(const FbxObject *pObject, const char *pImplementationTarget)
Get FbxImplementation from FbxObject.
FbxObject * FindDstObject(const char *pName, int pStartIndex=0) const
Searches the destination object with the specified name, starting at the specified index...
Defines a filtering criteria for a query of objects, connections and properties, so that only those s...
FbxObject * GetFirst()
Get the first source object that connects to the property or object.
FbxProperty FindPropertyHierarchical(const char *pName, bool pCaseSensitive=true) const
Searches a property by full name.
Type * GetNext()
Get next destination object that connects to the property or object.
FbxIterator(const FbxObject *pObject)
Constructor.
FbxObject * GetSrcObject(int pIndex=0) const
Returns the source object with which this object connects at the specified index. ...
int GetSrcObjectCount() const
Returns the number of source objects with which this property connects.
bool DisconnectSrcObject(FbxObject *pObject)
Disconnects this object from a source object.
FbxObject * GetNext()
Get next source object that connects to the property or object.
int GetSrcObjectCount(const FbxCriteria &pCriteria) const
Returns the number of source objects with which this object connects that are the specified class typ...
FbxProperty Find(const char *pName, bool pCaseSensitive=true) const
Searches a property using its name.
A utility class for iterating over source objects that connect to property (FbxProperty) or object (F...
FbxProperty FindProperty(const char *pName, bool pCaseSensitive=true) const
Searches a property by name.
Internal class used to differentiate objects during run-time.
int GetDstObjectCount() const
Returns the number of destination objects with which this property connects.
int GetDstObjectCount() const
Returns the number of destination objects of the specified class type with which this object connects...
FbxObject * FindSrcObject(const FbxCriteria &pCriteria, const char *pName, int pStartIndex=0) const
Searches the source object with the specified name which satisfies the given criteria, starting at the specified index.
int GetSrcObjectCount() const
Returns the number of source objects of a specific class type with which this object connects...
Class to hold user properties.
bool DisconnectAllDstObject(const FbxCriteria &pCriteria)
Disconnects this object from all destination objects that are the specified class type and that satis...
bool Is() const
Templated test if this class is a hierarchical children of the specified class type.
T * FbxCast(FbxObject *pObject)
Safe casting of FBX SDK objects into other FBX SDK class types.
Type * GetSafeNext()
Get next source object that connects to the property or object.
FBX_DEPRECATED bool DisconnectAllSrcObject(FbxClassId pClassId)
Disconnects this object from all source objects of a specific class type.
Type * GetPrevious()
Get previous source object that connects to the property or object.
#define FBXSDK_EVENT_DECLARE(Class)
Base class to emit event with the specified event type.
FbxIteratorDst(FbxObject *pObject)
Constructor.
A utility class for iterating over destination objects that connect to property (FbxProperty) or obje...
FbxObject * GetDstObject(const FbxCriteria &pCriteria, int pIndex=0) const
Returns the destination object with which this object connects that satisfies the given criteria at t...
FBX_DEPRECATED FbxObject * GetSrcObject(FbxClassId pClassId, int pIndex=0) const
Returns the source object of the specified class type at the specified index with which this object c...
T * FindSrcObject(const char *pName, int pStartIndex=0) const
Searches the source object with the specified name that is the specified class type, starting at the specified index.
A utility class for iterating over destination objects that connect to property (FbxProperty) or obje...
bool ConnectDstObject(FbxObject *pObject, FbxConnection::EType pType=FbxConnection::eNone)
Connects this object to one destination object.
A name is a case-sensitive string ID of a property, a node, a node attribute, a texture, etc.
Type * GetNext()
Get next source object that connects to the property or object.
FbxObject * GetPrevious()
Get previous destination object that connects to the property or object.
int GetDstObjectCount(const FbxCriteria &pCriteria) const
Returns the number of destination objects with which this object connects that are the specified clas...
FbxIteratorSrc(FbxObject *pObject)
Constructor.
bool DisconnectAllDstObject()
Disconnects this object from all destination objects.
FbxProperty GetDstProperty(int pIndex=0) const
Returns the destination property at the specified index with which this object connects.
This library class represents libraries that store sub-libraries and shading objects.
FbxProperty mProperty
The property to iterate.
bool DisconnectAllDstObject()
Disconnects this object from all destination objects of the specified class type. ...
FbxProperty FindDstProperty(const char *pName, const int pStartIndex=0) const
Searches the destination property with the specified name, starting with the specified index with whi...
bool DisconnectAllSrcObject(const FbxCriteria &pCriteria)
Disconnects this object from all source objects that satisfy a given criteria.
FbxPeripheral is an interface to load/unload content of FbxObject from memory to somewhere you define...
FbxObject * GetNext()
Get next destination object that connects to the property or object.
bool DisconnectAllSrcObject(const FbxCriteria &pCriteria)
Disconnects this object from all source objects that are of the specified class type and that satisfy...
FbxIteratorDstBase(FbxProperty &pProperty, FbxClassId pClassId)
Constructor.
FBX_DEPRECATED FbxObject * FindSrcObject(FbxClassId pClassId, const char *pName, int pStartIndex=0) const
Searches the source object with the specified name which is also the specified class type...
FbxObject * GetFirst()
Get the first destination object that connects to the property or object.
FbxProperty FindSrcProperty(const char *pName, int pStartIndex=0) const
Searches a source property with which this object connects that has a specific name, starting at the specified index.
A utility class for iterating over source objects that connect to property (FbxProperty) or object (F...
bool DisconnectAllSrcObject()
Disconnects this object from all source objects.
FbxProperty FindHierarchical(const char *pName, bool pCaseSensitive=true) const
Searches a property using its full name.
FbxObject * GetLast()
Get the last source object that connects to the property or object.
FbxClassId mClassId
The class ID specifies the type of the destination objects to be retrieved.
FBX event class, derived from FbxEventBase, and it contains a type ID for event.
Type * GetLast()
Get the last destination object that connects to the property or object.
Type * GetFirst()
Get the first source object that connects to the property or object.
Type * GetPrevious()
Get previous destination object that connects to the property or object.