Open Reality Reference Guide
|
|
Go to the documentation of this file.
47 #include <kaydaradef.h>
51 #include <fbsdk/fblibrary.h>
57 #define FBSDK_DLL K_DLLIMPORT
67 #pragma warning (disable: 4661) // no suitable definition provided for explicit template instantiation request
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
667 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
FBObjectStatus
Available lifetime status for any component.
@ kFBStatusMerging
Object is in Merging operations.
@ kFBStatusRetrieving
Object is in retrieving operations.
K_DLLIMPORT int FBDeleteObjectsByName(const char *pNamePattern, const char *pNameSpace=NULL, const char *pGroupName=NULL)
FBDeleteObjectsByName.
@ kFBStatusDestroying
Object is in destruction operations.
@ kFBFlagMergeable
Can be merged.
@ kFBFlagNotSelectableNameSpace
The entity will not add the namespace of the object to his list of all the namespaces of the scene.
@ kFBFlagDetachable
Object can be "detached". Used by the apply manager contextual menu.
K_DLLIMPORT HIObject FBGetFBObject(HIObject pObject, bool pAutoCreate=false)
Get the SDK object from an Internal Object.
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Connection notify event class.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
K_DLLIMPORT int __FBRegisterTypeInfo(int pInternalClassId)
__FBRegisterTypeInfo For internal use only, Register the TypeInfo mapped to internal class id.
void(ICallback::* FBCallback)(HISender pSender, HKEvent pEvent)
FBCallback.
Objects Containing class.
FBNamespaceAction
Namespace flags.
K_DLLIMPORT FBVisualComponent * FBGetFBVisualComponent(HIKtView pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
@ kFBFlagKeyable
Object can Key his property. (System Camera can't)
@ kFBFlagSavable
Can be saved.
FBComponent FBObject
Equivalent to FBComponent for gradual transition.
@ kFBFlagUniqueName
< Used in FBX SDK native IO, force bindary format for the bindary data.
Custom manager class for user controlled observer objects.
@ kFBRemoveAllNamespace
Remove all the namespace name.
K_DLLIMPORT FBComponent * FBFindObjectByFullName(const char *pObjectFullName)
FBFindObjectByFullName.
Objects Containing class.
K_DLLIMPORT FBComponent * GetFBComponent(const HIObject Object)
Get a handle to the FBComponent belonging to an HIObject.
K_DLLIMPORT void __FBAddModelToScene(HIObject pObject)
For internal usage only.
Library class for DLL registration.
K_DLLIMPORT void __FBRemoveModelFromScene(HIObject pObject)
For internal usage only.
K_DLLIMPORT FBArrayTemplate< FBComponent * > & FBGetComponentArray()
Get the Root FBComponent.
@ kFBFlagVisible
Can be visible. If disabled, the object will still be available in the navigator, it is only hidden i...
HKEventBase HKEvent
HKEvent.
@ kFBFlagSystem
Created from System (not from user)
@ kFBFlagParentable
Object (model) can be "parented". Used by the apply manager contextual menu.
@ kFBConcatNamespace
Use to add a namespace name to object.
@ kFBFlagRenamable
Can be renamed.
#define __FBClassDeclare(Name, Parent)
For internal use only.
K_DLLIMPORT FBComponentList * FBCreateComponentList()
Create a FBObjectList object.
Property: Base property class.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
A template class for arrays.
K_DLLIMPORT FBComponent * FBCreateObject(const char *pGroupName, const char *pEntryName, const char *pName, void *pData=NULL, int nth=0)
FBCreateObject.
@ kFBFlagNamespaceEditable
Allow editing on the namespace objects. If disabled, the "Add/Remove Namespace..." option is removed ...
@ kFBStatusClearing
Object is in clearing operations (File new).
@ 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.
@ kFBFlagAllocated
Object is allocated, so it must call 'delete this' on destroy.
K_DLLIMPORT FBComponent * FBGetFBComponent(HIObject pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
@ kFBFlagUndoable
Object can undo its actions and states, in a global Undo Stack.
@ kFBFlagBrowsable
Visible in the Scene Navigator/Schematic View/Property View/Model View. If disabled,...
FBObjectFlag
Available flags for any component.
FBConnectionAction
Possible actions when a notify plug event occurs.
PropertyEvent: Base event class.
@ kFBReplaceNamespace
Use to replace a define namespace.
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
K_DLLIMPORT int FBObject_GetGroupCount()
A set of functions to query the registration table.
K_DLLIMPORT void FBFindObjectsByName(const char *pNamePattern, FBComponentList &pList, bool pIncludeNamespace=true, bool pModelsOnly=false)
FBFindObjectsByName.
FBPropertyType
Property types.
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
@ kFBStatusCreating
Object is in creation operations.
@ kFBStatusStoring
Object is in storing operations.
T * FBCast(FBObject *pObject, bool pAutoCreate=false)
Cast the SDK object using it's IObject interface into the proper class.
PropertyList: Concrete class for PropertyList of component
K_DLLIMPORT void FBDestroyComponentList(FBComponentList *pObjectList)
Delete a FBObjectList object.
Template class to contain an array of items.
@ kFBFlagStorableData6
System/Obsolete.
Definition of the class FBPlug and related enums and utility functions.
@ kFBFlagDeletable
Can be deleted.
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
HIRegister HISender
HISender.
Library class for DLL registration.
K_DLLIMPORT FBPlug * __FBObjectCreatorSub(HIObject pObject)
__FBObjectCreatorSub For internal use only, Create the FBPlug object from internal object.
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
bool FBUnregisterObject(const char *pGroupName, const char *pEntryName, int nth=0)
FBUnregisterObject.
K_DLLIMPORT int __FBGetInternalClassId(int pTypeInfo)
__FBGetInternalClassId For internal use only, Get the internal class Id from the ORSDK FBCompoent's T...
Connections Basic Open Reality SDK Element.
Connection notify event class.
@ kFBFlagStorable6
System/Obsolete.
Connection notify event class.
@ kFBFlagSelectable
Can be selected. If disabled, representation of the object, like in the navigator,...
FBArrayTemplate< FBComponent * > FBComponentList
typedef FBArrayTemplate<FBComponent*> FBComponentList;
Property class: const char * (String).
MotionBuilder SDK base class.
Visual Component base class.
class FBPropertyBaseComponent< FBPlug * > FBPropertyPlug
Property: FBPropertyBaseComponent(FBPlug*)
@ kFBFlagNewable
Deleted on File->New.
@ kFBFlagStory
Object created/used by the Story tool. Useful flag for filtering Story objects.
@ kFBFlagStorableBlindData
Used in FBX SDK native IO.