]> OCCT Git - occt.git/commitdiff
0026398: Tricheck command should be extended to show free nodes and links breaking...
authoroan <oan@opencascade.com>
Mon, 20 Jul 2015 10:06:21 +0000 (13:06 +0300)
committerbugmaster <bugmaster@opencascade.com>
Mon, 20 Jul 2015 10:08:21 +0000 (13:08 +0300)
Remark from MSV

src/MeshTest/MeshTest_PluginCommands.cxx

index ed1b2e3ede58a0534c42a878f1184ba95faf6576..f4707ad7603df9eb6208fa3b728fc605460d9a33 100644 (file)
@@ -423,6 +423,16 @@ static Standard_Integer tricheck (Draw_Interpretor& di, int n, const char ** a)
     for (i=1; i <= nbFreeNodes; i++) {
       Standard_Integer iface, inode;
       aCheck.GetFreeNodeNum(i, iface, inode);
+
+      const TopoDS_Face& aFace = TopoDS::Face(aMapF.FindKey(iface));
+      TopLoc_Location aLoc;
+      Handle(Poly_Triangulation) aT = BRep_Tool::Triangulation(aFace, aLoc);
+      const TColgp_Array1OfPnt& aPoints = aT->Nodes();
+      const TColgp_Array1OfPnt2d& aPoints2d = aT->UVNodes();
+      const gp_Trsf& trsf = aLoc.Transformation();
+      DrawTrSurf::Set (name, aPoints(inode).Transformed(trsf));
+      DrawTrSurf::Set (name, aPoints2d(inode));
+
       di << "{" << iface << " " << inode << "} ";
     }
     di << "\n";
@@ -508,6 +518,32 @@ static Standard_Integer tricheck (Draw_Interpretor& di, int n, const char ** a)
     if (aFreeEdgeMap.Size() != 0)
     {
       di << "Not connected mesh inside face " << aFaceId << "\n";
+
+      const TColgp_Array1OfPnt& aPoints = aT->Nodes();
+      const TColgp_Array1OfPnt2d& aPoints2d = aT->UVNodes();
+      const gp_Trsf& trsf = aLoc.Transformation();
+
+      TColgp_Array1OfPnt pnts(1,2);
+      TColgp_Array1OfPnt2d pnts2d(1,2);
+      NCollection_Map<BRepMesh_Edge>::Iterator aMapIt(aFreeEdgeMap);
+      for (; aMapIt.More(); aMapIt.Next())
+      {
+        const BRepMesh_Edge& aLink = aMapIt.Key();
+        di << "{" << aLink.FirstNode() << " " << aLink.LastNode() << "} ";
+        pnts(1) = aPoints(aLink.FirstNode()).Transformed(trsf);
+        pnts(2) = aPoints(aLink.LastNode()).Transformed(trsf);
+        Handle(Poly_Polygon3D) poly = new Poly_Polygon3D (pnts);
+        DrawTrSurf::Set (name, poly);
+        DrawTrSurf::Set (name, pnts(1));
+        DrawTrSurf::Set (name, pnts(2));
+        pnts2d(1) = aPoints2d(aLink.FirstNode());
+        pnts2d(2) = aPoints2d(aLink.LastNode());
+        Handle(Poly_Polygon2D) poly2d = new Poly_Polygon2D (pnts2d);
+        DrawTrSurf::Set (name, poly2d);
+        DrawTrSurf::Set (name, pnts2d(1));
+        DrawTrSurf::Set (name, pnts2d(2));
+      }
+      di << "\n";
     }
   }
   return 0;