Open Reality Reference Guide
 
Loading...
Searching...
No Matches
fbcomponent.h
Go to the documentation of this file.
1#ifndef __FBBASE_H__
2#define __FBBASE_H__
3/**************************************************************************
4 Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5 All Rights Reserved.
6
7 The coded instructions, statements, computer programs, and/or related
8 material (collectively the "Data") in these files contain unpublished
9 information proprietary to Autodesk, Inc. and/or its licensors, which is
10 protected by Canada and United States of America federal copyright law
11 and by international treaties.
12
13 The Data may not be disclosed or distributed to third parties, in whole
14 or in part, without the prior written consent of Autodesk, Inc.
15 ("Autodesk").
16
17 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20 ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21 OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22 PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23 WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24 FREE.
25
26 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28 EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29 DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30 OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31 DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32 LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33 LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34 DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35 BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36
37**************************************************************************/
38
47#include <kaydaradef.h>
48
49// This include directive is necessary because of the definition of the
50// FBLibrary class.
51#include <fbsdk/fblibrary.h>
52
53#ifndef FBSDK_DLL
57 #define FBSDK_DLL K_DLLIMPORT
58#endif
59
60// Global includes
61#include <fbsdk/fbplug.h>
62#include <fbsdk/fbarray.h>
63#include <fbsdk/fbstring.h>
64#include <fbsdk/fbproperties.h>
65
66#ifdef _MSC_VER
67 #pragma warning (disable: 4661) // no suitable definition provided for explicit template instantiation request
68#endif
69
70K_FORWARD( IRegister );
71K_FORWARD( IError );
72K_FORWARD( IStore );
73K_FORWARD( IKtView );
74K_FORWARD( KEventBase );
75K_FORWARD( KGlobalNamedEvent );
76
77#ifdef FBSDKUseNamespace
78 namespace FBSDKNamespace {
79#endif
80
81#ifndef FBINCLUDE
82// Section that must be exported
83#else
84#endif
88#define FB_DEFAULT_SDK_ICON "openreality_noicon.png"
89
90// For internal use only.
94#define __FBClassInit mLocalPtr = NULL;
95
96// For internal use only.
100#define __FBClassDeInit if (mLocalPtr) {delete mLocalPtr; mLocalPtr = NULL;}
101
102// For internal use only.
106#define __FBClassInitSDKComponent( pObjectToWrappedIsAllocated ) \
107 __FBClassInit; \
108 mSDKComponent = pObjectToWrappedIsAllocated;
109
114FBSDK_DLL int __FBRegisterTypeInfo(int pInternalClassId);
115
121
127
131#define __FBClassDeclare( Name,Parent ) \
132 friend FBSDK_DLL FBPlug* __FBObjectCreatorSub(HIObject pObject);\
133 public: \
134\
137 typedef Parent __FBParentClass;\
138\
141 typedef Name __FBClassType;\
142\
145 virtual const char* ClassName() override { return #Name; } \
146\
150 virtual bool Is( int pTypeId ) override { return (pTypeId==TypeInfo) ? true : Parent::Is( pTypeId ); } \
151 virtual int GetTypeId() override { return TypeInfo; } \
152\
155 static int GetInternalClassId(); \
156\
159 Data##Name* mLocalPtr; \
160 virtual ~Name(); \
161 static int TypeInfo; \
163 private:
164
168#define __FBClassDeclareGroup( Name,Parent ) \
169 __FBClassDeclare( Name,Parent )\
170 public:\
171 static const char* ClassGroupName; \
172\
173 private:
174
175FBSDK_DLL void __FBAddModelToScene( HIObject pObject );
176FBSDK_DLL void __FBRemoveModelFromScene( HIObject pObject );
177
181#define FBStorableClassImplementation(ClassName, Type)\
182 const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
183 HIObject RegisterStorable##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
184 ClassName* Class = new ClassName(pName);\
185 Class->mAllocated = true;\
186 if( Class->FBCreate() ){\
187 __FBRemoveModelFromScene( Class->GetHIObject() ); /* Hack in MoBu2013, we shouldn't add object to the scene/entity automatically*/\
188 return Class->GetHIObject();\
189 } else {\
190 delete Class;\
191 return NULL;}}\
192 FBLibraryModule(ClassName##Storable){\
193 FBString lGroup = "FbxStorable/";\
194 lGroup += #Type;\
195 FBRegisterObject(ClassName##R2, lGroup, #ClassName, "", RegisterStorable##ClassName##Create, true, NULL);}
196
200#define FBElementClassImplementation(ClassName,IconFileName)\
201 HIObject RegisterElement##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
202 ClassName* Class = new ClassName(pName);\
203 Class->mAllocated = true;\
204 if( Class->FBCreate() ){\
205 __FBRemoveModelFromScene( Class->GetHIObject() ); /* Hack in MoBu2013, we shouldn't add object to the scene/entity automatically*/\
206 return Class->GetHIObject();\
207 } else {\
208 delete Class;\
209 return NULL;}}\
210 FBLibraryModule(ClassName##Element){\
211 FBRegisterObject(ClassName##R2, "Browsing/Templates/Elements", #ClassName, "", RegisterElement##ClassName##Create, true, IconFileName);}
212
216#define FBElementClassImplementationWithName(ClassName,UniqueNameStr,IconFileName)\
217 HIObject RegisterElement##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
218 ClassName* Class = new ClassName(pName);\
219 Class->mAllocated = true;\
220 Class->UniqueName = UniqueNameStr; \
221 if( Class->FBCreate() ){\
222 __FBRemoveModelFromScene( Class->GetHIObject() ); /* Hack in MoBu2013, we shouldn't add object to the scene/entity automatically*/\
223 return Class->GetHIObject();\
224 } else {\
225 delete Class;\
226 return NULL;}}\
227 FBLibraryModule(ClassName##Element){\
228 FBRegisterObject(ClassName##R2, "Browsing/Templates/Elements", UniqueNameStr, "", RegisterElement##ClassName##Create, true, IconFileName);}
229
233#define FBShadingElementClassImplementation(ClassName,IconFileName)\
234 HIObject RegisterShadingElement##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
235 ClassName* Class = new ClassName(pName);\
236 Class->mAllocated = true;\
237 if( Class->FBCreate() ){\
238 return Class->GetHIObject();\
239 } else {\
240 delete Class;\
241 return NULL;}}\
242 FBLibraryModule(ClassName##ShadingElement){\
243 FBRegisterObject(ClassName##R2, "Browsing/Templates/Shading Elements", #ClassName, "", RegisterShadingElement##ClassName##Create, true, IconFileName);}
244
251#define FBStorableClassDeclare(Name, Parent)\
252 FBClassDeclare(Name, Parent);\
253public:\
254 virtual const char* FbxGetObjectSubType() override; \
255\
256private: \
257
258
266#define FBPropertyInitComponent( Param,Type,PropName,Get,Set ) \
267 { \
268 PropertyAdd(PropName.Init( (void *)Param,#PropName,(Type* (*)(void *))Get,(void (*)(void *,Type*))Set )); \
269 PropName.TypeInfo = &Type::TypeInfo; \
270 }
271
279#define FBIS( Component,ComponentType ) \
280 ((Component) && (Component)->Is( ComponentType::TypeInfo ))
281
283// Utility function
285// For internal use only.
288
295FBSDK_DLL FBComponent* GetFBComponent( const HIObject Object );
296
297#if !defined(K_NO_UI)
303FBSDK_DLL FBVisualComponent* FBGetFBVisualComponent( HIKtView pObject,bool pAutoCreate=true );
304#endif
305
311FBSDK_DLL FBComponent* FBGetFBComponent( HIObject pObject, bool pAutoCreate=true );
312
315
323
332
334// Registration macros
336
341#define FBRegisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Register ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
346#define FBUnregisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Unregister ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
347
352FBSDK_DLL void FBSetStoreableCustomModelRegistered();
353FBSDK_DLL bool FBGetStoreableCustomModelRegistered();
354
359FBSDK_DLL void FBSetStoreableCustomMaterialRegistered();
360FBSDK_DLL bool FBGetStoreableCustomMaterialRegistered();
366FBSDK_DLL void FBSetStoreableCustomTextureRegistered();
367FBSDK_DLL bool FBGetStoreableCustomTextureRegistered();
368
369FBSDK_DLL bool FBObject_Register ( const char * pGroupName,const char * pEntryName,const char * pDescription, kObjectCreatorFnc pCreatorFnc, bool pIsMultipleAllowed,const char * pIconFilename);
370FBSDK_DLL bool FBObject_Unregister( const char * pGroupName,const char * pEntryName, int nth=0 );
371
375FBSDK_DLL const char* FBObject_GetGroupName ( int pGroupIndex );
376FBSDK_DLL int FBObject_GetEntryCount ( int pGroupIndex );
377FBSDK_DLL const char* FBObject_GetEntryName ( int pGroupIndex, int pIndex );
378FBSDK_DLL const char* FBObject_GetEntryDescription ( int pGroupIndex, int pIndex, int nth = 0 );
379FBSDK_DLL const char* FBObject_GetEntryDLLName ( int pGroupIndex, int pIndex, int nth = 0 );
380FBSDK_DLL const char* FBObject_GetIconName ( int pGroupIndex, int pIndex, int nth = 0 );
381FBSDK_DLL bool FBObject_GetMultiplicity ( int pGroupIndex, int pIndex, int nth = 0 );
382
390FBSDK_DLL FBComponent* FBCreateObject( const char* pGroupName, const char* pEntryName, const char* pName, void* pData = NULL, int nth = 0 );
391
397inline bool FBUnregisterObject( const char * pGroupName, const char * pEntryName, int nth=0 ) { return FBObject_Unregister( pGroupName,pEntryName,nth ); }
398
403#define FBRegisterObject( LocalId,Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename ) \
404 [[maybe_unused]] static bool __R##LocalId = FBObject_Register( Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename )
405
407typedef HIRegister HISender;
408
410typedef HKEventBase HKEvent;
416typedef void (ICallback::*FBCallback)(HISender pSender,HKEvent pEvent);
417
418FBSDK_DLL int FBRegister_ClassId(const char* pClassName);
419
424#define FBDeclareUserObject(ClassName)\
425public:\
426 static int ClassId;\
427 virtual int GetUserClassId();\
428 virtual const char* FbxGetObjectSubType() override;\
429\
430private:
431
433// FBComponent
435#ifdef new
439 #define RENEW new
440 #undef new
441#endif
442
444// FBSceneList
456 kFBFlagSelectable = (1 << 0),
457 kFBFlagDeletable = (1 << 1),
458 kFBFlagSavable = (1 << 2),
459 kFBFlagVisible = (1 << 3),
460 kFBFlagClonable = (1 << 4),
461 kFBFlagSystem = (1 << 5),
462 kFBFlagNewable = (1 << 6),
463 kFBFlagRenamable = (1 << 7),
464 kFBFlagMergeable = (1 << 8),
465 kFBFlagBrowsable = (1 << 9),
466 kFBFlagParentable = (1 << 10),
467 kFBFlagDetachable = (1 << 11),
468 kFBFlagUndoable = (1 << 12),
469 kFBFlagUndoableSeparately = (1 << 13),
470 kFBFlagKeyable = (1 << 14),
471 kFBFlagAllocated = (1 << 15),
472 kFBFlagStory = (1 << 16),
473 kFBFlagStorable6 = (1 << 17),
476 kFBFlagStorableBlindDataForceBinary = (1 << 20),
477 kFBFlagUniqueName = (1 << 21),
479 kFBFlagNamespaceEditable = (1 << 23),
481
484 kFBStatusCreating = (1 << 0),
485 kFBStatusStoring = (1 << 1),
486 kFBStatusRetrieving = (1 << 2),
487 kFBStatusMerging = (1 << 3),
488 kFBStatusDestroying = (1 << 4),
489 kFBStatusClearing = (1 << 5),
490};
491
494{
498};
500FB_DEFINE_ENUM(FBSDK_DLL, ConnectionType);
501FB_DEFINE_ENUM(FBSDK_DLL, ConnectionAction);
503
508 protected:
510 int mClassId;
512 bool mParents;
513 public:
520 virtual int Add( FBComponent* pItem );
524 virtual void RemoveAt( int pIndex ) override;
529 virtual FBComponent* GetAt(int pIndex)=0;
534 FBComponent* operator[](int pIndex);
538 virtual int GetCount() override;
539
544 virtual int Find( FBComponent* pItem );
545
550 virtual int Remove( FBComponent* pItem );
551
552 // Internal functions
553 void SetClassId( int pClassId );
554 int GetClassId( );
555 void SetListOfParents( bool pListOfParents );
556 bool GetIsListOfParents();
557
561 virtual FBPropertyType GetPropertyType( ) override { return kFBPT_object; }
562};
566{
567 public:
572 virtual FBComponent* GetAt(int pIndex);
573};
574
576// FBPropertyListObject
578
580
586{
587 public:
590
594 virtual int GetCount();
595
597
601 virtual FBComponent* operator[]( int pIndex );
602 virtual FBComponent* GetAt( int pIndex );
604
609 virtual int Add( FBComponent* pObject );
610
616 virtual int SetAt(int pIndex, FBComponent* pObject);
617
621 virtual void RemoveAt( int pIndex );
622
628 virtual int InsertAt(int pIndex, FBComponent* pObject);
632 virtual void Clear();
633
637 virtual void SetSingleConnect(bool pSingleConnect);
638
642 virtual int GetSingleConnect();
643
647 void SetFilter(int pInternalClassId);
648
652 int GetFilter();
653
654private:
656
661 const FBPropertyListObject& operator =( const FBPropertyListObject& );
663};
664
681{
682public:
683#ifndef DOXYGEN_SHOULD_SKIP_THIS
685 DataFBComponent* mLocalPtr;
686protected:
688 FBString mName;
689#endif
691public:
693 static int TypeInfo;
694
698 static int GetInternalClassId();
699
703 FBComponent( HIObject pObject );
706 virtual ~FBComponent();
711 virtual bool FBCreate();
712
714 virtual void FBDestroy();
715
717 virtual void FBDelete() override;
718
720 virtual bool SetHIObject(HIObject pObject, bool pSDKComponent) override;
721
726 virtual int PropertyAdd( FBProperty* pProperty );
727
732 bool PropertyAddReferenceProperty( FBProperty* pReferenceProperty );
733
738 void PropertyRemove( FBProperty* pProperty );
739
744 void PropertyGetModifiedList(FBArrayTemplate<FBProperty*>& pPropList, FBPlugModificationFlag pModificationFlags);
745
754 FBProperty* PropertyCreate( const char* pName, FBPropertyType pType, const char * pDataType, bool pAnimatable, bool pIsUser = false, FBProperty* pReferenceSource = NULL );
755
759 FBObjectFlag GetObjectFlags();
760
764 void SetObjectFlags(FBObjectFlag pFlags);
765
770 bool HasObjectFlags(FBObjectFlag pFlags);
771
775 void EnableObjectFlags(FBObjectFlag pFlags);
776
780 void DisableObjectFlags(FBObjectFlag pFlags);
781
786 void SetObjectStatus(FBObjectStatus pStatus, bool pValue);
787
791 bool GetObjectStatus(FBObjectStatus pStatus);
792
803 bool ProcessNamespaceHierarchy( FBNamespaceAction pNamespaceAction, const char* pNamespaceName, const char* pReplaceTo=NULL, bool pAddRight=true );
804
815 bool ProcessObjectNamespace ( FBNamespaceAction pNamespaceAction, const char* pNamespaceName, const char* pReplaceTo=NULL, bool pAddRight=true );
816
820 virtual const char* ClassName() override;
821
826 virtual bool UseCustomPropertyViewSet() const { return true; }
831 const char* GetFullName( void );
832
835 void SetOwnerNamespace(FBNamespace* pOwnerNSObj);
836
840 FBNamespace* GetOwnerNamespace( void );
841
842
846 FBFileReference* GetOwnerFileReference( void );
847
851 void HardSelect();
852
853#ifndef DOXYGEN_SHOULD_SKIP_THIS
855 // Overloaded allocation/destruction operator.
856 void *operator new( size_t stAllocateBlock );
857 void operator delete( void *pvMem );
859 void *operator new( size_t stAllocateBlock, int blockType, const char *filename, int linenumber );
860 void operator delete( void *pvMem, int blockType, const char *filename, int linenumber );
864 // Used to manage sub property events.
865 void RegisterPropertyEvent(FBPropertyEvent* pPropertyEvent);
866 void UnregisterPropertyEvent(FBPropertyEvent* pPropertyEvent);
867 void InvalidatePropertyEventsParents();
869#endif
870
871 FBPropertyManager PropertyList;
872 FBPropertyListComponent Components;
874 FBPropertyBool Selected;
875 FBPropertyString Name;
876 FBPropertyString LongName;
877
878#if !defined(K_NO_FOLDER)
879 FBPropertyFolder Folder;
880#endif
881
882public:
883#ifndef DOXYGEN_SHOULD_SKIP_THIS
884 IObject_Declare(override);
885 ICallback_Declare(override);
886#endif
887
892 virtual bool Is( int pTypeId ) override;
893 virtual int GetTypeId() override;
894
895 static void FBComponentSetName( FBComponent* pObject, const char *pName );
896 static const char* FBComponentGetName( FBComponent* pObject );
898 static void FBComponentSetLongName( FBComponent* pObject, const char *pName );
899 static const char* FBComponentGetLongName( FBComponent* pObject );
900
901public:
902#ifndef DOXYGEN_SHOULD_SKIP_THIS
904 KObject* mDummyObject;
905 void KObjectEvent(HIRegister pView, HKEventBase pEvent);
906#endif
907};
908
910typedef FBComponent FBObject;
911
917template<class T> inline T* FBCast(FBObject* pObject, bool pAutoCreate = false)
919 HIObject lObject = pObject ? FBGetFBObject(pObject->GetHIObject(), pAutoCreate) : NULL;
920 // Should also validate type but not available for now
921 return (T*)lObject;
922}
923
931FBSDK_DLL void FBFindObjectsByName( const char* pNamePattern, FBComponentList& pList, bool pIncludeNamespace = true, bool pModelsOnly = false );
932
941FBSDK_DLL FBComponent* FBFindObjectByFullName( const char* pObjectFullName );
942
956FBSDK_DLL int FBDeleteObjectsByName( const char* pNamePattern, const char* pNameSpace = NULL, const char* pGroupName = NULL);
957
958#ifdef RENEW
959 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__)
960 #undef RENEW
961#endif
962
964// FBEvent
967
969class FBSDK_DLL FBEvent
970{
971public:
977 FBEvent( HKEvent pEvent );
978
979 FBPropertyInt Type;
980#ifndef DOXYGEN_SHOULD_SKIP_THIS
981protected:
983 HKEventBase mEvent;
984public:
986 void PropertyAdd( FBProperty* ) {};
987#endif
988};
991// FBEventConnectionNotify
997{
998public:
1002 FBEventConnectionNotify(HKEventBase pEvent);
1003
1004 FBPropertyConnectionAction Action;
1005 FBPropertyInt SrcIndex;
1006 FBPropertyConnectionType ConnectionType;
1007 FBPropertyPlug SrcPlug;
1008 FBPropertyPlug DstPlug;
1009 FBPropertyPlug NewPlug;
1010};
1013// FBEventConnectionDataNotify
1019{
1020public:
1024 FBEventConnectionDataNotify(HKEventBase pEvent);
1026 FBPropertyConnectionAction Action;
1027 FBPropertyPlug Plug;
1028 void* GetData();
1029 void* GetOldData();
1030};
1033// FBEventConnectionStateNotify
1039{
1040public:
1044 FBEventConnectionStateNotify(HKEventBase pEvent);
1045
1046 FBPropertyConnectionAction Action;
1047 FBPropertyPlug Plug;
1048 void* GetData();
1049 void* GetOldData();
1051
1053// __FB_FORWARD( FBEventConnectionKeyingNotify ); //
1056
1058{
1059public:
1063 FBEventConnectionKeyingNotify(HKEventBase pEvent);
1070 FBConnectionAction GetAction( void );
1071
1077 FBPlug* GetPlug( void );
1083 FBPlug* GetProperty( void );
1089 void* GetData( void );
1090};
1091
1092
1094// FBLibrary
1096
1100class FBSDK_DLL FBLibraryBase : public ICallback
1101{
1102public:
1103 FBLibraryBase();
1104 virtual ~FBLibraryBase();
1105 IObject_Declare(override);
1106 ICallback_Declare(override);
1107
1112 virtual bool LibInit();
1113
1118 virtual bool LibOpen();
1119
1125 virtual bool LibReady();
1130 virtual bool LibClose();
1131
1135 virtual bool LibRelease();
1137 KGlobalNamedEvent *mLibrary_Open,
1138 *mLibrary_Ready,
1139 *mLibrary_Close,
1140 *mLibrary_Release;
1141
1142 void Library_OpenHandler(HIRegister pCaller,HKEventBase pEvent);
1143 void Library_ReadyHandler(HIRegister pCaller,HKEventBase pEvent);
1144 void Library_CloseHandler(HIRegister pCaller,HKEventBase pEvent);
1145 void Library_ReleaseHandler(HIRegister pCaller,HKEventBase pEvent);
1146};
1147
1149// FBLibrary
1151
1156{
1157public:
1162 virtual bool LibInit();
1163
1168 virtual bool LibOpen();
1169
1175 virtual bool LibReady();
1176
1180 virtual bool LibClose();
1181
1185 virtual bool LibRelease();
1186};
1187
1191#if defined(K_NODLL)
1192 #define FBLibraryDeclare( LibName ) \
1193 FB_DLL_INIT( LibName, Operation ) \
1194 { \
1195 switch( Operation ) \
1196 { \
1197 case kFBDllLoad: \
1198 { \
1199
1200#else
1201 #define FBLibraryDeclare( LibName ) \
1202 static FBLibrary LibName##GlobalFBLibrary; \
1203 extern "C" { \
1204 K_DLLEXPORT bool LIBRARY_INIT(HIError /*Error*/) \
1205 { \
1206 FB_EXT_INIT( LibName ); if (LibName##GlobalFBLibrary.LibInit()) return true; return false; \
1207 } \
1208 } \
1209 FB_DLL_INIT( LibName, Operation ) \
1210 { \
1211 switch( Operation ) \
1212 { \
1213 case kFBDllLoad: \
1214 {
1215#endif
1216
1221#define FBLibraryModule(Name) \
1222 void FBModule##Name()
1228#define FBLibraryRegister( ClassName ) \
1229 extern void FBModule##ClassName( ); \
1230 FBModule##ClassName( );
1236#define FBLibraryRegisterStorable( ClassName ) \
1237 extern void FBModule##ClassName##Storable( ); \
1238 FBModule##ClassName##Storable( );
1244#define FBLibraryRegisterElement( ClassName ) \
1245 extern void FBModule##ClassName##Element( ); \
1246 FBModule##ClassName##Element( );
1247
1252#define FBLibraryRegisterShadingElement( ClassName ) \
1253 extern void FBModule##ClassName##ShadingElement( ); \
1254 FBModule##ClassName##ShadingElement( );
1255
1257#define FBLibraryDeclareEnd \
1258 } \
1259 break; \
1260 default: \
1261 break; \
1262 } \
1264
1265// **********************************************************************************
1266
1270#define FBCustomManagerImplementation( ThisComponent ) \
1271 FBClassImplementation( ThisComponent ) \
1272
1276#define FBRegisterCustomManager( ClassName ) \
1277 FBLibraryModule( ClassName ) \
1278 { \
1279 static ClassName g##ClassName; \
1280 g##ClassName.FBCreate(); \
1281 g##ClassName.RegisterManager(); \
1282 } \
1283
1287#define FBCustomManagerDeclare( ClassName ) \
1288FBClassDeclare( ClassName, FBCustomManager ); \
1289 public: \
1290 ClassName() : FBCustomManager() { FBClassInit; } \
1291 \
1292 private:
1293
1294
1296// FBCustomManager
1298
1313class FBSDK_DLL FBCustomManager : public FBComponent {
1315public:
1319
1324 void RegisterManager();
1325
1329 virtual bool FBCreate() override;
1330
1337 virtual bool Init() ;
1338
1344 virtual bool Open() ;
1345
1350 virtual bool Clear() ;
1351
1355 virtual bool Close() ;
1356
1357};
1358
1359
1360#ifdef FBSDKUseNamespace
1361 }
1362#endif
1363
1364#endif
Template class to contain an array of items.
Definition fbarray.h:78
MotionBuilder SDK base class.
Custom manager class for user controlled observer objects.
Connection notify event class.
Connection notify event class.
Connection notify event class.
Base Event class.
Objects Containing class.
Folder class.
Definition fbfolder.h:79
Library class for DLL registration.
Library class for DLL registration.
Objects Containing class.
Definition fbnamespace.h:80
Connections Basic Open Reality SDK Element.
Definition fbplug.h:222
PropertyEvent: Base event class.
Property: Base property class.
PropertyList: Component.
PropertyList: Concrete class for PropertyList of component
List of scene objects.
Property Manager.
Property class: const char * (String).
Basic string class.
Definition fbstring.h:67
Visual Component base class.
Definition fbcontrols.h:312
A template class for arrays.
HKEventBase HKEvent
HKEvent.
K_DLLIMPORT FBComponentList * FBCreateComponentList()
Create a FBObjectList object.
K_DLLIMPORT FBVisualComponent * FBGetFBVisualComponent(HIKtView pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
K_DLLIMPORT int FBObject_GetGroupCount()
A set of functions to query the registration table.
HIRegister HISender
HISender.
K_DLLIMPORT FBPlug * __FBObjectCreatorSub(HIObject pObject)
__FBObjectCreatorSub For internal use only, Create the FBPlug object from internal object.
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.
FBArrayTemplate< FBComponent * > FBComponentList
typedef FBArrayTemplate<FBComponent*> FBComponentList;
K_DLLIMPORT void __FBAddModelToScene(HIObject pObject)
For internal usage only.
T * FBCast(FBObject *pObject, bool pAutoCreate=false)
Cast the SDK object using it's IObject interface into the proper class.
K_DLLIMPORT FBComponent * FBGetFBComponent(HIObject pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
K_DLLIMPORT void __FBRemoveModelFromScene(HIObject pObject)
For internal usage only.
K_DLLIMPORT FBComponent * FBCreateObject(const char *pGroupName, const char *pEntryName, const char *pName, void *pData=NULL, int nth=0)
FBCreateObject.
#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 * GetFBComponent(const HIObject Object)
Get a handle to the FBComponent belonging to an HIObject.
K_DLLIMPORT FBComponent * FBFindObjectByFullName(const char *pObjectFullName)
FBFindObjectByFullName.
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 FBArrayTemplate< FBComponent * > & FBGetComponentArray()
Get the Root FBComponent.
K_DLLIMPORT void FBDestroyComponentList(FBComponentList *pObjectList)
Delete a FBObjectList object.
void(ICallback::* FBCallback)(HISender pSender, HKEvent pEvent)
FBCallback.
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.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
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.
FBPlugModificationFlag
Definition fbplug.h:154
FBConnectionAction
Possible actions when a notify plug event occurs.
Definition fbplug.h:79
Property classes.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
FBPropertyType
Property types.
@ kFBPT_object
object.
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_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
String class.
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition fbtypes.h:62
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition fbtypes.h:68