47 #include <kaydaradef.h>
51 #include <fbsdk/fblibrary.h>
57 #define FBSDK_DLL K_DLLIMPORT
67 #pragma warning (disable: 4661)
70 K_FORWARD( IRegister );
74 K_FORWARD( KEventBase );
75 K_FORWARD( KGlobalNamedEvent );
77 #ifdef FBSDKUseNamespace
78 namespace FBSDKNamespace {
88 #define FB_DEFAULT_SDK_ICON "openreality_noicon.png"
94 #define __FBClassInit mLocalPtr = NULL;
100 #define __FBClassDeInit if (mLocalPtr) {delete mLocalPtr; mLocalPtr = NULL;}
106 #define __FBClassInitSDKComponent( pObjectToWrappedIsAllocated ) \
108 mSDKComponent = pObjectToWrappedIsAllocated;
131 #define __FBClassDeclare( Name,Parent ) \
132 friend FBSDK_DLL FBPlug* __FBObjectCreatorSub(HIObject pObject);\
137 typedef Parent __FBParentClass;\
141 typedef Name __FBClassType;\
145 virtual const char* ClassName() override { return #Name; } \
150 virtual bool Is( int pTypeId ) override { return (pTypeId==TypeInfo) ? true : Parent::Is( pTypeId ); } \
151 virtual int GetTypeId() override { return TypeInfo; } \
155 static int GetInternalClassId(); \
159 Data##Name* mLocalPtr; \
161 static int TypeInfo; \
168 #define __FBClassDeclareGroup( Name,Parent ) \
169 __FBClassDeclare( Name,Parent )\
171 static const char* ClassGroupName; \
181 #define FBStorableClassImplementation(ClassName, Type)\
182 const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
183 HIObject RegisterStorable##ClassName##Create(HIObject , const char* pName, void* ){\
184 ClassName* Class = new ClassName(pName);\
185 Class->mAllocated = true;\
186 if( Class->FBCreate() ){\
187 __FBRemoveModelFromScene( Class->GetHIObject() ); \
188 return Class->GetHIObject();\
192 FBLibraryModule(ClassName##Storable){\
193 FBString lGroup = "FbxStorable/";\
195 FBRegisterObject(ClassName##R2, lGroup, #ClassName, "", RegisterStorable##ClassName##Create, true, NULL);}
200 #define FBElementClassImplementation(ClassName,IconFileName)\
201 HIObject RegisterElement##ClassName##Create(HIObject , const char* pName, void* ){\
202 ClassName* Class = new ClassName(pName);\
203 Class->mAllocated = true;\
204 if( Class->FBCreate() ){\
205 __FBRemoveModelFromScene( Class->GetHIObject() ); \
206 return Class->GetHIObject();\
210 FBLibraryModule(ClassName##Element){\
211 FBRegisterObject(ClassName##R2, "Browsing/Templates/Elements", #ClassName, "", RegisterElement##ClassName##Create, true, IconFileName);}
216 #define FBShadingElementClassImplementation(ClassName,IconFileName)\
217 HIObject RegisterShadingElement##ClassName##Create(HIObject , const char* pName, void* ){\
218 ClassName* Class = new ClassName(pName);\
219 Class->mAllocated = true;\
220 if( Class->FBCreate() ){\
221 return Class->GetHIObject();\
225 FBLibraryModule(ClassName##ShadingElement){\
226 FBRegisterObject(ClassName##R2, "Browsing/Templates/Shading Elements", #ClassName, "", RegisterShadingElement##ClassName##Create, true, IconFileName);}
234 #define FBStorableClassDeclare(Name, Parent)\
235 FBClassDeclare(Name, Parent);\
237 virtual const char* FbxGetObjectSubType() override; \
249 #define FBPropertyInitComponent( Param,Type,PropName,Get,Set ) \
251 PropertyAdd(PropName.Init( (void *)Param,#PropName,(Type* (*)(void *))Get,(void (*)(void *,Type*))Set )); \
252 PropName.TypeInfo = &Type::TypeInfo; \
262 #define FBIS( Component,ComponentType ) \
263 ((Component) && (Component)->Is( ComponentType::TypeInfo ))
280 #if !defined(K_NO_UI)
324 #define FBRegisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Register ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
329 #define FBUnregisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Unregister ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
335 FBSDK_DLL void FBSetStoreableCustomModelRegistered();
336 FBSDK_DLL bool FBGetStoreableCustomModelRegistered();
342 FBSDK_DLL void FBSetStoreableCustomMaterialRegistered();
343 FBSDK_DLL bool FBGetStoreableCustomMaterialRegistered();
349 FBSDK_DLL void FBSetStoreableCustomTextureRegistered();
350 FBSDK_DLL bool FBGetStoreableCustomTextureRegistered();
352 FBSDK_DLL bool FBObject_Register (
const char * pGroupName,
const char * pEntryName,
const char * pDescription, kObjectCreatorFnc pCreatorFnc,
bool pIsMultipleAllowed,
const char * pIconFilename);
353 FBSDK_DLL bool FBObject_Unregister(
const char * pGroupName,
const char * pEntryName,
int nth=0 );
358 FBSDK_DLL const char* FBObject_GetGroupName (
int pGroupIndex );
359 FBSDK_DLL int FBObject_GetEntryCount (
int pGroupIndex );
360 FBSDK_DLL const char* FBObject_GetEntryName (
int pGroupIndex,
int pIndex );
361 FBSDK_DLL const char* FBObject_GetEntryDescription (
int pGroupIndex,
int pIndex,
int nth = 0 );
362 FBSDK_DLL const char* FBObject_GetEntryDLLName (
int pGroupIndex,
int pIndex,
int nth = 0 );
363 FBSDK_DLL const char* FBObject_GetIconName (
int pGroupIndex,
int pIndex,
int nth = 0 );
364 FBSDK_DLL bool FBObject_GetMultiplicity (
int pGroupIndex,
int pIndex,
int nth = 0 );
380 inline bool FBUnregisterObject(
const char * pGroupName,
const char * pEntryName,
int nth=0 ) {
return FBObject_Unregister( pGroupName,pEntryName,nth ); }
386 #define FBRegisterObject( LocalId,Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename ) \
387 [[maybe_unused]] static bool __R##LocalId = FBObject_Register( Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename )
401 FBSDK_DLL int FBRegister_ClassId(
const char* pClassName);
407 #define FBDeclareUserObject(ClassName)\
410 virtual int GetUserClassId();\
411 virtual const char* FbxGetObjectSubType() override;\
459 kFBFlagStorableBlindDataForceBinary = (1 << 20),
507 virtual void RemoveAt(
int pIndex )
override;
521 virtual int GetCount()
override;
536 void SetClassId(
int pClassId );
538 void SetListOfParents(
bool pListOfParents );
539 bool GetIsListOfParents();
577 virtual int GetCount();
599 virtual int SetAt(
int pIndex,
FBComponent* pObject);
604 virtual void RemoveAt(
int pIndex );
611 virtual int InsertAt(
int pIndex,
FBComponent* pObject);
615 virtual void Clear();
620 virtual void SetSingleConnect(
bool pSingleConnect);
625 virtual int GetSingleConnect();
630 void SetFilter(
int pInternalClassId);
666 #ifndef DOXYGEN_SHOULD_SKIP_THIS
668 DataFBComponent* mLocalPtr;
681 static int GetInternalClassId();
694 virtual bool FBCreate();
697 virtual void FBDestroy();
700 virtual void FBDelete()
override;
703 virtual bool SetHIObject(HIObject pObject,
bool pSDKComponent)
override;
709 virtual int PropertyAdd(
FBProperty* pProperty );
715 bool PropertyAddReferenceProperty(
FBProperty* pReferenceProperty );
737 FBProperty* PropertyCreate(
const char* pName,
FBPropertyType pType,
const char * pDataType,
bool pAnimatable,
bool pIsUser =
false,
FBProperty* pReferenceSource = NULL );
786 bool ProcessNamespaceHierarchy(
FBNamespaceAction pNamespaceAction,
const char* pNamespaceName,
const char* pReplaceTo=NULL,
bool pAddRight=
true );
798 bool ProcessObjectNamespace (
FBNamespaceAction pNamespaceAction,
const char* pNamespaceName,
const char* pReplaceTo=NULL,
bool pAddRight=
true );
803 virtual const char* ClassName()
override;
809 virtual bool UseCustomPropertyViewSet()
const {
return true; }
814 const char* GetFullName(
void );
836 #ifndef DOXYGEN_SHOULD_SKIP_THIS
839 void *
operator new(
size_t stAllocateBlock );
840 void operator delete(
void *pvMem );
842 void *
operator new(
size_t stAllocateBlock,
int blockType,
const char *filename,
int linenumber );
843 void operator delete(
void *pvMem,
int blockType,
const char *filename,
int linenumber );
850 void InvalidatePropertyEventsParents();
861 #if !defined(K_NO_FOLDER)
862 FBPropertyFolder Folder;
866 #ifndef DOXYGEN_SHOULD_SKIP_THIS
867 IObject_Declare(
override);
868 ICallback_Declare(
override);
875 virtual bool Is(
int pTypeId )
override;
876 virtual int GetTypeId()
override;
878 static void FBComponentSetName(
FBComponent* pObject,
const char *pName );
879 static const char* FBComponentGetName(
FBComponent* pObject );
881 static void FBComponentSetLongName(
FBComponent* pObject,
const char *pName );
882 static const char* FBComponentGetLongName(
FBComponent* pObject );
885 #ifndef DOXYGEN_SHOULD_SKIP_THIS
887 KObject* mDummyObject;
888 void KObjectEvent(HIRegister pView, HKEventBase pEvent);
900 template<
class T>
inline T*
FBCast(
FBObject* pObject,
bool pAutoCreate =
false)
902 HIObject lObject = pObject ?
FBGetFBObject(pObject->GetHIObject(), pAutoCreate) : NULL;
942 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__)
963 #ifndef DOXYGEN_SHOULD_SKIP_THIS
987 FBPropertyConnectionAction Action;
989 FBPropertyConnectionType ConnectionType;
1009 FBPropertyConnectionAction Action;
1029 FBPropertyConnectionAction Action;
1066 FBPlug* GetProperty(
void );
1072 void* GetData(
void );
1088 IObject_Declare(
override);
1089 ICallback_Declare(
override);
1095 virtual bool LibInit();
1101 virtual bool LibOpen();
1108 virtual bool LibReady();
1113 virtual bool LibClose();
1118 virtual bool LibRelease();
1120 KGlobalNamedEvent *mLibrary_Open,
1125 void Library_OpenHandler(HIRegister pCaller,HKEventBase pEvent);
1126 void Library_ReadyHandler(HIRegister pCaller,HKEventBase pEvent);
1127 void Library_CloseHandler(HIRegister pCaller,HKEventBase pEvent);
1128 void Library_ReleaseHandler(HIRegister pCaller,HKEventBase pEvent);
1145 virtual bool LibInit();
1151 virtual bool LibOpen();
1158 virtual bool LibReady();
1163 virtual bool LibClose();
1168 virtual bool LibRelease();
1174 #if defined(K_NODLL)
1175 #define FBLibraryDeclare( LibName ) \
1176 FB_DLL_INIT( LibName, Operation ) \
1178 switch( Operation ) \
1184 #define FBLibraryDeclare( LibName ) \
1185 static FBLibrary LibName##GlobalFBLibrary; \
1187 K_DLLEXPORT bool LIBRARY_INIT(HIError
) \
1189 FB_EXT_INIT( LibName ); if (LibName##GlobalFBLibrary.LibInit()) return true; return false; \
1192 FB_DLL_INIT( LibName, Operation ) \
1194 switch( Operation ) \
1204 #define FBLibraryModule(Name) \
1205 void FBModule##Name()
1211 #define FBLibraryRegister( ClassName ) \
1212 extern void FBModule##ClassName( ); \
1213 FBModule##ClassName( );
1219 #define FBLibraryRegisterStorable( ClassName ) \
1220 extern void FBModule##ClassName##Storable( ); \
1221 FBModule##ClassName##Storable( );
1227 #define FBLibraryRegisterElement( ClassName ) \
1228 extern void FBModule##ClassName##Element( ); \
1229 FBModule##ClassName##Element( );
1235 #define FBLibraryRegisterShadingElement( ClassName ) \
1236 extern void FBModule##ClassName##ShadingElement( ); \
1237 FBModule##ClassName##ShadingElement( );
1240 #define FBLibraryDeclareEnd \
1253 #define FBCustomManagerImplementation( ThisComponent ) \
1254 FBClassImplementation( ThisComponent ) \
1259 #define FBRegisterCustomManager( ClassName ) \
1260 FBLibraryModule( ClassName ) \
1262 static ClassName g##ClassName; \
1263 g##ClassName.FBCreate(); \
1264 g##ClassName.RegisterManager(); \
1270 #define FBCustomManagerDeclare( ClassName ) \
1271 FBClassDeclare( ClassName, FBCustomManager ); \
1273 ClassName() : FBCustomManager() { FBClassInit; } \
1307 void RegisterManager();
1312 virtual bool FBCreate()
override;
1320 virtual bool Init() ;
1327 virtual bool Open() ;
1333 virtual bool Clear() ;
1338 virtual bool Close() ;
1343 #ifdef FBSDKUseNamespace
Template class to contain an array of items.
MotionBuilder SDK base class.
Custom manager class for user controlled observer objects.
Connection notify event class.
Connection notify event class.
Connection notify event class.
Objects Containing class.
Library class for DLL registration.
Library class for DLL registration.
Objects Containing class.
Connections Basic Open Reality SDK Element.
PropertyEvent: Base event class.
Property: Base property class.
PropertyList: Concrete class for PropertyList of component
Property class: const char * (String).
Visual Component base class.
A template class for arrays.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
HKEventBase HKEvent
HKEvent.
K_DLLIMPORT FBComponentList * FBCreateComponentList()
Create a FBObjectList object.
K_DLLIMPORT int FBObject_GetGroupCount()
A set of functions to query the registration table.
HIRegister HISender
HISender.
bool FBUnregisterObject(const char *pGroupName, const char *pEntryName, int nth=0)
FBUnregisterObject.
FBObjectStatus
Available lifetime status for any component.
@ kFBStatusRetrieving
Object is in retrieving operations.
@ kFBStatusDestroying
Object is in destruction operations.
@ kFBStatusMerging
Object is in Merging operations.
@ kFBStatusClearing
Object is in clearing operations (File new).
@ kFBStatusStoring
Object is in storing operations.
@ kFBStatusCreating
Object is in creation operations.
K_DLLIMPORT FBPlug * __FBObjectCreatorSub(HIObject pObject)
__FBObjectCreatorSub For internal use only, Create the FBPlug object from internal object.
FBArrayTemplate< FBComponent * > FBComponentList
typedef FBArrayTemplate<FBComponent*> FBComponentList;
K_DLLIMPORT FBComponent * FBCreateObject(const char *pGroupName, const char *pEntryName, const char *pName, void *pData=NULL, int nth=0)
FBCreateObject.
T * FBCast(FBObject *pObject, bool pAutoCreate=false)
Cast the SDK object using it's IObject interface into the proper class.
K_DLLIMPORT FBArrayTemplate< FBComponent * > & FBGetComponentArray()
Get the Root FBComponent.
K_DLLIMPORT void __FBAddModelToScene(HIObject pObject)
For internal usage only.
K_DLLIMPORT void __FBRemoveModelFromScene(HIObject pObject)
For internal usage only.
#define __FBClassDeclare(Name, Parent)
For internal use only.
K_DLLIMPORT int __FBGetInternalClassId(int pTypeInfo)
__FBGetInternalClassId For internal use only, Get the internal class Id from the ORSDK FBCompoent's T...
FBObjectFlag
Available flags for any component.
@ kFBFlagStorableBlindData
Used in FBX SDK native IO.
@ kFBFlagSavable
Can be saved.
@ kFBFlagStorable6
System/Obsolete.
@ kFBFlagSystem
Created from System (not from user)
@ kFBFlagSelectable
Can be selected. If disabled, representation of the object, like in the navigator,...
@ kFBFlagNewable
Deleted on File->New.
@ kFBFlagKeyable
Object can Key his property. (System Camera can't)
@ kFBFlagAllocated
Object is allocated, so it must call 'delete this' on destroy.
@ kFBFlagStorableData6
System/Obsolete.
@ kFBFlagUndoableSeparately
Object which has kFlagUndoableSeparately flag turned on will have a separate Undo Stack.
@ kFBFlagClonable
Can be cloned. If disabled, the "Duplicate" option will be removed in the contextual menu.
@ kFBFlagRenamable
Can be renamed.
@ kFBFlagBrowsable
Visible in the Scene Navigator/Schematic View/Property View/Model View. If disabled,...
@ kFBFlagMergeable
Can be merged.
@ kFBFlagDeletable
Can be deleted.
@ kFBFlagNamespaceEditable
Allow editing on the namespace objects. If disabled, the "Add/Remove Namespace..." option is removed ...
@ kFBFlagDetachable
Object can be "detached". Used by the apply manager contextual menu.
@ kFBFlagVisible
Can be visible. If disabled, the object will still be available in the navigator, it is only hidden i...
@ kFBFlagUniqueName
< Used in FBX SDK native IO, force bindary format for the bindary data.
@ kFBFlagStory
Object created/used by the Story tool. Useful flag for filtering Story objects.
@ kFBFlagNotSelectableNameSpace
The entity will not add the namespace of the object to his list of all the namespaces of the scene.
@ kFBFlagParentable
Object (model) can be "parented". Used by the apply manager contextual menu.
@ kFBFlagUndoable
Object can undo its actions and states, in a global Undo Stack.
K_DLLIMPORT FBComponent * FBGetFBComponent(HIObject pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
K_DLLIMPORT void FBFindObjectsByName(const char *pNamePattern, FBComponentList &pList, bool pIncludeNamespace=true, bool pModelsOnly=false)
FBFindObjectsByName.
K_DLLIMPORT int FBDeleteObjectsByName(const char *pNamePattern, const char *pNameSpace=NULL, const char *pGroupName=NULL)
FBDeleteObjectsByName.
K_DLLIMPORT int __FBRegisterTypeInfo(int pInternalClassId)
__FBRegisterTypeInfo For internal use only, Register the TypeInfo mapped to internal class id.
FBComponent FBObject
Equivalent to FBComponent for gradual transition.
K_DLLIMPORT FBComponent * FBFindObjectByFullName(const char *pObjectFullName)
FBFindObjectByFullName.
K_DLLIMPORT FBVisualComponent * FBGetFBVisualComponent(HIKtView pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
K_DLLIMPORT void FBDestroyComponentList(FBComponentList *pObjectList)
Delete a FBObjectList object.
void(ICallback::* FBCallback)(HISender pSender, HKEvent pEvent)
FBCallback.
K_DLLIMPORT FBComponent * GetFBComponent(const HIObject Object)
Get a handle to the FBComponent belonging to an HIObject.
FBNamespaceAction
Namespace flags.
@ kFBConcatNamespace
Use to add a namespace name to object.
@ kFBRemoveAllNamespace
Remove all the namespace name.
@ kFBReplaceNamespace
Use to replace a define namespace.
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
Definition of the class FBPlug and related enums and utility functions.
K_DLLIMPORT HIObject FBGetFBObject(HIObject pObject, bool pAutoCreate=false)
Get the SDK object from an Internal Object.
FBConnectionAction
Possible actions when a notify plug event occurs.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
FBPropertyType
Property types.
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
class FBPropertyBaseComponent< FBPlug * > FBPropertyPlug
Property: FBPropertyBaseComponent(FBPlug*)
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.