- Main Page
- Classes
- Files
- Directories
- Examples

- File List
- File Members

Classes | Defines | Typedefs | Functions

# fbxplug.h File Reference

`#include <fbxsdk/fbxsdk_def.h>`
`#include <fbxsdk/core/fbxemitter.h>`
`#include <fbxsdk/fbxsdk_nsbegin.h>`
`#include <fbxsdk/fbxsdk_nsend.h>`

Go to the source code of this file.

## Classes
class | FbxClassId
| Internal class used to differentiate objects during run-time. More...
class | FbxPlug
| Top level class for any FBX object that requires ClassId functionality. More...
## Defines
#define | FBXSDK_PLUG_DECLARE(Class)
| Macro used to declare a new plug inherited class.
#define | FBXSDK_ABSTRACT_PLUG_DECLARE(Class)
| Macro used to declare a new abstract plug inherited class.
#define | FBXSDK_PLUG_IMPLEMENT(Class)
| Macro used to implement a new plug inherited class.
#define | FBXSDK_ABSTRACT_PLUG_IMPLEMENT(Class)
| Macro used to implement a new abstract plug inherited class.
#define | FBX_TYPE(class) ((const class*)0)
| Convert the class type parameter into a C class parameter for other function inputs.
## Typedefs
typedef FbxPlug *(* | FbxPlugCreateProc )(FbxManager &pManager, const char *pName, const FbxPlug *pFrom, const char *pFBXType, const char *pFBXSubType)
| The function pointer type for object constructor functions.
## Functions
template<class T >
T * | FbxCast (FbxPlug *pPlug)
| Safe casting of FBX SDK objects into other FBX SDK class types.
template<class T >
const T * | FbxCast (const FbxPlug *pPlug)
| Safe const casting of FBX SDK objects into other FBX SDK class types.

## Detailed Description

Definition in file fbxplug.h.

## Define Documentation

#define FBXSDK_PLUG_DECLARE | ( |  | Class | ) |

Search for all occurrences
Value:

    public:                                                                                 \
        FBXSDK_FRIEND_NEW();                                                                \
        static FbxClassId ClassId;                                                          \
        static Class* Create(FbxManager* pManager, const char* pName);                      \
        static Class* ManagerCreate(FbxManager* pManager, const char* pName, Class* pFrom)  \
        {                                                                                   \
            Class* lClass = FbxNew< Class >(*pManager, pName);                              \
            lClass->Construct(pFrom);                                                       \
            return lClass;                                                                  \
        }                                                                                   \
        virtual FbxClassId GetClassId() const { return ClassId; }                           \
        friend class FBXSDK_NAMESPACE::FbxManager;                                          \

Macro used to declare a new plug inherited class.

Definition at line 193 of file fbxplug.h.

#define FBXSDK_ABSTRACT_PLUG_DECLARE | ( |  | Class | ) |

Search for all occurrences
Value:

    public:                                                                                 \
        static FbxClassId ClassId;                                                          \
        static Class* Create(FbxManager* pManager, const char* pName);                      \
        static FbxPlugCreateProc ManagerCreate;                                             \
        virtual FbxClassId  GetClassId() const { return ClassId; }                          \
        friend class FBXSDK_NAMESPACE::FbxManager;                                          \

Macro used to declare a new abstract plug inherited class.

Definition at line 208 of file fbxplug.h.

#define FBXSDK_PLUG_IMPLEMENT | ( |  | Class | ) |

Search for all occurrences
Value:

    FbxClassId Class::ClassId;                                                          \
        Class* Class::Create(FbxManager* pManager, const char* pName)                       \
        {                                                                                   \
            Class* ClassPtr;                                                                \
            ClassPtr = 0;                                                                   \
            return (Class*)pManager->CreateNewObjectFromClassId(Class::ClassId, pName);     \
        }                                                                                   \

Macro used to implement a new plug inherited class.

Definition at line 217 of file fbxplug.h.

#define FBXSDK_ABSTRACT_PLUG_IMPLEMENT | ( |  | Class | ) |

Search for all occurrences
Value:

    FbxClassId Class::ClassId;                                                          \
        FbxPlugCreateProc Class::ManagerCreate = 0;                                         \
        Class* Class::Create(FbxManager* pManager, const char* pName)                       \
        {                                                                                   \
            Class* ClassPtr;                                                                \
            ClassPtr = 0;                                                                   \
            return (Class*)pManager->CreateNewObjectFromClassId(Class::ClassId, pName);     \
        }                                                                                   \

Macro used to implement a new abstract plug inherited class.

Definition at line 227 of file fbxplug.h.

#define FBX_TYPE | ( |  | class | ) | ((const class*)0)

Search for all occurrences

Convert the class type parameter into a C class parameter for other function inputs.

Usage example:

     //Assuming MyCamera is a valid FbxCamera object
     bool AreCamerasObject = MyCamera->Is(FBX_TYPE(FbxObject)); //Should return true :)

Examples:
  Animation/main.cxx, ExportDocument/main.cxx, ExportScene03/main.cxx, ImportScene/DisplayAnimation.cxx, ImportScene/DisplayGenericInfo.cxx, ImportScene/DisplayMaterial.cxx, SwitchBinding/main.cxx, ViewScene/SceneCache.cxx, and ViewScene/SceneContext.cxx.

Definition at line 336 of file fbxplug.h.

## Typedef Documentation

typedef FbxPlug*(* FbxPlugCreateProc)(FbxManager &pManager, const char *pName, const FbxPlug *pFrom, const char *pFBXType, const char *pFBXSubType)

Search for all occurrences

The function pointer type for object constructor functions.

Definition at line 29 of file fbxplug.h.

## Function Documentation

T* FbxCast | ( | FbxPlug * | pPlug | ) | `[inline]`

Search for all occurrences

Safe casting of FBX SDK objects into other FBX SDK class types.

This cast will perform the complete test to make sure the object inherits from the requested class type. This is the equivalent of a dynamic_cast but much faster.

Parameters:

  pPlug | The object to try to cast into T type.

Returns:
  A non-null pointer if the cast was successful.

Definition at line 344 of file fbxplug.h.

    {
        return pPlug && pPlug->Is(T::ClassId) ? (T*)pPlug : 0;
    }

const T* FbxCast | ( | const FbxPlug * | pPlug | ) | `[inline]`

Search for all occurrences

Safe const casting of FBX SDK objects into other FBX SDK class types.

This cast will perform the complete test to make sure the object inherits from the requested class type. This is the equivalent of a dynamic_cast but much faster.

Parameters:

  pPlug | The object to try to cast into T type.

Returns:
  A non-null pointer if the cast was successful.

Definition at line 355 of file fbxplug.h.

    {
        return pPlug && pPlug->Is(T::ClassId) ? (const T*)pPlug : 0;
    }