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);
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;
1085 inline const FbxProperty&
GetNext() { mProperty = mObject->GetNextProperty(mProperty);
return mProperty; }
1104 mProperty(pProperty),
1118 mProperty(pObject->RootProperty),
1164 return GetPrevious();
1186 while (mIndex>mSize) mIndex--;
1187 return GetPrevious();
1298 mProperty(pProperty),
1312 mProperty(pObject->RootProperty),
1358 return GetPrevious();
1380 while (mIndex>mSize) mIndex--;
1381 return GetPrevious();
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) {}
int GetSrcObjectCount() const
Returns the number of source objects of a specific class type with which this object connects...
int mSize
The class ID specifies the type of the source objects to be retrieved.
FbxProperty FindDstProperty(const char *pName, int pStartIndex=0) const
Searches a destination property with which this object connects that has a specific name...
Class to manage property handle.
void * GetUserDataPtr() const
Returns the data pointer of the user data record whose ID is the object ID.
FBX SDK environment definition.
FbxIteratorSrcBase(FbxObject *pObject, FbxClassId pClassId)
Constructor.
FbxProperty GetNextProperty(const FbxProperty &pProperty) const
Returns the next property of this object that follows the specified property.
const FbxProperty & GetFirst()
Get the first property of the object.
bool DisconnectDstObject(FbxObject *pObject)
Disconnects this object from the destination object.
void ResetToEnd()
Reset the iterate index to the end.
int GetDstObjectCount(const FbxCriteria &pCriteria) const
Returns the number of destination objects with which this object connects that are the specified clas...
FbxIteratorDst(FbxProperty &pProperty)
Constructor.
bool IsRoot() const
Judges if this property is the root property.
Type * GetSafeNext()
Get next destination object that connects to the property or object.
FbxProperty FindPropertyHierarchical(const char *pName, bool pCaseSensitive=true) const
Searches a property by full name.
const FbxProperty & GetNext()
Get next property of the object.
FbxIteratorSrc(FbxProperty &pProperty)
Constructor.
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.
Abstract class for implementing I/O operations through a stream of data.
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.
bool IsConnectedSrcObject(const FbxObject *pObject) const
Judges whether this object connects with the source object.
void ResetToBegin()
Reset the iterate index to the beginning.
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.
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...
FbxIteratorDstBase(FbxObject *pObject, FbxClassId pClassId)
Constructor.
FbxProperty FindProperty(const char *pName, bool pCaseSensitive=true) const
Searches a property by name.
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...
FbxProperty FindHierarchical(const char *pName, bool pCaseSensitive=true) const
Searches a property using its full name.
bool IsConnectedDstProperty(const FbxProperty &pProperty)
Determines if this object connects with the specified destination property.
FbxProperty FindProperty(const char *pName, const FbxDataType &pDataType, bool pCaseSensitive=true) const
Searches a property by name and data type.
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 char *pName, int pStartIndex=0) const
Searches the destination object with the specified name, starting at the specified index...
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...
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...
A utility class for iterating over the properties (FbxProperty) of any FbxObject. ...
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...
FbxIteratorSrcBase(FbxProperty &pProperty, FbxClassId pClassId)
Constructor.
This object represents the shading node implementation.
FbxProperty GetNextDescendent(const FbxProperty &pProperty) const
Returns the property that follows pProperty that is a descendant of this property.
FbxProperty GetSrcProperty(const int pIndex=0) const
Returns the source property at the specified index with which this property connects.
FbxProperty GetSrcProperty(int pIndex=0) const
Returns the source property at the specified index with which this object connects.
FbxProperty GetFirstDescendent() const
Returns the first property that is a descendant of this property.
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.
int GetDstPropertyCount() const
Returns the number of destination properties with which this object connects.
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 ...
A deep copy of the object.
FbxObject * GetSafeNext()
Get next destination object that connects to the property or object.
bool IsConnectedSrcProperty(const FbxProperty &pProperty)
Determines whether this object connects with the specified source property.
FbxObject * GetSrcObject(int pIndex=0) const
Returns the source object with which this object connects at the specified index. ...
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.
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.
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.
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.
int GetDstObjectCount() const
Returns the number of destination objects with which this object connects.
int mSize
The number of destination objects whose type is specified by mClassId.
int GetDstObjectCount() const
Returns the number of destination objects with which this property connects.
FbxProperty Find(const char *pName, bool pCaseSensitive=true) const
Searches a property using its name.
void SetUserDataPtr(void *pUserData)
Sets the data pointer for the user data record whose ID is the object ID.
const FbxImplementation * GetImplementation(const FbxObject *pObject, const char *pImplementationTarget)
Get FbxImplementation from FbxObject.
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.
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.
bool IsConnectedDstObject(const FbxObject *pObject) const
Judges whether this object connects with the destination object.
Type * GetNext()
Get next destination object that connects to the property or object.
FbxIterator(const FbxObject *pObject)
Constructor.
bool DisconnectSrcObject(FbxObject *pObject)
Disconnects this object from a source object.
FbxObject * GetNext()
Get next source object that connects to the property or object.
A utility class for iterating over source objects that connect to property (FbxProperty) or object (F...
Internal class used to differentiate objects during run-time.
FbxProperty GetDstProperty(const int pIndex=0) const
Returns the destination property at the specified index with which this property connects.
FbxObject * FindSrcObject(const char *pName, int pStartIndex=0) const
Searches the source object with the specified name, starting at the specified index.
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...
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.
FbxProperty GetDstProperty(int pIndex=0) const
Returns the destination property at the specified index with which this object connects.
int GetSrcObjectCount() const
Returns the number of source objects 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...
int GetSrcObjectCount(const FbxCriteria &pCriteria) const
Returns the number of source objects with which this object connects that are the specified class typ...
FbxProperty FindPropertyHierarchical(const char *pName, const FbxDataType &pDataType, bool pCaseSensitive=true) const
Searches a property by full name and data type.
Type * GetPrevious()
Get previous source object that connects to the property or object.
FbxProperty GetFirstProperty() const
Returns the first property of this 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...
int GetSrcPropertyCount() const
Returns the number of source properties with which this object connects.
bool Is() const
Templated test if this class is a hierarchical children of the specified class type.
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.
T * GetDstObject(int pIndex=0) const
Returns the destination object with which this object connects that is the specified class type at th...
int GetDstObjectCount() const
Returns the number of destination objects of the specified class type with which this object connects...
int GetSrcObjectCount(const FbxCriteria &pCriteria) const
Returns the number of source objects that satisfy the given criteria with which this object connects...
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.
FbxIteratorSrc(FbxObject *pObject)
Constructor.
bool DisconnectAllDstObject()
Disconnects this object from all destination objects.
T * FindDstObject(const char *pName, int pStartIndex=0) const
Searches the destination object with the specified name which is of the specified class type...
This library class represents libraries that store sub-libraries and shading objects.
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...
FbxProperty mProperty
The property to iterate.
EObjectFlag
Flags available to control objects.
bool DisconnectAllDstObject()
Disconnects this object from all destination objects of the specified class type. ...
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 * GetDstObject(const int pIndex=0) const
Returns the destination object at the specified index with which this property 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...
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...
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.
int GetDstObjectCount(const FbxCriteria &pCriteria) const
Returns the number of destination objects with which this object connects that satisfy the given crit...
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.
FbxObject * GetLast()
Get the last source object that connects to the property or object.
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.
Class for array of basic elements such as pointers and basic types.
FbxClassId mClassId
The class ID specifies the type of the destination objects to be retrieved.
FbxObject * GetDstObject(int pIndex=0) const
Returns the destination object at the specified index with which this object connects.
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.
T * GetSrcObject(int pIndex=0) const
Returns the source object of the specified class type at the specified index.