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 *);
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[];
778 { operator=((tType)pValue ); }
792 inline operator tType()
const { tType Value; this->GetData( &Value,
sizeof(Value) );
return Value; }
794 virtual const char*
EnumList(
int pIndex )
override
796 if( FBPropertyBaseEnum::IsInternal() )
798 return FBProperty::EnumList( pIndex );
808 return mStrings[pIndex];
812 assert(mStrings[0] || FBPropertyBaseEnum::IsInternal());
831 while ((tmpstr=EnumList( count ))!=
NULL) {
832 if (strcmp(tmpstr,pString)==0) {
833 FBPropertyBaseEnum::SetData( &count );
862 FBProperty* Init(
void* pParent,
const char *pName );
871 virtual int GetCount()=0;
877 virtual void RemoveAt(
int pIndex )=0;
882 virtual bool IsList();
915 virtual int Add( tType pItem )=0;
922 virtual tType operator[](
int pIndex )=0;
933 inline virtual int Find( tType pItem )
936 for(Index=0; Index<GetCount(); Index++ )
938 if(
operator[](Index)==pItem )
952 int Index = Find( pItem );
964 inline virtual tType
GetAt(
int pIndex)
966 return operator[](pIndex);
1005 kReference GetReferenceAt(
int pIndex );
1010 void SetReferenceAt(
int pIndex,kReference pRef );
1016 int Find( kReference pRef );
1022 int Find(
const char *S );
1028 virtual const char *GetAt(
int pIndex );
1035 const char *operator[](
int pIndex);
1049 int Remove(
const char *S );
1057 virtual int Add(
const char *S,kReference pRef = 0 );
1060 virtual void Clear();
1065 virtual void RemoveAt(
int pIndex );
1071 virtual int IndexOf(
const char *S);
1078 virtual void InsertAt(
int pIndex,
const char *S,kReference pRef = 0 );
1085 virtual bool SetAt(
int pIndex,
const char *pString );
1090 virtual bool IsList()
override;
1102 virtual bool SetString(
const char *pString )
override;
1153 FBProperty* Find(
const char *pPropertyName,
bool pMultilangLookup=
true );
1179 void RemoveFromCache( KProperty* pProperty );
1186 FBProperty* FindInCache( KProperty* pProperty );
1198 void SetParent(
HIObject pParent );
1200 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1206 friend class FBVisualComponent;
1255 #if defined(KARCH_DEV_INTEL)
1256 #define FBImplementPropertyComponent( DllTag, Type )
1258 #define FBImplementPropertyComponent( DllTag, Type ) \
1259 template class DllTag FBSDKNamespaceFunc(FBPropertyBase)< FB##Type*,kFBPT_object >; \
1260 template class DllTag FBSDKNamespaceFunc(FBPropertyBaseComponent)< FB##Type* >;
1267 #if defined(KARCH_DEV_INTEL)
1268 #define FBImplementPropertyEnum( DllTag, Type ) // On SGI by having mString defined for each enum already instantiates the template.
1269 #define FBImplementClassPropertyEnum( DllTag, Class, EnumName )
1271 #define FBImplementPropertyEnum( DllTag, Type ) \
1272 template class DllTag FBSDKNamespaceFunc(FBPropertyBaseEnum)< enum FB##Type >
1273 #define FBImplementClassPropertyEnum( DllTag, Class, EnumName ) \
1274 template class DllTag FBSDKNamespaceFunc(FBPropertyBaseEnum)< enum Class::E##EnumName >
1281 #if defined(KARCH_DEV_INTEL)
1282 #define FBImplementPropertyList( DllTag, Type )
1284 #define FBImplementPropertyList( DllTag, Type ) \
1285 template class DllTag FBSDKNamespaceFunc(FBPropertyBaseList) < FB##Type* >
1306 inline operator const char* ()
const {
char* Value; GetData( &Value,
sizeof(Value) );
return Value; }
1308 inline bool operator==(
const char*
pValue)
const {
char* Value; GetData( &Value,
sizeof(Value) );
return (Value == pValue) || (strcmp(Value, pValue) == 0); }
1314 virtual void SetPropertyValue(
const char*
pValue )
override;
1385 #define FBPropertyInit( Param,Type,PropName,Get,Set ) \
1387 PropertyAdd(PropName.Init( (void*)Param,#PropName,(Type (*)(void *))Get,(void (*)(void *,Type))Set )); \
1394 #define FBPropertyInitList( Param,PropName ) \
1396 PropertyAdd(PropName.Init( Param,#PropName )); \
1403 #define FBPropertyInitStringList( Param,PropName ) \
1405 PropertyAdd(PropName.Init( Param, #PropName )); \
1414 #define FBPropertyInitEvent( Param,Type,SubType,PropName ) \
1416 PropertyAdd(PropName.Init( this, IQ(Param,IRegister),#PropName,Type,SubType )); \
1423 #define FBPropertyInitEventGlobal( GlobalEventName,PropName ) \
1425 PropertyAdd(PropName.InitGlobal( #PropName,GlobalEventName )); \
1429 #define FBPropertyInitInternal( Parent, PropName, MBProperty ) \
1431 PropertyAdd(PropName.InitInternal( MBProperty ));\
1435 #define FBPropertyInitInternalEnum( Param,Type,PropName,MBProperty,Get,Set ) \
1437 PropName.InitInternal( MBProperty ); \
1438 PropertyAdd(PropName.Init( (void*)Param,#PropName,(Type (*)(void *))Get,(void (*)(void *,Type))Set )); \
1448 #define FBPropertyPublish( Parent,Prop,PropName,Get,Set ) \
1450 PropertyAdd(Prop.CreateInternal( Parent,PropName,(fbExternalGetSetHandler)Get,(fbExternalGetSetHandler)Set )); \
1459 #define FBPropertyInitTextureConnectable( Parent,Prop,PropName ) \
1461 PropertyAdd(Prop.CreateTextureConnectable( Parent,PropName )); \
1503 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1524 virtual KDataType* GetDataType()
override;
1529 const char* GetDataTypeName();
1539 void SetFocus(
bool pState );
1548 void KeyAt(
FBTime pTime );
1553 void KeyRemoveAt(
FBTime pTime );
1558 int GetDataSize()
const;
1576 void SetAnimated(
bool pState,
bool pCheckLocked =
false );
1592 virtual void SetData(
void* pData )
override;
1597 virtual void GetData(
void* pData,
int pSize,
FBEvaluateInfo* pEvalInfo =
NULL )
const override;
1626 bool AllowsMuting()
const;
1631 bool HasSomethingMuted()
const;
1636 bool IsMuted()
const;
1642 bool IsMemberMuted(
int pIndex )
const;
1647 void SetMuted(
bool pMuted );
1653 void SetMemberMuted(
int pIndex ,
bool pMuted );
1660 bool SetColor(
const FBColor& pColor,
int pIndex);
1672 bool ResetColor(
int pIndex);
1678 bool IsFocusedChild(
int pIndex);
1685 bool SetFocusChild(
int pIndex,
bool pState);
1717 FBPropertyAnimatable::SetData(&pValue);
1724 operator tType()
const
1727 FBPropertyAnimatable::GetData(&val,
sizeof(val));
1802 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1804 static const char *mStrings[];
1832 inline operator tType()
const { tType Value; GetData( &Value,
sizeof(Value) );
return Value; }
1838 return FBProperty::EnumList( pIndex );
1846 else if(mStrings[0])
1848 return mStrings[pIndex];
1852 assert(mStrings[0] || IsInternal());
1870 const char * tmpstr;
1871 while ((tmpstr=EnumList( Count ))!=
NULL) {
1872 if (strcmp(tmpstr,pString)==0) {
1887 #ifdef FBSDKUseNamespace
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
class FBPropertyBase< kReference, kFBPT_kReference > FBPropertykReference
Property: kReference
class FBPropertyBase< FBColorAndAlpha, kFBPT_ColorRGBA > FBPropertyColorAndAlpha
FBPropertyColorAndAlpha type definition.
PropertyEvent: Base event class.
virtual bool IsAnimatable() override
Certify that the property is animatable.
Property: Base property class.
#define Set(a0, a1, a2, a3)
A template class for arrays.
class FBPropertyBase< FBTimeCode, kFBPT_TimeCode > FBPropertyTimeCode
Property: FBTimeCode
~FBPropertyAction()
Destructor.
virtual const char * EnumList(int pIndex) override
Return the string of an enum value.
class FBPropertyBaseAnimatable< bool, kFBPT_bool > FBPropertyAnimatableBool
FBPropertyAnimatableBool type definition.
PropertyEvent: Global ConnectionStateNotify event.
virtual tType GetAt(int pIndex)
Get a property at pIndex.
A box is a fundamental building block in the application architecture.
void * GetParent()
Get the parent of the object.
Property class: const char * (String).
PropertyEvent: Global ConnectionNotify event.
void operator=(tType pValue)
Overloaded = operator.
Slave property can be modified, valid only when the master property is modified.
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.
class FBPropertyBaseAnimatable< unsigned long long, kFBPT_uint64 > FBPropertyAnimatableUInt64
FBPropertyAnimatableUInt64 type definition.
A take is a container for animation in a scene.
class FBVector3< double > FBVector3d
3D vector.
FBPropertyBaseList()
Constructor.
bool operator==(const char *pValue) const
class FBPropertyBase< unsigned long long, kFBPT_uint64 > FBPropertyUInt64
Property: int
Template class to contain an array of items.
FBPropertyBaseEnum(const FBPropertyBaseEnum< tType > &pValue)
FBPropertyBaseEnum.
virtual const char * AsString(FBDataAsStringFlag pFlag=kFBDataAsStringUI) override
Get as string.
class FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
class FBPropertyBase< FBComponent *, kFBPT_object > _FBPropertyBaseComponent
Property: FBPropertyBase(FBComponent*)
Convert data to string type for UI display.
class FBPropertyBaseAnimatable< int, kFBPT_enum > FBPropertyAnimatableEnum
FBPropertyBaseAnimatableEnum type definition.
Property: Action Action property to trigger function.
class FBPropertyBase< FBColor, kFBPT_ColorRGB > FBPropertyColor
FBPropertyColor type definition.
virtual FBPropertyType GetPropertyType() override
Get the property's type.
virtual void GetData(void *pData, int pSize, FBEvaluateInfo *pEvalInfo=((void *) 0)) const
Get value.
#define IObject_Declare(IsPure)
tType GetPropertyValue()
Get the value of the internal property.
Animatable property base class.
tType ValueType
Property Value Type.
class FBPropertyBaseAnimatable< FBColor, kFBPT_ColorRGB > FBPropertyAnimatableColor
FBPropertyAnimatableColor type definition.
void operator=(tType pValue)
Overloaded = operator.
class FBPropertyBaseComponent< FBComponent * > FBPropertyComponent
Property: FBPropertyBaseComponent(FBComponent*)
void(* fbGetSetHandler)(void)
function pointer
virtual FBPropertyType GetPropertyType() override
Get the property's type.
FBPropertyBaseAnimatableEnum()
Constructor.
FBPropertyAction()
Constructor.
class FBPropertyBase< FBPlug *, kFBPT_object > _FBPropertyBasePlug
Property: FBPropertyBase(FBPlug*)
bool operator!=(const char *pValue) const
Should not be saved to or loaded from an FBX file.
class FBPropertyBase< FBVector2d, kFBPT_Vector2D > FBPropertyVector2d
FBPropertyVector2d type definition.
~FBPropertyBaseList()
Destructor.
Definition of the class FBPlug and related enums and utility functions.
This property is loaded from file.
The value has been allocated and must be delete in destructor.
virtual int Find(tType pItem)
Locate a property in the list.
void operator=(tType pValue)
Overloaded = operator.
class FBPropertyBaseAnimatable< FBVector3d, kFBPT_Vector3D > FBPropertyAnimatableVector3d
FBPropertyAnimatableVector3D type definition.
void(* fbExternalGetSetHandler)(HIObject pObject)
function pointer
FBPropertyBaseAnimatableEnum(const FBPropertyBaseAnimatableEnum< tType > &pValue)
FBPropertyBaseAnimatableEnum.
FBPropertyBaseComponent(const FBPropertyBaseComponent< tType > &pValue)
Constructor.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
class FBVector4< double > FBVector4d
4D vector
void operator=(tType pValue)
Overloaded = operator.
virtual void SetData(void *pData)
Set value.
class FBPropertyBaseEnum< enum kDefaultEnum > FBPropertyEnum
A typedef Definition.
FBPropertyBase()
Constructor.
virtual bool SetString(const char *pString) override
Set string as enum value.
class FBPropertyBaseAnimatable< bool, kFBPT_Action > FBPropertyAnimatableAction
FBPropertyAnimatableAction type definition.
virtual bool SetString(const char *pString) override
Set enum value by equivalent string.
~FBPropertyBaseComponent()
Destructor.
FBPropertyBaseList(HIObject pParent, const char *pName)
Constructor.
PropertyEvent: UI idle event.
#define FBSDKNamespace
FBSDKNamespace define.
virtual const char * AsString(FBDataAsStringFlag pFlag=kFBDataAsStringUI) override
Get as string.
FBPropertyBase * Init(void *pParent, const char *pName, tType(*pGet)(void *)=((void *) 0), void(*pSet)(void *, tType)=((void *) 0))
Initialization function.
~FBPropertyBaseEnum()
Destructor.
const char PyObject const char long
class FBPropertyBase< FBVector3d, kFBPT_Vector3D > FBPropertyVector3d
FBPropertyVector3d type definition.
class FBPropertyBase< FBTimeSpan, kFBPT_TimeSpan > FBPropertyTimeSpan
Property: FBTimeSpan
class FBPropertyBase< FBVector4d, kFBPT_Vector4D > FBPropertyVector4d
FBPropertyVector4d type definition.
T * FBCast(FBProperty *pProperty, bool pAutoCreate=false)
Cast property using it's IObject interface into the proper type.
int * TypeInfo
< type="" information.="">
FBDataAsStringFlag
FBDataAsStringFlag.
class FBPropertyBaseAnimatable< int, kFBPT_int > FBPropertyAnimatableInt
FBPropertyAnimatableInt type definition.
~FBPropertyBase()
Destructor.
FBPropertyBase(const FBPropertyBase< tType, pPT > &pValue)
Constructor.
This flag is used to show/hide the property in the propertiview.
class FBPropertyBase< float, kFBPT_float > FBPropertyFloat
Property: float
MotionBuilder SDK base class.
bool operator==(const FBPickInfos &pLhs, const FBPickInfos &pRhs)
class FBPropertyBaseAnimatable< FBVector2d, kFBPT_Vector2D > FBPropertyAnimatableVector2d
FBPropertyAnimatableVector2D type definition.
class FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
class FBVector2< double > FBVector2d
2D vector.
FBPropertyBaseAnimatable()
Constructors.
FBPropertyBaseAnimatable(const FBPropertyBaseAnimatable< tType, pPT > &pValue)
virtual void SetPropertyValue(tType pValue)
Set the value of the internal property.
class FBPropertyBaseAnimatable< double, kFBPT_double > FBPropertyAnimatableDouble
FBPropertyBaseAnimatableDouble type definition.
class FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
PropertyEvent: Video Frame Rendering Event
class FBPropertyBaseAnimatable< FBColorAndAlpha, kFBPT_ColorRGBA > FBPropertyAnimatableColorAndAlpha
FBPropertyAnimatableColorAndAlpha type definition.
class FBPropertyBaseAnimatable< long long, kFBPT_int64 > FBPropertyAnimatableInt64
FBPropertyAnimatableInt64 type definition.
kDefaultEnum
Patch to use the base enum for casting values .
virtual const char * EnumList(int pIndex) override
Return the string of an enum value.
Connections Basic Open Reality SDK Element.
Convert data to string type for storage.
class FBPropertyBase< FBProperty *, kFBPT_Reference > FBPropertyReference
Property: FBProperty *
class FBPropertyBaseComponent< FBPlug * > FBPropertyPlug
Property: FBPropertyBaseComponent(FBPlug*)
FBPropertyFlag
Available flags for FBProperty objects.
AnimationNodeNotify evaluation information.
class FBPropertyBaseAnimatable< FBTimeCode, kFBPT_TimeCode > FBPropertyAnimatableTimeCode
FBPropertyBaseAnimatableTimeCode type definition.
void operator=(const char *pValue)
Overloaded = operator.
This flag is used to show/hide the property in the propertiview.
class FBPropertyBaseAnimatable< FBVector4d, kFBPT_Vector4D > FBPropertyAnimatableVector4d
FBPropertyAnimatableVector4D type definition.
void * mParent
mParent Parent of the property.
class FBPropertyBase< long long, kFBPT_int64 > FBPropertyInt64
Property: int
FBPropertyBaseComponent()
Constructor.
FBPropertyType
Property types.
~FBPropertyBaseAnimatableEnum()
Destructor.
#define FBClassDeclare(Name, Parent)
Class declaration.
tType ValueType
Property Value Type.
HIObject FBGetFBObject(HIObject pObject, bool pAutoCreate=false)
Get the SDK object from an Internal Object.
PropertyEvent: Global ConnectionDataNotify event.
virtual int Remove(tType pItem)
Remove pItem from the list.
virtual FBPropertyType GetPropertyType() override
Get the property's type.
void operator=(const FBPropertyBase< tType, pPT > &pProperty)
Overloaded = operator.
class FBPropertyBaseAnimatable< FBTime, kFBPT_Time > FBPropertyAnimatableTime
FBPropertyBaseAnimatableTime type definition.
PropertyEvent: Global KeyingNotify event.
~FBPropertyBaseAnimatable()
Destructor.
This is property is connected and slaved by other same type of master property, and it always ask val...
virtual FBPropertyType GetPropertyType() override
Get the property's type.
void(ICallback::* kICallbackHandler)(HIRegister pCaller, HKEventBase pEvent)
class FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
void operator=(tType pValue)
Overloaded = operator.