0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / IGESData / IGESData_DefaultSpecific.cxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 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
973c2be1 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.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
42cf5bc1 14
7fd59977 15#include <IGESData.hxx>
42cf5bc1 16#include <IGESData_DefaultSpecific.hxx>
17#include <IGESData_IGESDumper.hxx>
18#include <IGESData_IGESEntity.hxx>
7fd59977 19#include <IGESData_Protocol.hxx>
42cf5bc1 20#include <IGESData_SpecificLib.hxx>
21#include <IGESData_UndefinedEntity.hxx>
7fd59977 22#include <Interface_Macros.hxx>
42cf5bc1 23#include <Interface_UndefinedContent.hxx>
7fd59977 24#include <Message_Messenger.hxx>
42cf5bc1 25#include <Standard_Type.hxx>
26#include <TCollection_HAsciiString.hxx>
7fd59977 27
92efcf78 28IMPLEMENT_STANDARD_RTTIEXT(IGESData_DefaultSpecific,IGESData_SpecificModule)
29
b311480e 30IGESData_DefaultSpecific::IGESData_DefaultSpecific ()
7fd59977 31{ IGESData_SpecificLib::SetGlobal(this, IGESData::Protocol()); }
32
33 void IGESData_DefaultSpecific::OwnDump
34 (const Standard_Integer /*CN*/, const Handle(IGESData_IGESEntity)& ent,
0ebe5b0a 35 const IGESData_IGESDumper& dumper, Standard_OStream& S,
7fd59977 36 const Standard_Integer /*own*/) const
37{
38 DeclareAndCast(IGESData_UndefinedEntity,lent,ent);
39 if (lent.IsNull()) return;
40
41 Standard_Integer dstat = lent->DirStatus();
0ebe5b0a 42 if (dstat != 0)
43 S << " -- Directory Entry Error Status = " << dstat << " --\n";
7fd59977 44 Handle(Interface_UndefinedContent) cont = lent->UndefinedContent();
45 Standard_Integer nb = cont->NbParams();
46 S << " UNDEFINED ENTITY ...\n"<<nb
47 <<" Parameters (WARNING : Odd Integer Values Interpreted as Entities)\n";
48 for (Standard_Integer i = 1; i <= nb; i ++) {
49 Interface_ParamType ptyp = cont->ParamType(i);
0ebe5b0a 50 if (ptyp == Interface_ParamVoid) S <<" ["<<i<<":Void]";
7fd59977 51 else if (cont->IsParamEntity(i)) {
52 DeclareAndCast(IGESData_IGESEntity,anent,cont->ParamEntity(i));
0ebe5b0a 53 S <<" ["<<i<<":IGES]=";
7fd59977 54 dumper.PrintDNum(anent,S);
55 }
0ebe5b0a 56 else { S <<" ["<<i<<"]=" << cont->ParamValue(i)->String(); }
57 if ( i == (i%5)*5) S << "\n";
7fd59977 58 }
0ebe5b0a 59 S << std::endl;
7fd59977 60}