1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <IGESData.hxx>
16 #include <IGESData_DefaultSpecific.hxx>
17 #include <IGESData_IGESDumper.hxx>
18 #include <IGESData_SpecificLib.hxx>
19 #include <IGESData_UndefinedEntity.hxx>
20 #include <Interface_Macros.hxx>
21 #include <Interface_UndefinedContent.hxx>
22 #include <Message_Messenger.hxx>
23 #include <Standard_Type.hxx>
24 #include <TCollection_HAsciiString.hxx>
26 IMPLEMENT_STANDARD_RTTIEXT(IGESData_DefaultSpecific,IGESData_SpecificModule)
28 IGESData_DefaultSpecific::IGESData_DefaultSpecific ()
29 { IGESData_SpecificLib::SetGlobal(this, IGESData::Protocol()); }
31 void IGESData_DefaultSpecific::OwnDump
32 (const Standard_Integer /*CN*/, const Handle(IGESData_IGESEntity)& ent,
33 const IGESData_IGESDumper& dumper, Standard_OStream& S,
34 const Standard_Integer /*own*/) const
36 DeclareAndCast(IGESData_UndefinedEntity,lent,ent);
37 if (lent.IsNull()) return;
39 Standard_Integer dstat = lent->DirStatus();
41 S << " -- Directory Entry Error Status = " << dstat << " --\n";
42 Handle(Interface_UndefinedContent) cont = lent->UndefinedContent();
43 Standard_Integer nb = cont->NbParams();
44 S << " UNDEFINED ENTITY ...\n"<<nb
45 <<" Parameters (WARNING : Odd Integer Values Interpreted as Entities)\n";
46 for (Standard_Integer i = 1; i <= nb; i ++) {
47 Interface_ParamType ptyp = cont->ParamType(i);
48 if (ptyp == Interface_ParamVoid) S <<" ["<<i<<":Void]";
49 else if (cont->IsParamEntity(i)) {
50 DeclareAndCast(IGESData_IGESEntity,anent,cont->ParamEntity(i));
51 S <<" ["<<i<<":IGES]=";
52 dumper.PrintDNum(anent,S);
54 else { S <<" ["<<i<<"]=" << cont->ParamValue(i)->String(); }
55 if ( i == (i%5)*5) S << "\n";