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
54 
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: 4275) // 'int' : forcing value to bool 'true' or 'false' (performance warning)
68  #pragma warning (disable: 4661) // no suitable definition provided for explicit template instantiation request
69 #endif
70 
71 K_FORWARD( IRegister );
72 K_FORWARD( IError );
73 K_FORWARD( IStore );
74 K_FORWARD( IKtView );
75 K_FORWARD( KEventBase );
76 K_FORWARD( KGlobalNamedEvent );
77 
78 #ifdef FBSDKUseNamespace
79  namespace FBSDKNamespace {
80 #endif
81 
82 #ifndef FBINCLUDE
83 // Section that must be exported
84 #else
85 #endif
86 
89 #define FB_DEFAULT_SDK_ICON "openreality_noicon.png"
90 
91 // For internal use only.
95 #define __FBClassInit mLocalPtr = NULL;
96 
97 // For internal use only.
101 #define __FBClassDeInit if (mLocalPtr) {delete mLocalPtr; mLocalPtr = NULL;}
102 
103 // For internal use only.
107 #define __FBClassInitSDKComponent( pObjectToWrappedIsAllocated ) \
108  __FBClassInit; \
109  mSDKComponent = pObjectToWrappedIsAllocated;
110 
115 FBSDK_DLL int __FBRegisterTypeInfo(int pInternalClassId);
116 
121 FBSDK_DLL int __FBGetInternalClassId(int pTypeInfo);
122 
127 FBSDK_DLL FBPlug* __FBObjectCreatorSub(HIObject pObject);
128 
132 #define __FBClassDeclare( Name,Parent ) \
133  friend FBSDK_DLL FBPlug* __FBObjectCreatorSub(HIObject pObject);\
134  public: \
135 \
138  typedef Parent __FBParentClass;\
139 \
142  typedef Name __FBClassType;\
143 \
146  virtual const char* ClassName() override { return #Name; } \
147 \
151  virtual bool Is( int pTypeId ) override { return (pTypeId==TypeInfo) ? true : Parent::Is( pTypeId ); } \
152  virtual int GetTypeId() override { return TypeInfo; } \
153 \
156  static int GetInternalClassId(); \
157 \
160  Data##Name* mLocalPtr; \
161  virtual ~Name(); \
162  static int TypeInfo; \
163 \
164  private:
165 
169 #define __FBClassDeclareGroup( Name,Parent ) \
170  __FBClassDeclare( Name,Parent )\
171  public:\
172  static const char* ClassGroupName; \
173 \
174  private:
175 
176 FBSDK_DLL void __FBAddModelToScene( HIObject pObject );
177 FBSDK_DLL void __FBRemoveModelFromScene( HIObject pObject );
178 
182 #define FBStorableClassImplementation(ClassName, Type)\
183  const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
184  HIObject RegisterStorable##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
185  ClassName* Class = new ClassName(pName);\
186  Class->mAllocated = true;\
187  if( Class->FBCreate() ){\
188  __FBRemoveModelFromScene( Class->GetHIObject() ); /* Hack in MoBu2013, we shouldn't add object to the scene/entity automatically*/\
189  return Class->GetHIObject();\
190  } else {\
191  delete Class;\
192  return NULL;}}\
193  FBLibraryModule(ClassName##Storable){\
194  FBString lGroup = "FbxStorable/";\
195  lGroup += #Type;\
196  FBRegisterObject(ClassName##R2, lGroup, #ClassName, "", RegisterStorable##ClassName##Create, true, NULL);}
197 
201 #define FBElementClassImplementation(ClassName,IconFileName)\
202  HIObject RegisterElement##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
203  ClassName* Class = new ClassName(pName);\
204  Class->mAllocated = true;\
205  if( Class->FBCreate() ){\
206  __FBRemoveModelFromScene( Class->GetHIObject() ); /* Hack in MoBu2013, we shouldn't add object to the scene/entity automatically*/\
207  return Class->GetHIObject();\
208  } else {\
209  delete Class;\
210  return NULL;}}\
211  FBLibraryModule(ClassName##Element){\
212  FBRegisterObject(ClassName##R2, "Browsing/Templates/Elements", #ClassName, "", RegisterElement##ClassName##Create, true, IconFileName);}
213 
217 #define FBShadingElementClassImplementation(ClassName,IconFileName)\
218  HIObject RegisterShadingElement##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
219  ClassName* Class = new ClassName(pName);\
220  Class->mAllocated = true;\
221  if( Class->FBCreate() ){\
222  return Class->GetHIObject();\
223  } else {\
224  delete Class;\
225  return NULL;}}\
226  FBLibraryModule(ClassName##ShadingElement){\
227  FBRegisterObject(ClassName##R2, "Browsing/Templates/Shading Elements", #ClassName, "", RegisterShadingElement##ClassName##Create, true, IconFileName);}
228 
235 #define FBStorableClassDeclare(Name, Parent)\
236  FBClassDeclare(Name, Parent);\
237 public:\
238  virtual const char* FbxGetObjectSubType() override; \
239 \
240 private: \
241 
242 
250 #define FBPropertyInitComponent( Param,Type,PropName,Get,Set ) \
251  { \
252  PropertyAdd(PropName.Init( (void *)Param,#PropName,(Type* (*)(void *))Get,(void (*)(void *,Type*))Set )); \
253  PropName.TypeInfo = &Type::TypeInfo; \
254  }
255 
263 #define FBIS( Component,ComponentType ) \
264  ((Component) && (Component)->Is( ComponentType::TypeInfo ))
265 
267 // Utility function
269 // For internal use only.
272 
279 FBSDK_DLL FBComponent* GetFBComponent( const HIObject Object );
280 
281 #if !defined(K_NO_UI)
282 
287 FBSDK_DLL FBVisualComponent* FBGetFBVisualComponent( HIKtView pObject,bool pAutoCreate=true );
288 #endif
289 
295 FBSDK_DLL FBComponent* FBGetFBComponent( HIObject pObject, bool pAutoCreate=true );
296 
299 
307 
312 
316 
318 // Registration macros
320 
325 #define FBRegisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Register ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
326 
330 #define FBUnregisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Unregister ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
331 
336 FBSDK_DLL void FBSetStoreableCustomModelRegistered();
337 FBSDK_DLL bool FBGetStoreableCustomModelRegistered();
338 
343 FBSDK_DLL void FBSetStoreableCustomMaterialRegistered();
344 FBSDK_DLL bool FBGetStoreableCustomMaterialRegistered();
345 
350 FBSDK_DLL void FBSetStoreableCustomTextureRegistered();
351 FBSDK_DLL bool FBGetStoreableCustomTextureRegistered();
352 
353 FBSDK_DLL bool FBObject_Register ( const char * pGroupName,const char * pEntryName,const char * pDescription, kObjectCreatorFnc pCreatorFnc, bool pIsMultipleAllowed,const char * pIconFilename);
354 FBSDK_DLL bool FBObject_Unregister( const char * pGroupName,const char * pEntryName, int nth=0 );
355 
359 FBSDK_DLL const char* FBObject_GetGroupName ( int pGroupIndex );
360 FBSDK_DLL int FBObject_GetEntryCount ( int pGroupIndex );
361 FBSDK_DLL const char* FBObject_GetEntryName ( int pGroupIndex, int pIndex );
362 FBSDK_DLL const char* FBObject_GetEntryDescription ( int pGroupIndex, int pIndex, int nth = 0 );
363 FBSDK_DLL const char* FBObject_GetEntryDLLName ( int pGroupIndex, int pIndex, int nth = 0 );
364 FBSDK_DLL const char* FBObject_GetIconName ( int pGroupIndex, int pIndex, int nth = 0 );
365 FBSDK_DLL bool FBObject_GetMultiplicity ( int pGroupIndex, int pIndex, int nth = 0 );
366 
374 FBSDK_DLL FBComponent* FBCreateObject( const char* pGroupName, const char* pEntryName, const char* pName, void* pData = NULL, int nth = 0 );
375 
381 inline bool FBUnregisterObject( const char * pGroupName, const char * pEntryName, int nth=0 ) { return FBObject_Unregister( pGroupName,pEntryName,nth ); }
382 
387 #define FBRegisterObject( LocalId,Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename ) \
388  static int __R##LocalId = FBObject_Register( Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename )
389 
391 typedef HIRegister HISender;
392 
394 typedef HKEventBase HKEvent;
395 
400 typedef void (ICallback::*FBCallback)(HISender pSender,HKEvent pEvent);
401 
402 FBSDK_DLL int FBRegister_ClassId(const char* pClassName);
403 
408 #define FBDeclareUserObject(ClassName)\
409 public:\
410  static int ClassId;\
411  virtual int GetUserClassId();\
412  virtual const char* FbxGetObjectSubType() override;\
413 \
414 private:
415 
417 // FBComponent
419 #ifdef new
420 
423  #define RENEW new
424  #undef new
425 #endif
426 
428 // FBSceneList
432 FB_DEFINE_LIST( FBSDK_DLL, Component );
433 
435 FB_DEFINE_COMPONENT( FBSDK_DLL, Folder );
436 
439 {
440  kFBFlagSelectable = (1 << 0),
441  kFBFlagDeletable = (1 << 1),
442  kFBFlagSavable = (1 << 2),
443  kFBFlagVisible = (1 << 3),
444  kFBFlagClonable = (1 << 4),
445  kFBFlagSystem = (1 << 5),
446  kFBFlagNewable = (1 << 6),
447  kFBFlagRenamable = (1 << 7),
448  kFBFlagMergeable = (1 << 8),
449  kFBFlagBrowsable = (1 << 9),
450  kFBFlagParentable = (1 << 10),
451  kFBFlagDetachable = (1 << 11),
452  kFBFlagUndoable = (1 << 12),
454  kFBFlagKeyable = (1 << 14),
455  kFBFlagAllocated = (1 << 15),
456  kFBFlagStory = (1 << 16),
457  kFBFlagStorable6 = (1 << 17),
458  kFBFlagStorableData6 = (1 << 18),
460  kFBFlagStorableBlindDataForceBinary = (1 << 20),
461  kFBFlagUniqueName = (1 << 21),
464 };
465 
468  kFBStatusCreating = (1 << 0),
469  kFBStatusStoring = (1 << 1),
470  kFBStatusRetrieving = (1 << 2),
471  kFBStatusMerging = (1 << 3),
472  kFBStatusDestroying = (1 << 4),
473  kFBStatusClearing = (1 << 5),
474 };
475 
478 {
482 };
483 
484 FB_DEFINE_ENUM(FBSDK_DLL, ConnectionType);
485 FB_DEFINE_ENUM(FBSDK_DLL, ConnectionAction);
486 FB_DEFINE_ENUM(FBSDK_DLL, ObjectFlag);
487 
491 {
492  protected:
494  int mClassId;
496  bool mParents;
497  public:
504  virtual int Add( FBComponent* pItem );
508  virtual void RemoveAt( int pIndex );
513  virtual FBComponent* GetAt(int pIndex)=0;
518  FBComponent* operator[](int pIndex);
522  virtual int GetCount();
523 
528  virtual int Find( FBComponent* pItem );
529 
534  virtual int Remove( FBComponent* pItem );
535 
536  // Internal functions
537  void SetClassId( int pClassId );
538  int GetClassId( );
539  void SetListOfParents( bool pListOfParents );
540  bool GetIsListOfParents();
541 
545  virtual FBPropertyType GetPropertyType( ) override { return kFBPT_object; }
546 };
550 {
551  public:
556  virtual FBComponent* GetAt(int pIndex);
557 };
558 
560 // FBPropertyListObject
562 
564 
570 {
571  public:
574 
578  virtual int GetCount();
579 
581 
585  virtual FBComponent* operator[]( int pIndex );
586  virtual FBComponent* GetAt( int pIndex );
588 
593  virtual int Add( FBComponent* pObject );
594 
600  virtual int SetAt(int pIndex, FBComponent* pObject);
601 
605  virtual void RemoveAt( int pIndex );
606 
612  virtual int InsertAt(int pIndex, FBComponent* pObject);
613 
616  virtual void Clear();
617 
621  virtual void SetSingleConnect(bool pSingleConnect);
622 
626  virtual int GetSingleConnect();
627 
631  void SetFilter(int pInternalClassId);
632 
636  int GetFilter();
637 
638 private:
640 
645  const FBPropertyListObject& operator =( const FBPropertyListObject& );
647 };
648 
651 
665 {
666 public:
667 #ifndef DOXYGEN_SHOULD_SKIP_THIS
668  DataFBComponent* mLocalPtr;
670 protected:
672  FBString mName;
673 #endif
674 
675 public:
677  static int TypeInfo;
678 
682  static int GetInternalClassId();
683 
687  FBComponent( HIObject pObject );
688 
690  virtual ~FBComponent();
691 
695  virtual bool FBCreate();
696 
698  virtual void FBDestroy();
699 
701  virtual void FBDelete() override;
702 
704  virtual bool SetHIObject(HIObject pObject, bool pSDKComponent) override;
705 
710  virtual int PropertyAdd( FBProperty* pProperty );
711 
716  bool PropertyAddReferenceProperty( FBProperty* pReferenceProperty );
717 
722  void PropertyRemove( FBProperty* pProperty );
723 
728  void PropertyGetModifiedList(FBArrayTemplate<FBProperty*>& pPropList, FBPlugModificationFlag pModificationFlags);
729 
738  FBProperty* PropertyCreate( const char* pName, FBPropertyType pType, const char * pDataType, bool pAnimatable, bool pIsUser = false, FBProperty* pReferenceSource = NULL );
739 
743  FBObjectFlag GetObjectFlags();
744 
748  void SetObjectFlags(FBObjectFlag pFlags);
749 
754  bool HasObjectFlags(FBObjectFlag pFlags);
755 
759  void EnableObjectFlags(FBObjectFlag pFlags);
760 
764  void DisableObjectFlags(FBObjectFlag pFlags);
765 
770  void SetObjectStatus(FBObjectStatus pStatus, bool pValue);
771 
775  bool GetObjectStatus(FBObjectStatus pStatus);
776 
787  bool ProcessNamespaceHierarchy( FBNamespaceAction pNamespaceAction, const char* pNamespaceName, const char* pReplaceTo=NULL, bool pAddRight=true );
788 
799  bool ProcessObjectNamespace ( FBNamespaceAction pNamespaceAction, const char* pNamespaceName, const char* pReplaceTo=NULL, bool pAddRight=true );
800 
804  virtual const char* ClassName() override;
805 
810  virtual bool UseCustomPropertyViewSet() const { return true; }
811 
815  const char* GetFullName( void );
816 
819  void SetOwnerNamespace(FBNamespace* pOwnerNSObj);
820 
824  FBNamespace* GetOwnerNamespace( void );
825 
826 
830  FBFileReference* GetOwnerFileReference( void );
831 
835  void HardSelect();
836 
837 #ifndef DOXYGEN_SHOULD_SKIP_THIS
838 
839  // Overloaded allocation/destruction operator.
840  void *operator new( size_t stAllocateBlock );
841  void operator delete( void *pvMem );
842 
843  void *operator new( size_t stAllocateBlock, int blockType, const char *filename, int linenumber );
844  void operator delete( void *pvMem, int blockType, const char *filename, int linenumber );
846 
848  // Used to manage sub property events.
849  void RegisterPropertyEvent(FBPropertyEvent* pPropertyEvent);
850  void UnregisterPropertyEvent(FBPropertyEvent* pPropertyEvent);
851  void InvalidatePropertyEventsParents();
853 #endif
854 
861 
862 #if !defined(K_NO_FOLDER)
863  FBPropertyFolder Folder;
864 #endif
865 
866 public:
867 #ifndef DOXYGEN_SHOULD_SKIP_THIS
868  IObject_Declare(K_IMPLEMENTATION);
869  ICallback_Declare(K_IMPLEMENTATION);
870 #endif
871 
876  virtual bool Is( int pTypeId );
877  virtual int GetTypeId();
878 
879  static void FBComponentSetName( FBComponent* pObject, const char *pName );
880  static const char* FBComponentGetName( FBComponent* pObject );
881 
882  static void FBComponentSetLongName( FBComponent* pObject, const char *pName );
883  static const char* FBComponentGetLongName( FBComponent* pObject );
884 
885 public:
886 #ifndef DOXYGEN_SHOULD_SKIP_THIS
887 
888  KObject* mDummyObject;
889  void KObjectEvent(HIRegister pView, HKEventBase pEvent);
890 #endif
891 };
892 
895 
901 template<class T> inline T* FBCast(FBObject* pObject, bool pAutoCreate = false)
902 {
903  HIObject lObject = pObject ? FBGetFBObject(pObject->GetHIObject(), pAutoCreate) : NULL;
904  // Should also validate type but not available for now
905  return (T*)lObject;
906 }
907 
915 FBSDK_DLL void FBFindObjectsByName( const char* pNamePattern, FBComponentList& pList, bool pIncludeNamespace = true, bool pModelsOnly = false );
916 
925 FBSDK_DLL FBComponent* FBFindObjectByFullName( const char* pObjectFullName );
926 
940 FBSDK_DLL int FBDeleteObjectsByName( const char* pNamePattern, const char* pNameSpace = NULL, const char* pGroupName = NULL);
941 
942 #ifdef RENEW
943  #define new new( _NORMAL_BLOCK, __FILE__, __LINE__)
944  #undef RENEW
945 #endif
946 
948 // FBEvent
951 
954 {
955 public:
961  FBEvent( HKEvent pEvent );
962 
964 #ifndef DOXYGEN_SHOULD_SKIP_THIS
965 protected:
967  HKEventBase mEvent;
968 public:
970  void PropertyAdd( FBProperty* ) {};
971 #endif
972 };
973 
975 // FBEventConnectionNotify
978 
981 {
982 public:
986  FBEventConnectionNotify(HKEventBase pEvent);
987 
988  FBPropertyConnectionAction Action;
990  FBPropertyConnectionType ConnectionType;
994 };
995 
997 // FBEventConnectionDataNotify
1000 
1003 {
1004 public:
1008  FBEventConnectionDataNotify(HKEventBase pEvent);
1009 
1010  FBPropertyConnectionAction Action;
1012  void* GetData();
1013  void* GetOldData();
1014 };
1015 
1017 // FBEventConnectionStateNotify
1020 
1023 {
1024 public:
1028  FBEventConnectionStateNotify(HKEventBase pEvent);
1029 
1030  FBPropertyConnectionAction Action;
1032  void* GetData();
1033  void* GetOldData();
1034 };
1035 
1037 // __FB_FORWARD( FBEventConnectionKeyingNotify ); //
1040 
1042 {
1043 public:
1047  FBEventConnectionKeyingNotify(HKEventBase pEvent);
1048 
1054  FBConnectionAction GetAction( void );
1055 
1061  FBPlug* GetPlug( void );
1067  FBPlug* GetProperty( void );
1073  void* GetData( void );
1074 };
1075 
1076 
1078 // FBLibrary
1080 
1084 class FBSDK_DLL FBLibraryBase : public ICallback
1085 {
1086 public:
1087  FBLibraryBase();
1088  virtual ~FBLibraryBase();
1089  IObject_Declare(K_IMPLEMENTATION);
1090  ICallback_Declare(K_IMPLEMENTATION);
1091 
1096  virtual bool LibInit();
1097 
1102  virtual bool LibOpen();
1103 
1109  virtual bool LibReady();
1110 
1114  virtual bool LibClose();
1115 
1119  virtual bool LibRelease();
1121  KGlobalNamedEvent *mLibrary_Open,
1122  *mLibrary_Ready,
1123  *mLibrary_Close,
1124  *mLibrary_Release;
1125 
1126  void Library_OpenHandler(HIRegister pCaller,HKEventBase pEvent);
1127  void Library_ReadyHandler(HIRegister pCaller,HKEventBase pEvent);
1128  void Library_CloseHandler(HIRegister pCaller,HKEventBase pEvent);
1129  void Library_ReleaseHandler(HIRegister pCaller,HKEventBase pEvent);
1130 };
1131 
1133 // FBLibrary
1135 
1139 class FBLibrary : public FBLibraryBase
1140 {
1141 public:
1146  virtual bool LibInit();
1147 
1152  virtual bool LibOpen();
1153 
1159  virtual bool LibReady();
1160 
1164  virtual bool LibClose();
1165 
1169  virtual bool LibRelease();
1170 };
1171 
1175 #if defined(K_NODLL)
1176  #define FBLibraryDeclare( LibName ) \
1177  FB_DLL_INIT( LibName, Operation ) \
1178  { \
1179  switch( Operation ) \
1180  { \
1181  case kFBDllLoad: \
1182  { \
1183 
1184 #else
1185  #define FBLibraryDeclare( LibName ) \
1186  static FBLibrary LibName##GlobalFBLibrary; \
1187  extern "C" { \
1188  K_DLLEXPORT bool LIBRARY_INIT(HIError /*Error*/) \
1189  { \
1190  FB_EXT_INIT( LibName ); if (LibName##GlobalFBLibrary.LibInit()) return true; return false; \
1191  } \
1192  } \
1193  FB_DLL_INIT( LibName, Operation ) \
1194  { \
1195  switch( Operation ) \
1196  { \
1197  case kFBDllLoad: \
1198  {
1199 #endif
1200 
1205 #define FBLibraryModule(Name) \
1206  void FBModule##Name()
1207 
1212 #define FBLibraryRegister( ClassName ) \
1213  extern void FBModule##ClassName( ); \
1214  FBModule##ClassName( );
1215 
1220 #define FBLibraryRegisterStorable( ClassName ) \
1221  extern void FBModule##ClassName##Storable( ); \
1222  FBModule##ClassName##Storable( );
1223 
1228 #define FBLibraryRegisterElement( ClassName ) \
1229  extern void FBModule##ClassName##Element( ); \
1230  FBModule##ClassName##Element( );
1231 
1236 #define FBLibraryRegisterShadingElement( ClassName ) \
1237  extern void FBModule##ClassName##ShadingElement( ); \
1238  FBModule##ClassName##ShadingElement( );
1239 
1241 #define FBLibraryDeclareEnd \
1242  } \
1243  break; \
1244  default: \
1245  break; \
1246  } \
1247 }
1248 
1249 // **********************************************************************************
1250 
1254 #define FBCustomManagerImplementation( ThisComponent ) \
1255  FBClassImplementation( ThisComponent ) \
1256 
1257 
1260 #define FBRegisterCustomManager( ClassName ) \
1261  FBLibraryModule( ClassName ) \
1262  { \
1263  static ClassName g##ClassName; \
1264  g##ClassName.FBCreate(); \
1265  g##ClassName.RegisterManager(); \
1266  } \
1267 
1268 
1271 #define FBCustomManagerDeclare( ClassName ) \
1272 FBClassDeclare( ClassName, FBCustomManager ); \
1273  public: \
1274  ClassName() : FBCustomManager() { FBClassInit; } \
1275  \
1276  private:
1277 
1278 
1280 // FBCustomManager
1282 
1284 
1299 public:
1302  FBCustomManager();
1303 
1308  void RegisterManager();
1309 
1313  virtual bool FBCreate();
1314 
1321  virtual bool Init() ;
1322 
1328  virtual bool Open() ;
1329 
1334  virtual bool Clear() ;
1335 
1339  virtual bool Close() ;
1340 
1341 };
1342 
1343 
1344 #ifdef FBSDKUseNamespace
1345  }
1346 #endif
1347 
1348 #endif
Can be selected. If disabled, representation of the object, like in the navigator, can still be selected and can still affect the original object.
Definition: fbcomponent.h:440
FBPropertyPlug SrcPlug
Read Only Property: The source plug involved in the action.
Definition: fbcomponent.h:991
K_DLLIMPORT void FBDestroyComponentList(FBComponentList *pObjectList)
Delete a FBObjectList object.
FBPropertyInt SrcIndex
Read Only Property: Index of the source in the destination component.
Definition: fbcomponent.h:989
A template class for arrays.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
System/Obsolete.
Definition: fbcomponent.h:458
K_DLLIMPORT FBComponent * FBFindObjectByFullName(const char *pObjectFullName)
FBFindObjectByFullName.
Connection notify event class.
Definition: fbcomponent.h:1002
FBPropertyType
Property types.
Definition: fbproperties.h:79
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
Definition: fbproperties.h:161
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:549
Can be deleted.
Definition: fbcomponent.h:441
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
Template class to contain an array of items.
Definition: fbarray.h:77
FBPropertyPlug Plug
Read Only Property: The plug involved in the action.
Definition: fbcomponent.h:1031
K_DLLIMPORT FBComponent * GetFBComponent(const HIObject Object)
Get a handle to the FBComponent belonging to an HIObject.
FBPropertyConnectionAction Action
Read Only Property: Connection&#39;s action performed.
Definition: fbcomponent.h:1010
Can be saved.
Definition: fbcomponent.h:442
Can be visible. If disabled, the object will still be available in the navigator, it is only hidden i...
Definition: fbcomponent.h:443
Can be renamed.
Definition: fbcomponent.h:447
Basic string class.
Definition: fbstring.h:66
virtual bool UseCustomPropertyViewSet() const
Use the custom property viewSet or not.
Definition: fbcomponent.h:810
FBPropertyListComponent Components
List: List of components.
Definition: fbcomponent.h:856
T * FBCast(FBObject *pObject, bool pAutoCreate=false)
Cast the SDK object using it&#39;s IObject interface into the proper class.
Definition: fbcomponent.h:901
Created from System (not from user)
Definition: fbcomponent.h:445
FBPropertyString LongName
Read Write Property: Name and namespace for object.
Definition: fbcomponent.h:860
PropertyList: Component.
Definition: fbcomponent.h:490
FBNamespaceAction
Namespace flags.
Definition: fbcomponent.h:477
Deleted on File->New.
Definition: fbcomponent.h:446
Property Manager.
K_DLLIMPORT FBComponentList * FBCreateComponentList()
Create a FBObjectList object.
Property: Base property class.
Definition: fbproperties.h:192
Remove all the namespace name.
Definition: fbcomponent.h:481
Object which has kFlagUndoableSeparately flag turned on will have a separate Undo Stack...
Definition: fbcomponent.h:453
Property classes.
KGlobalNamedEvent * mLibrary_Release
Library Release.
Definition: fbcomponent.h:1121
Object is allocated, so it must call &#39;delete this&#39; on destroy.
Definition: fbcomponent.h:455
Object can Key his property. (System Camera can&#39;t)
Definition: fbcomponent.h:454
FBPropertyPlug Plug
Read Only Property: The plug involved in the action.
Definition: fbcomponent.h:1011
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:148
Object can be "detached". Used by the apply manager contextual menu.
Definition: fbcomponent.h:451
FBPropertyFolder Folder
Read Write Property: The folder that contain this component.
Definition: fbcomponent.h:863
static int TypeInfo
Contains the Type information of the object.
Definition: fbcomponent.h:677
The entity will not add the namespace of the object to his list of all the namespaces of the scene...
Definition: fbcomponent.h:462
K_DLLIMPORT FBVisualComponent * FBGetFBVisualComponent(HIKtView pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbcomponent.h:57
PropertyEvent: Base event class.
Definition: fbproperties.h:507
Definition of the class FBPlug and related enums and utility functions.
Object is in clearing operations (File new).
Definition: fbcomponent.h:473
object.
Definition: fbproperties.h:92
virtual FBPropertyType GetPropertyType() override
Get the property&#39;s type.
Definition: fbcomponent.h:545
Library class for DLL registration.
Definition: fbcomponent.h:1084
Library class for DLL registration.
Definition: fbcomponent.h:1139
Object can undo its actions and states, in a global Undo Stack.
Definition: fbcomponent.h:452
Objects Containing class.
Definition: fbnamespace.h:79
Use to add a namespace name to object.
Definition: fbcomponent.h:479
Visible in the Scene Navigator/Schematic View/Property View/Model View. If disabled, the object representation in the navigator will not be visible. In the Schematic View, system object are not shown and other objects will still be visible, but a red X will be drawn on them. It is not possible to select the object in the Schematic View. After disabling that flag of a selected object, it will still be selected to allow a script based on selection to work. It will then be possible for a user to deselect the object, but it will not be possible to select it.
Definition: fbcomponent.h:449
Can be cloned. If disabled, the "Duplicate" option will be removed in the contextual menu...
Definition: fbcomponent.h:444
K_DLLIMPORT void __FBAddModelToScene(HIObject pObject)
For internal usage only.
< Used in FBX SDK native IO, force bindary format for the bindary data.
Definition: fbcomponent.h:461
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBPropertyBool Selected
Read Write Property: Selected property.
Definition: fbcomponent.h:858
K_DLLIMPORT FBComponent * FBCreateObject(const char *pGroupName, const char *pEntryName, const char *pName, void *pData=NULL, int nth=0)
FBCreateObject.
List of scene objects.
Definition: fbcomponent.h:569
K_DLLIMPORT int FBDeleteObjectsByName(const char *pNamePattern, const char *pNameSpace=NULL, const char *pGroupName=NULL)
FBDeleteObjectsByName.
Connection notify event class.
Definition: fbcomponent.h:980
FBPropertyPlug DstPlug
Read Only Property: The destination plug involved in the action.
Definition: fbcomponent.h:992
HKEventBase HKEvent
HKEvent.
Definition: fbcomponent.h:394
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
FBPropertyManager PropertyList
Read Only Property: Manages all of the properties for the component.
Definition: fbcomponent.h:855
Property class: const char * (String).
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:381
Object is in creation operations.
Definition: fbcomponent.h:468
Connections Basic Open Reality SDK Element.
Definition: fbplug.h:220
FBPropertyConnectionAction Action
Read Only Property: Connection&#39;s action performed.
Definition: fbcomponent.h:988
Connection notify event class.
Definition: fbcomponent.h:1022
void(ICallback::* FBCallback)(HISender pSender, HKEvent pEvent)
FBCallback.
Definition: fbcomponent.h:400
Object created/used by the Story tool. Useful flag for filtering Story objects.
Definition: fbcomponent.h:456
Object (model) can be "parented". Used by the apply manager contextual menu.
Definition: fbcomponent.h:450
Base Event class.
Definition: fbcomponent.h:953
Use to replace a define namespace.
Definition: fbcomponent.h:480
FBPropertyConnectionType ConnectionType
Read Only Property: Connection&#39;s type.
Definition: fbcomponent.h:990
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
Can be merged.
Definition: fbcomponent.h:448
FBObjectStatus
Available lifetime status for any component.
Definition: fbcomponent.h:467
K_DLLIMPORT HIObject FBGetFBObject(HIObject pObject, bool pAutoCreate=false)
Get the SDK object from an Internal Object.
FBPropertyInt Type
Read Only Property: Type of event.
Definition: fbcomponent.h:963
Object is in retrieving operations.
Definition: fbcomponent.h:470
K_DLLIMPORT FBComponent * FBGetFBComponent(HIObject pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
FBPropertyPlug NewPlug
Read Only Property: New plug created by the action. (Mostly used by merge/replace) ...
Definition: fbcomponent.h:993
Allow editing on the namespace objects. If disabled, the "Add/Remove Namespace..." option is removed ...
Definition: fbcomponent.h:463
FBComponent FBObject
Equivalent to FBComponent for gradual transition.
Definition: fbcomponent.h:894
Object is in storing operations.
Definition: fbcomponent.h:469
Folder class.
Definition: fbfolder.h:78
K_DLLIMPORT void __FBRemoveModelFromScene(HIObject pObject)
For internal usage only.
K_DLLIMPORT int __FBGetInternalClassId(int pTypeInfo)
__FBGetInternalClassId For internal use only, Get the internal class Id from the ORSDK FBCompoent&#39;s T...
Visual Component base class.
Definition: fbcontrols.h:312
K_DLLIMPORT void FBFindObjectsByName(const char *pNamePattern, FBComponentList &pList, bool pIncludeNamespace=true, bool pModelsOnly=false)
FBFindObjectsByName.
FBPropertyString Name
Read Write Property: Unique name of object.
Definition: fbcomponent.h:859
MotionBuilder SDK base class.
Definition: fbcomponent.h:664
Used in FBX SDK native IO.
Definition: fbcomponent.h:459
FBArrayTemplate< FBComponent * > FBComponentList
typedef FBArrayTemplate<FBComponent*> FBComponentList;
Definition: fbcomponent.h:298
FBObjectFlag
Available flags for any component.
Definition: fbcomponent.h:438
String class.
FBConnectionAction
Possible actions when a notify plug event occurs.
Definition: fbplug.h:78
FBPropertyListComponent Parents
List: Parents.
Definition: fbcomponent.h:857
K_DLLIMPORT int FBObject_GetGroupCount()
A set of functions to query the registration table.
Objects Containing class.
class FBPropertyBaseComponent< FBPlug * > FBPropertyPlug
Property: FBPropertyBaseComponent(FBPlug*)
Object is in Merging operations.
Definition: fbcomponent.h:471
K_DLLIMPORT FBArrayTemplate< FBComponent * > & FBGetComponentArray()
Get the Root FBComponent.
FBPropertyConnectionAction Action
Read Only Property: Connection&#39;s action performed.
Definition: fbcomponent.h:1030
Custom manager class for user controlled observer objects.
Definition: fbcomponent.h:1297
K_DLLIMPORT int __FBRegisterTypeInfo(int pInternalClassId)
__FBRegisterTypeInfo For internal use only, Register the TypeInfo mapped to internal class id...
Object is in destruction operations.
Definition: fbcomponent.h:472
FBPlugModificationFlag
Definition: fbplug.h:153
System/Obsolete.
Definition: fbcomponent.h:457
HIRegister HISender
HISender.
Definition: fbcomponent.h:391