File indexing completed on 2026-09-20 09:19:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef TObj_Application_HeaderFile
0019 #define TObj_Application_HeaderFile
0020
0021 #include <TDocStd_Application.hxx>
0022 #include <Message_Gravity.hxx>
0023 #include <Message_Messenger.hxx>
0024
0025
0026
0027
0028
0029 class TObj_Application : public TDocStd_Application
0030 {
0031 public:
0032
0033 Standard_EXPORT static occ::handle<TObj_Application> GetInstance();
0034
0035
0036 occ::handle<Message_Messenger>& Messenger() { return myMessenger; }
0037
0038 public:
0039
0040
0041
0042
0043
0044 Standard_EXPORT virtual bool SaveDocument(const occ::handle<TDocStd_Document>& theSourceDoc,
0045 const TCollection_ExtendedString& theTargetFile);
0046
0047
0048 Standard_EXPORT virtual bool SaveDocument(const occ::handle<TDocStd_Document>& theSourceDoc,
0049 Standard_OStream& theOStream);
0050
0051
0052 Standard_EXPORT virtual bool LoadDocument(const TCollection_ExtendedString& theSourceFile,
0053 occ::handle<TDocStd_Document>& theTargetDoc);
0054
0055
0056 Standard_EXPORT virtual bool LoadDocument(Standard_IStream& theIStream,
0057 occ::handle<TDocStd_Document>& theTargetDoc);
0058
0059
0060 virtual Standard_EXPORT bool CreateNewDocument(occ::handle<TDocStd_Document>& theDoc,
0061 const TCollection_ExtendedString& theFormat);
0062
0063
0064
0065 virtual Standard_EXPORT void ErrorMessage(const TCollection_ExtendedString& theMsg,
0066 const Message_Gravity theLevel);
0067
0068
0069
0070 virtual void ErrorMessage(const TCollection_ExtendedString& theMsg)
0071 {
0072 ErrorMessage(theMsg, Message_Alarm);
0073 }
0074
0075
0076
0077 void SetVerbose(const bool isVerbose) { myIsVerbose = isVerbose; }
0078
0079
0080 bool IsVerbose() const { return myIsVerbose; }
0081
0082
0083 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const;
0084
0085 public:
0086
0087
0088
0089
0090
0091 Standard_EXPORT const char* ResourcesName() override;
0092
0093 protected:
0094
0095
0096
0097
0098
0099
0100 Standard_EXPORT TObj_Application();
0101
0102
0103 void SetError(const PCDM_StoreStatus theStatus, const TCollection_ExtendedString& theInfo);
0104
0105
0106 void SetError(const PCDM_ReaderStatus theStatus, const TCollection_ExtendedString& theInfo);
0107
0108 private:
0109
0110
0111
0112
0113 bool myIsError;
0114 bool myIsVerbose;
0115 occ::handle<Message_Messenger> myMessenger;
0116
0117 public:
0118
0119 DEFINE_STANDARD_RTTIEXT(TObj_Application, TDocStd_Application)
0120 };
0121
0122
0123 #endif