// Created on: 1999-07-15 // Created by: Denis PASCAL // Copyright (c) 1999-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #include #include #include #include #include #include #include #include #include // LES ATTRIBUTES #include #include #include //======================================================================= //function : NewDirectory (DF, entry ) //======================================================================= static Standard_Integer DDataStd_NewDirectory (Draw_Interpretor& di, Standard_Integer nb, const char** arg) { if( nb != 3 ) { di << "Too few arguments" << "\n"; return 1; } Handle(TDF_Data) DF; if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label label; DDF::AddLabel(DF, arg[2], label); TDataStd_Directory::New(label ); return 0; } //======================================================================= //function : AddDirectory (DF, entry ) //======================================================================= static Standard_Integer DDataStd_AddDirectory (Draw_Interpretor& di, Standard_Integer nb, const char** arg) { if( nb != 3 ) { di << "Too few arguments" << "\n"; return 1; } Handle(TDF_Data) DF; if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label label; if( !DDF::FindLabel(DF, arg[2], label) ) { di << "No label for entry" << "\n"; return 1; } Handle(TDataStd_Directory) A; if (TDataStd_Directory::Find(label, A)) { Handle(TDataStd_Directory) Dir = TDataStd_Directory::AddDirectory (A); TCollection_AsciiString entry; TDF_Tool::Entry(Dir->Label(), entry); di << entry.ToCString()<<" "; //return a label to draw return 0; } di << "No Object Attribute on label" << "\n"; return 1; } //======================================================================= //function : MakeObjectLabel (DF, entry ) //======================================================================= static Standard_Integer DDataStd_MakeObjectLabel (Draw_Interpretor& di, Standard_Integer nb, const char** arg) { if( nb != 3 ) { di << "Too few arguments" << "\n"; return 1; } Handle(TDF_Data) DF; if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label label; if( !DDF::FindLabel(DF, arg[2], label) ) { di << "No label for entry" << "\n"; return 1; } Handle(TDataStd_Directory) A; if(TDataStd_Directory::Find(label,A)) { TCollection_AsciiString entry; TDF_Tool::Entry(TDataStd_Directory::MakeObjectLabel(A), entry); di << entry.ToCString()<<" "; //return a label to draw return 0; } di << "No Object Attribute on label" << "\n"; return 1; } //======================================================================= //function : DDataStd_NewNoteBook //purpose : NewNoteBook (DF, entry) //======================================================================= static Standard_Integer DDataStd_NewNoteBook (Draw_Interpretor& di, Standard_Integer nb, const char** arg) { if (nb == 3) { Handle(TDF_Data) DF; if (!DDF::GetDF(arg[1],DF)) return 1; TDF_Label L; DDF::AddLabel(DF, arg[2], L); TDataStd_NoteBook::New(L); return 0; } di << "DDataStd_NewNoteBook : Error\n"; return 1; } //======================================================================= //function : NewShape (DF, entry, [in_shape] ) //======================================================================= static Standard_Integer DDataStd_NewShape (Draw_Interpretor& di, Standard_Integer nb, const char** arg) { //di << "nb = " <