1 #ifndef __FBPROPERTIES_H__
2 #define __FBPROPERTIES_H__
51 #define FBSDK_DLL K_DLLIMPORT
72 #ifdef FBSDKUseNamespace
139 #define FB_DEFINE_COMPONENT( DllTag, Type ) \
141 typedef class DllTag FBPropertyBase< FB##Type*,kFBPT_object > FBPropertyBase##Type; \
142 typedef class DllTag FBPropertyBaseComponent< FB##Type* > FBProperty##Type
148 #define FB_DEFINE_ENUM( DllTag, Type ) \
149 typedef class DllTag FBPropertyBaseEnum< enum FB##Type > FBProperty##Type;
154 #define FB_DEFINE_CLASS_ENUM( EnumName ) \
155 typedef class FBPropertyBaseEnum< enum __FBClassType::e##EnumName > Property##EnumName;
161 #define FB_DEFINE_LIST( DllTag, Type ) \
162 typedef class DllTag FBPropertyBaseList< FB##Type* > FBPropertyBaseList##Type;
206 #ifndef DOXYGEN_SHOULD_SKIP_THIS
211 FBProperty* InitInternal( KProperty* pProperty );
214 KProperty* GetInternal()
const;
217 void* GetValuePtr()
const;
226 void SetInternal( KProperty* pInternal );
230 void SetEnable(
bool pValue );
235 const char* GetName();
240 void SetName(
const char *pName);
250 const char* GetPropertyTypeName();
255 virtual KDataType* GetDataType();
261 virtual void SetData(
void* pData );
270 virtual void GetData(
void* pData,
int pSize,
FBEvaluateInfo *pEvalInfo =
NULL )
const;
282 bool SetInt(
int pInt);
294 virtual bool SetString(
const char* pString );
299 const char* OriValueAsString();
302 bool IsAnimated()
const;
306 bool OriIsAnimated()
const;
312 virtual bool IsList();
313 virtual bool IsAnimatable();
314 bool IsInternal()
const;
315 bool IsUserProperty();
316 bool IsTextureConnectableProperty();
317 bool IsReferenceProperty();
334 bool IsTemporaryProperty();
350 virtual bool IsReadOnly();
356 virtual const char* EnumList(
int pIndex );
362 FBStringList* GetEnumStringList(
bool pCreateIt =
false);
366 void NotifyEnumStringListChanged();
393 void SetMinMax(
double pMin,
double pMax,
bool pForceMinClamp =
false,
bool pForceMaxClamp =
false );
399 void SetMin(
double pMin,
bool pForceMinClamp =
false );
405 void SetMax(
double pMax,
bool pForceMaxClamp =
false );
435 int GetSubMemberCount()
const;
440 bool AllowsLocking()
const;
445 bool HasSomethingLocked()
const;
450 bool IsLocked()
const;
456 bool IsMemberLocked(
int pIndex )
const;
461 void SetLocked(
bool pLocked );
467 void SetMemberLocked(
int pIndex ,
bool pLocked );
484 return (T*)lProperty;
510 #ifndef DOXYGEN_SHOULD_SKIP_THIS
537 FBPropertyEvent *InitGlobal(
const char* pName,
const char* pGlobalEventName );
552 virtual void InvalidateParent();
561 DataFBPropertyEvent* mLocalPtr;
618 #ifndef DOXYGEN_SHOULD_SKIP_THIS
619 void (*
Set)(
void *, tType);
620 tType (* Get)(
void *);
661 inline void operator=(tType pValue) { SetData( &pValue ); }
676 inline operator tType()
const { tType Value; GetData( &Value,
sizeof(Value) );
return Value; }
688 if(IsInternal() && GetValuePtr())
690 *(tType*)GetValuePtr() = pValue;
699 if(IsInternal() && GetValuePtr())
701 return *(tType*)GetValuePtr();
712 inline virtual bool IsReadOnly() {
return IsInternal() ? (FBProperty::IsReadOnly()) : (
Set ==
NULL); }
721 *((tType*)pData) = (*Get)(mParent);
723 else if (IsInternal())
725 FBProperty::GetData( pData, pSize, pEvalInfo );
729 assert(Get !=
NULL || IsInternal());
730 *((tType*)pData) = (tType)0;
740 (*Set)( mParent,*(tType*)pData );
742 else if (IsInternal())
744 FBProperty::SetData( pData );
748 assert(
Set !=
NULL || IsInternal() );
760 #ifndef DOXYGEN_SHOULD_SKIP_THIS
762 static const char *mStrings[];
783 inline void operator=(tType pValue) { SetData( &pValue ); }
790 inline operator tType()
const { tType Value; GetData( &Value,
sizeof(Value) );
return Value; }
792 virtual const char*
EnumList(
int pIndex )
override
794 if( FBPropertyBaseEnum::IsInternal() )
796 return FBProperty::EnumList( pIndex );
806 return mStrings[pIndex];
810 assert(mStrings[0] || FBPropertyBaseEnum::IsInternal());
829 while ((tmpstr=EnumList( Count ))!=
NULL) {
830 if (strcmp(tmpstr,pString)==0) {
831 FBPropertyBaseEnum::SetData( &Count );
860 FBProperty* Init(
void* pParent,
const char *pName );
869 virtual int GetCount()=0;
875 virtual void RemoveAt(
int pIndex )=0;
880 virtual bool IsList();
913 virtual int Add( tType pItem )=0;
920 virtual tType operator[](
int pIndex )=0;
931 inline virtual int Find( tType pItem )
934 for(Index=0; Index<GetCount(); Index++ )
936 if(
operator[](Index)==pItem )
950 int Index = Find( pItem );
962 inline virtual tType
GetAt(
int pIndex)
964 return operator[](pIndex);
1003 kReference GetReferenceAt(
int pIndex );
1008 void SetReferenceAt(
int pIndex,kReference pRef );
1014 int Find( kReference pRef );
1020 int Find(
const char *S );
1026 virtual const char *GetAt(
int pIndex );
1033 const char *operator[](
int pIndex);
1047 int Remove(
const char *S );
1055 virtual int Add(
const char *S,kReference pRef = 0 );
1058 virtual void Clear();
1063 virtual void RemoveAt(
int pIndex );
1069 virtual int IndexOf(
const char *S);
1076 virtual void InsertAt(
int pIndex,
const char *S,kReference pRef = 0 );
1083 virtual bool SetAt(
int pIndex,
const char *pString );
1088 virtual bool IsList()
override;
1100 virtual bool SetString(
const char *pString )
override;
1151 FBProperty* Find(
const char *pPropertyName,
bool pMultilangLookup=
true );
1177 void RemoveFromCache( KProperty* pProperty );
1184 FBProperty* FindInCache( KProperty* pProperty );
1196 void SetParent(
HIObject pParent );
1198 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1251 #if defined(KARCH_DEV_INTEL)
1252 #define FBImplementPropertyComponent( DllTag, Type )
1254 #define FBImplementPropertyComponent( DllTag, Type ) \
1255 template class DllTag FBSDKNamespaceFunc(FBPropertyBase)< FB##Type*,kFBPT_object >; \
1256 template class DllTag FBSDKNamespaceFunc(FBPropertyBaseComponent)< FB##Type* >;
1263 #if defined(KARCH_DEV_INTEL)
1264 #define FBImplementPropertyEnum( DllTag, Type ) // On SGI by having mString defined for each enum already instantiates the template.
1265 #define FBImplementClassPropertyEnum( DllTag, Class, EnumName )
1267 #define FBImplementPropertyEnum( DllTag, Type ) \
1268 template class DllTag FBSDKNamespaceFunc(FBPropertyBaseEnum)< enum FB##Type >
1269 #define FBImplementClassPropertyEnum( DllTag, Class, EnumName ) \
1270 template class DllTag FBSDKNamespaceFunc(FBPropertyBaseEnum)< enum Class::E##EnumName >
1277 #if defined(KARCH_DEV_INTEL)
1278 #define FBImplementPropertyList( DllTag, Type )
1280 #define FBImplementPropertyList( DllTag, Type ) \
1281 template class DllTag FBSDKNamespaceFunc(FBPropertyBaseList) < FB##Type* >
1295 inline void operator=(
const char* pValue) { SetData( &pValue ); }
1302 inline operator const char* ()
const {
char* Value; GetData( &Value,
sizeof(Value) );
return Value; }
1304 inline bool operator==(
const char* pValue)
const {
char* Value; GetData( &Value,
sizeof(Value) );
return (Value == pValue) || (strcmp(Value, pValue) == 0); }
1310 virtual void SetPropertyValue(
const char* pValue )
override;
1381 #define FBPropertyInit( Param,Type,PropName,Get,Set ) \
1383 PropertyAdd(PropName.Init( (void*)Param,#PropName,(Type (*)(void *))Get,(void (*)(void *,Type))Set )); \
1390 #define FBPropertyInitList( Param,PropName ) \
1392 PropertyAdd(PropName.Init( Param,#PropName )); \
1399 #define FBPropertyInitStringList( Param,PropName ) \
1401 PropertyAdd(PropName.Init( Param, #PropName )); \
1410 #define FBPropertyInitEvent( Param,Type,SubType,PropName ) \
1412 PropertyAdd(PropName.Init( this, IQ(Param,IRegister),#PropName,Type,SubType )); \
1419 #define FBPropertyInitEventGlobal( GlobalEventName,PropName ) \
1421 PropertyAdd(PropName.InitGlobal( #PropName,GlobalEventName )); \
1425 #define FBPropertyInitInternal( Parent, PropName, MBProperty ) \
1427 PropertyAdd(PropName.InitInternal( MBProperty ));\
1431 #define FBPropertyInitInternalEnum( Param,Type,PropName,MBProperty,Get,Set ) \
1433 PropName.InitInternal( MBProperty ); \
1434 PropertyAdd(PropName.Init( (void*)Param,#PropName,(Type (*)(void *))Get,(void (*)(void *,Type))Set )); \
1444 #define FBPropertyPublish( Parent,Prop,PropName,Get,Set ) \
1446 PropertyAdd(Prop.CreateInternal( Parent,PropName,(fbExternalGetSetHandler)Get,(fbExternalGetSetHandler)Set )); \
1455 #define FBPropertyInitTextureConnectable( Parent,Prop,PropName ) \
1457 PropertyAdd(Prop.CreateTextureConnectable( Parent,PropName )); \
1499 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1520 virtual KDataType* GetDataType()
override;
1525 const char* GetDataTypeName();
1535 void SetFocus(
bool pState );
1544 void KeyAt(
FBTime pTime );
1549 void KeyRemoveAt(
FBTime pTime );
1554 int GetDataSize()
const;
1572 void SetAnimated(
bool pState,
bool pCheckLocked =
false );
1588 virtual void SetData(
void* pData )
override;
1593 virtual void GetData(
void* pData,
int pSize,
FBEvaluateInfo* pEvalInfo =
NULL )
const override;
1622 bool AllowsMuting()
const;
1627 bool HasSomethingMuted()
const;
1632 bool IsMuted()
const;
1638 bool IsMemberMuted(
int pIndex )
const;
1643 void SetMuted(
bool pMuted );
1649 void SetMemberMuted(
int pIndex ,
bool pMuted );
1676 void operator=(tType pValue);
1682 operator tType()
const;
1755 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1757 static const char *mStrings[];
1785 inline operator tType()
const { tType Value; GetData( &Value,
sizeof(Value) );
return Value; }
1791 return FBProperty::EnumList( pIndex );
1799 else if(mStrings[0])
1801 return mStrings[pIndex];
1805 assert(mStrings[0] || IsInternal());
1823 const char * tmpstr;
1824 while ((tmpstr=EnumList( Count ))!=
NULL) {
1825 if (strcmp(tmpstr,pString)==0) {
1840 #ifdef FBSDKUseNamespace
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
class FBPropertyBase< FBPlug *, kFBPT_object > _FBPropertyBasePlug
Property: FBPropertyBase(FBPlug*)
#define Set(a0, a1, a2, a3)
A template class for arrays.
This property is loaded from file.
class FBPropertyBase< FBVector2d, kFBPT_Vector2D > FBPropertyVector2d
FBPropertyVector2d type definition.
class FBPropertyBase< FBTimeSpan, kFBPT_TimeSpan > FBPropertyTimeSpan
Property: FBTimeSpan
~FBPropertyBaseEnum()
Destructor.
FBDataAsStringFlag
FBDataAsStringFlag.
class FBPropertyBaseAnimatable< int, kFBPT_int > FBPropertyAnimatableInt
FBPropertyAnimatableInt type definition.
virtual FBPropertyType GetPropertyType()
Get the property's type.
class FBPropertyBaseAnimatable< FBVector2d, kFBPT_Vector2D > FBPropertyAnimatableVector2d
FBPropertyAnimatableVector2D type definition.
class FBVector4< double > FBVector4d
4D vector
class FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
void * GetParent()
Get the parent of the object.
void operator=(tType pValue)
Overloaded = operator.
class FBVector2< double > FBVector2d
2D vector.
class FBPropertyBaseEnum< enum kDefaultEnum > FBPropertyEnum
A typedef Definition.
class FBPropertyBaseAnimatable< double, kFBPT_double > FBPropertyAnimatableDouble
FBPropertyBaseAnimatableDouble type definition.
class FBPropertyBaseAnimatable< bool, kFBPT_Action > FBPropertyAnimatableAction
FBPropertyAnimatableAction type definition.
class FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
PropertyEvent: Global KeyingNotify event.
virtual bool IsReadOnly()
Is this class read-only? If there is an existing set function, this class is read/write, otherwise it is read-only.
virtual const char * AsString(FBDataAsStringFlag pFlag=kFBDataAsStringUI)
Get as string.
FBPropertyBaseComponent(const FBPropertyBaseComponent< tType > &pValue)
Constructor.
virtual FBPropertyType GetPropertyType()
Get the property's type.
void operator=(tType pValue)
Overloaded = operator.
class FBPropertyBaseAnimatable< FBColorAndAlpha, kFBPT_ColorRGBA > FBPropertyAnimatableColorAndAlpha
FBPropertyAnimatableColorAndAlpha type definition.
class FBPropertyBaseAnimatable< long long, kFBPT_int64 > FBPropertyAnimatableInt64
FBPropertyAnimatableInt64 type definition.
class FBPropertyBase< FBProperty *, kFBPT_Reference > FBPropertyReference
Property: FBProperty *
class FBPropertyBase< FBVector3d, kFBPT_Vector3D > FBPropertyVector3d
FBPropertyVector3d type definition.
This flag is used to show/hide the property in the propertiview.
FBPropertyFlag
Available flags for FBProperty objects.
AnimationNodeNotify evaluation information.
class FBPropertyBase< FBVector4d, kFBPT_Vector4D > FBPropertyVector4d
FBPropertyVector4d type definition.
virtual void GetData(void *pData, int pSize, FBEvaluateInfo *pEvalInfo=((void *) 0)) const
Get value.
virtual int Remove(tType pItem)
Remove pItem from the list.
class FBPropertyBase< long long, kFBPT_int64 > FBPropertyInt64
Property: int
class FBPropertyBase< float, kFBPT_float > FBPropertyFloat
Property: float
int * TypeInfo
< type="" information.="" />
#define IObject_Declare(IsPure)
Property class: const char * (String).
tType GetPropertyValue()
Get the value of the internal property.
T * FBCast(FBProperty *pProperty, bool pAutoCreate=false)
Cast property using it's IObject interface into the proper type.
This flag is used to show/hide the property in the propertiview.
virtual const char * AsString(FBDataAsStringFlag pFlag=kFBDataAsStringUI)
Get as string.
PropertyEvent: Global ConnectionDataNotify event.
tType ValueType
Property Value Type.
Connections Basic Open Reality SDK Element.
MotionBuilder SDK base class.
Convert data to string type for storage.
virtual FBPropertyType GetPropertyType()
Get the property's type.
kDefaultEnum
Patch to use the base enum for casting values .
PropertyEvent: Global ConnectionStateNotify event.
~FBPropertyBaseComponent()
Destructor.
class FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
class FBPropertyBase< kReference, kFBPT_kReference > FBPropertykReference
Property: kReference
class FBPropertyBase< FBColorAndAlpha, kFBPT_ColorRGBA > FBPropertyColorAndAlpha
FBPropertyColorAndAlpha type definition.
This is property is connected and slaved by other same type of master property, and it always ask val...
class FBPropertyBaseComponent< FBPlug * > FBPropertyPlug
Property: FBPropertyBaseComponent(FBPlug*)
class FBPropertyBase< FBTimeCode, kFBPT_TimeCode > FBPropertyTimeCode
Property: FBTimeCode
virtual const char * EnumList(int pIndex)
Return the string of an enum value.
class FBPropertyBaseAnimatable< FBTimeCode, kFBPT_TimeCode > FBPropertyAnimatableTimeCode
FBPropertyBaseAnimatableTimeCode type definition.
void operator=(const char *pValue)
Overloaded = operator.
class FBPropertyBaseAnimatable< bool, kFBPT_bool > FBPropertyAnimatableBool
FBPropertyAnimatableBool type definition.
class FBPropertyBaseAnimatable< FBVector4d, kFBPT_Vector4D > FBPropertyAnimatableVector4d
FBPropertyAnimatableVector4D type definition.
Definition of the class FBPlug and related enums and utility functions.
FBPropertyType
Property types.
Property: Action Action property to trigger function.
A take is a container for animation in a scene.
void operator=(tType pValue)
Overloaded = operator.
class FBPropertyBaseAnimatable< FBTime, kFBPT_Time > FBPropertyAnimatableTime
FBPropertyBaseAnimatableTime type definition.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
void operator=(tType pValue)
Overloaded = operator.
virtual void SetData(void *pData)
Set value.
Property: Base property class.
virtual const char * EnumList(int pIndex)
Return the string of an enum value.
Template class to contain an array of items.
Animatable property base class.
FBPropertyBase()
Constructor.
Slave property can be modified, valid only when the master property is modified.
class FBVector3< double > FBVector3d
3D vector.
PropertyEvent: UI idle event.
bool operator==(const char *pValue) const
#define FBSDKNamespace
FBSDKNamespace define.
class FBPropertyBase< unsigned long long, kFBPT_uint64 > FBPropertyUInt64
Property: int
FBPropertyBase * Init(void *pParent, const char *pName, tType(*pGet)(void *)=((void *) 0), void(*pSet)(void *, tType)=((void *) 0))
Initialization function.
~FBPropertyAction()
Destructor.
virtual FBPropertyType GetPropertyType()
Get the property's type.
FBPropertyBaseList()
Constructor.
FBPropertyBaseAnimatableEnum()
Constructor.
const char PyObject const char long
PropertyEvent: Base event class.
PropertyEvent: Global ConnectionNotify event.
class FBPropertyBase< FBComponent *, kFBPT_object > _FBPropertyBaseComponent
Property: FBPropertyBase(FBComponent*)
class FBPropertyBaseAnimatable< int, kFBPT_enum > FBPropertyAnimatableEnum
FBPropertyBaseAnimatableEnum type definition.
FBPropertyBaseEnum(const FBPropertyBaseEnum< tType > &pValue)
FBPropertyBaseEnum.
~FBPropertyBase()
Destructor.
virtual tType GetAt(int pIndex)
Get a property at pIndex.
~FBPropertyBaseAnimatableEnum()
Destructor.
FBPropertyBase(const FBPropertyBase< tType, pPT > &pValue)
Constructor.
A box is a fundamental building block in the application architecture.
HIObject FBGetFBObject(HIObject pObject, bool pAutoCreate=false)
Get the SDK object from an Internal Object.
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
virtual void SetPropertyValue(tType pValue)
Set the value of the internal property.
tType ValueType
Property Value Type.
PropertyEvent: Video Frame Rendering Event
class FBPropertyBaseAnimatable< FBColor, kFBPT_ColorRGB > FBPropertyAnimatableColor
FBPropertyAnimatableColor type definition.
bool operator==(const FBPickInfos &pLhs, const FBPickInfos &pRhs)
FBPropertyBaseAnimatableEnum(const FBPropertyBaseAnimatableEnum< tType > &pValue)
FBPropertyBaseAnimatableEnum.
class FBPropertyBaseAnimatable< unsigned long long, kFBPT_uint64 > FBPropertyAnimatableUInt64
FBPropertyAnimatableUInt64 type definition.
class FBPropertyBaseComponent< FBComponent * > FBPropertyComponent
Property: FBPropertyBaseComponent(FBComponent*)
~FBPropertyBaseList()
Destructor.
Convert data to string type for UI display.
virtual bool SetString(const char *pString)
Set enum value by equivalent string.
virtual bool SetString(const char *pString)
Set string as enum value.
FBPropertyAction()
Constructor.
bool operator!=(const char *pValue) const
virtual bool IsAnimatable()
Certify that the property is animatable.
virtual int Find(tType pItem)
Locate a property in the list.
class FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
Visual Component base class.
void * mParent
mParent Parent of the property.
class FBPropertyBase< FBColor, kFBPT_ColorRGB > FBPropertyColor
FBPropertyColor type definition.
#define FBClassDeclare(Name, Parent)
Class declaration.
The value has been allocated and must be delete in destructor.
void operator=(const FBPropertyBase< tType, pPT > &pProperty)
Overloaded = operator.
class FBPropertyBaseAnimatable< FBVector3d, kFBPT_Vector3D > FBPropertyAnimatableVector3d
FBPropertyAnimatableVector3D type definition.
void(* fbExternalGetSetHandler)(HIObject pObject)
function pointer
FBPropertyBaseList(HIObject pParent, const char *pName)
Constructor.
FBPropertyBaseComponent()
Constructor.
void(ICallback::* kICallbackHandler)(HIRegister pCaller, HKEventBase pEvent)
void(* fbGetSetHandler)(void)
function pointer
Should not be saved to or loaded from an FBX file.