0031573: Visualization - Do not show seam edge for shading presentation with boundary...
authorvsv <vsv@opencascade.com>
Wed, 20 May 2020 12:50:15 +0000 (15:50 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 28 May 2020 07:22:54 +0000 (10:22 +0300)
src/IVtk/IVtk_Types.hxx
src/IVtkOCC/IVtkOCC_ShapeMesher.cxx
src/IVtkTools/IVtkTools_DisplayModeFilter.cxx
tests/v3d/ivtk/seam_edges [new file with mode: 0644]

index 862222b..5ae4683 100644 (file)
@@ -86,7 +86,8 @@ typedef enum
   MT_BoundaryEdge  =  4, //!< Boundary edge (related to a single face)
   MT_SharedEdge    =  5, //!< Shared edge (related to several faces)
   MT_WireFrameFace =  6, //!< Wireframe face
-  MT_ShadedFace    =  7  //!< Shaded face
+  MT_ShadedFace    =  7, //!< Shaded face
+  MT_SeamEdge      =  8  //!< Seam edge between faces
 } IVtk_MeshType;
 
 //! @enum IVtk_DisplayMode Display modes for 3D shapes
index 09735d6..290f96a 100644 (file)
@@ -180,16 +180,16 @@ void IVtkOCC_ShapeMesher::addEdges()
                                  TopAbs_EDGE, 
                                  TopAbs_FACE,
                                  anEdgesMap);
-
   int aNbFaces;
   IVtk_MeshType aType;
   myEdgesTypes.Clear();
 
-  TopExp_Explorer anEdgeIter (GetShapeObj()->GetShape(), TopAbs_EDGE);
-  for (; anEdgeIter.More(); anEdgeIter.Next())
+  TopTools_IndexedDataMapOfShapeListOfShape::Iterator aEdgeIt(anEdgesMap);
+  for (; aEdgeIt.More(); aEdgeIt.Next())
   {
-    const TopoDS_Edge& anOcctEdge = TopoDS::Edge (anEdgeIter.Current());
-    aNbFaces = anEdgesMap.FindFromKey (anOcctEdge).Extent();
+    const TopoDS_Edge& anOcctEdge = TopoDS::Edge (aEdgeIt.Key());
+    const TopTools_ListOfShape& aFaceList = aEdgeIt.Value();
+    aNbFaces = aFaceList.Extent();
     if (aNbFaces == 0)
     {
       aType = MT_FreeEdge;
@@ -200,7 +200,8 @@ void IVtkOCC_ShapeMesher::addEdges()
     }
     else
     {
-      aType = MT_SharedEdge;
+      aType = (aNbFaces >= 2) && (BRep_Tool::MaxContinuity(anOcctEdge) > GeomAbs_G2) ?
+        MT_SeamEdge : MT_SharedEdge;
     }
     addEdge (anOcctEdge, GetShapeObj()->GetSubShapeId (anOcctEdge), aType);
     myEdgesTypes.Bind (anOcctEdge, aType);
index 8b3b31c..e80a210 100644 (file)
@@ -48,6 +48,7 @@ IVtkTools_DisplayModeFilter::IVtkTools_DisplayModeFilter()
   aTypes.Add (MT_FreeEdge);
   aTypes.Add (MT_BoundaryEdge);
   aTypes.Add (MT_SharedEdge);
+  aTypes.Add (MT_SeamEdge);
   aTypes.Add (MT_WireFrameFace);
 
   myModesDefinition[DM_Wireframe] = aTypes;
diff --git a/tests/v3d/ivtk/seam_edges b/tests/v3d/ivtk/seam_edges
new file mode 100644 (file)
index 0000000..524d9ed
--- /dev/null
@@ -0,0 +1,17 @@
+puts "=========="
+puts "seam_edges"
+puts "=========="
+puts ""
+#################################################################
+#  Tests boundary edges draw without seam edges in the IVtk view
+#################################################################
+
+set anImage $imagedir/${casename}.png
+
+ivtkinit
+psphere s 10 15 80
+ivtkdisplay s
+ivtksetdispmode 1
+ivtksetboundingdraw 1
+
+ivtkdump $anImage