fbsdk/fbcomponent.h Source File

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 );
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.
270 __FB_FORWARD( FBComponent );
271 __FB_FORWARD( FBVisualComponent );
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 
306 FBSDK_DLL FBComponentList* FBCreateComponentList();
307 
311 FBSDK_DLL void FBDestroyComponentList( FBComponentList* pObjectList );
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 
338 
345 
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 
392 
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
430 FB_FORWARD( FBPropertyListComponent );
431 __FB_FORWARD( FBComponent );
432 FB_DEFINE_LIST( FBSDK_DLL, Component );
433 
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),
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);
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 #if _MSC_VER >= 1200
845  void operator delete( void *pvMem, int blockType, const char *filename, int linenumber );
846 #endif
847 
848 
850  // Used to manage sub property events.
851  void RegisterPropertyEvent(FBPropertyEvent* pPropertyEvent);
852  void UnregisterPropertyEvent(FBPropertyEvent* pPropertyEvent);
853  void InvalidatePropertyEventsParents();
855 #endif
856 
863 
864 #if !defined(K_NO_FOLDER)
866 #endif
867 
868 public:
869 #ifndef DOXYGEN_SHOULD_SKIP_THIS
872 #endif
873 
878  virtual bool Is( int pTypeId );
879  virtual int GetTypeId();
880 
881  static void FBComponentSetName( FBComponent* pObject, const char *pName );
882  static const char* FBComponentGetName( FBComponent* pObject );
883 
884  static void FBComponentSetLongName( FBComponent* pObject, const char *pName );
885  static const char* FBComponentGetLongName( FBComponent* pObject );
886 
887 public:
888 #ifndef DOXYGEN_SHOULD_SKIP_THIS
889 
890  KObject* mDummyObject;
891  void KObjectEvent(HIRegister pView, HKEventBase pEvent);
892 #endif
893 };
894 
897 
903 template<class T> inline T* FBCast(FBObject* pObject, bool pAutoCreate = false)
904 {
905  HIObject lObject = pObject ? FBGetFBObject(pObject->GetHIObject(), pAutoCreate) : NULL;
906  // Should also validate type but not available for now
907  return (T*)lObject;
908 }
909 
917 FBSDK_DLL void FBFindObjectsByName( const char* pNamePattern, FBComponentList& pList, bool pIncludeNamespace = true, bool pModelsOnly = false );
918 
927 FBSDK_DLL FBComponent* FBFindObjectByFullName( const char* pObjectFullName );
928 
942 FBSDK_DLL int FBDeleteObjectsByName( const char* pNamePattern, const char* pNameSpace = NULL, const char* pGroupName = NULL);
943 
944 #ifdef RENEW
945  #define new new( _NORMAL_BLOCK, __FILE__, __LINE__)
946  #undef RENEW
947 #endif
948 
950 // FBEvent
952 __FB_FORWARD( FBEvent );
953 
956 {
957 public:
963  FBEvent( HKEvent pEvent );
964 
966 #ifndef DOXYGEN_SHOULD_SKIP_THIS
967 protected:
969  HKEventBase mEvent;
970 public:
972  void PropertyAdd( FBProperty* ) {};
973 #endif
974 };
975 
977 // FBEventConnectionNotify
979 __FB_FORWARD( FBEventConnectionNotify );
980 
983 {
984 public:
989 
996 };
997 
999 // FBEventConnectionDataNotify
1002 
1005 {
1006 public:
1011 
1014  void* GetData();
1015  void* GetOldData();
1016 };
1017 
1019 // FBEventConnectionStateNotify
1022 
1025 {
1026 public:
1031 
1034  void* GetData();
1035  void* GetOldData();
1036 };
1037 
1039 // __FB_FORWARD( FBEventConnectionKeyingNotify ); //
1042 
1044 {
1045 public:
1050 
1056  FBConnectionAction GetAction( void );
1057 
1063  FBPlug* GetPlug( void );
1069  FBPlug* GetProperty( void );
1075  void* GetData( void );
1076 };
1077 
1078 
1080 // FBLibrary
1082 
1087 {
1088 public:
1089  FBLibraryBase();
1090  virtual ~FBLibraryBase();
1093 
1098  virtual bool LibInit();
1099 
1104  virtual bool LibOpen();
1105 
1111  virtual bool LibReady();
1112 
1116  virtual bool LibClose();
1117 
1121  virtual bool LibRelease();
1123  KGlobalNamedEvent *mLibrary_Open,
1124  *mLibrary_Ready,
1125  *mLibrary_Close,
1126  *mLibrary_Release;
1127 
1128  void Library_OpenHandler(HIRegister pCaller,HKEventBase pEvent);
1129  void Library_ReadyHandler(HIRegister pCaller,HKEventBase pEvent);
1130  void Library_CloseHandler(HIRegister pCaller,HKEventBase pEvent);
1131  void Library_ReleaseHandler(HIRegister pCaller,HKEventBase pEvent);
1132 };
1133 
1135 // FBLibrary
1137 
1141 class FBLibrary : public FBLibraryBase
1142 {
1143 public:
1148  virtual bool LibInit();
1149 
1154  virtual bool LibOpen();
1155 
1161  virtual bool LibReady();
1162 
1166  virtual bool LibClose();
1167 
1171  virtual bool LibRelease();
1172 };
1173 
1177 #if defined(K_NODLL)
1178  #define FBLibraryDeclare( LibName ) \
1179  FB_DLL_INIT( LibName, Operation ) \
1180  { \
1181  switch( Operation ) \
1182  { \
1183  case kFBDllLoad: \
1184  { \
1185 
1186 #else
1187  #define FBLibraryDeclare( LibName ) \
1188  static FBLibrary LibName##GlobalFBLibrary; \
1189  extern "C" { \
1190  K_DLLEXPORT bool LIBRARY_INIT(HIError /*Error*/) \
1191  { \
1192  FB_EXT_INIT( LibName ); if (LibName##GlobalFBLibrary.LibInit()) return true; return false; \
1193  } \
1194  } \
1195  FB_DLL_INIT( LibName, Operation ) \
1196  { \
1197  switch( Operation ) \
1198  { \
1199  case kFBDllLoad: \
1200  {
1201 #endif
1202 
1207 #define FBLibraryModule(Name) \
1208  void FBModule##Name()
1209 
1214 #define FBLibraryRegister( ClassName ) \
1215  extern void FBModule##ClassName( ); \
1216  FBModule##ClassName( );
1217 
1222 #define FBLibraryRegisterStorable( ClassName ) \
1223  extern void FBModule##ClassName##Storable( ); \
1224  FBModule##ClassName##Storable( );
1225 
1230 #define FBLibraryRegisterElement( ClassName ) \
1231  extern void FBModule##ClassName##Element( ); \
1232  FBModule##ClassName##Element( );
1233 
1238 #define FBLibraryRegisterShadingElement( ClassName ) \
1239  extern void FBModule##ClassName##ShadingElement( ); \
1240  FBModule##ClassName##ShadingElement( );
1241 
1243 #define FBLibraryDeclareEnd \
1244  } \
1245  break; \
1246  default: \
1247  break; \
1248  } \
1249 }
1250 
1251 // **********************************************************************************
1252 
1256 #define FBCustomManagerImplementation( ThisComponent ) \
1257  FBClassImplementation( ThisComponent ) \
1258 
1259 
1262 #define FBRegisterCustomManager( ClassName ) \
1263  FBLibraryModule( ClassName ) \
1264  { \
1265  static ClassName g##ClassName; \
1266  g##ClassName.FBCreate(); \
1267  g##ClassName.RegisterManager(); \
1268  } \
1269 
1270 
1273 #define FBCustomManagerDeclare( ClassName ) \
1274 FBClassDeclare( ClassName, FBCustomManager ); \
1275  public: \
1276  ClassName() : FBCustomManager() { FBClassInit; } \
1277  \
1278  private:
1279 
1280 
1282 // FBCustomManager
1284 
1285 __FB_FORWARD( FBCustomManager );
1286 
1301 public:
1304  FBCustomManager();
1305 
1310  void RegisterManager();
1311 
1315  virtual bool FBCreate();
1316 
1323  virtual bool Init() ;
1324 
1330  virtual bool Open() ;
1331 
1336  virtual bool Clear() ;
1337 
1341  virtual bool Close() ;
1342 
1343 };
1344 
1345 
1346 #ifdef FBSDKUseNamespace
1347  }
1348 #endif
1349 
1350 #endif
Object is in destruction operations.
Definition: fbcomponent.h:472
PropertyEvent: Base event class.
Definition: fbproperties.h:507
Property: Base property class.
Definition: fbproperties.h:192
void FBSetStoreableCustomTextureRegistered()
A template class for arrays.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
class FBPropertyBaseComponent< FBFolder * > FBPropertyFolder
Definition: fbcomponent.h:435
Object is in clearing operations (File new).
Definition: fbcomponent.h:473
int FBObject_GetGroupCount()
A set of functions to query the registration table.
FBPropertyPlug Plug
Read Only Property: The plug involved in the action.
Definition: fbcomponent.h:1033
< used="" in="" fbx="" sdk="" native="" io,="" force="" bindary="" format="" for="" the="" bindary="" data.="">
Definition: fbcomponent.h:461
Object (model) can be "parented".
Definition: fbcomponent.h:450
K_FORWARD(KStringList)
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
Definition: fbproperties.h:139
const char * FBObject_GetEntryName(int pGroupIndex, int pIndex)
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
Definition: fbproperties.h:161
Property class: const char * (String).
HIRegister HISender
HISender.
Definition: fbcomponent.h:391
Connection notify event class.
Definition: fbcomponent.h:982
Created from System (not from user)
Definition: fbcomponent.h:445
Basic string class.
Definition: fbstring.h:66
IKtView * HIKtView
Definition: fbcontrols.h:63
int __FBRegisterTypeInfo(int pInternalClassId)
__FBRegisterTypeInfo For internal use only, Register the TypeInfo mapped to internal class id...
FBPropertyConnectionType ConnectionType
Read Only Property: Connection's type.
Definition: fbcomponent.h:992
Library class for DLL registration.
Definition: fbcomponent.h:1086
void FBSetStoreableCustomMaterialRegistered()
Connection notify event class.
Definition: fbcomponent.h:1024
#define NULL
Definition: kaydara.h:179
Objects Containing class.
FBPropertyPlug Plug
Read Only Property: The plug involved in the action.
Definition: fbcomponent.h:1013
Template class to contain an array of items.
Definition: fbarray.h:77
#define ICallback_Declare(IsPure)
Forwarding.
Definition: icallback.h:42
FBObjectStatus
Available lifetime status for any component.
Definition: fbcomponent.h:467
FBPropertyConnectionAction Action
Read Only Property: Connection's action performed.
Definition: fbcomponent.h:1032
Used in FBX SDK native IO.
Definition: fbcomponent.h:459
#define K_IMPLEMENTATION
Definition: iobject.h:53
Property classes.
class FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
FBArrayTemplate< FBComponent * > FBComponentList
typedef FBArrayTemplate FBComponentList;
Definition: fbcomponent.h:298
#define IObject_Declare(IsPure)
Definition: iobject.h:75
virtual bool UseCustomPropertyViewSet() const
Use the custom property viewSet or not.
Definition: fbcomponent.h:810
Base Event class.
Definition: fbcomponent.h:955
FBNamespaceAction
Namespace flags.
Definition: fbcomponent.h:477
bool FBObject_GetMultiplicity(int pGroupIndex, int pIndex, int nth=0)
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:148
FBVisualComponent * FBGetFBVisualComponent(HIKtView pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
bool FBUnregisterObject(const char *pGroupName, const char *pEntryName, int nth=0)
FBUnregisterObject.
Definition: fbcomponent.h:381
Definition: Python-ast.h:24
const char * FBObject_GetEntryDLLName(int pGroupIndex, int pIndex, int nth=0)
HKEventBase HKEvent
HKEvent.
Definition: fbcomponent.h:394
FBComponentList * FBCreateComponentList()
Create a FBObjectList object.
Object created/used by the Story tool.
Definition: fbcomponent.h:456
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbcomponent.h:57
int FBObject_GetEntryCount(int pGroupIndex)
FBComponent * FBFindObjectByFullName(const char *pObjectFullName)
FBFindObjectByFullName.
FBPropertyInt Type
Read Only Property: Type of event.
Definition: fbcomponent.h:965
bool FBGetStoreableCustomMaterialRegistered()
void FBFindObjectsByName(const char *pNamePattern, FBComponentList &pList, bool pIncludeNamespace=true, bool pModelsOnly=false)
FBFindObjectsByName.
Connection notify event class.
Definition: fbcomponent.h:1004
Definition of the class FBPlug and related enums and utility functions.
Object is in creation operations.
Definition: fbcomponent.h:468
FBArrayTemplate< FBComponent * > & FBGetComponentArray()
Get the Root FBComponent.
Folder class.
Definition: fbfolder.h:78
FBPropertyListComponent Parents
List: Parents.
Definition: fbcomponent.h:859
FBPropertyPlug DstPlug
Read Only Property: The destination plug involved in the action.
Definition: fbcomponent.h:994
Object is in retrieving operations.
Definition: fbcomponent.h:470
const char * FBObject_GetIconName(int pGroupIndex, int pIndex, int nth=0)
Remove all the namespace name.
Definition: fbcomponent.h:481
FBPropertyPlug SrcPlug
Read Only Property: The source plug involved in the action.
Definition: fbcomponent.h:993
Library class for DLL registration.
Definition: fbcomponent.h:1141
FBPropertyString LongName
Read Write Property: Name and namespace for object.
Definition: fbcomponent.h:862
FBConnectionAction
Possible actions when a notify plug event occurs.
Definition: fbplug.h:78
Definition: Python-ast.h:18
Deleted on File->New.
Definition: fbcomponent.h:446
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:549
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
Object can undo its actions and states, in a global Undo Stack.
Definition: fbcomponent.h:452
static int TypeInfo
Contains the Type information of the object.
Definition: fbcomponent.h:677
FBComponent FBObject
Equivalent to FBComponent for gradual transition.
Definition: fbcomponent.h:896
HIObject(* kObjectCreatorFnc)(HIObject pOwner, const char *pName, void *pData)
Definition: iobject.h:88
FBPropertyConnectionAction Action
Read Only Property: Connection's action performed.
Definition: fbcomponent.h:1012
void __FBAddModelToScene(HIObject pObject)
For internal usage only.
FBPropertyManager PropertyList
Read Only Property: Manages all of the properties for the component.
Definition: fbcomponent.h:857
Object can be "detached".
Definition: fbcomponent.h:451
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
FBPlugModificationFlag
Definition: fbplug.h:153
PropertyList: Component.
Definition: fbcomponent.h:490
Allow editing on the namespace objects.
Definition: fbcomponent.h:463
The entity will not add the namespace of the object to his list of all the namespaces of the scene...
Definition: fbcomponent.h:462
void(ICallback::* FBCallback)(HISender pSender, HKEvent pEvent)
FBCallback.
Definition: fbcomponent.h:400
List of scene objects.
Definition: fbcomponent.h:569
class FBPropertyBaseEnum< enum FBConnectionAction > FBPropertyConnectionAction
Definition: fbcomponent.h:485
KEventBase * HKEventBase
Definition: fbcomponent.h:75
const char * FBObject_GetGroupName(int pGroupIndex)
FBPropertyPlug NewPlug
Read Only Property: New plug created by the action.
Definition: fbcomponent.h:995
FBPropertyConnectionAction Action
Read Only Property: Connection's action performed.
Definition: fbcomponent.h:990
Object is in Merging operations.
Definition: fbcomponent.h:471
int FBRegister_ClassId(const char *pClassName)
KGlobalNamedEvent * mLibrary_Release
Library Release.
Definition: fbcomponent.h:1123
MotionBuilder SDK base class.
Definition: fbcomponent.h:664
T * FBCast(FBObject *pObject, bool pAutoCreate=false)
Cast the SDK object using it's IObject interface into the proper class.
Definition: fbcomponent.h:903
FBPropertyInt SrcIndex
Read Only Property: Index of the source in the destination component.
Definition: fbcomponent.h:991
FBPlug * __FBObjectCreatorSub(HIObject pObject)
__FBObjectCreatorSub For internal use only, Create the FBPlug object from internal object...
Object can Key his property.
Definition: fbcomponent.h:454
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
FBPropertyListComponent Components
List: List of components.
Definition: fbcomponent.h:858
Object which has kFlagUndoableSeparately flag turned on will have a separate Undo Stack...
Definition: fbcomponent.h:453
Use to add a namespace name to object.
Definition: fbcomponent.h:479
void FBDestroyComponentList(FBComponentList *pObjectList)
Delete a FBObjectList object.
bool FBObject_Register(const char *pGroupName, const char *pEntryName, const char *pDescription, kObjectCreatorFnc pCreatorFnc, bool pIsMultipleAllowed, const char *pIconFilename)
Visible in the Scene Navigator/Schematic View/Property View/Model View.
Definition: fbcomponent.h:449
Connections Basic Open Reality SDK Element.
Definition: fbplug.h:220
Object is in storing operations.
Definition: fbcomponent.h:469
FBComponent * FBCreateObject(const char *pGroupName, const char *pEntryName, const char *pName, void *pData=((void *) 0), int nth=0)
FBCreateObject.
FBObjectFlag
Available flags for any component.
Definition: fbcomponent.h:438
FBComponent * FBGetFBComponent(HIObject pObject, bool pAutoCreate=true)
Get the FBComponent from an Internal Object.
class FBPropertyBaseComponent< FBPlug * > FBPropertyPlug
Property: FBPropertyBaseComponent(FBPlug*)
int __FBGetInternalClassId(int pTypeInfo)
__FBGetInternalClassId For internal use only, Get the internal class Id from the ORSDK FBCompoent's T...
FBPropertyBool Selected
Read Write Property: Selected property.
Definition: fbcomponent.h:860
Can be visible.
Definition: fbcomponent.h:443
FBComponent * GetFBComponent(const HIObject Object)
Get a handle to the FBComponent belonging to an HIObject.
virtual FBPropertyType GetPropertyType() override
Get the property's type.
Definition: fbcomponent.h:545
Objects Containing class.
Definition: fbnamespace.h:79
const char void * pValue
Definition: fbcontrols.h:2116
bool FBGetStoreableCustomModelRegistered()
void FBSetStoreableCustomModelRegistered()
String class.
bool FBObject_Unregister(const char *pGroupName, const char *pEntryName, int nth=0)
const char * FBObject_GetEntryDescription(int pGroupIndex, int pIndex, int nth=0)
FBPropertyType
Property types.
Definition: fbproperties.h:79
HIObject FBGetFBObject(HIObject pObject, bool pAutoCreate=false)
Get the SDK object from an Internal Object.
FBPropertyFolder Folder
Read Write Property: The folder that contain this component.
Definition: fbcomponent.h:865
class FBPropertyBaseEnum< enum FBConnectionType > FBPropertyConnectionType
Definition: fbcomponent.h:484
IRegister * HIRegister
Definition: fbcomponent.h:71
FBPropertyString Name
Read Write Property: Unique name of object.
Definition: fbcomponent.h:861
bool FBGetStoreableCustomTextureRegistered()
int FBDeleteObjectsByName(const char *pNamePattern, const char *pNameSpace=((void *) 0), const char *pGroupName=((void *) 0))
FBDeleteObjectsByName.
void __FBRemoveModelFromScene(HIObject pObject)
For internal usage only.
Object is allocated, so it must call 'delete this' on destroy.
Definition: fbcomponent.h:455
Custom manager class for user controlled observer objects.
Definition: fbcomponent.h:1299
Use to replace a define namespace.
Definition: fbcomponent.h:480
class FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool