CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
TfObject.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef __TF_OBJECT_H__
25#define __TF_OBJECT_H__
26
27#include "TD_PackPush.h"
28
29#include "RxObject.h"
30#include "RxIterator.h"
31#include "TfVariant.h"
32#include "DbStubPtrArray.h"
33#include "Gi/GiDrawable.h"
34
35//DOM-IGNORE-BEGIN
36#define ODTF_CREATE_ATTRIBUTE(Name, value) \
37 result.push_back(::newOdTfAttribute(OD_T(#Name), pObject, value));
38
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) \
44 return result; \
45 }
46
47#define ODTF_CREATE_PROPERTY_NO_ATTRS(PropertyName, type, getterFn, setterFn, \
48 defaultItemFn) \
49 result.push_back(::newOdTfProperty( \
50 OD_T(#PropertyName), pClass, static_cast<OdTfVariant::Type>(type), NULL, \
51 defaultItemFn, getterFn, setterFn));
52
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); \
58 return result; \
59 }
60
61#define ODTF_DECLARE_MEMBERS(ClassName)\
62 ODRX_DECLARE_MEMBERS_GENERIC(OdTfClass, ClassName)
63
64#define ODTF_DEFINE_RTTI_MEMBERS(ClassName, ParentClass) \
65 ODRX_DEFINE_RTTI_MEMBERS_GENERIC(OdTfClass, ClassName, ParentClass)
66
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)))
74
75#define ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, attrsConsFn, propsConsFn, \
76 pseudoConsFn, szClassName) \
77 \
78 ODTF_DEFINE_RTTI_MEMBERS(ClassName, ParentClass) \
79 ODTF_DEFINE_INIT_MEMBERS(ClassName, ParentClass, attrsConsFn, propsConsFn, \
80 pseudoConsFn, szClassName)
81
82#define ODTF_NO_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS(ClassName, ParentClass) \
83 \
84 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, NULL, NULL, \
85 OD_T(#ClassName)) \
86 \
87 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, EMPTY_CONSTR)
88
89#define ODTF_NO_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, \
90 PROPERTIES_LIST) \
91 ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST) \
92 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, \
93 ClassName##propertiesConstructor, NULL, \
94 OD_T(#ClassName)) \
95 \
96 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, EMPTY_CONSTR)
97
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)) \
104 \
105 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
106
107#define ODTF_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, \
108 DOCREATE) \
109 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, NULL, \
110 ClassName::pseudoConstructor, OD_T(#ClassName)) \
111 \
112 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
113
114//DOM-IGNORE-END
115
116class OdTfObject;
117class OdTfClass;
118class OdTfProperty;
119class OdTfAttribute;
120
126 //DOM-IGNORE-BEGIN
128 //DOM-IGNORE-END
129public:
134 virtual OdRxObject* owner() const = 0;
135
143 virtual const OdTfAttribute* find(const OdString& name) const = 0;
144};
145
151
160 //DOM-IGNORE-BEGIN
162 //DOM-IGNORE-END
163public:
164
170
175 virtual OdTfClass* owner() const = 0;
176
181 virtual size_type size() const = 0;
182
188 virtual bool contains(const OdTfProperty* pProp) const = 0;
189
195 virtual const OdTfProperty* find(size_type index) const = 0;
196
204 virtual const OdTfProperty* find(const OdString& name) const = 0;
205
216 virtual const OdTfProperty* find(const OdString& name,
217 const OdTfVariant::Type type) const = 0;
218
224 virtual size_type index(const OdTfProperty* pProp) const = 0;
225
232 virtual bool unique(const OdString& name) const = 0;
233
243 virtual bool unique(const OdString& name,
244 const OdTfVariant::Type type) const = 0;
245
250 virtual OdRxIteratorPtr iterator() const = 0;
251};
252
258
259class OdTfClassImpl;
260
268 //DOM-IGNORE-BEGIN
270 //DOM-IGNORE-END
271protected:
272 OdTfClass(OdTfClassImpl*);
273public:
274
280
286
292
299 virtual OdTfClass* tfParent() const;
300};
301
307
314class ODRX_ABSTRACT TFCORE_EXPORT OdTfProperty : public OdRxObject {
315 //DOM-IGNORE-BEGIN
317 //DOM-IGNORE-END
318public:
319
324 virtual OdTfClass* owner() const = 0;
325
330 virtual OdTfVariant::Type type() const = 0;
331
336 virtual const OdString& name() const = 0;
337
343
352 virtual OdTfVariant defaultItemValue() const = 0;
353
362 virtual OdResult getValue(const OdTfObject* pObject,
363 OdTfVariant& value) const = 0;
364
373 virtual OdResult setValue(OdTfObject* pObject,
374 const OdTfVariant& value) const = 0;
375};
376
382
389class ODRX_ABSTRACT TFCORE_EXPORT OdTfAttribute : public OdRxObject {
390 //DOM-IGNORE-BEGIN
392 //DOM-IGNORE-END
393public:
394
399 virtual OdRxObject* owner() const = 0;
400
405 virtual const OdString& name() const = 0;
406
411 virtual OdTfVariant value() const = 0;
412};
413
419
432 //DOM-IGNORE-BEGIN
434 //DOM-IGNORE-END
435
436public:
437
443
449
454 virtual const OdTfObject* getOwner() const = 0;
455
470 const OdTfProperty* pPI, OdTfVariant& value,
471 const ItemIndexType arrayIndex = -1) const = 0;
472
487 const OdTfProperty* pPI, const OdTfVariant& value,
488 const ItemIndexType arrayIndex = -1) = 0;
489
511 const ItemIndexType arrayIndex = -1,
512 const OdTfClass* pClass = NULL) const = 0;
513
535 const OdTfVariant& value,
536 const ItemIndexType arrayIndex = -1,
537 const OdTfClass* pClass = NULL) = 0;
552 const PropertyIndexType propertyIndex, OdTfVariant& value,
553 const ItemIndexType arrayIndex = -1) const = 0;
554
569 const PropertyIndexType propertyIndex, const OdTfVariant& value,
570 const ItemIndexType arrayIndex = -1) = 0;
571};
572
578
579//
580//
581//
582
588
594
600 OdTfVariant&);
601
607 const OdTfVariant&);
608
614
631 const OdString& name, OdRxClass* pBaseClass,
634 bool bRegister = true);
635
642
660 OdTfClass* pClass, const OdString& name, OdRxClass* pBaseClass,
661 const OdArray<OdTfAttribute*>& attributes,
662 const OdArray<OdTfProperty*>& properties, OdPseudoConstructorType pConstr,
663 bool bRegister = true);
664
680 OdTfVariantConstructorType pDefaultValueConstructor,
682
689
704 OdTfProperty* pProp, const OdString& name, OdTfClass* pOwner,
706 OdTfVariantConstructorType pDefaultValueConstructor,
708
718 OdRxObject* pOwner,
719 const OdTfVariant& value);
720#include "TD_PackPop.h"
721#endif // __TF_OBJECT_H__
OdSmartPtr< OdRxIterator > OdRxIteratorPtr
int OdInt32
#define ODRX_ABSTRACT
OdResult
Definition OdResult.h:29
OdRxObjectPtr(* OdPseudoConstructorType)()
Definition RxObject.h:848
#define ODRX_DECLARE_MEMBERS(ClassName)
Definition RxObject.h:112
#define TFCORE_EXPORT
Definition TfExport.h:34
TFCORE_EXPORT OdTfClass * createOdTfClass()
OdSmartPtr< OdTfAttribute > OdTfAttributePtr
Definition TfObject.h:418
TFCORE_EXPORT OdTfAttribute * newOdTfAttribute(const OdString &name, OdRxObject *pOwner, const OdTfVariant &value)
OdArray< OdTfProperty * >(* OdTfPropertiesConstructorType)(OdTfClass *)
Definition TfObject.h:587
OdSmartPtr< OdTfProperty > OdTfPropertyPtr
Definition TfObject.h:381
OdResult(* OdTfPropertySetterType)(OdTfObject *, const OdTfVariant &)
Definition TfObject.h:606
OdSmartPtr< OdTfAttributesContainer > OdTfAttributesContainerPtr
Definition TfObject.h:150
TFCORE_EXPORT OdTfProperty * initOdTfProperty(OdTfProperty *pProp, const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, const OdArray< OdTfAttribute * > &attributes, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
OdSmartPtr< OdTfClass > OdTfClassPtr
Definition TfObject.h:306
OdSmartPtr< OdTfPropertiesContainer > OdTfPropertiesContainerPtr
Definition TfObject.h:257
#define ODTF_DECLARE_MEMBERS(ClassName)
Definition TfObject.h:61
TFCORE_EXPORT OdTfProperty * createOdTfProperty()
OdArray< OdTfAttribute * >(* OdTfAttributesConstructorType)(OdRxObject *)
Definition TfObject.h:593
OdResult(* OdTfPropertyGetterType)(const OdTfObject *, OdTfVariant &)
Definition TfObject.h:599
TFCORE_EXPORT OdTfProperty * newOdTfProperty(const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, OdTfAttributesConstructorType pAttrsConstr, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
OdTfVariant(* OdTfVariantConstructorType)()
Definition TfObject.h:613
OdSmartPtr< OdTfObject > OdTfObjectPtr
Definition TfObject.h:577
TFCORE_EXPORT OdTfClass * newOdTfClass(const OdString &name, OdRxClass *pBaseClass, OdTfAttributesConstructorType pAttrsConstr, OdTfPropertiesConstructorType pPropsConstr, OdPseudoConstructorType pConstr, bool bRegister=true)
TFCORE_EXPORT OdTfClass * initOdTfClass(OdTfClass *pClass, const OdString &name, OdRxClass *pBaseClass, const OdArray< OdTfAttribute * > &attributes, const OdArray< OdTfProperty * > &properties, OdPseudoConstructorType pConstr, bool bRegister=true)
typename A::size_type size_type
Definition OdArray.h:837
OdRxClass(OdRxClassImpl *)
virtual const OdString & name() const =0
virtual OdTfVariant value() const =0
virtual OdRxObject * owner() const =0
virtual const OdTfAttribute * find(const OdString &name) const =0
virtual OdRxObject * owner() const =0
virtual const OdTfPropertiesContainerPtr allProperties() const
virtual OdTfClass * tfParent() const
virtual const OdTfAttributesContainerPtr attributes() const
OdTfClass(OdTfClassImpl *)
virtual const OdTfPropertiesContainerPtr properties() const
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
OdTfPropertiesContainer::size_type PropertyIndexType
Definition TfObject.h:442
OdTfVariantArray::size_type ItemIndexType
Definition TfObject.h:448
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 OdResult getProperty(const OdString &name, OdTfVariant &value, const ItemIndexType arrayIndex=-1, const OdTfClass *pClass=NULL) const =0
virtual const OdTfProperty * find(const OdString &name) 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(size_type index) const =0
virtual OdTfClass * owner() const =0
virtual const OdTfProperty * find(const OdString &name, const OdTfVariant::Type type) const =0
virtual size_type size() const =0
virtual bool contains(const OdTfProperty *pProp) const =0
virtual bool unique(const OdString &name) const =0
virtual OdTfAttributesContainerPtr attributes() const =0
virtual const OdString & name() const =0
virtual OdTfVariant defaultItemValue() const =0
virtual OdTfClass * owner() const =0
virtual OdResult getValue(const OdTfObject *pObject, OdTfVariant &value) const =0
virtual OdResult setValue(OdTfObject *pObject, const OdTfVariant &value) const =0
virtual OdTfVariant::Type type() const =0
GLuint const GLchar * name
Definition gles2_ext.h:265
GLuint GLsizei GLsizei GLint GLenum * type
Definition gles2_ext.h:274
GLsizei const GLfloat * value
Definition gles2_ext.h:302