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);\
167 template <
class T>
inline bool Is()
const {
return GetClassId().Is(T::ClassId); }
188 void Destroy(
bool pRecursive=
false);
191 void ResetProperties();
200 eInitialized = 1 << 0,
205 eContentLoaded = 1 << 5,
206 eDontLocalize = 1 << 6,
207 eCopyCalledByClone = 1 << 16
213 void SetObjectFlags(EObjectFlag pFlags,
bool pValue);
218 bool GetObjectFlags(EObjectFlag pFlags)
const;
223 void SetAllObjectFlags(
FbxUInt pFlags);
227 FbxUInt GetAllObjectFlags()
const;
265 bool IsAReferenceTo()
const;
273 bool IsReferencedBy()
const;
277 int GetReferencedByCount()
const;
282 FbxObject* GetReferencedBy(
int pIndex)
const;
292 void SetName(
const char* pName);
297 const char* GetName()
const;
302 FbxString GetNameWithoutNameSpacePrefix()
const;
307 FbxString GetNameWithNameSpacePrefix()
const;
312 void SetInitialName(
const char* pName);
317 const char* GetInitialName()
const;
349 static FbxString RemovePrefix(
char* pName);
361 static FbxString StripPrefix(
const char* pName);
374 virtual bool GetSelected();
379 virtual void SetSelected(
bool pSelected);
392 void SetUserDataPtr(
const FbxUInt64& pUserID,
void* pUserData);
398 void* GetUserDataPtr(
const FbxUInt64& pUserID)
const;
668 return RootProperty.
Find(pName, pCaseSensitive );
679 return RootProperty.
Find(pName, pDataType, pCaseSensitive );
815 bool ContentIsLoaded()
const;
820 void ContentDecrementLockCount();
825 void ContentIncrementLockCount();
833 bool ContentIsLocked()
const;
840 virtual bool ContentWriteTo(
FbxStream& pStream)
const;
847 virtual bool ContentReadFrom(
const FbxStream& pStream);
858 void EmitMessage(FbxMessage* pMessage)
const;
871 virtual const char* Localize(
const char* pID,
const char* pDefault=
NULL)
const;
900 bool HasDefaultImplementation(
void)
const;
944 virtual bool SetUrl(
char* pUrl);
951 void SetRuntimeClassId(
const FbxClassId& pClassId);
961 bool IsRuntime(
const FbxClassId& pClassId)
const;
965 bool IsRuntimePlug()
const;
970 virtual void Compact();
979 virtual void Construct(
const FbxObject* pFrom);
984 virtual void ConstructProperties(
bool pForceSet);
989 virtual void Destruct(
bool pRecursive);
993 virtual void ContentClear();
1003 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1005 virtual bool Compare(
FbxObject* pOtherObject);
1010 bool operator==(
const FbxObject& pObject);
1011 bool operator!=(
const FbxObject& pObject);
1015 inline FbxPropertyHandle& GetPropertyHandle() {
return RootProperty.mPropertyHandle; }
1020 virtual const char* GetTypeName()
const;
1026 void WipeAllConnections();
1029 static void SetWipeMode(
bool pState);
1030 static bool GetWipeMode();
1035 enum EPropertyNotifyType
1037 ePropertySetRequest,
1042 virtual bool ConnectNotify(
const FbxConnectEvent& pEvent);
1043 virtual bool PropertyNotify(EPropertyNotifyType pType,
FbxProperty& pProperty);
1044 bool Copyable(
const FbxObject& pObject);
1047 void CopyPropertiesFrom(
const FbxObject& pFrom);
1048 void SetClassRootProperty(
FbxProperty& lProperty);
1049 int GetFlatPropertyCount()
const;
1053 FbxUserDataRecord* mUserData;
1060 static bool mWipeMode;
1298 mProperty(pProperty),
1312 mProperty(pObject->RootProperty),
1380 while (mIndex>mSize) mIndex--;
1471 #define FBX_TYPE(class) ((const class*)0)
1481 return pObject && pObject->
Is<T>() ? (T*)pObject : 0;
1492 return pObject && pObject->
Is<T>() ? (
const T*)pObject : 0;
1496 #define FbxForEach(Iterator, Object) for((Object)=(Iterator).GetFirst();(Object)!=0;(Object)=(Iterator).GetNext())
1499 #define FbxForEachReverse(Iterator, Object) for(Object=(Iterator).GetLast();(Object)!=0;Object=(Iterator).GetPrevious())
1504 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1531 inline EType GetType()
const {
return mType; }
1532 inline EDirection GetDirection()
const {
return mDirection; }
1533 inline FbxProperty& GetSrc()
const {
return *mSrc; }
1534 inline FbxProperty& GetDst()
const {
return *mDst; }
1535 template <
class T>
inline T* GetSrcIfObject()
const {
return mSrc->
IsRoot() ? FbxCast<T>(mSrc->GetFbxObject()) : (T*)0; }
1536 template <
class T>
inline T* GetDstIfObject()
const {
return mDst->IsRoot() ? FbxCast<T>(mDst->GetFbxObject()) : (T*)0; }
1540 EDirection mDirection;
1545 class FbxObjectPropertyChanged :
public FbxEvent<FbxObjectPropertyChanged>
1550 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.
FbxIteratorSrc(FbxProperty &pProperty)
Constructor.
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...
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.
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.
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.
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.
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...
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.
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.