File indexing completed on 2026-09-12 09:19:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _TDF_RelocationTable_HeaderFile
0017 #define _TDF_RelocationTable_HeaderFile
0018
0019 #include <Standard.hxx>
0020
0021 #include <TDF_Label.hxx>
0022 #include <NCollection_DataMap.hxx>
0023 #include <TDF_Attribute.hxx>
0024 #include <Standard_Transient.hxx>
0025 #include <NCollection_IndexedDataMap.hxx>
0026 #include <NCollection_Map.hxx>
0027 #include <Standard_Handle.hxx>
0028 #include <Standard_OStream.hxx>
0029 class TDF_Label;
0030 class TDF_Attribute;
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 class TDF_RelocationTable : public Standard_Transient
0045 {
0046
0047 public:
0048
0049
0050
0051 Standard_EXPORT TDF_RelocationTable(const bool selfRelocate = false);
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 Standard_EXPORT void SelfRelocate(const bool selfRelocate);
0070
0071
0072 Standard_EXPORT bool SelfRelocate() const;
0073
0074 Standard_EXPORT void AfterRelocate(const bool afterRelocate);
0075
0076
0077 Standard_EXPORT bool AfterRelocate() const;
0078
0079
0080
0081 Standard_EXPORT void SetRelocation(const TDF_Label& aSourceLabel, const TDF_Label& aTargetLabel);
0082
0083
0084
0085
0086
0087
0088 Standard_EXPORT bool HasRelocation(const TDF_Label& aSourceLabel, TDF_Label& aTargetLabel) const;
0089
0090
0091
0092 Standard_EXPORT void SetRelocation(const occ::handle<TDF_Attribute>& aSourceAttribute,
0093 const occ::handle<TDF_Attribute>& aTargetAttribute);
0094
0095
0096
0097
0098
0099
0100 Standard_EXPORT bool HasRelocation(const occ::handle<TDF_Attribute>& aSourceAttribute,
0101 occ::handle<TDF_Attribute>& aTargetAttribute) const;
0102
0103
0104 template <class T>
0105 bool HasRelocation(const occ::handle<TDF_Attribute>& theSource, occ::handle<T>& theTarget) const
0106 {
0107 occ::handle<TDF_Attribute> anAttr = theTarget;
0108 return HasRelocation(theSource, anAttr) && !(theTarget = occ::down_cast<T>(anAttr)).IsNull();
0109 }
0110
0111
0112
0113 Standard_EXPORT void SetTransientRelocation(
0114 const occ::handle<Standard_Transient>& aSourceTransient,
0115 const occ::handle<Standard_Transient>& aTargetTransient);
0116
0117
0118
0119
0120
0121
0122 Standard_EXPORT bool HasTransientRelocation(
0123 const occ::handle<Standard_Transient>& aSourceTransient,
0124 occ::handle<Standard_Transient>& aTargetTransient) const;
0125
0126
0127
0128 Standard_EXPORT void Clear();
0129
0130
0131
0132 Standard_EXPORT void TargetLabelMap(NCollection_Map<TDF_Label>& aLabelMap) const;
0133
0134
0135
0136
0137 Standard_EXPORT void TargetAttributeMap(
0138 NCollection_Map<occ::handle<TDF_Attribute>>& anAttributeMap) const;
0139
0140
0141 Standard_EXPORT NCollection_DataMap<TDF_Label, TDF_Label>& LabelTable();
0142
0143
0144 Standard_EXPORT NCollection_DataMap<occ::handle<TDF_Attribute>, occ::handle<TDF_Attribute>>&
0145 AttributeTable();
0146
0147
0148 Standard_EXPORT NCollection_IndexedDataMap<occ::handle<Standard_Transient>,
0149 occ::handle<Standard_Transient>>&
0150 TransientTable();
0151
0152
0153 Standard_EXPORT Standard_OStream& Dump(const bool dumpLabels,
0154 const bool dumpAttributes,
0155 const bool dumpTransients,
0156 Standard_OStream& anOS) const;
0157
0158 DEFINE_STANDARD_RTTIEXT(TDF_RelocationTable, Standard_Transient)
0159
0160 private:
0161 bool mySelfRelocate;
0162 bool myAfterRelocate;
0163 NCollection_DataMap<TDF_Label, TDF_Label> myLabelTable;
0164 NCollection_DataMap<occ::handle<TDF_Attribute>, occ::handle<TDF_Attribute>> myAttributeTable;
0165 NCollection_IndexedDataMap<occ::handle<Standard_Transient>, occ::handle<Standard_Transient>>
0166 myTransientTable;
0167 };
0168
0169 #endif