File indexing completed on 2025-01-18 10:05:22
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
0048 enum DataTag
0049 {
0050 DataTag_FormatVersion = TObj_Partition::DataTag_Last,
0051 DataTag_Last
0052 };
0053
0054 protected:
0055
0056
0057
0058
0059
0060 Standard_EXPORT TObj_Model ();
0061
0062
0063 Standard_EXPORT ~TObj_Model ();
0064
0065
0066 Standard_EXPORT virtual Standard_Boolean checkDocumentEmpty(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
0170 (const Handle(TObj_Object)& theObject);
0171
0172
0173
0174 Standard_EXPORT Standard_Boolean IsRegisteredName
0175 (const Handle(TCollection_HExtendedString)& theName,
0176 const Handle(TObj_TNameContainer)& theDictionary ) const;
0177
0178
0179
0180 Standard_EXPORT void RegisterName
0181 (const Handle(TCollection_HExtendedString)& theName,
0182 const TDF_Label& theLabel,
0183 const Handle(TObj_TNameContainer)& theDictionary ) const;
0184
0185
0186
0187 Standard_EXPORT void UnRegisterName
0188 (const Handle(TCollection_HExtendedString)& theName,
0189 const Handle(TObj_TNameContainer)& theDictionary ) const;
0190
0191 public:
0192
0193
0194
0195
0196
0197
0198 Standard_EXPORT Standard_Boolean HasOpenCommand() const;
0199
0200
0201 Standard_EXPORT void OpenCommand() const;
0202
0203
0204
0205 Standard_EXPORT void CommitCommand() const;
0206
0207
0208
0209 Standard_EXPORT void AbortCommand() const;
0210
0211
0212 virtual Standard_EXPORT Standard_Boolean IsModified () const;
0213
0214
0215 Standard_EXPORT void SetModified (const Standard_Boolean theModified);
0216
0217 public:
0218
0219
0220
0221
0222
0223 virtual Standard_EXPORT const Handle(TObj_Application) GetApplication();
0224
0225 public:
0226
0227
0228
0229
0230
0231
0232
0233 virtual Standard_EXPORT TCollection_ExtendedString GetFormat() const;
0234
0235
0236 Standard_EXPORT Standard_Integer GetFormatVersion() const;
0237
0238 protected:
0239
0240
0241
0242
0243
0244 Standard_EXPORT void SetFormatVersion(const Standard_Integer theVersion);
0245
0246 public:
0247
0248
0249
0250
0251
0252 virtual Standard_EXPORT Standard_Boolean Update ();
0253
0254 public:
0255
0256
0257
0258
0259
0260 virtual Standard_EXPORT Standard_GUID GetGUID () const;
0261
0262 public:
0263
0264
0265
0266
0267
0268 Standard_EXPORT Handle(TObj_TNameContainer) GetDictionary() const;
0269
0270 protected:
0271
0272
0273
0274
0275
0276 Standard_EXPORT Handle(TObj_Partition) getPartition
0277 (const TDF_Label& theLabel,
0278 const Standard_Boolean theHidden=Standard_False) const;
0279
0280
0281
0282 Standard_EXPORT Handle(TObj_Partition) getPartition
0283 (const TDF_Label& theLabel,
0284 const Standard_Integer theIndex,
0285 const TCollection_ExtendedString& theName,
0286 const Standard_Boolean theHidden=Standard_False) const;
0287
0288
0289
0290 Standard_EXPORT Handle(TObj_Partition) getPartition
0291 (const Standard_Integer theIndex,
0292 const TCollection_ExtendedString& theName,
0293 const Standard_Boolean theHidden=Standard_False) const;
0294
0295 public:
0296
0297
0298 Standard_EXPORT Handle(TDocStd_Document) GetDocument() const;
0299
0300 protected:
0301
0302
0303
0304
0305 Standard_EXPORT TDF_Label GetDataLabel() const;
0306
0307 public:
0308
0309
0310
0311 void SetLabel(const TDF_Label& theLabel) { myLabel = theLabel; }
0312
0313 protected:
0314
0315
0316
0317
0318
0319
0320 virtual Standard_EXPORT Standard_Boolean initNewModel
0321 (const Standard_Boolean IsNew);
0322
0323
0324
0325 virtual Standard_EXPORT void updateBackReferences
0326 (const Handle(TObj_Object)& theObject);
0327
0328
0329
0330
0331 virtual Standard_Boolean isToCheck() const
0332 { return Standard_True; }
0333
0334 public:
0335
0336
0337
0338
0339
0340
0341
0342 virtual Standard_EXPORT Standard_Boolean Paste
0343 (Handle(TObj_Model) theModel,
0344 Handle(TDF_RelocationTable) theRelocTable = 0);
0345
0346
0347 virtual Standard_EXPORT Handle(TObj_Model) NewEmpty() = 0;
0348
0349
0350 Standard_EXPORT void CopyReferences
0351 (const Handle(TObj_Model)& theTarget,
0352 const Handle(TDF_RelocationTable)& theRelocTable);
0353
0354 private:
0355
0356
0357
0358
0359 TDF_Label myLabel;
0360 Handle(Message_Messenger) myMessenger;
0361
0362 public:
0363
0364 DEFINE_STANDARD_RTTIEXT(TObj_Model,Standard_Transient)
0365 };
0366
0367
0368
0369 #endif