Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:46:25

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 
0031 //! Provides facilities to manipulate data framework
0032 //! in a Draw-Commands environment.
0033 class DDF 
0034 {
0035 public:
0036 
0037   DEFINE_STANDARD_ALLOC
0038 
0039   
0040   //! Search in draw  directory the framewok  identified
0041   //! by its name <Name>. returns True if found. In that
0042   //! case <DF> is set.
0043   Standard_EXPORT static Standard_Boolean GetDF (Standard_CString& Name, Handle(TDF_Data)& DF, const Standard_Boolean Complain = Standard_True);
0044   
0045   //! Search in <DF>  the label identified by its  entry
0046   //! <Entry>.  returns  <True> if  found. In  that case
0047   //! <Label> is set.
0048   Standard_EXPORT static Standard_Boolean FindLabel (const Handle(TDF_Data)& DF, const Standard_CString Entry, TDF_Label& Label, const Standard_Boolean Complain = Standard_True);
0049   
0050   //! Search in <DF> the  label identified by its entry
0051   //! <Entry>.   if label doesn't  exist, create  and add
0052   //! the Label in <DF>. In that case return True.
0053   Standard_EXPORT static Standard_Boolean AddLabel (const Handle(TDF_Data)& DF, const Standard_CString Entry, TDF_Label& Label);
0054   
0055   //! Search   in <DF> the  attribute  identified by its
0056   //! <ID> and its <entry>.  returns <True> if found. In
0057   //! that case A is set.
0058   Standard_EXPORT static Standard_Boolean Find (const Handle(TDF_Data)& DF, const Standard_CString Entry, const Standard_GUID& ID, Handle(TDF_Attribute)& A, const Standard_Boolean Complain = Standard_True);
0059   
0060   //! Safe variant for arbitrary type of argument
0061   template <class T> 
0062   static Standard_Boolean Find (const Handle(TDF_Data)& DF, const Standard_CString Entry, const Standard_GUID& ID, Handle(T)& A, const Standard_Boolean Complain = Standard_True)
0063   {
0064     Handle(TDF_Attribute) anAttr = A;
0065     return Find (DF, Entry, ID, anAttr, Complain) && ! (A = Handle(T)::DownCast(anAttr)).IsNull();
0066   }
0067 
0068   Standard_EXPORT static Draw_Interpretor& ReturnLabel (Draw_Interpretor& theCommands, const TDF_Label& L);
0069   
0070   Standard_EXPORT static void AllCommands (Draw_Interpretor& theCommands);
0071   
0072   //! Basic commands.
0073   Standard_EXPORT static void BasicCommands (Draw_Interpretor& theCommands);
0074   
0075   //! Data framework commands
0076   //! create, clear & copy.
0077   Standard_EXPORT static void DataCommands (Draw_Interpretor& theCommands);
0078   
0079   //! open commit abort a transaction
0080   //! undo facilities.
0081   Standard_EXPORT static void TransactionCommands (Draw_Interpretor& theCommands);
0082   
0083   //! Browser commands .
0084   Standard_EXPORT static void BrowserCommands (Draw_Interpretor& theCommands);
0085 
0086 };
0087 
0088 #endif // _DDF_HeaderFile