File indexing completed on 2026-09-26 09:05:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _TDataStd_NamedData_HeaderFile
0017 #define _TDataStd_NamedData_HeaderFile
0018
0019 #include <TDF_Attribute.hxx>
0020 #include <TCollection_ExtendedString.hxx>
0021 #include <NCollection_DataMap.hxx>
0022 #include <Standard_Integer.hxx>
0023 #include <NCollection_Array1.hxx>
0024 #include <NCollection_HArray1.hxx>
0025
0026 class TDataStd_HDataMapOfStringInteger;
0027 class TDataStd_HDataMapOfStringReal;
0028 class TDataStd_HDataMapOfStringString;
0029 class TDataStd_HDataMapOfStringByte;
0030 class TDataStd_HDataMapOfStringHArray1OfInteger;
0031 class TDataStd_HDataMapOfStringHArray1OfReal;
0032 class TCollection_ExtendedString;
0033
0034
0035 class TDataStd_NamedData : public TDF_Attribute
0036 {
0037 public:
0038
0039 Standard_EXPORT static const Standard_GUID& GetID();
0040
0041
0042 Standard_EXPORT static occ::handle<TDataStd_NamedData> Set(const TDF_Label& label);
0043
0044 public:
0045
0046 Standard_EXPORT TDataStd_NamedData();
0047
0048
0049 Standard_EXPORT bool HasIntegers() const;
0050
0051
0052
0053 Standard_EXPORT bool HasInteger(const TCollection_ExtendedString& theName) const;
0054
0055
0056
0057
0058 Standard_EXPORT int GetInteger(const TCollection_ExtendedString& theName);
0059
0060
0061
0062 Standard_EXPORT void SetInteger(const TCollection_ExtendedString& theName, const int theInteger);
0063
0064
0065 Standard_EXPORT const NCollection_DataMap<TCollection_ExtendedString, int>&
0066 GetIntegersContainer();
0067
0068
0069 Standard_EXPORT void ChangeIntegers(
0070 const NCollection_DataMap<TCollection_ExtendedString, int>& theIntegers);
0071
0072
0073 Standard_EXPORT bool HasReals() const;
0074
0075
0076 Standard_EXPORT bool HasReal(const TCollection_ExtendedString& theName) const;
0077
0078
0079
0080
0081 Standard_EXPORT double GetReal(const TCollection_ExtendedString& theName);
0082
0083
0084
0085 Standard_EXPORT void SetReal(const TCollection_ExtendedString& theName, const double theReal);
0086
0087
0088 Standard_EXPORT const NCollection_DataMap<TCollection_ExtendedString, double>&
0089 GetRealsContainer();
0090
0091
0092 Standard_EXPORT void ChangeReals(
0093 const NCollection_DataMap<TCollection_ExtendedString, double>& theReals);
0094
0095
0096 Standard_EXPORT bool HasStrings() const;
0097
0098
0099 Standard_EXPORT bool HasString(const TCollection_ExtendedString& theName) const;
0100
0101
0102
0103
0104 Standard_EXPORT const TCollection_ExtendedString& GetString(
0105 const TCollection_ExtendedString& theName);
0106
0107
0108
0109 Standard_EXPORT void SetString(const TCollection_ExtendedString& theName,
0110 const TCollection_ExtendedString& theString);
0111
0112
0113 Standard_EXPORT const NCollection_DataMap<TCollection_ExtendedString, TCollection_ExtendedString>&
0114 GetStringsContainer();
0115
0116
0117 Standard_EXPORT void ChangeStrings(
0118 const NCollection_DataMap<TCollection_ExtendedString, TCollection_ExtendedString>& theStrings);
0119
0120
0121 Standard_EXPORT bool HasBytes() const;
0122
0123
0124 Standard_EXPORT bool HasByte(const TCollection_ExtendedString& theName) const;
0125
0126
0127
0128
0129 Standard_EXPORT uint8_t GetByte(const TCollection_ExtendedString& theName);
0130
0131
0132
0133 Standard_EXPORT void SetByte(const TCollection_ExtendedString& theName, const uint8_t theByte);
0134
0135
0136 Standard_EXPORT const NCollection_DataMap<TCollection_ExtendedString, uint8_t>&
0137 GetBytesContainer();
0138
0139
0140 Standard_EXPORT void ChangeBytes(
0141 const NCollection_DataMap<TCollection_ExtendedString, uint8_t>& theBytes);
0142
0143
0144 Standard_EXPORT bool HasArraysOfIntegers() const;
0145
0146
0147 Standard_EXPORT bool HasArrayOfIntegers(const TCollection_ExtendedString& theName) const;
0148
0149
0150
0151
0152 Standard_EXPORT const occ::handle<NCollection_HArray1<int>>& GetArrayOfIntegers(
0153 const TCollection_ExtendedString& theName);
0154
0155
0156
0157
0158
0159 void SetArrayOfIntegers(const TCollection_ExtendedString& theName,
0160 const occ::handle<NCollection_HArray1<int>>& theArrayOfIntegers)
0161 {
0162 Backup();
0163 setArrayOfIntegers(theName, theArrayOfIntegers);
0164 }
0165
0166
0167 Standard_EXPORT const NCollection_DataMap<TCollection_ExtendedString,
0168 occ::handle<NCollection_HArray1<int>>>&
0169 GetArraysOfIntegersContainer();
0170
0171
0172 Standard_EXPORT void ChangeArraysOfIntegers(
0173 const NCollection_DataMap<TCollection_ExtendedString, occ::handle<NCollection_HArray1<int>>>&
0174 theArraysOfIntegers);
0175
0176
0177 Standard_EXPORT bool HasArraysOfReals() const;
0178
0179
0180 Standard_EXPORT bool HasArrayOfReals(const TCollection_ExtendedString& theName) const;
0181
0182
0183
0184
0185 Standard_EXPORT const occ::handle<NCollection_HArray1<double>>& GetArrayOfReals(
0186 const TCollection_ExtendedString& theName);
0187
0188
0189
0190
0191
0192 void SetArrayOfReals(const TCollection_ExtendedString& theName,
0193 const occ::handle<NCollection_HArray1<double>>& theArrayOfReals)
0194 {
0195 Backup();
0196 setArrayOfReals(theName, theArrayOfReals);
0197 }
0198
0199
0200 Standard_EXPORT const NCollection_DataMap<TCollection_ExtendedString,
0201 occ::handle<NCollection_HArray1<double>>>&
0202 GetArraysOfRealsContainer();
0203
0204
0205 Standard_EXPORT void ChangeArraysOfReals(
0206 const NCollection_DataMap<TCollection_ExtendedString, occ::handle<NCollection_HArray1<double>>>&
0207 theArraysOfReals);
0208
0209
0210 void Clear()
0211 {
0212 Backup();
0213 clear();
0214 }
0215
0216 public:
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238
0239
0240
0241
0242 virtual bool HasDeferredData() const { return false; }
0243
0244
0245
0246
0247
0248
0249
0250
0251 virtual bool LoadDeferredData(bool theToKeepDeferred = false)
0252 {
0253 (void)theToKeepDeferred;
0254 return false;
0255 }
0256
0257
0258
0259
0260
0261 virtual bool UnloadDeferredData() { return false; }
0262
0263 public:
0264
0265 Standard_EXPORT void clear();
0266
0267
0268 Standard_EXPORT void setInteger(const TCollection_ExtendedString& theName, const int theInteger);
0269
0270
0271 Standard_EXPORT void setReal(const TCollection_ExtendedString& theName, const double theReal);
0272
0273
0274 Standard_EXPORT void setString(const TCollection_ExtendedString& theName,
0275 const TCollection_ExtendedString& theString);
0276
0277
0278 Standard_EXPORT void setByte(const TCollection_ExtendedString& theName, const uint8_t theByte);
0279
0280
0281 Standard_EXPORT void setArrayOfIntegers(
0282 const TCollection_ExtendedString& theName,
0283 const occ::handle<NCollection_HArray1<int>>& theArrayOfIntegers);
0284
0285
0286 Standard_EXPORT void setArrayOfReals(
0287 const TCollection_ExtendedString& theName,
0288 const occ::handle<NCollection_HArray1<double>>& theArrayOfReals);
0289
0290 public:
0291 Standard_EXPORT const Standard_GUID& ID() const override;
0292
0293 Standard_EXPORT void Restore(const occ::handle<TDF_Attribute>& With) override;
0294
0295 Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0296
0297 Standard_EXPORT void Paste(const occ::handle<TDF_Attribute>& Into,
0298 const occ::handle<TDF_RelocationTable>& RT) const override;
0299
0300 Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const override;
0301
0302
0303 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0304
0305 DEFINE_STANDARD_RTTIEXT(TDataStd_NamedData, TDF_Attribute)
0306
0307 protected:
0308 occ::handle<TDataStd_HDataMapOfStringInteger> myIntegers;
0309 occ::handle<TDataStd_HDataMapOfStringReal> myReals;
0310 occ::handle<TDataStd_HDataMapOfStringString> myStrings;
0311 occ::handle<TDataStd_HDataMapOfStringByte> myBytes;
0312 occ::handle<TDataStd_HDataMapOfStringHArray1OfInteger> myArraysOfIntegers;
0313 occ::handle<TDataStd_HDataMapOfStringHArray1OfReal> myArraysOfReals;
0314 };
0315
0316 #endif