File indexing completed on 2026-05-25 08:17:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef TObj_Model_HeaderFile
0019 #define TObj_Model_HeaderFile
0020
0021 #include <Message_Messenger.hxx>
0022 #include <TObj_Partition.hxx>
0023 #include <TCollection_ExtendedString.hxx>
0024
0025 class TObj_TNameContainer;
0026 class TCollection_HExtendedString;
0027 class TDocStd_Document;
0028 class TObj_CheckModel;
0029 class TObj_Application;
0030
0031 class TObj_Model;
0032 DEFINE_STANDARD_HANDLE(TObj_Model, Standard_Transient)
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 class TObj_Model : public Standard_Transient
0043 {
0044 protected:
0045
0046
0047 enum DataTag
0048 {
0049 DataTag_FormatVersion = TObj_Partition::DataTag_Last,
0050 DataTag_Last
0051 };
0052
0053 protected:
0054
0055
0056
0057
0058
0059 Standard_EXPORT TObj_Model();
0060
0061
0062 Standard_EXPORT ~TObj_Model();
0063
0064
0065 Standard_EXPORT virtual Standard_Boolean checkDocumentEmpty(
0066 const TCollection_ExtendedString& theFile);
0067
0068 public:
0069
0070
0071
0072
0073
0074 void SetMessenger(const Handle(Message_Messenger)& theMsgr) { myMessenger = theMsgr; }
0075
0076
0077
0078 Handle(Message_Messenger) Messenger() const { return myMessenger; }
0079
0080 public:
0081
0082
0083
0084
0085
0086
0087 Standard_EXPORT virtual Standard_Boolean Load(const TCollection_ExtendedString& theFile);
0088
0089
0090
0091 Standard_EXPORT virtual Standard_Boolean Load(Standard_IStream& theIStream);
0092
0093
0094 Standard_EXPORT virtual Standard_Boolean SaveAs(const TCollection_ExtendedString& theFile);
0095
0096
0097 Standard_EXPORT virtual Standard_Boolean SaveAs(Standard_OStream& theOStream);
0098
0099
0100 Standard_EXPORT Standard_Boolean Save();
0101
0102 public:
0103
0104
0105
0106
0107
0108 virtual Standard_EXPORT Standard_Boolean Close();
0109
0110
0111 Standard_EXPORT void CloseDocument(const Handle(TDocStd_Document)& theDoc);
0112
0113
0114
0115 static Standard_EXPORT Handle(TObj_Model) GetDocumentModel(const TDF_Label& theLabel);
0116
0117
0118
0119 virtual Standard_EXPORT Handle(TCollection_HExtendedString) GetFile() const;
0120
0121 public:
0122
0123
0124
0125
0126
0127 virtual Standard_EXPORT Handle(TObj_ObjectIterator) GetObjects() const;
0128
0129
0130 virtual Standard_EXPORT Handle(TObj_ObjectIterator) GetChildren() const;
0131
0132
0133 virtual Standard_EXPORT Handle(TObj_Object) FindObject(
0134 const Handle(TCollection_HExtendedString)& theName,
0135 const Handle(TObj_TNameContainer)& theDictionary) const;
0136
0137
0138
0139 virtual Standard_EXPORT Handle(TObj_CheckModel) GetChecker() const;
0140
0141 public:
0142
0143
0144
0145
0146
0147 virtual Standard_EXPORT Handle(TObj_Object) GetRoot() const;
0148
0149
0150 Standard_EXPORT Handle(TObj_Partition) GetMainPartition() const;
0151
0152 public:
0153
0154
0155
0156
0157
0158 TDF_Label GetLabel() const { return myLabel; }
0159
0160 public:
0161
0162
0163
0164
0165
0166 virtual Standard_EXPORT Handle(TCollection_HExtendedString) GetModelName() const;
0167
0168
0169 static Standard_EXPORT void SetNewName(const Handle(TObj_Object)& theObject);
0170
0171
0172
0173 Standard_EXPORT Standard_Boolean
0174 IsRegisteredName(const Handle(TCollection_HExtendedString)& theName,
0175 const Handle(TObj_TNameContainer)& theDictionary) const;
0176
0177
0178
0179 Standard_EXPORT void RegisterName(const Handle(TCollection_HExtendedString)& theName,
0180 const TDF_Label& theLabel,
0181 const Handle(TObj_TNameContainer)& theDictionary) const;
0182
0183
0184
0185 Standard_EXPORT void UnRegisterName(const Handle(TCollection_HExtendedString)& theName,
0186 const Handle(TObj_TNameContainer)& theDictionary) const;
0187
0188 public:
0189
0190
0191
0192
0193
0194
0195 Standard_EXPORT Standard_Boolean HasOpenCommand() const;
0196
0197
0198 Standard_EXPORT void OpenCommand() const;
0199
0200
0201
0202 Standard_EXPORT void CommitCommand() const;
0203
0204
0205
0206 Standard_EXPORT void AbortCommand() const;
0207
0208
0209 virtual Standard_EXPORT Standard_Boolean IsModified() const;
0210
0211
0212 Standard_EXPORT void SetModified(const Standard_Boolean theModified);
0213
0214 public:
0215
0216
0217
0218
0219
0220 virtual Standard_EXPORT const Handle(TObj_Application) GetApplication();
0221
0222 public:
0223
0224
0225
0226
0227
0228
0229
0230 virtual Standard_EXPORT TCollection_ExtendedString GetFormat() const;
0231
0232
0233 Standard_EXPORT Standard_Integer GetFormatVersion() const;
0234
0235 protected:
0236
0237
0238
0239
0240
0241 Standard_EXPORT void SetFormatVersion(const Standard_Integer theVersion);
0242
0243 public:
0244
0245
0246
0247
0248
0249 virtual Standard_EXPORT Standard_Boolean Update();
0250
0251 public:
0252
0253
0254
0255
0256
0257 virtual Standard_EXPORT Standard_GUID GetGUID() const;
0258
0259 public:
0260
0261
0262
0263
0264
0265 Standard_EXPORT Handle(TObj_TNameContainer) GetDictionary() const;
0266
0267 protected:
0268
0269
0270
0271
0272
0273 Standard_EXPORT Handle(TObj_Partition) getPartition(
0274 const TDF_Label& theLabel,
0275 const Standard_Boolean theHidden = Standard_False) const;
0276
0277
0278
0279 Standard_EXPORT Handle(TObj_Partition) getPartition(
0280 const TDF_Label& theLabel,
0281 const Standard_Integer theIndex,
0282 const TCollection_ExtendedString& theName,
0283 const Standard_Boolean theHidden = Standard_False) const;
0284
0285
0286
0287 Standard_EXPORT Handle(TObj_Partition) getPartition(
0288 const Standard_Integer theIndex,
0289 const TCollection_ExtendedString& theName,
0290 const Standard_Boolean theHidden = Standard_False) const;
0291
0292 public:
0293
0294 Standard_EXPORT Handle(TDocStd_Document) GetDocument() const;
0295
0296 protected:
0297
0298
0299
0300
0301 Standard_EXPORT TDF_Label GetDataLabel() const;
0302
0303 public:
0304
0305
0306 void SetLabel(const TDF_Label& theLabel) { myLabel = theLabel; }
0307
0308 protected:
0309
0310
0311
0312
0313
0314 virtual Standard_EXPORT Standard_Boolean initNewModel(const Standard_Boolean IsNew);
0315
0316
0317
0318 virtual Standard_EXPORT void updateBackReferences(const Handle(TObj_Object)& theObject);
0319
0320
0321
0322
0323 virtual Standard_Boolean isToCheck() const { return Standard_True; }
0324
0325 public:
0326
0327
0328
0329
0330
0331
0332
0333 virtual Standard_EXPORT Standard_Boolean Paste(Handle(TObj_Model) theModel,
0334 Handle(TDF_RelocationTable) theRelocTable = 0);
0335
0336
0337 virtual Standard_EXPORT Handle(TObj_Model) NewEmpty() = 0;
0338
0339
0340 Standard_EXPORT void CopyReferences(const Handle(TObj_Model)& theTarget,
0341 const Handle(TDF_RelocationTable)& theRelocTable);
0342
0343 private:
0344
0345
0346
0347
0348 TDF_Label myLabel;
0349 Handle(Message_Messenger) myMessenger;
0350
0351 public:
0352
0353 DEFINE_STANDARD_RTTIEXT(TObj_Model, Standard_Transient)
0354 };
0355
0356
0357
0358 #endif