CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
RxAttribute.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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-2022 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 _ODRXATTRIBUTE_INCLUDED_
25#define _ODRXATTRIBUTE_INCLUDED_
26
27#include "OdString.h"
28#include "OdArray.h"
29#include "RxValue.h"
30#include "RxProperty.h"
31
32 //DOM-IGNORE-BEGIN
33class OdRxAttributeImpl;
34class OdRxAttributeCollectionImpl;
35class OdRxMember;
37//DOM-IGNORE-END
38
44{
45public:
46 //DOM-IGNORE-BEGIN
48 //DOM-IGNORE-END
49
53 virtual ~OdRxAttribute();
54protected:
55 //DOM-IGNORE-BEGIN
56 OdRxAttribute(OdRxAttributeImpl*);
57 friend class OdRxAttributeImpl;
58 OdRxAttributeImpl* m_pImpl;
59 //DOM-IGNORE-END
60};
61
66
73{
74 //DOM-IGNORE-BEGIN
75 friend class OdRxAttributeCollectionImpl;
76 OdRxAttributeCollectionImpl* m_pImpl;
77 //DOM-IGNORE-END
78public:
83
88
94 int count() const;
95
103 const OdRxAttribute* getAt(int index) const;
104
113
123 const OdRxAttribute* get(const OdRxClass* type) const;
124
135
147 OdResult add(const OdRxAttribute* attribute);
148
159 OdResult override(const OdRxAttribute* attribute);
160
169 OdResult remove(const OdRxAttribute* attribute);
170};
171
178{
179protected:
180
192 virtual OdResult subLoadString(unsigned int id, unsigned int sourceHint, OdString& result) = 0;
193public:
194 //DOM-IGNORE-BEGIN
196 //DOM-IGNORE-END
197
211 static OdResult loadString(const OdRxObject* pClass, unsigned int id, unsigned int sourceHint, OdString& result);
212};
213
214//DOM-IGNORE-BEGIN
215class OdRxLocalizedNameAttributeImpl;
216//DOM-IGNORE-END
217
224{
225public:
226 //DOM-IGNORE-BEGIN
228 //DOM-IGNORE-END
229
239 static OdRxAttributePtr createObject(unsigned int id, unsigned int sourceHint = 0);
240
253
260 unsigned int id() const;
261
268 unsigned int sourceHint() const;
269protected:
270 //DOM-IGNORE-BEGIN
271 OdRxLocalizedNameAttribute(OdRxLocalizedNameAttributeImpl*);
272 //DOM-IGNORE-END
273};
274
275//DOM-IGNORE-BEGIN
276class OdRxAlternateLocalizedNameAttributeImpl;
277//DOM-IGNORE-END
278
285{
286public:
287 //DOM-IGNORE-BEGIN
289 //DOM-IGNORE-END
290
301 static OdRxAttributePtr createObject(unsigned int id, unsigned int sourceHint = 0);
302
303 //DOM-IGNORE-BEGIN
304 OdRxAlternateLocalizedNameAttribute(OdRxAlternateLocalizedNameAttributeImpl* impl);
305 //DOM-IGNORE-END
306};
307
308//DOM-IGNORE-BEGIN
309class OdRxUiPlacementAttributeImpl;
310//DOM-IGNORE-END
311
317{
318public:
319 //DOM-IGNORE-BEGIN
321 OdRxUiPlacementAttribute(OdRxUiPlacementAttributeImpl*);
322 //DOM-IGNORE-END
323
333 static OdRxAttributePtr createObject(const OdString& category, unsigned int weight);
334
343 static OdString getCategory(const OdRxObject* member);
344
353 static float getWeight(const OdRxObject* member);
354};
355
356//DOM-IGNORE-BEGIN
357class OdRxLMVAttributeImpl;
359{
360public:
362 OdRxLMVAttribute(OdRxLMVAttributeImpl*);
363};
364//DOM-IGNORE-END
365
366//DOM-IGNORE-BEGIN
367class OdRxDescriptionAttributeImpl;
368//DOM-IGNORE-END
369
375{
376public:
377 //DOM-IGNORE-BEGIN
379 OdRxDescriptionAttribute(OdRxDescriptionAttributeImpl*);
380 //DOM-IGNORE-END
381
393 static OdRxAttributePtr createObject(const OdString& description, unsigned int id = 0, unsigned int sourceHint = 0);
394
406
413 unsigned int id() const;
414
421 unsigned int sourceHint() const;
422};
423
428typedef OdRxPropertyBasePtr (*FindPropertyCallback)(const OdRxObject* pObject, const OdString& pszPropName);
429
434typedef bool(*ConvertValueCallback)(const OdRxPropertyBase* pProperty, OdRxValue& value);
435
436//DOM-IGNORE-BEGIN
437class OdRxRefersToAttributeImpl;
438//DOM-IGNORE-END
439
447{
448public:
449//DOM-IGNORE-BEGIN
451//DOM-IGNORE-END
452
462
470 OdString path() const;
471
485 static const OdRxPropertyBasePtr parseReference(const OdString& path, const OdRxObject* pObject, FindPropertyCallback find = NULL, ConvertValueCallback convert = NULL);
486protected:
487 //DOM-IGNORE-BEGIN
488 OdRxRefersToAttribute(OdRxRefersToAttributeImpl*);
489 //DOM-IGNORE-END
490};
491
492//DOM-IGNORE-BEGIN
493class OdRxCOMAttributeImpl;
494//DOM-IGNORE-END
495
502{
503public:
504 //DOM-IGNORE-BEGIN
506 //DOM-IGNORE-END
516
523 OdString name() const;
524protected:
525 //DOM-IGNORE-BEGIN
526 OdRxCOMAttribute(OdRxCOMAttributeImpl*);
527 //DOM-IGNORE-END
528};
529
530//DOM-IGNORE-BEGIN
531class OdRxFilePathAttributeImpl;
532//DOM-IGNORE-END
533
539{
540public:
541 //DOM-IGNORE-BEGIN
543protected:
544 OdRxFilePathAttribute(OdRxFilePathAttributeImpl*);
545 //DOM-IGNORE-END
546};
547
548//DOM-IGNORE-BEGIN
549class OdRxFlagsAttributeImpl;
550//DOM-IGNORE-END
551
557{
558public:
559 //DOM-IGNORE-BEGIN
561protected:
562 OdRxFlagsAttribute(OdRxFlagsAttributeImpl*);
563 //DOM-IGNORE-END
564};
565
566//DOM-IGNORE-BEGIN
567class OdRxUnitTypeAttributeImpl;
568//DOM-IGNORE-END
569
576{
577public:
578
583 {
585 kUnitless = 0,
587 kDistance = (0x1 << 0),
589 kAngle = (0x1 << 1),
591 kArea = (0x1 << 2),
593 kVolume = (0x1 << 3),
595 kCurrency = (0x1 << 4),
597 kPercentage = (0x1 << 5),
599 kAngleNotTransformed = (0x1 << 16),
600 };
601
602 //DOM-IGNORE-BEGIN
604 //DOM-IGNORE-END
605
615
623protected:
624 //DOM-IGNORE-BEGIN
625 OdRxUnitTypeAttribute(OdRxUnitTypeAttributeImpl*);
626 //DOM-IGNORE-END
627};
628
629//DOM-IGNORE-BEGIN
630class OdRxUseDialogForReferredCollectionAttributeImpl;
631
636{
637public:
639protected:
640 OdRxUseDialogForReferredCollectionAttribute(OdRxUseDialogForReferredCollectionAttributeImpl*);
641};
642
643class OdRxUiCascadingContextMenuAttributeImpl;
648{
649public:
651protected:
652 OdRxUiCascadingContextMenuAttribute(OdRxUiCascadingContextMenuAttributeImpl*);
653};
654//DOM-IGNORE-END
655
656//DOM-IGNORE-BEGIN
657class OdRxCumulativeAttributeImpl;
658//DOM-IGNORE-END
659
666{
667public:
668 //DOM-IGNORE-BEGIN
670 //DOM-IGNORE-END
671
682
689 OdString type() const;
690protected:
691 //DOM-IGNORE-BEGIN
692 OdRxCumulativeAttribute(OdRxCumulativeAttributeImpl*);
693 //DOM-IGNORE-END
694};
695
696//DOM-IGNORE-BEGIN
697class OdRxAffinityAttributeImpl;
698//DOM-IGNORE-END
699
711{
712public:
713 //DOM-IGNORE-BEGIN
715 //DOM-IGNORE-END
716
727
735 OdString name() const;
736protected:
737 //DOM-IGNORE-BEGIN
738 OdRxAffinityAttribute(OdRxAffinityAttributeImpl*);
739 //DOM-IGNORE-END
740};
741
742//DOM-IGNORE-BEGIN
743class OdRxTypePromotionAttributeImpl;
744//DOM-IGNORE-END
745
752{
753public:
754 //DOM-IGNORE-BEGIN
756 //DOM-IGNORE-END
757
767 static OdRxAttributePtr createObject(const OdString& properties);
768
776protected:
777 //DOM-IGNORE-BEGIN
778 OdRxTypePromotionAttribute(OdRxTypePromotionAttributeImpl*);
779 //DOM-IGNORE-END
780};
781
782//DOM-IGNORE-BEGIN
783class OdRxUnionTypeAttributeImpl;
784//DOM-IGNORE-END
785
792{
793public:
794 //DOM-IGNORE-BEGIN
796 //DOM-IGNORE-END
797
807 static OdRxAttributePtr createObject(const OdString& typenames);
808
816protected:
817 //DOM-IGNORE-BEGIN
818 OdRxUnionTypeAttribute(OdRxUnionTypeAttributeImpl*);
819 //DOM-IGNORE-END
820};
821
822//DOM-IGNORE-BEGIN
823class OdRxDefaultValueAttributeImpl;
824//DOM-IGNORE-END
825
832{
833public:
834 //DOM-IGNORE-BEGIN
836 //DOM-IGNORE-END
837
848
855 const OdRxValue& value() const;
856protected:
857 //DOM-IGNORE-BEGIN
858 OdRxDefaultValueAttribute(OdRxDefaultValueAttributeImpl*);
859 //DOM-IGNORE-END
860};
861
862//DOM-IGNORE-BEGIN
863class OdRxHierarchyLevelAttributeImpl;
864//DOM-IGNORE-END
865
872{
873public:
874 //DOM-IGNORE-BEGIN
876 //DOM-IGNORE-END
877
887
895
903
904 //DOM-IGNORE-BEGIN
905 OdRxHierarchyLevelAttribute(OdRxHierarchyLevelAttributeImpl*);
907 //DOM-IGNORE-END
908};
909
910//DOM-IGNORE-BEGIN
911class OdRxDisplayAsAttributeImpl;
912//DOM-IGNORE-END
913
921{
922public:
923 //DOM-IGNORE-BEGIN
925 //DOM-IGNORE-END
926
936 static OdRxAttributePtr createObject(const OdString& property_name);
937
947
966 virtual OdString getDisplayValue(OdRxValue& value, bool useDynamicProperties = true);
967
968 //DOM-IGNORE-BEGIN
969 OdRxDisplayAsAttribute(OdRxDisplayAsAttributeImpl* pImpl);
971 //DOM-IGNORE-END
972};
973
974//DOM-IGNORE-BEGIN
975class OdRxDynamicAttributeImpl;
976//DOM-IGNORE-END
977
984{
985public:
986 //DOM-IGNORE-BEGIN
988 //DOM-IGNORE-END
989
1000
1008
1015 const OdRxValue& getValue() const;
1016
1024
1025protected:
1026 //DOM-IGNORE-BEGIN
1027 OdRxDynamicAttribute(OdRxDynamicAttributeImpl*);
1028 //DOM-IGNORE-END
1029};
1030
1035
1036//DOM-IGNORE-BEGIN
1037class OdRxDynamicCollectionAttributeImpl;
1038//DOM-IGNORE-END
1039
1045{
1046public:
1047 //DOM-IGNORE-BEGIN
1049 //DOM-IGNORE-END
1056 //static OdRxAttributePtr createObject();
1057
1064 int count() const;
1065
1075
1085
1095 const OdRxDynamicAttribute* getByName(const OdString name, bool caseSensitive) const;
1096
1106 OdRxDynamicAttribute* getByName(const OdString name, bool caseSensitive);
1107
1118
1128
1129protected:
1130 //DOM-IGNORE-BEGIN
1131 OdRxDynamicCollectionAttribute(OdRxDynamicCollectionAttributeImpl*);
1132 //DOM-IGNORE-END
1133};
1134
1139
1140//DOM-IGNORE-BEGIN
1141class OdRxGenerateDynamicPropertiesAttributeImpl;
1142//DOM-IGNORE-END
1143
1148{
1149public:
1150 //DOM-IGNORE-BEGIN
1152 //DOM-IGNORE-END
1153
1158protected:
1159 //DOM-IGNORE-BEGIN
1160 OdRxGenerateDynamicPropertiesAttribute(OdRxGenerateDynamicPropertiesAttributeImpl*);
1161 //DOM-IGNORE-END
1162};
1163
1164#endif
#define ODRX_ABSTRACT
OdResult
Definition: OdResult.h:29
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdSmartPtr< OdRxDynamicAttribute > OdRxDynamicAttributePtr
Definition: RxAttribute.h:1034
OdSmartPtr< OdRxAttribute > OdRxAttributePtr
Definition: RxAttribute.h:65
bool(* ConvertValueCallback)(const OdRxPropertyBase *pProperty, OdRxValue &value)
Definition: RxAttribute.h:434
OdRxPropertyBasePtr(* FindPropertyCallback)(const OdRxObject *pObject, const OdString &pszPropName)
Definition: RxAttribute.h:428
OdSmartPtr< OdRxDynamicCollectionAttribute > OdRxDynamicCollectionAttributePtr
Definition: RxAttribute.h:1138
OdSmartPtr< OdRxPropertyBase > OdRxPropertyBasePtr
Definition: RxProperty.h:79
ODRX_DECLARE_MEMBERS(OdRxAffinityAttribute)
OdRxAffinityAttribute(OdRxAffinityAttributeImpl *)
OdString name() const
static OdRxAttributePtr createObject(const OdString &name)
static OdRxAttributePtr createObject(unsigned int id, unsigned int sourceHint=0)
ODRX_DECLARE_MEMBERS(OdRxAlternateLocalizedNameAttribute)
OdRxAlternateLocalizedNameAttribute(OdRxAlternateLocalizedNameAttributeImpl *impl)
const OdRxAttribute * getAt(int index) const
OdResult remove(const OdRxAttribute *attribute)
const OdRxAttribute * get(const OdRxClass *type) const
OdResult add(const OdRxAttribute *attribute)
OdRxAttribute * getAt(int index)
OdRxAttribute * get(const OdRxClass *type)
ODRX_DECLARE_MEMBERS(OdRxAttribute)
virtual ~OdRxAttribute()
OdRxAttribute(OdRxAttributeImpl *)
OdRxAttributeImpl * m_pImpl
Definition: RxAttribute.h:58
OdString name() const
ODRX_DECLARE_MEMBERS(OdRxCOMAttribute)
OdRxCOMAttribute(OdRxCOMAttributeImpl *)
static OdRxAttributePtr createObject(const OdString &name)
OdRxCumulativeAttribute(OdRxCumulativeAttributeImpl *)
static OdRxAttributePtr createObject(const OdString &type)
ODRX_DECLARE_MEMBERS(OdRxCumulativeAttribute)
OdString type() const
const OdRxValue & value() const
static OdRxAttributePtr createObject(const OdRxValue &value)
OdRxDefaultValueAttribute(OdRxDefaultValueAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxDefaultValueAttribute)
static OdString getDescription(const OdRxObject *pO)
OdRxDescriptionAttribute(OdRxDescriptionAttributeImpl *)
unsigned int sourceHint() const
unsigned int id() const
static OdRxAttributePtr createObject(const OdString &description, unsigned int id=0, unsigned int sourceHint=0)
ODRX_DECLARE_MEMBERS(OdRxDescriptionAttribute)
virtual OdString getDisplayValue(OdRxValue &value, bool useDynamicProperties=true)
static OdRxAttributePtr createObject(const OdString &property_name)
OdRxDisplayAsAttribute(OdRxDisplayAsAttributeImpl *pImpl)
ODRX_DECLARE_MEMBERS(OdRxDisplayAsAttribute)
OdRxDynamicAttribute(OdRxDynamicAttributeImpl *)
OdString getName() const
ODRX_DECLARE_MEMBERS(OdRxDynamicAttribute)
static OdRxAttributePtr createObject(const OdString &name, const OdRxValue &value)
OdRxValue & getValue()
const OdRxValue & getValue() const
ODRX_DECLARE_MEMBERS(OdRxDynamicCollectionAttribute)
const OdRxDynamicAttribute * getByName(const OdString name, bool caseSensitive) const
OdRxDynamicAttribute * getAt(int index)
OdResult add(const OdRxDynamicAttribute *attribute)
OdResult remove(const OdRxDynamicAttribute *attribute)
OdRxDynamicAttribute * getByName(const OdString name, bool caseSensitive)
const OdRxDynamicAttribute * getAt(int index) const
OdRxDynamicCollectionAttribute(OdRxDynamicCollectionAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxFilePathAttribute)
OdRxFilePathAttribute(OdRxFilePathAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxFlagsAttribute)
OdRxFlagsAttribute(OdRxFlagsAttributeImpl *)
OdRxGenerateDynamicPropertiesAttribute(OdRxGenerateDynamicPropertiesAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxGenerateDynamicPropertiesAttribute)
virtual OdString value(OdRxValue &value)
ODRX_DECLARE_MEMBERS(OdRxHierarchyLevelAttribute)
static OdRxAttributePtr createObject(const OdString &value)
OdRxHierarchyLevelAttribute(OdRxHierarchyLevelAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxLMVAttribute)
OdRxLMVAttribute(OdRxLMVAttributeImpl *)
static OdString getLocalizedName(const OdRxObject *pO)
unsigned int sourceHint() const
OdRxLocalizedNameAttribute(OdRxLocalizedNameAttributeImpl *)
unsigned int id() const
static OdRxAttributePtr createObject(unsigned int id, unsigned int sourceHint=0)
ODRX_DECLARE_MEMBERS(OdRxLocalizedNameAttribute)
static const OdRxPropertyBasePtr parseReference(const OdString &path, const OdRxObject *pObject, FindPropertyCallback find=NULL, ConvertValueCallback convert=NULL)
OdString path() const
ODRX_DECLARE_MEMBERS(OdRxRefersToAttribute)
static OdRxAttributePtr createObject(const OdString &path)
OdRxRefersToAttribute(OdRxRefersToAttributeImpl *)
virtual OdResult subLoadString(unsigned int id, unsigned int sourceHint, OdString &result)=0
static OdResult loadString(const OdRxObject *pClass, unsigned int id, unsigned int sourceHint, OdString &result)
ODRX_DECLARE_MEMBERS(OdRxResourceLoader)
OdRxTypePromotionAttribute(OdRxTypePromotionAttributeImpl *)
static OdRxAttributePtr createObject(const OdString &properties)
OdString properties() const
ODRX_DECLARE_MEMBERS(OdRxTypePromotionAttribute)
ODRX_DECLARE_MEMBERS(OdRxUiCascadingContextMenuAttribute)
OdRxUiCascadingContextMenuAttribute(OdRxUiCascadingContextMenuAttributeImpl *)
static float getWeight(const OdRxObject *member)
static OdString getCategory(const OdRxObject *member)
ODRX_DECLARE_MEMBERS(OdRxUiPlacementAttribute)
OdRxUiPlacementAttribute(OdRxUiPlacementAttributeImpl *)
static OdRxAttributePtr createObject(const OdString &category, unsigned int weight)
OdString typenames() const
static OdRxAttributePtr createObject(const OdString &typenames)
OdRxUnionTypeAttribute(OdRxUnionTypeAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxUnionTypeAttribute)
OdRxUnitTypeAttribute(OdRxUnitTypeAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxUnitTypeAttribute)
static OdRxAttributePtr createObject(UnitType unitType)
UnitType unitType() const
ODRX_DECLARE_MEMBERS(OdRxUseDialogForReferredCollectionAttribute)
OdRxUseDialogForReferredCollectionAttribute(OdRxUseDialogForReferredCollectionAttributeImpl *)
GLuint index
Definition: gles2_ext.h:265
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