1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0031573: Visualization - Do not show seam edge for shading presentation with boundary edges in VTK

This commit is contained in:
vsv 2020-05-20 15:50:15 +03:00 committed by bugmaster
parent e4e3254a35
commit 2ba1172b73
4 changed files with 27 additions and 7 deletions

View 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

View 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);

View 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;

17
tests/v3d/ivtk/seam_edges Normal file
View File

@ -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