diff --git a/src/IVtk/IVtk_Types.hxx b/src/IVtk/IVtk_Types.hxx index 862222b0cb..5ae46834d9 100644 --- a/src/IVtk/IVtk_Types.hxx +++ b/src/IVtk/IVtk_Types.hxx @@ -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 diff --git a/src/IVtkOCC/IVtkOCC_ShapeMesher.cxx b/src/IVtkOCC/IVtkOCC_ShapeMesher.cxx index 09735d6136..290f96a8ec 100644 --- a/src/IVtkOCC/IVtkOCC_ShapeMesher.cxx +++ b/src/IVtkOCC/IVtkOCC_ShapeMesher.cxx @@ -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); diff --git a/src/IVtkTools/IVtkTools_DisplayModeFilter.cxx b/src/IVtkTools/IVtkTools_DisplayModeFilter.cxx index 8b3b31c6ba..e80a2104f0 100644 --- a/src/IVtkTools/IVtkTools_DisplayModeFilter.cxx +++ b/src/IVtkTools/IVtkTools_DisplayModeFilter.cxx @@ -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 index 0000000000..524d9ed80e --- /dev/null +++ b/tests/v3d/ivtk/seam_edges @@ -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