1 // Created on: 2000-03-01
2 // Created by: Denis PASCAL
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _DDocStd_HeaderFile
17 #define _DDocStd_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <Standard_Boolean.hxx>
24 #include <Standard_CString.hxx>
25 #include <Draw_Interpretor.hxx>
26 class TDocStd_Application;
27 class TDocStd_Document;
31 class DDocStd_DrawDocument;
34 //! This package provides Draw services to test CAF
35 //! standard documents (see TDocStd package)
39 //! * Modification registration and Update management.
41 //! * External references mechanism
45 //! * Document Creation, Save and Restore
53 //! Returns the global instance of application.
54 Standard_EXPORT static const Handle(TDocStd_Application)& GetApplication ();
56 Standard_EXPORT static Standard_Boolean GetDocument (Standard_CString& Name, Handle(TDocStd_Document)& Doc, const Standard_Boolean Complain = Standard_True);
58 Standard_EXPORT static Standard_Boolean Find (const Handle(TDocStd_Document)& Document, const Standard_CString Entry, TDF_Label& Label, const Standard_Boolean Complain = Standard_True);
60 Standard_EXPORT static Standard_Boolean Find (const Handle(TDocStd_Document)& Document, const Standard_CString Entry, const Standard_GUID& ID, Handle(TDF_Attribute)& A, const Standard_Boolean Complain = Standard_True);
62 //! Safe variant for arbitrary type of argument
64 static Standard_Boolean Find (const Handle(TDocStd_Document)& Document, const Standard_CString Entry, const Standard_GUID& ID, Handle(T)& A, const Standard_Boolean Complain = Standard_True)
66 Handle(TDF_Attribute) anAttr = A;
67 return Find (Document, Entry, ID, anAttr, Complain) && ! (A = Handle(T)::DownCast(anAttr)).IsNull();
70 Standard_EXPORT static Draw_Interpretor& ReturnLabel (Draw_Interpretor& theCommands, const TDF_Label& L);
72 Standard_EXPORT static void AllCommands (Draw_Interpretor& theCommands);
74 //! NewDocument, Open, SaveAs, Save
75 Standard_EXPORT static void ApplicationCommands (Draw_Interpretor& theCommands);
77 //! Undo, Redo, SetModified, Propagate
78 Standard_EXPORT static void DocumentCommands (Draw_Interpretor& theCommands);
81 Standard_EXPORT static void ToolsCommands (Draw_Interpretor& theCommands);
83 //! Create, Add, Remove, Open, Commit, Undo, Redo, SetNestedMode
84 Standard_EXPORT static void MTMCommands (Draw_Interpretor& theCommands);
100 friend class DDocStd_DrawDocument;
110 #endif // _DDocStd_HeaderFile