From d2c431925b784bddb88ddf13173aef0541879ab8 Mon Sep 17 00:00:00 2001 From: VTN <> Date: Fri, 2 Sep 2011 10:14:02 +0000 Subject: [PATCH] 0022686: Some Draw commands do not return necessary information in Draw_Interpretor, but write in cout. --- src/MeshTest/MeshTest_CheckTopology.cxx | 4 ++-- src/MeshTest/MeshTest_CheckTopology.hxx | 3 ++- src/MeshTest/MeshTest_PluginCommands.cxx | 30 ++++++++++++------------ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/MeshTest/MeshTest_CheckTopology.cxx b/src/MeshTest/MeshTest_CheckTopology.cxx index 7627fceb7b..e26d3818d1 100755 --- a/src/MeshTest/MeshTest_CheckTopology.cxx +++ b/src/MeshTest/MeshTest_CheckTopology.cxx @@ -24,7 +24,7 @@ //purpose : Performs checking //======================================================================= -void MeshTest_CheckTopology::Perform () +void MeshTest_CheckTopology::Perform (Draw_Interpretor& di) { TopTools_IndexedMapOfShape aMapF; TopTools_IndexedDataMapOfShapeListOfShape aMapEF; @@ -107,7 +107,7 @@ void MeshTest_CheckTopology::Perform () TopLoc_Location aLoc; Handle(Poly_Triangulation) aT = BRep_Tool::Triangulation(aFace, aLoc); if (aT.IsNull()) { - cout<< "face "< #include #include +#include //! This class checks topology of the mesh presented by //! triangulations of faces. @@ -34,7 +35,7 @@ public: : myShape(theShape) {} //! performs checking - Standard_EXPORT void Perform(); + Standard_EXPORT void Perform(Draw_Interpretor& di); //! returns the number of faces with free links Standard_Integer NbFacesWithFL() const diff --git a/src/MeshTest/MeshTest_PluginCommands.cxx b/src/MeshTest/MeshTest_PluginCommands.cxx index 785b39bd9d..95a80babf1 100755 --- a/src/MeshTest/MeshTest_PluginCommands.cxx +++ b/src/MeshTest/MeshTest_PluginCommands.cxx @@ -302,7 +302,7 @@ static Standard_Integer triarea (Draw_Interpretor& di, int n, const char ** a) BRepGProp::SurfaceProperties(shape, props, anEps); double aGeomArea = props.Mass(); - di << aTriArea << " " << aGeomArea << " "; + di << aTriArea << " " << aGeomArea << "\n"; return 0; } @@ -320,7 +320,7 @@ static Standard_Integer tricheck (Draw_Interpretor& di, int n, const char ** a) // execute check MeshTest_CheckTopology aCheck(shape); - aCheck.Perform(); + aCheck.Perform(di); // dump info on free links inside the triangulation Standard_Integer nbFree = 0; @@ -330,7 +330,7 @@ static Standard_Integer tricheck (Draw_Interpretor& di, int n, const char ** a) Standard_Integer nbEdge = aCheck.NbFreeLinks(k); Standard_Integer iF = aCheck.GetFaceNumWithFL(k); nbFree += nbEdge; - cout<<"free links of face "< 0) { - cout<<"cross face errors: {face1, node1, face2, node2, distance}"< 0) { - cout<<"async edges:"< 0) { - cout << "free nodes (in pairs: face / node): " << endl; + di << "free nodes (in pairs: face / node): " << "\n"; for (i=1; i <= nbFreeNodes; i++) { Standard_Integer iface, inode; aCheck.GetFreeNodeNum(i, iface, inode); - cout << "{" << iface << " " << inode << "} "; + di << "{" << iface << " " << inode << "} "; } - cout << endl; + di << "\n"; } // output errors summary to DRAW @@ -401,6 +401,6 @@ static Standard_Integer tricheck (Draw_Interpretor& di, int n, const char ** a) di << "Free_links " << nbFree << " Cross_face_errors " << nbErr << " Async_edges " << nbAsync - << " Free_nodes " << nbFreeNodes << " "; + << " Free_nodes " << nbFreeNodes << "\n"; return 0; }