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);
OdRxObjectPtr(* OdPseudoConstructorType)()
#define ODRX_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)
OdSmartPtr< OdTfAttribute > OdTfAttributePtr
OdSmartPtr< OdTfProperty > OdTfPropertyPtr
OdResult(* OdTfPropertySetterType)(OdTfObject *, const OdTfVariant &)
OdSmartPtr< OdTfAttributesContainer > OdTfAttributesContainerPtr
TFCORE_EXPORT OdTfProperty * createOdTfProperty()
TFCORE_EXPORT OdTfProperty * newOdTfProperty(const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, OdTfAttributesConstructorType pAttrsConstr, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
TFCORE_EXPORT OdTfClass * newOdTfClass(const OdString &name, OdRxClass *pBaseClass, OdTfAttributesConstructorType pAttrsConstr, OdTfPropertiesConstructorType pPropsConstr, OdPseudoConstructorType pConstr, bool bRegister=true)
TFCORE_EXPORT OdTfProperty * initOdTfProperty(OdTfProperty *pProp, const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, const OdArray< OdTfAttribute * > &attributes, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
OdArray< OdTfProperty * >(* OdTfPropertiesConstructorType)(OdTfClass *)
OdSmartPtr< OdTfClass > OdTfClassPtr
TFCORE_EXPORT OdTfClass * createOdTfClass()
OdSmartPtr< OdTfPropertiesContainer > OdTfPropertiesContainerPtr
#define ODTF_DECLARE_MEMBERS(ClassName)
OdResult(* OdTfPropertyGetterType)(const OdTfObject *, OdTfVariant &)
TFCORE_EXPORT OdTfAttribute * newOdTfAttribute(const OdString &name, OdRxObject *pOwner, const OdTfVariant &value)
OdTfVariant(* OdTfVariantConstructorType)()
OdSmartPtr< OdTfObject > OdTfObjectPtr
OdArray< OdTfAttribute * >(* OdTfAttributesConstructorType)(OdRxObject *)
virtual OdString name() const =0
virtual OdRxObject * owner() const =0
virtual OdTfVariant value() const =0
virtual const OdTfAttribute * find(const OdString &name) const =0
virtual OdRxObject * owner() const =0
virtual const OdTfPropertiesContainerPtr properties() const =0
virtual OdTfClass * tfParent() const =0
virtual const OdTfAttributesContainerPtr attributes() const =0
virtual const OdTfPropertiesContainerPtr allProperties() const =0
virtual bool hasPersistentReactor(OdTfPersistentReactor *) const =0
virtual OdResult setProperty(const OdString &name, const OdTfVariant &value, const ItemIndexType arrayIndex=-1, const OdTfClass *pClass=NULL)=0
virtual OdResult setProperty(const OdTfProperty *pPI, const OdTfVariant &value, const ItemIndexType arrayIndex=-1)=0
virtual OdResult getProperty(const PropertyIndexType propertyIndex, OdTfVariant &value, const ItemIndexType arrayIndex=-1) const =0
virtual void removePersistentReactor(OdTfPersistentReactor *)=0
virtual void removeReactor(OdTfObjectReactor *pReactor)=0
virtual void getPersistentReactors(OdTfPersistentReactorArray &elmIds)=0
OdTfPropertiesContainer::size_type PropertyIndexType
OdTfVariantArray::size_type ItemIndexType
virtual OdResult setProperty(const PropertyIndexType propertyIndex, const OdTfVariant &value, const ItemIndexType arrayIndex=-1)=0
virtual OdResult getProperty(const OdTfProperty *pPI, OdTfVariant &value, const ItemIndexType arrayIndex=-1) const =0
virtual const OdTfObject * getOwner() const =0
virtual void addReactor(OdTfObjectReactor *pReactor)=0
virtual void getTransientReactors(OdTfObjectReactorArray &reactors)=0
virtual OdResult getProperty(const OdString &name, OdTfVariant &value, const ItemIndexType arrayIndex=-1, const OdTfClass *pClass=NULL) const =0
virtual void addPersistentReactor(OdTfPersistentReactor *)=0
virtual const OdTfProperty * find(size_type index) const =0
virtual OdRxIteratorPtr iterator() const =0
virtual bool unique(const OdString &name, const OdTfVariant::Type type) const =0
virtual size_type index(const OdTfProperty *pProp) const =0
virtual const OdTfProperty * find(const OdString &name) const =0
virtual size_type size() const =0
virtual bool contains(const OdTfProperty *pProp) const =0
virtual OdTfClass * owner() const =0
virtual const OdTfProperty * find(const OdString &name, const OdTfVariant::Type type) const =0
virtual bool unique(const OdString &name) const =0
virtual OdTfAttributesContainerPtr attributes() const =0
virtual OdTfVariant defaultItemValue() const =0
virtual OdString name() const =0
virtual OdResult getValue(const OdTfObject *pObject, OdTfVariant &value) const =0
virtual OdTfClass * owner() const =0
virtual OdResult setValue(OdTfObject *pObject, const OdTfVariant &value) const =0
virtual OdTfVariant::Type type() const =0
GLuint const GLchar * name
GLuint GLsizei GLsizei GLint GLenum * type
GLsizei const GLfloat * value