Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:16:59

0001 // Created on: 2000-03-01
0002 // Created by: Denis PASCAL
0003 // Copyright (c) 2000-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _DDocStd_HeaderFile
0017 #define _DDocStd_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <Standard_Boolean.hxx>
0024 #include <Draw_Interpretor.hxx>
0025 class TDocStd_Application;
0026 class TDocStd_Document;
0027 class TDF_Label;
0028 class Standard_GUID;
0029 class TDF_Attribute;
0030 
0031 //! This package provides Draw services to test CAF
0032 //! standard documents (see TDocStd package)
0033 //!
0034 //! It provides :
0035 //!
0036 //! * Modification registration and Update management.
0037 //!
0038 //! * External references mechanism
0039 //!
0040 //! * UNDO/REDO
0041 //!
0042 //! * Document Creation, Save and Restore
0043 class DDocStd
0044 {
0045 public:
0046   DEFINE_STANDARD_ALLOC
0047 
0048   //! Returns the global instance of application.
0049   Standard_EXPORT static const occ::handle<TDocStd_Application>& GetApplication();
0050 
0051   Standard_EXPORT static bool GetDocument(const char*&                   Name,
0052                                           occ::handle<TDocStd_Document>& Doc,
0053                                           const bool                     Complain = true);
0054 
0055   Standard_EXPORT static bool Find(const occ::handle<TDocStd_Document>& Document,
0056                                    const char* const                    Entry,
0057                                    TDF_Label&                           Label,
0058                                    const bool                           Complain = true);
0059 
0060   Standard_EXPORT static bool Find(const occ::handle<TDocStd_Document>& Document,
0061                                    const char* const                    Entry,
0062                                    const Standard_GUID&                 ID,
0063                                    occ::handle<TDF_Attribute>&          A,
0064                                    const bool                           Complain = true);
0065 
0066   //! Safe variant for arbitrary type of argument
0067   template <class T>
0068   static bool Find(const occ::handle<TDocStd_Document>& Document,
0069                    const char* const                    Entry,
0070                    const Standard_GUID&                 ID,
0071                    occ::handle<T>&                      A,
0072                    const bool                           Complain = true)
0073   {
0074     occ::handle<TDF_Attribute> anAttr = A;
0075     return Find(Document, Entry, ID, anAttr, Complain) && !(A = occ::down_cast<T>(anAttr)).IsNull();
0076   }
0077 
0078   Standard_EXPORT static Draw_Interpretor& ReturnLabel(Draw_Interpretor& theCommands,
0079                                                        const TDF_Label&  L);
0080 
0081   Standard_EXPORT static void AllCommands(Draw_Interpretor& theCommands);
0082 
0083   //! NewDocument, Open, SaveAs, Save
0084   Standard_EXPORT static void ApplicationCommands(Draw_Interpretor& theCommands);
0085 
0086   //! Undo, Redo, SetModified, Propagate
0087   Standard_EXPORT static void DocumentCommands(Draw_Interpretor& theCommands);
0088 
0089   //! Modified, Update
0090   Standard_EXPORT static void ToolsCommands(Draw_Interpretor& theCommands);
0091 
0092   //! Create, Add, Remove, Open, Commit, Undo, Redo, SetNestedMode
0093   Standard_EXPORT static void MTMCommands(Draw_Interpretor& theCommands);
0094 
0095   //! ShapeSchema_Read
0096   Standard_EXPORT static void ShapeSchemaCommands(Draw_Interpretor& theCommands);
0097 };
0098 
0099 #endif // _DDocStd_HeaderFile