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:
@@ -99,6 +99,7 @@ Prs3d_Drawer::Prs3d_Drawer()
|
||||
myHasOwnUnFreeBoundaryAspect (Standard_False),
|
||||
myUnFreeBoundaryDraw (Standard_True),
|
||||
myHasOwnUnFreeBoundaryDraw (Standard_False),
|
||||
myFaceBoundaryUpperContinuity(-1),
|
||||
myHasOwnFaceBoundaryAspect (Standard_False),
|
||||
myFaceBoundaryDraw (Standard_False),
|
||||
myHasOwnFaceBoundaryDraw (Standard_False),
|
||||
@@ -1120,6 +1121,28 @@ void Prs3d_Drawer::ClearLocalAttributes()
|
||||
myTypeOfHLR = Prs3d_TOH_NotSet;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetupOwnFaceBoundaryAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean Prs3d_Drawer::SetupOwnFaceBoundaryAspect (const Handle(Prs3d_Drawer)& theDefaults)
|
||||
{
|
||||
if (myHasOwnFaceBoundaryAspect)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
myFaceBoundaryAspect = new Prs3d_LineAspect (THE_DEF_COLOR_FaceBoundary, Aspect_TOL_SOLID, 1.0);
|
||||
myHasOwnFaceBoundaryAspect = true;
|
||||
|
||||
const Handle(Prs3d_Drawer)& aLink = (!theDefaults.IsNull() && theDefaults != this) ? theDefaults : myLink;
|
||||
if (!aLink.IsNull())
|
||||
{
|
||||
*myFaceBoundaryAspect->Aspect() = *aLink->FaceBoundaryAspect()->Aspect();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetOwnLineAspects
|
||||
// purpose :
|
||||
@@ -1210,16 +1233,7 @@ Standard_Boolean Prs3d_Drawer::SetOwnLineAspects (const Handle(Prs3d_Drawer)& th
|
||||
*myUnFreeBoundaryAspect->Aspect() = *aLink->UnFreeBoundaryAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!myHasOwnFaceBoundaryAspect)
|
||||
{
|
||||
isUpdateNeeded = true;
|
||||
myFaceBoundaryAspect = new Prs3d_LineAspect (THE_DEF_COLOR_FaceBoundary, Aspect_TOL_SOLID, 1.0);
|
||||
myHasOwnFaceBoundaryAspect = true;
|
||||
if (!aLink.IsNull())
|
||||
{
|
||||
*myFaceBoundaryAspect->Aspect() = *aLink->FaceBoundaryAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
isUpdateNeeded = SetupOwnFaceBoundaryAspect (theDefaults) || isUpdateNeeded;
|
||||
return isUpdateNeeded;
|
||||
}
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include <Prs3d_DimensionUnits.hxx>
|
||||
#include <Prs3d_TypeOfHLR.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
|
||||
class Prs3d_IsoAspect;
|
||||
class Prs3d_LineAspect;
|
||||
@@ -738,6 +739,10 @@ public:
|
||||
//! face boundaries aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnFaceBoundaryAspect() const { return myHasOwnFaceBoundaryAspect; }
|
||||
|
||||
//! Sets own face boundary aspect.
|
||||
//! Returns FALSE if the drawer already has its own attribute for face boundary aspect.
|
||||
Standard_EXPORT Standard_Boolean SetupOwnFaceBoundaryAspect (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
||||
|
||||
//! Enables or disables face boundary drawing for shading presentations.
|
||||
//! The method sets drawing flag owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
@@ -756,6 +761,25 @@ public:
|
||||
//! "draw face boundaries" flag that overrides the one in the link.
|
||||
Standard_Boolean HasOwnFaceBoundaryDraw() const { return myHasOwnFaceBoundaryDraw; }
|
||||
|
||||
//! Returns true if the drawer has its own attribute for face boundaries upper edge continuity class that overrides the one in the link.
|
||||
Standard_Boolean HasOwnFaceBoundaryUpperContinuity() const { return myFaceBoundaryUpperContinuity != -1; }
|
||||
|
||||
//! Get the most edge continuity class; GeomAbs_CN by default (all edges).
|
||||
GeomAbs_Shape FaceBoundaryUpperContinuity() const
|
||||
{
|
||||
return HasOwnFaceBoundaryUpperContinuity()
|
||||
? (GeomAbs_Shape )myFaceBoundaryUpperContinuity
|
||||
: (!myLink.IsNull()
|
||||
? myLink->FaceBoundaryUpperContinuity()
|
||||
: GeomAbs_CN);
|
||||
}
|
||||
|
||||
//! Set the most edge continuity class for face boundaries.
|
||||
void SetFaceBoundaryUpperContinuity (GeomAbs_Shape theMostAllowedEdgeClass) { myFaceBoundaryUpperContinuity = theMostAllowedEdgeClass; }
|
||||
|
||||
//! Unset the most edge continuity class for face boundaries.
|
||||
void UnsetFaceBoundaryUpperContinuity() { myFaceBoundaryUpperContinuity = -1; }
|
||||
|
||||
//! Returns settings for the appearance of dimensions.
|
||||
Standard_EXPORT const Handle(Prs3d_DimensionAspect)& DimensionAspect();
|
||||
|
||||
@@ -944,6 +968,7 @@ protected:
|
||||
Standard_Boolean myUnFreeBoundaryDraw;
|
||||
Standard_Boolean myHasOwnUnFreeBoundaryDraw;
|
||||
Handle(Prs3d_LineAspect) myFaceBoundaryAspect;
|
||||
Standard_Integer myFaceBoundaryUpperContinuity; //!< the most edge continuity class (GeomAbs_Shape) to be included to face boundaries presentation, or -1 if undefined
|
||||
Standard_Boolean myHasOwnFaceBoundaryAspect;
|
||||
Standard_Boolean myFaceBoundaryDraw;
|
||||
Standard_Boolean myHasOwnFaceBoundaryDraw;
|
||||
@@ -956,7 +981,6 @@ protected:
|
||||
Prs3d_DimensionUnits myDimensionDisplayUnits;
|
||||
Standard_Boolean myHasOwnDimLengthDisplayUnits;
|
||||
Standard_Boolean myHasOwnDimAngleDisplayUnits;
|
||||
|
||||
};
|
||||
|
||||
Standard_DEPRECATED("Class name is deprecated - use Prs3d_Drawer instead")
|
||||
|
Reference in New Issue
Block a user