fbsdk/fbcomponent.h File Reference

fbcomponent.h File Reference
+ この参照ページは、次の概要トピックと関連付けられています。
#include <kaydaradef.h>
#include <fbsdk/fblibrary.h>
#include <fbsdk/fbplug.h>
#include <fbsdk/fbarray.h>
#include <fbsdk/fbstring.h>
#include <fbsdk/fbproperties.h>

File Description

Basic class definitions.

Contains the basic classes that most SDK objects will derive from. These classes form the base of many functionalities of the SDK. The file also contains the base macros used in the definition/registration of the SDK classes.

Definition in file fbcomponent.h.

Classes

class  FBPropertyListComponentBase
 PropertyList: Component. More...
 
class  FBPropertyListComponent
 PropertyList: Concrete class for PropertyList of component More...
 
class  FBPropertyListObject
 List of scene objects. More...
 
class  FBComponent
 MotionBuilder SDK base class. More...
 
class  FBEvent
 Base Event class. More...
 
class  FBEventConnectionNotify
 Connection notify event class. More...
 
class  FBEventConnectionDataNotify
 Connection notify event class. More...
 
class  FBEventConnectionStateNotify
 Connection notify event class. More...
 
class  FBEventConnectionKeyingNotify
 
class  FBLibraryBase
 Library class for DLL registration. More...
 
class  FBLibrary
 Library class for DLL registration. More...
 
class  FBCustomManager
 Custom manager class for user controlled observer objects. More...
 

Namespaces

 ORSDK2018
 

Macros

#define FBSDK_DLL   K_DLLIMPORT
 Be sure that FBSDK_DLL is defined only once... More...
 
#define FB_DEFAULT_SDK_ICON   "openreality_noicon.png"
 Define SDK icon filename. More...
 
#define __FBClassInit   mLocalPtr = NULL;
 For internal use only. More...
 
#define __FBClassDeInit   if (mLocalPtr) {delete mLocalPtr; mLocalPtr = NULL;}
 For internal use only. More...
 
#define __FBClassInitSDKComponent(pObjectToWrappedIsAllocated)
 For internal use onlyL decide if we need to delete the corresponding KObject. More...
 
#define __FBClassDeclare(Name, Parent)
 For internal use only. More...
 
#define __FBClassDeclareGroup(Name, Parent)
 For internal use only. More...
 
#define FBStorableClassImplementation(ClassName, Type)
 Storable Class implementation. More...
 
#define FBElementClassImplementation(ClassName, IconFileName)
 Element Class implementation. More...
 
#define FBShadingElementClassImplementation(ClassName, IconFileName)
 Shading Element Class implementation. More...
 
#define FBStorableClassDeclare(Name, Parent)
 Storable Class declaration. More...
 
#define FBPropertyInitComponent(Param, Type, PropName, Get, Set)
 Initialize a property: component. More...
 
#define FBIS(Component, ComponentType)   ((Component) && (Component)->Is( ComponentType::TypeInfo ))
 Macro to verify the type of a component. More...
 
#define FBRegisterEvent   ( Object, EventId, EventProc ) IQ( Object,IRegister)->Register ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
 Event registration/un-registration. More...
 
#define FBUnregisterEvent   ( Object, EventId, EventProc ) IQ( Object,IRegister)->Unregister ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
 Event registration/un-registration. More...
 
#define FBRegisterObject(LocalId, Path, Name, Description, Constructor, IsMultipleAllowed, IconFilename)   static int __R##LocalId = FBObject_Register( Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename )
 Event registration/un-registration. More...
 
#define FBDeclareUserObject(ClassName)
 Event registration/un-registration. More...
 
#define FBLibraryDeclare(LibName)
 Declare the library for the application. More...
 
#define FBLibraryModule(Name)   void FBModule##Name()
 FBLibraryModule Define a module registration call. More...
 
#define FBLibraryRegister(ClassName)
 FBLibraryRegister Declare the module's registration functions. More...
 
#define FBLibraryRegisterStorable(ClassName)
 FBLibraryRegisterStorable Declare the module's registration functions for storable classes. More...
 
#define FBLibraryRegisterElement(ClassName)
 FBLibraryRegisterElement Declare the module's registration functions for element classes. More...
 
#define FBLibraryRegisterShadingElement(ClassName)
 FBLibraryRegisterShadingElement Declare the module's registration functions for shading element classes. More...
 
#define FBLibraryDeclareEnd
 Finish library declaration. More...
 
#define FBCustomManagerImplementation(ThisComponent)   FBClassImplementation( ThisComponent ) \
 FBCustomManagerImplementation. More...
 
#define FBRegisterCustomManager(ClassName)
 FBRegisterCustomManager. More...
 
#define FBCustomManagerDeclare(ClassName)
 FBRegisterCustomDeclare. More...
 

Typedefs

typedef IRegister * HIRegister
 
typedef IError * HIError
 
typedef IStore * HIStore
 
typedef IKtView * HIKtView
 
typedef KEventBase * HKEventBase
 
typedef KGlobalNamedEvent * HKGlobalNamedEvent
 
typedef FBArrayTemplate< FBComponent * > FBComponentList
 typedef FBArrayTemplate<FBComponent*> FBComponentList; More...
 
typedef HIRegister HISender
 HISender. More...
 
typedef HKEventBase HKEvent
 HKEvent. More...
 
typedef void(ICallback::* FBCallback) (HISender pSender, HKEvent pEvent)
 FBCallback. More...
 
typedef class FBPropertyBaseList< FBComponent * > FBPropertyBaseListComponent
 
typedef class FBPropertyBase< FBFolder *, kFBPT_object > FBPropertyBaseFolder
 
typedef class FBPropertyBaseComponent< FBFolder * > FBPropertyFolder
 
typedef class FBPropertyBaseEnum< enum FBConnectionType > FBPropertyConnectionType
 
typedef class FBPropertyBaseEnum< enum FBConnectionAction > FBPropertyConnectionAction
 
typedef class FBPropertyBaseEnum< enum FBObjectFlag > FBPropertyObjectFlag
 
typedef FBComponent FBObject
 Equivalent to FBComponent for gradual transition. More...
 

Enumerations

enum  FBObjectFlag {
  kFBFlagSelectable = (1 << 0), kFBFlagDeletable = (1 << 1), kFBFlagSavable = (1 << 2), kFBFlagVisible = (1 << 3),
  kFBFlagClonable = (1 << 4), kFBFlagSystem = (1 << 5), kFBFlagNewable = (1 << 6), kFBFlagRenamable = (1 << 7),
  kFBFlagMergeable = (1 << 8), kFBFlagBrowsable = (1 << 9), kFBFlagParentable = (1 << 10), kFBFlagDetachable = (1 << 11),
  kFBFlagUndoable = (1 << 12), kFBFlagUndoableSeparately = (1 << 13), kFBFlagKeyable = (1 << 14), kFBFlagAllocated = (1 << 15),
  kFBFlagStory = (1 << 16), kFBFlagStorable6 = (1 << 17), kFBFlagStorableData6 = (1 << 18), kFBFlagStorableBlindData = (1 << 19),
  kFBFlagStorableBlindDataForceBinary = (1 << 20), kFBFlagUniqueName = (1 << 21), kFBFlagNotSelectableNameSpace = (1 << 22), kFBFlagNamespaceEditable = (1 << 23)
}
 Available flags for any component. More...
 
enum  FBObjectStatus {
  kFBStatusCreating = (1 << 0), kFBStatusStoring = (1 << 1), kFBStatusRetrieving = (1 << 2), kFBStatusMerging = (1 << 3),
  kFBStatusDestroying = (1 << 4)
}
 Available lifetime status for any component. More...
 
enum  FBNamespaceAction { kFBConcatNamespace, kFBReplaceNamespace, kFBRemoveAllNamespace }
 Namespace flags. More...
 

Functions

int __FBRegisterTypeInfo (int pInternalClassId)
 __FBRegisterTypeInfo For internal use only, Register the TypeInfo mapped to internal class id. More...
 
int __FBGetInternalClassId (int pTypeInfo)
 __FBGetInternalClassId For internal use only, Get the internal class Id from the ORSDK FBCompoent's TypeInfo. More...
 
FBPlug * __FBObjectCreatorSub (HIObject pObject)
 __FBObjectCreatorSub For internal use only, Create the FBPlug object from internal object. More...
 
void __FBAddModelToScene (HIObject pObject)
 For internal usage only. More...
 
void __FBRemoveModelFromScene (HIObject pObject)
 For internal usage only. More...
 
FBComponent * GetFBComponent (const HIObject Object)
 Get a handle to the FBComponent belonging to an HIObject. More...
 
FBVisualComponent * FBGetFBVisualComponent (HIKtView pObject, bool pAutoCreate=true)
 Get the FBComponent from an Internal Object. More...
 
FBComponent * FBGetFBComponent (HIObject pObject, bool pAutoCreate=true)
 Get the FBComponent from an Internal Object. More...
 
FBComponentList * FBCreateComponentList ()
 Create a FBObjectList object. More...
 
void FBDestroyComponentList (FBComponentList *pObjectList)
 Delete a FBObjectList object. More...
 
FBArrayTemplate< FBComponent * > & FBGetComponentArray ()
 Get the Root FBComponent. More...
 
void FBSetStoreableCustomModelRegistered ()
 
bool FBGetStoreableCustomModelRegistered ()
 
void FBSetStoreableCustomMaterialRegistered ()
 
bool FBGetStoreableCustomMaterialRegistered ()
 
void FBSetStoreableCustomTextureRegistered ()
 
bool FBGetStoreableCustomTextureRegistered ()
 
bool FBObject_Register (const char *pGroupName, const char *pEntryName, const char *pDescription, kObjectCreatorFnc pCreatorFnc, bool pIsMultipleAllowed, const char *pIconFilename)
 
bool FBObject_Unregister (const char *pGroupName, const char *pEntryName, int nth=0)
 
int FBObject_GetGroupCount ()
 A set of functions to query the registration table. More...
 
const char * FBObject_GetGroupName (int pGroupIndex)
 
int FBObject_GetEntryCount (int pGroupIndex)
 
const char * FBObject_GetEntryName (int pGroupIndex, int pIndex)
 
const char * FBObject_GetEntryDescription (int pGroupIndex, int pIndex, int nth=0)
 
const char * FBObject_GetEntryDLLName (int pGroupIndex, int pIndex, int nth=0)
 
const char * FBObject_GetIconName (int pGroupIndex, int pIndex, int nth=0)
 
bool FBObject_GetMultiplicity (int pGroupIndex, int pIndex, int nth=0)
 
FBComponent * FBCreateObject (const char *pGroupName, const char *pEntryName, const char *pName, void *pData=((void *) 0), int nth=0)
 FBCreateObject. More...
 
bool FBUnregisterObject (const char *pGroupName, const char *pEntryName, int nth=0)
 FBUnregisterObject. More...
 
int FBRegister_ClassId (const char *pClassName)
 
template<class T >
T * FBCast (FBObject *pObject, bool pAutoCreate=false)
 Cast the SDK object using it's IObject interface into the proper class. More...
 
void FBFindObjectsByName (const char *pNamePattern, FBComponentList &pList, bool pIncludeNamespace=true, bool pModelsOnly=false)
 FBFindObjectsByName. More...
 
FBComponent * FBFindObjectByFullName (const char *pObjectFullName)
 FBFindObjectByFullName. More...
 
int FBDeleteObjectsByName (const char *pNamePattern, const char *pNameSpace=((void *) 0), const char *pGroupName=((void *) 0))
 FBDeleteObjectsByName. More...
 

Variables

const int kFBFlagCustomObject = (1 << 24)
 User custom class instances (Internal usage only, to be removed in the future). More...
 
const int kFBStatusOwnedByUndo = (1 << 5)
 

Macro Definition Documentation

#define __FBClassDeclare (   Name,
  Parent 
)

For internal use only.

Definition at line 132 of file fbcomponent.h.

#define __FBClassDeclareGroup (   Name,
  Parent 
)
Value:
public:\
static const char* ClassGroupName; \\
private:
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
#define Name(a0, a1, a2, a3, a4)
Definition: Python-ast.h:502

For internal use only.

Definition at line 169 of file fbcomponent.h.

#define __FBClassDeInit   if (mLocalPtr) {delete mLocalPtr; mLocalPtr = NULL;}

For internal use only.

Definition at line 101 of file fbcomponent.h.

#define __FBClassInit   mLocalPtr = NULL;

For internal use only.

Definition at line 95 of file fbcomponent.h.

#define __FBClassInitSDKComponent (   pObjectToWrappedIsAllocated)
Value:
mSDKComponent = pObjectToWrappedIsAllocated;
#define __FBClassInit
For internal use only.
Definition: fbcomponent.h:95

For internal use onlyL decide if we need to delete the corresponding KObject.

Definition at line 107 of file fbcomponent.h.

#define FB_DEFAULT_SDK_ICON   "openreality_noicon.png"

Define SDK icon filename.

+ Examples:

Definition at line 89 of file fbcomponent.h.

#define FBCustomManagerDeclare (   ClassName)
Value:
FBClassDeclare( ClassName, FBCustomManager ); \
public: \
ClassName() : FBCustomManager() { FBClassInit; } \ \
private:
#define FBClassInit
Class initialization.
Definition: fbdefines.h:64
#define FBClassDeclare(Name, Parent)
Class declaration.
Definition: fbdefines.h:85

FBRegisterCustomDeclare.

Parameters
ClassNameClass to declare registration functions for.
+ Examples:

Definition at line 1277 of file fbcomponent.h.

#define FBCustomManagerImplementation (   ThisComponent)    FBClassImplementation( ThisComponent ) \

FBCustomManagerImplementation.

Parameters
ThisComponentComponent to customize
+ Examples:

Definition at line 1260 of file fbcomponent.h.

#define FBDeclareUserObject (   ClassName)
Value:
public:\
static int ClassId;\
virtual int GetUserClassId();\
virtual const char* FbxGetObjectSubType() override;\\
private:

Event registration/un-registration.

For internal use only.

+ Examples:

Definition at line 408 of file fbcomponent.h.

#define FBElementClassImplementation (   ClassName,
  IconFileName 
)
Value:
HIObject RegisterElement##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
ClassName* Class = new ClassName(pName);\
Class->mAllocated = true;\
if( Class->FBCreate() ){\
__FBRemoveModelFromScene( Class->GetHIObject() ); /* Hack in MoBu2013, we shouldn't add object to the scene/entity automatically*/\
return Class->GetHIObject();\
} else {\
delete Class;\
return NULL;}}\
FBLibraryModule(ClassName##Element){\
FBRegisterObject(ClassName##R2, "Browsing/Templates/Elements", #ClassName, "", RegisterElement##ClassName##Create, true, IconFileName);}
#define FBRegisterObject(LocalId, Path, Name, Description, Constructor, IsMultipleAllowed, IconFilename)
Event registration/un-registration.
Definition: fbcomponent.h:387
#define NULL
Definition: kaydara.h:169
#define FBLibraryModule(Name)
FBLibraryModule Define a module registration call.
Definition: fbcomponent.h:1211

Element Class implementation.

(Asset system) This should be placed in the source code file for a class.

+ Examples:

Definition at line 201 of file fbcomponent.h.

#define FBIS (   Component,
  ComponentType 
)    ((Component) && (Component)->Is( ComponentType::TypeInfo ))

Macro to verify the type of a component.

Used to compare a component to another, by verifying their Class::TypeInfo values.

Parameters
ComponentComponent to verify.
ComponentTypeType to verify Component with.
Returns
true if object is of type ComponentType.
+ Examples:

Definition at line 263 of file fbcomponent.h.

#define FBLibraryDeclare (   LibName)
Value:
static FBLibrary LibName##GlobalFBLibrary; \
extern "C" { \
K_DLLEXPORT bool LIBRARY_INIT(HIError /*Error*/) \
{ \
FB_EXT_INIT( LibName ); if (LibName##GlobalFBLibrary.LibInit()) return true; return false; \
} \
} \
FB_DLL_INIT( LibName, Operation ) \
{ \
switch( Operation ) \
{ \
case kFBDllLoad: \
{
#define FB_EXT_INIT(libname)
Definition: fblibrary.h:108
#define FB_DLL_INIT(DllName, Startup)
Definition: fblibrary.h:91
IError * HIError
Definition: fbcomponent.h:72
#define K_DLLEXPORT
Definition: kaydaradef.h:57

Declare the library for the application.

Creates the FBLibrary object and generic interface functions for DLL access.

+ Examples:

Definition at line 1191 of file fbcomponent.h.

#define FBLibraryDeclareEnd
Value:
} \
break; \
default: \
break; \
} \
}

Finish library declaration.

+ Examples:

Definition at line 1247 of file fbcomponent.h.

#define FBLibraryModule (   Name)    void FBModule##Name()

FBLibraryModule Define a module registration call.

Parameters
NameModule to register.

Definition at line 1211 of file fbcomponent.h.

#define FBLibraryRegister (   ClassName)
Value:
extern void FBModule##ClassName( ); \
FBModule##ClassName( );

FBLibraryRegister Declare the module's registration functions.

Parameters
ClassNameClass to declare registration functions for.
+ Examples:

Definition at line 1218 of file fbcomponent.h.

#define FBLibraryRegisterElement (   ClassName)
Value:
extern void FBModule##ClassName##Element( ); \
FBModule##ClassName##Element( );

FBLibraryRegisterElement Declare the module's registration functions for element classes.

Parameters
ClassNameClass to declare registration functions for.
+ Examples:

Definition at line 1234 of file fbcomponent.h.

#define FBLibraryRegisterShadingElement (   ClassName)
Value:
extern void FBModule##ClassName##ShadingElement( ); \
FBModule##ClassName##ShadingElement( );

FBLibraryRegisterShadingElement Declare the module's registration functions for shading element classes.

Parameters
ClassNameClass to declare registration functions for.
+ Examples:

Definition at line 1242 of file fbcomponent.h.

#define FBLibraryRegisterStorable (   ClassName)
Value:
extern void FBModule##ClassName##Storable( ); \
FBModule##ClassName##Storable( );

FBLibraryRegisterStorable Declare the module's registration functions for storable classes.

Parameters
ClassNameClass to declare registration functions for.
+ Examples:

Definition at line 1226 of file fbcomponent.h.

#define FBPropertyInitComponent (   Param,
  Type,
  PropName,
  Get,
  Set 
)
Value:
{ \
PropertyAdd(PropName.Init( (void *)Param,#PropName,(Type* (*)(void *))Get,(void (*)(void *,Type*))Set )); \
PropName.TypeInfo = &Type::TypeInfo; \
}
#define Set(a0, a1, a2, a3)
Definition: Python-ast.h:467

Initialize a property: component.

Parameters
ParamOwner name.
TypeType of variable.
PropNameComponent name.
GetGet function pointer.
SetSet function pointer.

Definition at line 250 of file fbcomponent.h.

#define FBRegisterCustomManager (   ClassName)
Value:
FBLibraryModule( ClassName ) \
{ \
static ClassName g##ClassName; \
g##ClassName.FBCreate(); \
g##ClassName.RegisterManager(); \
} \
#define FBLibraryModule(Name)
FBLibraryModule Define a module registration call.
Definition: fbcomponent.h:1211

FBRegisterCustomManager.

Parameters
ClassNameClass to declare registration functions for.
+ Examples:

Definition at line 1266 of file fbcomponent.h.

#define FBRegisterEvent   ( Object, EventId, EventProc ) IQ( Object,IRegister)->Register ( EventId,(HICallback)this,(kICallbackHandler)EventProc );

Event registration/un-registration.

For internal use only.

Definition at line 325 of file fbcomponent.h.

#define FBRegisterObject (   LocalId,
  Path,
  Name,
  Description,
  Constructor,
  IsMultipleAllowed,
  IconFilename 
)    static int __R##LocalId = FBObject_Register( Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename )

Event registration/un-registration.

For internal use only.

Definition at line 387 of file fbcomponent.h.

#define FBSDK_DLL   K_DLLIMPORT

Be sure that FBSDK_DLL is defined only once...

Definition at line 57 of file fbcomponent.h.

#define FBShadingElementClassImplementation (   ClassName,
  IconFileName 
)
Value:
HIObject RegisterShadingElement##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
ClassName* Class = new ClassName(pName);\
Class->mAllocated = true;\
if( Class->FBCreate() ){\
return Class->GetHIObject();\
} else {\
delete Class;\
return NULL;}}\
FBLibraryModule(ClassName##ShadingElement){\
FBRegisterObject(ClassName##R2, "Browsing/Templates/Shading Elements", #ClassName, "", RegisterShadingElement##ClassName##Create, true, IconFileName);}
#define FBRegisterObject(LocalId, Path, Name, Description, Constructor, IsMultipleAllowed, IconFilename)
Event registration/un-registration.
Definition: fbcomponent.h:387
#define NULL
Definition: kaydara.h:169
#define FBLibraryModule(Name)
FBLibraryModule Define a module registration call.
Definition: fbcomponent.h:1211

Shading Element Class implementation.

This should be placed in the source code file for a class.

+ Examples:

Definition at line 217 of file fbcomponent.h.

#define FBStorableClassDeclare (   Name,
  Parent 
)
Value:
FBClassDeclare(Name, Parent);\
public:\
virtual const char* FbxGetObjectSubType() override; \\
private: \
#define Name(a0, a1, a2, a3, a4)
Definition: Python-ast.h:502
#define FBClassDeclare(Name, Parent)
Class declaration.
Definition: fbdefines.h:85

Storable Class declaration.

Overloads the necessary functions when a class inherits from FBComponent (or its derivatives) and that you want it to be persistent.

Parameters
NameName of class to declare.
ParentParent class to associate with Name.
+ Examples:

Definition at line 235 of file fbcomponent.h.

#define FBStorableClassImplementation (   ClassName,
  Type 
)
Value:
const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
HIObject RegisterStorable##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
ClassName* Class = new ClassName(pName);\
Class->mAllocated = true;\
if( Class->FBCreate() ){\
__FBRemoveModelFromScene( Class->GetHIObject() ); /* Hack in MoBu2013, we shouldn't add object to the scene/entity automatically*/\
return Class->GetHIObject();\
} else {\
delete Class;\
return NULL;}}\
FBLibraryModule(ClassName##Storable){\
FBString lGroup = "FbxStorable/";\
lGroup += #Type;\
FBRegisterObject(ClassName##R2, lGroup, #ClassName, "", RegisterStorable##ClassName##Create, true, NULL);}
#define FBRegisterObject(LocalId, Path, Name, Description, Constructor, IsMultipleAllowed, IconFilename)
Event registration/un-registration.
Definition: fbcomponent.h:387
#define NULL
Definition: kaydara.h:169
IObject * HIObject
Definition: iobject.h:46
#define FBLibraryModule(Name)
FBLibraryModule Define a module registration call.
Definition: fbcomponent.h:1211

Storable Class implementation.

This should be placed in the source code file for a class.

Definition at line 182 of file fbcomponent.h.

#define FBUnregisterEvent   ( Object, EventId, EventProc ) IQ( Object,IRegister)->Unregister ( EventId,(HICallback)this,(kICallbackHandler)EventProc );

Event registration/un-registration.

For internal use only.

Definition at line 330 of file fbcomponent.h.

Typedef Documentation

typedef IError* HIError

Definition at line 72 of file fbcomponent.h.

typedef IKtView* HIKtView

Definition at line 74 of file fbcomponent.h.

typedef IRegister* HIRegister

Definition at line 71 of file fbcomponent.h.

typedef IStore* HIStore

Definition at line 73 of file fbcomponent.h.

typedef KEventBase* HKEventBase

Definition at line 75 of file fbcomponent.h.

typedef KGlobalNamedEvent* HKGlobalNamedEvent

Definition at line 76 of file fbcomponent.h.

Go to the source code of this file.