From: apn Date: Thu, 23 Oct 2014 10:42:17 +0000 (+0400) Subject: 0023911: Invalid output of command Xdump X-Git-Tag: V6_8_0~67 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=0cc44c473066eabb93766648ca42abe14a86b3fd 0023911: Invalid output of command Xdump Improved output of Xdump command using Draw_Interpretor. Improved output of Xdump command using Standard_SStream. OStream is used instead of SStream. Test cases for issue CR23911 --- diff --git a/src/XCAFDoc/XCAFDoc_ShapeTool.cdl b/src/XCAFDoc/XCAFDoc_ShapeTool.cdl index 6db5d84335..51631c04cd 100644 --- a/src/XCAFDoc/XCAFDoc_ShapeTool.cdl +++ b/src/XCAFDoc/XCAFDoc_ShapeTool.cdl @@ -91,8 +91,8 @@ uses SequenceOfHAsciiString from TColStd, GraphNode from XCAFDoc, AttributeSequence from TDF, - DataMapOfShapeLabel from XCAFDoc - + DataMapOfShapeLabel from XCAFDoc, + OStream from Standard is GetID (myclass) ---C++: return const & @@ -369,12 +369,13 @@ is BaseLabel(me) returns Label from TDF; ---Purpose: returns the label under which shapes are stored - Dump(me; deep : Boolean from Standard = Standard_False); + Dump(me; theDumpLog: out OStream from Standard; deep : Boolean from Standard = Standard_False); - DumpShape(myclass; L: Label from TDF; + DumpShape(myclass; theDumpLog: out OStream from Standard; + L: Label from TDF; level :Integer from Standard = 0; deep : Boolean from Standard = Standard_False); - ---Purpose: Print in cout type of shape found on label + ---Purpose: Print to ostream type of shape found on label -- and the entry of , with tabs before. -- If , print also TShape and Location addresses diff --git a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx index f96d65f2bf..3a063ccfef 100644 --- a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx +++ b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx @@ -1172,30 +1172,31 @@ TDF_Label XCAFDoc_ShapeTool::BaseLabel () const //purpose : recursive part of Dump() //======================================================================= -static void DumpAssembly(const TDF_Label L, +static void DumpAssembly(Standard_OStream& theDumpLog, + const TDF_Label L, const Standard_Integer level, const Standard_Boolean deep) { for (Standard_Integer i=0; iGet(); + theDumpLog<<" "<Get(); if (deep) { TopoDS_Shape S; XCAFDoc_ShapeTool::GetShape(L, S); - cout<<"("<<*(void**)&S.TShape(); + theDumpLog<<"("<<*(void**)&S.TShape(); if (! S.Location().IsIdentity()) - cout<<", "<< *(void**)&S.Location(); - cout<<") "; + theDumpLog<<", "<< *(void**)&S.Location(); + theDumpLog<<") "; } - cout<HasFather()) { if (Node->Father()->Label().HasChild()) - DumpAssembly(Node->Father()->Label(), level+1, deep); + DumpAssembly(theDumpLog, Node->Father()->Label(), level+1, deep); else { - XCAFDoc_ShapeTool::DumpShape(Node->Father()->Label(), level+1, deep); - cout<Father()->Label(), level+1, deep); + theDumpLog<0) cout<0) theDumpLog<Get(); + theDumpLog<<" "<Get(); if (deep) { - cout<<"("<<*(void**)&S.TShape(); + theDumpLog<<"("<<*(void**)&S.TShape(); if (! S.Location().IsIdentity()) - cout<<", "<< *(void**)&S.Location(); - cout<<") "; + theDumpLog<<", "<< *(void**)&S.Location(); + theDumpLog<<") "; } } diff --git a/src/XDEDRAW/XDEDRAW.cxx b/src/XDEDRAW/XDEDRAW.cxx index aadc90f56b..7f87d1d133 100644 --- a/src/XDEDRAW/XDEDRAW.cxx +++ b/src/XDEDRAW/XDEDRAW.cxx @@ -225,7 +225,9 @@ static Standard_Integer dump (Draw_Interpretor& di, Standard_Integer argc, const Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main()); Standard_Boolean deep = Standard_False; if ( (argc==3) && (Draw::Atoi(argv[2])==1) ) deep = Standard_True; - myAssembly->Dump(deep); + Standard_SStream aDumpLog; + myAssembly->Dump(aDumpLog, deep); + di<