mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0029787: Visualization - Avoid in presentation edges of certain continuity class
A new flag Prs3d_Drawer::FaceBoundaryUpperContinuity() has been introduced handled by StdPrs_ShadedShape::FillFaceBoundaries() method to exclude edges of higher continuity class (e.g. to skip seam edges). Draw Harness command vshowfaceboundary has been replaced by vaspects: > vaspects -setFaceBoundaryDraw 1 -setFaceBoundaryColor RED -setFaceBoundaryType DASH.
This commit is contained in:
@@ -301,7 +301,8 @@ namespace
|
||||
}
|
||||
|
||||
//! Compute boundary presentation for faces of the shape.
|
||||
static Handle(Graphic3d_ArrayOfSegments) fillFaceBoundaries (const TopoDS_Shape& theShape)
|
||||
static Handle(Graphic3d_ArrayOfSegments) fillFaceBoundaries (const TopoDS_Shape& theShape,
|
||||
GeomAbs_Shape theUpperContinuity)
|
||||
{
|
||||
// collection of all triangulation nodes on edges
|
||||
// for computing boundaries presentation
|
||||
@@ -340,6 +341,13 @@ namespace
|
||||
}
|
||||
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeIter.Key());
|
||||
if (theUpperContinuity < GeomAbs_CN
|
||||
&& anEdgeIter.Value().Extent() >= 2
|
||||
&& BRep_Tool::MaxContinuity (anEdge) > theUpperContinuity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Poly_PolygonOnTriangulation) anEdgePoly = BRep_Tool::PolygonOnTriangulation (anEdge, aTriangulation, aTrsf);
|
||||
if (!anEdgePoly.IsNull()
|
||||
&& anEdgePoly->Nodes().Length() >= 2)
|
||||
@@ -383,6 +391,13 @@ namespace
|
||||
}
|
||||
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeIter.Key());
|
||||
if (theUpperContinuity < GeomAbs_CN
|
||||
&& anEdgeIter.Value().Extent() >= 2
|
||||
&& BRep_Tool::MaxContinuity (anEdge) > theUpperContinuity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Poly_PolygonOnTriangulation) anEdgePoly = BRep_Tool::PolygonOnTriangulation (anEdge, aTriangulation, aTrsf);
|
||||
if (anEdgePoly.IsNull()
|
||||
|| anEdgePoly->Nodes().Length () < 2)
|
||||
@@ -575,12 +590,10 @@ void StdPrs_ShadedShape::Add (const Handle (Prs3d_Presentation)& thePrs,
|
||||
|
||||
if (theDrawer->FaceBoundaryDraw())
|
||||
{
|
||||
Handle(Graphic3d_ArrayOfSegments) aBndSegments = fillFaceBoundaries (theShape);
|
||||
if (!aBndSegments.IsNull())
|
||||
if (Handle(Graphic3d_ArrayOfSegments) aBndSegments = fillFaceBoundaries (theShape, theDrawer->FaceBoundaryUpperContinuity()))
|
||||
{
|
||||
Handle(Graphic3d_AspectLine3d) aBoundaryAspect = theDrawer->FaceBoundaryAspect()->Aspect();
|
||||
Handle(Graphic3d_Group) aPrsGrp = Prs3d_Root::CurrentGroup (thePrs);
|
||||
aPrsGrp->SetGroupPrimitivesAspect (aBoundaryAspect);
|
||||
aPrsGrp->SetGroupPrimitivesAspect (theDrawer->FaceBoundaryAspect()->Aspect());
|
||||
aPrsGrp->AddPrimitiveArray (aBndSegments);
|
||||
}
|
||||
}
|
||||
@@ -603,9 +616,10 @@ Handle(Graphic3d_ArrayOfTriangles) StdPrs_ShadedShape::FillTriangles (const Topo
|
||||
// function : FillFaceBoundaries
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(Graphic3d_ArrayOfSegments) StdPrs_ShadedShape::FillFaceBoundaries (const TopoDS_Shape& theShape)
|
||||
Handle(Graphic3d_ArrayOfSegments) StdPrs_ShadedShape::FillFaceBoundaries (const TopoDS_Shape& theShape,
|
||||
GeomAbs_Shape theUpperContinuity)
|
||||
{
|
||||
return fillFaceBoundaries (theShape);
|
||||
return fillFaceBoundaries (theShape, theUpperContinuity);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
Reference in New Issue
Block a user