Open Reality Reference Guide
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 FBShadingElementClassImplementation(ClassName,IconFileName)\
217 HIObject RegisterShadingElement##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
218 ClassName* Class = new ClassName(pName);\
219 Class->mAllocated = true;\
220 if( Class->FBCreate() ){\
221 return Class->GetHIObject();\
222 } else {\
223 delete Class;\
224 return NULL;}}\
225 FBLibraryModule(ClassName##ShadingElement){\
226 FBRegisterObject(ClassName##R2, "Browsing/Templates/Shading Elements", #ClassName, "", RegisterShadingElement##ClassName##Create, true, IconFileName);}
227
234#define FBStorableClassDeclare(Name, Parent)\
235 FBClassDeclare(Name, Parent);\
236public:\
237 virtual const char* FbxGetObjectSubType() override; \
238\
239private: \
240
241
249#define FBPropertyInitComponent( Param,Type,PropName,Get,Set ) \
250 { \
251 PropertyAdd(PropName.Init( (void *)Param,#PropName,(Type* (*)(void *))Get,(void (*)(void *,Type*))Set )); \
252 PropName.TypeInfo = &Type::TypeInfo; \
253 }
254
262#define FBIS( Component,ComponentType ) \
263 ((Component) && (Component)->Is( ComponentType::TypeInfo ))
264
266// Utility function
268// For internal use only.
271
278FBSDK_DLL FBComponent* GetFBComponent( const HIObject Object );
279
280#if !defined(K_NO_UI)
286FBSDK_DLL FBVisualComponent* FBGetFBVisualComponent( HIKtView pObject,bool pAutoCreate=true );
287#endif
288
294FBSDK_DLL FBComponent* FBGetFBComponent( HIObject pObject, bool pAutoCreate=true );
295
298
306
315
317// Registration macros
319
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 );
330
335FBSDK_DLL void FBSetStoreableCustomModelRegistered();
336FBSDK_DLL bool FBGetStoreableCustomModelRegistered();
337
342FBSDK_DLL void FBSetStoreableCustomMaterialRegistered();
343FBSDK_DLL bool FBGetStoreableCustomMaterialRegistered();
349FBSDK_DLL void FBSetStoreableCustomTextureRegistered();
350FBSDK_DLL bool FBGetStoreableCustomTextureRegistered();
351
352FBSDK_DLL bool FBObject_Register ( const char * pGroupName,const char * pEntryName,const char * pDescription, kObjectCreatorFnc pCreatorFnc, bool pIsMultipleAllowed,const char * pIconFilename);
353FBSDK_DLL bool FBObject_Unregister( const char * pGroupName,const char * pEntryName, int nth=0 );
354
358FBSDK_DLL const char* FBObject_GetGroupName ( int pGroupIndex );
359FBSDK_DLL int FBObject_GetEntryCount ( int pGroupIndex );
360FBSDK_DLL const char* FBObject_GetEntryName ( int pGroupIndex, int pIndex );
361FBSDK_DLL const char* FBObject_GetEntryDescription ( int pGroupIndex, int pIndex, int nth = 0 );
362FBSDK_DLL const char* FBObject_GetEntryDLLName ( int pGroupIndex, int pIndex, int nth = 0 );
363FBSDK_DLL const char* FBObject_GetIconName ( int pGroupIndex, int pIndex, int nth = 0 );
364FBSDK_DLL bool FBObject_GetMultiplicity ( int pGroupIndex, int pIndex, int nth = 0 );
365
373FBSDK_DLL FBComponent* FBCreateObject( const char* pGroupName, const char* pEntryName, const char* pName, void* pData = NULL, int nth = 0 );
374
380inline bool FBUnregisterObject( const char * pGroupName, const char * pEntryName, int nth=0 ) { return FBObject_Unregister( pGroupName,pEntryName,nth ); }
381
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 )
388
390typedef HIRegister HISender;
391
393typedef HKEventBase HKEvent;
399typedef void (ICallback::*FBCallback)(HISender pSender,HKEvent pEvent);
400
401FBSDK_DLL int FBRegister_ClassId(const char* pClassName);
402
407#define FBDeclareUserObject(ClassName)\
408public:\
409 static int ClassId;\
410 virtual int GetUserClassId();\
411 virtual const char* FbxGetObjectSubType() override;\
412\
413private:
414
416// FBComponent
418#ifdef new
422 #define RENEW new
423 #undef new
424#endif
425
427// FBSceneList
439 kFBFlagSelectable = (1 << 0),
440 kFBFlagDeletable = (1 << 1),
441 kFBFlagSavable = (1 << 2),
442 kFBFlagVisible = (1 << 3),
443 kFBFlagClonable = (1 << 4),
444 kFBFlagSystem = (1 << 5),
445 kFBFlagNewable = (1 << 6),
446 kFBFlagRenamable = (1 << 7),
447 kFBFlagMergeable = (1 << 8),
448 kFBFlagBrowsable = (1 << 9),
449 kFBFlagParentable = (1 << 10),
450 kFBFlagDetachable = (1 << 11),
451 kFBFlagUndoable = (1 << 12),
452 kFBFlagUndoableSeparately = (1 << 13),
453 kFBFlagKeyable = (1 << 14),
454 kFBFlagAllocated = (1 << 15),
455 kFBFlagStory = (1 << 16),
456 kFBFlagStorable6 = (1 << 17),
459 kFBFlagStorableBlindDataForceBinary = (1 << 20),
460 kFBFlagUniqueName = (1 << 21),
462 kFBFlagNamespaceEditable = (1 << 23),
464
467 kFBStatusCreating = (1 << 0),
468 kFBStatusStoring = (1 << 1),
469 kFBStatusRetrieving = (1 << 2),
470 kFBStatusMerging = (1 << 3),
471 kFBStatusDestroying = (1 << 4),
472 kFBStatusClearing = (1 << 5),
473};
474
477{
481};
483FB_DEFINE_ENUM(FBSDK_DLL, ConnectionType);
484FB_DEFINE_ENUM(FBSDK_DLL, ConnectionAction);
486
491 protected:
493 int mClassId;
495 bool mParents;
496 public:
503 virtual int Add( FBComponent* pItem );
507 virtual void RemoveAt( int pIndex ) override;
512 virtual FBComponent* GetAt(int pIndex)=0;
517 FBComponent* operator[](int pIndex);
521 virtual int GetCount() override;
522
527 virtual int Find( FBComponent* pItem );
528
533 virtual int Remove( FBComponent* pItem );
534
535 // Internal functions
536 void SetClassId( int pClassId );
537 int GetClassId( );
538 void SetListOfParents( bool pListOfParents );
539 bool GetIsListOfParents();
540
544 virtual FBPropertyType GetPropertyType( ) override { return kFBPT_object; }
545};
549{
550 public:
555 virtual FBComponent* GetAt(int pIndex);
556};
557
559// FBPropertyListObject
561
563
569{
570 public:
573
577 virtual int GetCount();
578
580
584 virtual FBComponent* operator[]( int pIndex );
585 virtual FBComponent* GetAt( int pIndex );
587
592 virtual int Add( FBComponent* pObject );
593
599 virtual int SetAt(int pIndex, FBComponent* pObject);
600
604 virtual void RemoveAt( int pIndex );
605
611 virtual int InsertAt(int pIndex, FBComponent* pObject);
615 virtual void Clear();
616
620 virtual void SetSingleConnect(bool pSingleConnect);
621
625 virtual int GetSingleConnect();
626
630 void SetFilter(int pInternalClassId);
631
635 int GetFilter();
636
637private:
639
644 const FBPropertyListObject& operator =( const FBPropertyListObject& );
646};
647
664{
665public:
666#ifndef DOXYGEN_SHOULD_SKIP_THIS
668 DataFBComponent* mLocalPtr;
669protected:
671 FBString mName;
672#endif
674public:
676 static int TypeInfo;
677
681 static int GetInternalClassId();
682
686 FBComponent( HIObject pObject );
689 virtual ~FBComponent();
694 virtual bool FBCreate();
695
697 virtual void FBDestroy();
698
700 virtual void FBDelete() override;
701
703 virtual bool SetHIObject(HIObject pObject, bool pSDKComponent) override;
704
709 virtual int PropertyAdd( FBProperty* pProperty );
710
715 bool PropertyAddReferenceProperty( FBProperty* pReferenceProperty );
716
721 void PropertyRemove( FBProperty* pProperty );
722
727 void PropertyGetModifiedList(FBArrayTemplate<FBProperty*>& pPropList, FBPlugModificationFlag pModificationFlags);
728
737 FBProperty* PropertyCreate( const char* pName, FBPropertyType pType, const char * pDataType, bool pAnimatable, bool pIsUser = false, FBProperty* pReferenceSource = NULL );
738
742 FBObjectFlag GetObjectFlags();
743
747 void SetObjectFlags(FBObjectFlag pFlags);
748
753 bool HasObjectFlags(FBObjectFlag pFlags);
754
758 void EnableObjectFlags(FBObjectFlag pFlags);
759
763 void DisableObjectFlags(FBObjectFlag pFlags);
764
769 void SetObjectStatus(FBObjectStatus pStatus, bool pValue);
770
774 bool GetObjectStatus(FBObjectStatus pStatus);
775
786 bool ProcessNamespaceHierarchy( FBNamespaceAction pNamespaceAction, const char* pNamespaceName, const char* pReplaceTo=NULL, bool pAddRight=true );
787
798 bool ProcessObjectNamespace ( FBNamespaceAction pNamespaceAction, const char* pNamespaceName, const char* pReplaceTo=NULL, bool pAddRight=true );
799
803 virtual const char* ClassName() override;
804
809 virtual bool UseCustomPropertyViewSet() const { return true; }
814 const char* GetFullName( void );
815
818 void SetOwnerNamespace(FBNamespace* pOwnerNSObj);
819
823 FBNamespace* GetOwnerNamespace( void );
824
825
829 FBFileReference* GetOwnerFileReference( void );
830
834 void HardSelect();
835
836#ifndef DOXYGEN_SHOULD_SKIP_THIS
838 // Overloaded allocation/destruction operator.
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 );
847 // Used to manage sub property events.
848 void RegisterPropertyEvent(FBPropertyEvent* pPropertyEvent);
849 void UnregisterPropertyEvent(FBPropertyEvent* pPropertyEvent);
850 void InvalidatePropertyEventsParents();
852#endif
853
854 FBPropertyManager PropertyList;
855 FBPropertyListComponent Components;
857 FBPropertyBool Selected;
858 FBPropertyString Name;
859 FBPropertyString LongName;
860
861#if !defined(K_NO_FOLDER)
862 FBPropertyFolder Folder;
863#endif
864
865public:
866#ifndef DOXYGEN_SHOULD_SKIP_THIS
867 IObject_Declare(override);
868 ICallback_Declare(override);
869#endif
870
875 virtual bool Is( int pTypeId ) override;
876 virtual int GetTypeId() override;
877
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 );
883
884public:
885#ifndef DOXYGEN_SHOULD_SKIP_THIS
887 KObject* mDummyObject;
888 void KObjectEvent(HIRegister pView, HKEventBase pEvent);
889#endif
890};
891
893typedef FBComponent FBObject;
894
900template<class T> inline T* FBCast(FBObject* pObject, bool pAutoCreate = false)
902 HIObject lObject = pObject ? FBGetFBObject(pObject->GetHIObject(), pAutoCreate) : NULL;
903 // Should also validate type but not available for now
904 return (T*)lObject;
905}
906
914FBSDK_DLL void FBFindObjectsByName( const char* pNamePattern, FBComponentList& pList, bool pIncludeNamespace = true, bool pModelsOnly = false );
915
924FBSDK_DLL FBComponent* FBFindObjectByFullName( const char* pObjectFullName );
925
939FBSDK_DLL int FBDeleteObjectsByName( const char* pNamePattern, const char* pNameSpace = NULL, const char* pGroupName = NULL);
940
941#ifdef RENEW
942 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__)
943 #undef RENEW
944#endif
945
947// FBEvent
950
952class FBSDK_DLL FBEvent
953{
954public:
960 FBEvent( HKEvent pEvent );
961
962 FBPropertyInt Type;
963#ifndef DOXYGEN_SHOULD_SKIP_THIS
964protected:
966 HKEventBase mEvent;
967public:
969 void PropertyAdd( FBProperty* ) {};
970#endif
971};
974// FBEventConnectionNotify
980{
981public:
985 FBEventConnectionNotify(HKEventBase pEvent);
986
987 FBPropertyConnectionAction Action;
988 FBPropertyInt SrcIndex;
989 FBPropertyConnectionType ConnectionType;
990 FBPropertyPlug SrcPlug;
991 FBPropertyPlug DstPlug;
992 FBPropertyPlug NewPlug;
993};
996// FBEventConnectionDataNotify
1002{
1003public:
1007 FBEventConnectionDataNotify(HKEventBase pEvent);
1009 FBPropertyConnectionAction Action;
1010 FBPropertyPlug Plug;
1011 void* GetData();
1012 void* GetOldData();
1013};
1016// FBEventConnectionStateNotify
1022{
1023public:
1027 FBEventConnectionStateNotify(HKEventBase pEvent);
1028
1029 FBPropertyConnectionAction Action;
1030 FBPropertyPlug Plug;
1031 void* GetData();
1032 void* GetOldData();
1034
1036// __FB_FORWARD( FBEventConnectionKeyingNotify ); //
1039
1041{
1042public:
1046 FBEventConnectionKeyingNotify(HKEventBase pEvent);
1053 FBConnectionAction GetAction( void );
1054
1060 FBPlug* GetPlug( void );
1066 FBPlug* GetProperty( void );
1072 void* GetData( void );
1073};
1074
1075
1077// FBLibrary
1079
1083class FBSDK_DLL FBLibraryBase : public ICallback
1084{
1085public:
1086 FBLibraryBase();
1087 virtual ~FBLibraryBase();
1088 IObject_Declare(override);
1089 ICallback_Declare(override);
1090
1095 virtual bool LibInit();
1096
1101 virtual bool LibOpen();
1102
1108 virtual bool LibReady();
1113 virtual bool LibClose();
1114
1118 virtual bool LibRelease();
1120 KGlobalNamedEvent *mLibrary_Open,
1121 *mLibrary_Ready,
1122 *mLibrary_Close,
1123 *mLibrary_Release;
1124
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);
1129};
1130
1132// FBLibrary
1134
1139{
1140public:
1145 virtual bool LibInit();
1146
1151 virtual bool LibOpen();
1152
1158 virtual bool LibReady();
1159
1163 virtual bool LibClose();
1164
1168 virtual bool LibRelease();
1169};
1170
1174#if defined(K_NODLL)
1175 #define FBLibraryDeclare( LibName ) \
1176 FB_DLL_INIT( LibName, Operation ) \
1177 { \
1178 switch( Operation ) \
1179 { \
1180 case kFBDllLoad: \
1181 { \
1182
1183#else
1184 #define FBLibraryDeclare( LibName ) \
1185 static FBLibrary LibName##GlobalFBLibrary; \
1186 extern "C" { \
1187 K_DLLEXPORT bool LIBRARY_INIT(HIError /*Error*/) \
1188 { \
1189 FB_EXT_INIT( LibName ); if (LibName##GlobalFBLibrary.LibInit()) return true; return false; \
1190 } \
1191 } \
1192 FB_DLL_INIT( LibName, Operation ) \
1193 { \
1194 switch( Operation ) \
1195 { \
1196 case kFBDllLoad: \
1197 {
1198#endif
1199
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( );
1230
1235#define FBLibraryRegisterShadingElement( ClassName ) \
1236 extern void FBModule##ClassName##ShadingElement( ); \
1237 FBModule##ClassName##ShadingElement( );
1238
1240#define FBLibraryDeclareEnd \
1241 } \
1242 break; \
1243 default: \
1244 break; \
1245 } \
1247
1248// **********************************************************************************
1249
1253#define FBCustomManagerImplementation( ThisComponent ) \
1254 FBClassImplementation( ThisComponent ) \
1255
1259#define FBRegisterCustomManager( ClassName ) \
1260 FBLibraryModule( ClassName ) \
1261 { \
1262 static ClassName g##ClassName; \
1263 g##ClassName.FBCreate(); \
1264 g##ClassName.RegisterManager(); \
1265 } \
1266
1270#define FBCustomManagerDeclare( ClassName ) \
1271FBClassDeclare( ClassName, FBCustomManager ); \
1272 public: \
1273 ClassName() : FBCustomManager() { FBClassInit; } \
1274 \
1275 private:
1276
1277
1279// FBCustomManager
1281
1296class FBSDK_DLL FBCustomManager : public FBComponent {
1298public:
1302
1307 void RegisterManager();
1308
1312 virtual bool FBCreate() override;
1313
1320 virtual bool Init() ;
1321
1327 virtual bool Open() ;
1328
1333 virtual bool Clear() ;
1334
1338 virtual bool Close() ;
1339
1340};
1341
1342
1343#ifdef FBSDKUseNamespace
1344 }
1345#endif
1346
1347#endif
Template class to contain an array of items.
Definition: fbarray.h:78
MotionBuilder SDK base class.
Definition: fbcomponent.h:651
Custom manager class for user controlled observer objects.
Definition: fbcomponent.h:1283
Connection notify event class.
Definition: fbcomponent.h:989
Connection notify event class.
Definition: fbcomponent.h:967
Connection notify event class.
Definition: fbcomponent.h:1009
Base Event class.
Definition: fbcomponent.h:940
Objects Containing class.
Folder class.
Definition: fbfolder.h:79
Library class for DLL registration.
Definition: fbcomponent.h:1071
Library class for DLL registration.
Definition: fbcomponent.h:1126
Objects Containing class.
Definition: fbnamespace.h:80
Connections Basic Open Reality SDK Element.
Definition: fbplug.h:222
PropertyEvent: Base event class.
Definition: fbproperties.h:515
Property: Base property class.
Definition: fbproperties.h:195
PropertyList: Component.
Definition: fbcomponent.h:477
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:536
List of scene objects.
Definition: fbcomponent.h:556
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.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbcomponent.h:57
HKEventBase HKEvent
HKEvent.
Definition: fbcomponent.h:380
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.
Definition: fbcomponent.h:377
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.
Definition: fbcomponent.h:367
FBObjectStatus
Available lifetime status for any component.
Definition: fbcomponent.h:453
@ kFBStatusRetrieving
Object is in retrieving operations.
Definition: fbcomponent.h:456
@ kFBStatusDestroying
Object is in destruction operations.
Definition: fbcomponent.h:458
@ kFBStatusMerging
Object is in Merging operations.
Definition: fbcomponent.h:457
@ kFBStatusClearing
Object is in clearing operations (File new).
Definition: fbcomponent.h:459
@ kFBStatusStoring
Object is in storing operations.
Definition: fbcomponent.h:455
@ kFBStatusCreating
Object is in creation operations.
Definition: fbcomponent.h:454
FBArrayTemplate< FBComponent * > FBComponentList
typedef FBArrayTemplate<FBComponent*> FBComponentList;
Definition: fbcomponent.h:284
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.
Definition: fbcomponent.h:887
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.
Definition: fbcomponent.h:131
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.
Definition: fbcomponent.h:425
@ kFBFlagStorableBlindData
Used in FBX SDK native IO.
Definition: fbcomponent.h:445
@ kFBFlagSavable
Can be saved.
Definition: fbcomponent.h:428
@ kFBFlagStorable6
System/Obsolete.
Definition: fbcomponent.h:443
@ kFBFlagSystem
Created from System (not from user)
Definition: fbcomponent.h:431
@ kFBFlagSelectable
Can be selected. If disabled, representation of the object, like in the navigator,...
Definition: fbcomponent.h:426
@ kFBFlagNewable
Deleted on File->New.
Definition: fbcomponent.h:432
@ kFBFlagKeyable
Object can Key his property. (System Camera can't)
Definition: fbcomponent.h:440
@ kFBFlagAllocated
Object is allocated, so it must call 'delete this' on destroy.
Definition: fbcomponent.h:441
@ kFBFlagStorableData6
System/Obsolete.
Definition: fbcomponent.h:444
@ kFBFlagUndoableSeparately
Object which has kFlagUndoableSeparately flag turned on will have a separate Undo Stack.
Definition: fbcomponent.h:439
@ kFBFlagClonable
Can be cloned. If disabled, the "Duplicate" option will be removed in the contextual menu.
Definition: fbcomponent.h:430
@ kFBFlagRenamable
Can be renamed.
Definition: fbcomponent.h:433
@ kFBFlagBrowsable
Visible in the Scene Navigator/Schematic View/Property View/Model View. If disabled,...
Definition: fbcomponent.h:435
@ kFBFlagMergeable
Can be merged.
Definition: fbcomponent.h:434
@ kFBFlagDeletable
Can be deleted.
Definition: fbcomponent.h:427
@ kFBFlagNamespaceEditable
Allow editing on the namespace objects. If disabled, the "Add/Remove Namespace..." option is removed ...
Definition: fbcomponent.h:449
@ kFBFlagDetachable
Object can be "detached". Used by the apply manager contextual menu.
Definition: fbcomponent.h:437
@ kFBFlagVisible
Can be visible. If disabled, the object will still be available in the navigator, it is only hidden i...
Definition: fbcomponent.h:429
@ kFBFlagUniqueName
< Used in FBX SDK native IO, force bindary format for the bindary data.
Definition: fbcomponent.h:447
@ kFBFlagStory
Object created/used by the Story tool. Useful flag for filtering Story objects.
Definition: fbcomponent.h:442
@ kFBFlagNotSelectableNameSpace
The entity will not add the namespace of the object to his list of all the namespaces of the scene.
Definition: fbcomponent.h:448
@ kFBFlagParentable
Object (model) can be "parented". Used by the apply manager contextual menu.
Definition: fbcomponent.h:436
@ kFBFlagUndoable
Object can undo its actions and states, in a global Undo Stack.
Definition: fbcomponent.h:438
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.
Definition: fbcomponent.h:880
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.
Definition: fbcomponent.h:386
FBNamespaceAction
Namespace flags.
Definition: fbcomponent.h:464
@ kFBConcatNamespace
Use to add a namespace name to object.
Definition: fbcomponent.h:465
@ kFBRemoveAllNamespace
Remove all the namespace name.
Definition: fbcomponent.h:467
@ kFBReplaceNamespace
Use to replace a define namespace.
Definition: fbcomponent.h:466
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.
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.
Definition: fbproperties.h:80
@ kFBPT_object
object.
Definition: fbproperties.h:92
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
Definition: fbproperties.h:163
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.
Definition: fbproperties.h:150
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