Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:27:36

0001 // Created by: DAUTRY Philippe
0002 // Copyright (c) 1997-1999 Matra Datavision
0003 // Copyright (c) 1999-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 _DDF_HeaderFile
0017 #define _DDF_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 TDF_Data;
0026 class TDF_Label;
0027 class Standard_GUID;
0028 class TDF_Attribute;
0029 
0030 //! Provides facilities to manipulate data framework
0031 //! in a Draw-Commands environment.
0032 class DDF
0033 {
0034 public:
0035   DEFINE_STANDARD_ALLOC
0036 
0037   //! Search in draw directory the framewok identified
0038   //! by its name <Name>. returns True if found. In that
0039   //! case <DF> is set.
0040   Standard_EXPORT static bool GetDF(const char*&           Name,
0041                                     occ::handle<TDF_Data>& DF,
0042                                     const bool             Complain = true);
0043 
0044   //! Search in <DF> the label identified by its entry
0045   //! <Entry>. returns <True> if found. In that case
0046   //! <Label> is set.
0047   Standard_EXPORT static bool FindLabel(const occ::handle<TDF_Data>& DF,
0048                                         const char* const            Entry,
0049                                         TDF_Label&                   Label,
0050                                         const bool                   Complain = true);
0051 
0052   //! Search in <DF> the label identified by its entry
0053   //! <Entry>. if label doesn't exist, create and add
0054   //! the Label in <DF>. In that case return True.
0055   Standard_EXPORT static bool AddLabel(const occ::handle<TDF_Data>& DF,
0056                                        const char* const            Entry,
0057                                        TDF_Label&                   Label);
0058 
0059   //! Search in <DF> the attribute identified by its
0060   //! <ID> and its <entry>. returns <True> if found. In
0061   //! that case A is set.
0062   Standard_EXPORT static bool Find(const occ::handle<TDF_Data>& DF,
0063                                    const char* const            Entry,
0064                                    const Standard_GUID&         ID,
0065                                    occ::handle<TDF_Attribute>&  A,
0066                                    const bool                   Complain = true);
0067 
0068   //! Safe variant for arbitrary type of argument
0069   template <class T>
0070   static bool Find(const occ::handle<TDF_Data>& DF,
0071                    const char* const            Entry,
0072                    const Standard_GUID&         ID,
0073                    occ::handle<T>&              A,
0074                    const bool                   Complain = true)
0075   {
0076     occ::handle<TDF_Attribute> anAttr = A;
0077     return Find(DF, Entry, ID, anAttr, Complain) && !(A = occ::down_cast<T>(anAttr)).IsNull();
0078   }
0079 
0080   Standard_EXPORT static Draw_Interpretor& ReturnLabel(Draw_Interpretor& theCommands,
0081                                                        const TDF_Label&  L);
0082 
0083   Standard_EXPORT static void AllCommands(Draw_Interpretor& theCommands);
0084 
0085   //! Basic commands.
0086   Standard_EXPORT static void BasicCommands(Draw_Interpretor& theCommands);
0087 
0088   //! Data framework commands
0089   //! create, clear & copy.
0090   Standard_EXPORT static void DataCommands(Draw_Interpretor& theCommands);
0091 
0092   //! open commit abort a transaction
0093   //! undo facilities.
0094   Standard_EXPORT static void TransactionCommands(Draw_Interpretor& theCommands);
0095 
0096   //! Browser commands .
0097   Standard_EXPORT static void BrowserCommands(Draw_Interpretor& theCommands);
0098 };
0099 
0100 #endif // _DDF_HeaderFile