File indexing completed on 2025-01-18 10:05:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _StdPersistent_Naming_HeaderFile
0016 #define _StdPersistent_Naming_HeaderFile
0017
0018 #include <StdObjMgt_Attribute.hxx>
0019 #include <StdObjMgt_Persistent.hxx>
0020 #include <StdPersistent_HArray1.hxx>
0021 #include <StdLPersistent_HArray1.hxx>
0022 #include <StdLPersistent_HString.hxx>
0023
0024 #include <TNaming_Naming.hxx>
0025
0026 class TNaming_Name;
0027
0028
0029 class StdPersistent_Naming
0030 {
0031 public:
0032 class NamedShape : public StdObjMgt_Attribute<TNaming_NamedShape>
0033 {
0034 public:
0035
0036 inline void Read (StdObjMgt_ReadData& theReadData)
0037 { theReadData >> myOldShapes >> myNewShapes >> myShapeStatus >> myVersion; }
0038
0039 inline void Write (StdObjMgt_WriteData& theWriteData) const
0040 { theWriteData << myOldShapes << myNewShapes << myShapeStatus << myVersion; }
0041
0042 inline void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const
0043 {
0044 if (!myOldShapes.IsNull()) theChildren.Append(myOldShapes);
0045 if (!myNewShapes.IsNull()) theChildren.Append(myNewShapes);
0046 }
0047
0048 inline Standard_CString PName() const { return "PNaming_NamedShape"; }
0049
0050
0051 void Import (const Handle(TNaming_NamedShape)& theAttribute) const;
0052
0053 private:
0054 Handle(StdPersistent_HArray1::Shape1) myOldShapes;
0055 Handle(StdPersistent_HArray1::Shape1) myNewShapes;
0056 Standard_Integer myShapeStatus;
0057 Standard_Integer myVersion;
0058 };
0059
0060 class Name : public StdObjMgt_Persistent
0061 {
0062 public:
0063
0064 Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData);
0065
0066 Standard_EXPORT virtual void Write (StdObjMgt_WriteData& theWriteData) const;
0067
0068 inline void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const
0069 {
0070 if (!myArgs.IsNull()) theChildren.Append(myArgs);
0071 if (!myStop.IsNull()) theChildren.Append(myStop);
0072 }
0073
0074 inline Standard_CString PName() const { return "PNaming_Name"; }
0075
0076
0077 Standard_EXPORT virtual void Import
0078 (TNaming_Name& theName, const Handle(TDF_Data)& theDF) const;
0079
0080 private:
0081 Standard_Integer myType;
0082 Standard_Integer myShapeType;
0083 Handle(StdLPersistent_HArray1::Persistent) myArgs;
0084 Handle(StdObjMgt_Persistent) myStop;
0085 Standard_Integer myIndex;
0086 };
0087
0088 class Name_1 : public Name
0089 {
0090 public:
0091
0092 Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData);
0093
0094 Standard_EXPORT virtual void Write (StdObjMgt_WriteData& theWriteData) const;
0095
0096 inline void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const
0097 {
0098 Name::PChildren(theChildren);
0099 if (!myContextLabel.IsNull()) theChildren.Append(myContextLabel);
0100 }
0101
0102 inline Standard_CString PName() const { return "PNaming_Name_1"; }
0103
0104
0105 Standard_EXPORT virtual void Import
0106 (TNaming_Name& theName, const Handle(TDF_Data)& theDF) const;
0107
0108 private:
0109 Handle(StdLPersistent_HString::Ascii) myContextLabel;
0110 };
0111
0112 class Name_2 : public Name_1
0113 {
0114 public:
0115
0116 Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData);
0117
0118 Standard_EXPORT virtual void Write (StdObjMgt_WriteData& theWriteData) const;
0119
0120 inline void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const
0121 { Name_1::PChildren(theChildren); }
0122
0123 inline Standard_CString PName() const { return "PNaming_Name_2"; }
0124
0125
0126 Standard_EXPORT virtual void Import
0127 (TNaming_Name& theName, const Handle(TDF_Data)& theDF) const;
0128
0129 private:
0130 Standard_Integer myOrientation;
0131 };
0132
0133 class Naming : public StdObjMgt_Attribute<TNaming_Naming>::SingleRef
0134 {
0135 public:
0136
0137 Standard_EXPORT virtual void ImportAttribute();
0138 };
0139
0140 class Naming_1 : public Naming
0141 {
0142 public:
0143
0144 Standard_EXPORT virtual void ImportAttribute();
0145 };
0146
0147 typedef Naming Naming_2;
0148 };
0149
0150 #endif