// File: DDataStd_ObjectCommands.cxx // Created: Thu Jul 15 10:19:40 1999 // Author: Denis PASCAL // #include #include #include #include #include #include #include #include #include #include #include #include // LES ATTRIBUTES #include #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 = " <