CFx SDK Documentation
2020SP3
|
Go to the documentation of this file.
24 #ifndef __TF_OBJECT_H__
25 #define __TF_OBJECT_H__
36 #define ODTF_CREATE_ATTRIBUTE(Name, value) \
37 reuslt.push_back(::newOdTfAttribute(OD_T(#Name), pObject, value));
39 #define ODTF_DEFINE_ATTRIBUTES_CONSTRUCTOR(Name, ATTRIBUTES_LIST) \
40 static OdArray<OdTfAttribute*> Name##AttributesConstructor( \
41 OdRxObject* pObject) { \
42 OdArray<OdTfAttribute*> result; \
43 ATTRIBUTES_LIST(ODTF_CREATE_ATTRIBUTE) \
47 #define ODTF_CREATE_PROPERTY_NO_ATTRS(PropertyName, type, gettterFn, setterFn, \
49 result.push_back(::newOdTfProperty( \
50 OD_T(#PropertyName), pClass, static_cast<OdTfVariant::Type>(type), NULL, \
51 defaultItemFn, gettterFn, setterFn));
53 #define ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST) \
54 static OdArray<OdTfProperty*> ClassName##propertiesConstructor( \
55 OdTfClass* pClass) { \
56 OdArray<OdTfProperty*> result; \
57 PROPERTIES_LIST(ODTF_CREATE_PROPERTY_NO_ATTRS); \
61 #define ODTF_DECLARE_MEMBERS(ClassName)\
62 ODRX_DECLARE_MEMBERS_GENERIC(OdTfClass, ClassName)
64 #define ODTF_DEFINE_RTTI_MEMBERS(ClassName, ParentClass) \
65 ODRX_DEFINE_RTTI_MEMBERS_GENERIC(OdTfClass, ClassName, ParentClass)
67 #define ODTF_DEFINE_INIT_MEMBERS(ClassName, ParentClass, attrsConsFn, \
68 propsConsFn, pseudoConsFn, szClassName) \
69 ODRX_DEFINE_INIT_MEMBERS_GENERIC( \
70 ClassName, (::newOdTfClass(szClassName, ParentClass::desc(), \
71 attrsConsFn, propsConsFn, pseudoConsFn)), \
72 (::newOdTfClass(szClassName, ParentClass::desc(), attrsConsFn, \
73 propsConsFn, pseudoConsFn)))
75 #define ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, attrsConsFn, propsConsFn, \
76 pseudoConsFn, szClassName) \
78 ODTF_DEFINE_RTTI_MEMBERS(ClassName, ParentClass) \
79 ODTF_DEFINE_INIT_MEMBERS(ClassName, ParentClass, attrsConsFn, propsConsFn, \
80 pseudoConsFn, szClassName)
82 #define ODTF_NO_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS(ClassName, ParentClass) \
84 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, NULL, NULL, \
87 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, EMPTY_CONSTR)
89 #define ODTF_NO_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, \
91 ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST) \
92 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, \
93 ClassName##propertiesConstructor, NULL, \
96 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, EMPTY_CONSTR)
98 #define ODTF_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, \
99 PROPERTIES_LIST, DOCREATE) \
100 ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST) \
101 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, \
102 ClassName##propertiesConstructor, \
103 ClassName::pseudoConstructor, OD_T(#ClassName)) \
105 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
107 #define ODTF_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, \
109 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, NULL, \
110 ClassName::pseudoConstructor, OD_T(#ClassName)) \
112 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
359 bool bRegister =
true);
367 bool bRegister =
true);
387 #endif // __TF_OBJECT_H__
virtual void getPersistentReactors(OdTfPersistentReactorArray &elmIds)=0
virtual OdResult setProperty(const OdTfProperty *pPI, const OdTfVariant &value, const ItemIndexType arrayIndex=-1)=0
OdResult(* OdTfPropertyGetterType)(const OdTfObject *, OdTfVariant &)
OdSmartPtr< OdTfClass > OdTfClassPtr
GLuint const GLchar * name
TFCORE_EXPORT OdTfClass * createOdTfClass()
OdTfPropertiesContainer::size_type PropertyIndexType
virtual void removePersistentReactor(OdTfPersistentReactor *)=0
GLuint GLsizei GLsizei GLint GLenum * type
OdSmartPtr< OdTfAttribute > OdTfAttributePtr
virtual const OdTfProperty * find(const OdString &name, const OdTfVariant::Type type) const =0
virtual void removeReactor(OdTfObjectReactor *pReactor)=0
virtual const OdTfProperty * find(size_type index) const =0
virtual const OdTfPropertiesContainerPtr properties() const =0
OdArray< OdTfAttribute * >(* OdTfAttributesConstructorType)(OdRxObject *)
virtual OdResult getValue(const OdTfObject *pObject, OdTfVariant &value) const =0
OdArray< OdTfProperty * >(* OdTfPropertiesConstructorType)(OdTfClass *)
virtual OdTfClass * owner() const =0
virtual OdString name() const =0
virtual void addPersistentReactor(OdTfPersistentReactor *)=0
virtual bool contains(const OdTfProperty *pProp) const =0
virtual OdTfVariant value() const =0
TFCORE_EXPORT OdTfAttribute * newOdTfAttribute(const OdString &name, OdRxObject *pOwner, const OdTfVariant &value)
virtual OdRxObject * owner() const =0
virtual OdString name() const =0
virtual const OdTfObject * getOwner() const =0
OdSmartPtr< OdTfAttributesContainer > OdTfAttributesContainerPtr
virtual const OdTfProperty * find(const OdString &name) const =0
virtual OdResult setProperty(const OdString &name, const OdTfVariant &value, const ItemIndexType arrayIndex=-1, const OdTfClass *pClass=NULL)=0
virtual OdTfVariant::Type type() const =0
#define ODTF_DECLARE_MEMBERS(ClassName)
TFCORE_EXPORT OdTfClass * initOdTfClass(OdTfClass *pClass, const OdString &name, OdRxClass *pBaseClass, const OdArray< OdTfAttribute * > &attributes, const OdArray< OdTfProperty * > &properties, OdPseudoConstructorType pConstr, bool bRegister=true)
virtual size_type size() const =0
virtual OdResult setProperty(const PropertyIndexType propertyIndex, const OdTfVariant &value, const ItemIndexType arrayIndex=-1)=0
virtual OdResult getProperty(const OdString &name, OdTfVariant &value, const ItemIndexType arrayIndex=-1, const OdTfClass *pClass=NULL) const =0
virtual const OdTfAttributesContainerPtr attributes() const =0
OdSmartPtr< OdTfPropertiesContainer > OdTfPropertiesContainerPtr
virtual size_type index(const OdTfProperty *pProp) const =0
virtual const OdTfPropertiesContainerPtr allProperties() const =0
TFCORE_EXPORT OdTfProperty * createOdTfProperty()
OdSmartPtr< OdTfObject > OdTfObjectPtr
virtual bool hasPersistentReactor(OdTfPersistentReactor *) const =0
OdTfVariant(* OdTfVariantConstructorType)()
virtual OdRxObject * owner() const =0
virtual bool unique(const OdString &name, const OdTfVariant::Type type) const =0
virtual OdTfVariant defaultItemValue() const =0
OdTfVariantArray::size_type ItemIndexType
virtual OdTfClass * tfParent() const =0
virtual void addReactor(OdTfObjectReactor *pReactor)=0
GLsizei const GLfloat * value
virtual bool unique(const OdString &name) const =0
virtual OdTfClass * owner() const =0
virtual OdRxIteratorPtr iterator() const =0
TFCORE_EXPORT OdTfProperty * initOdTfProperty(OdTfProperty *pProp, const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, const OdArray< OdTfAttribute * > &attributes, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
virtual OdTfAttributesContainerPtr attributes() const =0
virtual OdResult getProperty(const PropertyIndexType propertyIndex, OdTfVariant &value, const ItemIndexType arrayIndex=-1) const =0
virtual void getTransientReactors(OdTfObjectReactorArray &reactors)=0
OdSmartPtr< OdTfProperty > OdTfPropertyPtr
OdResult(* OdTfPropertySetterType)(OdTfObject *, const OdTfVariant &)
TFCORE_EXPORT OdTfClass * newOdTfClass(const OdString &name, OdRxClass *pBaseClass, OdTfAttributesConstructorType pAttrsConstr, OdTfPropertiesConstructorType pPropsConstr, OdPseudoConstructorType pConstr, bool bRegister=true)
ODRX_DECLARE_MEMBERS(OdRxClass)
#define ODRX_DECLARE_MEMBERS(ClassName)
virtual OdResult setValue(OdTfObject *pObject, const OdTfVariant &value) const =0
virtual const OdTfAttribute * find(const OdString &name) const =0
TFCORE_EXPORT OdTfProperty * newOdTfProperty(const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, OdTfAttributesConstructorType pAttrsConstr, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
virtual OdResult getProperty(const OdTfProperty *pPI, OdTfVariant &value, const ItemIndexType arrayIndex=-1) const =0
OdRxObjectPtr(* OdPseudoConstructorType)()