1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0023407: Draw face outlines for XDE objects

FaceOutline aspect and flag added to AIS_Drawer, Prs3d_Drawer.cdl
FaceOutlines computed by StdPrs_ShadedShape and build upon the edge triangulation.
"vshowoutlines" draw command for testing outlines on AIS_Shapes,
"XShowOutlines" draw command for testing outlines on XCAF objects.
remarks corrected:
- FaceOutline renamed to FaceBoundary
- Graphic3d_ArrayOfSegments with edges used instead of Graphic3d_ArrayOfPolylines with bounds.
draw boundaries in separate Graphic3d_Group.
Adding test cases bugs/vis/CR23407_1 CR23407_2
This commit is contained in:
apl
2012-09-14 14:37:57 +04:00
parent dd2c7137e0
commit a2d5ab2e7f
12 changed files with 647 additions and 6 deletions

View File

@@ -478,7 +478,42 @@ is
-- Type of line: Aspect_TOL_SOLID Width: 1.
is redefined static;
SetFaceBoundaryDraw (me : mutable;
theIsEnabled : Boolean from Standard)
is redefined static;
---Purpose: Enables or disables drawing of face boundaries 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.
-- theIsEnabled is a boolean flag indicating whether the face boundaries should be
-- drawn or not.
IsFaceBoundaryDraw (me) returns Boolean from Standard
is redefined static;
---Purpose: Checks whether the drawing of face boundaries is enabled or not.
SetFaceBoundaryAspect (me : mutable;
theAspect : LineAspect from Prs3d)
is redefined static;
---Purpose: Sets line aspect for face boundaries.
-- The method sets line aspect owned by the drawer that will be used during
-- visualization instead of the one set in link.
-- theAspect is the line aspect that determines the look of the face boundaries.
FaceBoundaryAspect (me : mutable) returns mutable LineAspect from Prs3d
is redefined static;
---Purpose: Returns line aspect of face boundaries.
IsOwnFaceBoundaryDraw (me) returns Boolean from Standard
is static;
---Purpose: Returns true if the drawer has its own attribute for
-- "draw face boundaries" flag that overrides the one in the link.
---C++: inline
IsOwnFaceBoundaryAspect (me) returns Boolean from Standard
is static;
---Purpose: Returns true if the drawer has its own attribute for
-- face boundaries aspect that overrides the one in the link.
---C++: inline
--
-- Attributes for the presentation of a Datum.
--
@@ -593,6 +628,7 @@ fields
myOwnHLRDeviationAngle : Real from Standard;
myPreviousHLRDeviationAngle : Real from Standard;
myHasOwnFaceBoundaryDraw : Boolean from Standard;
end Drawer;

View File

@@ -26,7 +26,8 @@ myhasOwnDeviationCoefficient(Standard_False),
myPreviousDeviationCoefficient(0.1),
myhasOwnHLRDeviationCoefficient (Standard_False),
myhasOwnDeviationAngle (Standard_False),
myhasOwnHLRDeviationAngle (Standard_False)
myhasOwnHLRDeviationAngle (Standard_False),
myHasOwnFaceBoundaryDraw (Standard_False)
{
SetMaximalParameterValue(500000.);
myLink->SetMaximalParameterValue(500000.);
@@ -262,10 +263,58 @@ void AIS_Drawer::ClearLocalAttributes()
if(!myRadiusAspect.IsNull()) myRadiusAspect.Nullify();
if(!mySectionAspect.IsNull()) mySectionAspect.Nullify();
if( myhasOwnHLRDeviationCoefficient ) myhasOwnHLRDeviationCoefficient = Standard_False;
if(myhasOwnHLRDeviationAngle ) myhasOwnHLRDeviationAngle = Standard_False;
if(myhasOwnHLRDeviationAngle ) myhasOwnHLRDeviationAngle = Standard_False;
if (!myFaceBoundaryAspect.IsNull()) myFaceBoundaryAspect.Nullify();
myHasOwnFaceBoundaryDraw = Standard_False;
hasLocalAttributes = Standard_False;
}
// =======================================================================
// function : SetFaceBoundaryDraw
// purpose :
// =======================================================================
void AIS_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled)
{
myHasOwnFaceBoundaryDraw = Standard_True;
myFaceBoundaryDraw = theIsEnabled;
}
// =======================================================================
// function : IsFaceBoundaryDraw
// purpose :
// =======================================================================
Standard_Boolean AIS_Drawer::IsFaceBoundaryDraw() const
{
if (!IsOwnFaceBoundaryDraw ())
{
return myLink->IsFaceBoundaryDraw ();
}
return myFaceBoundaryDraw;
}
// =======================================================================
// function : SetFaceBoundaryAspect
// purpose :
// =======================================================================
void AIS_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
{
myFaceBoundaryAspect = theAspect;
}
// =======================================================================
// function : FaceBoundaryAspect
// purpose :
// =======================================================================
Handle_Prs3d_LineAspect AIS_Drawer::FaceBoundaryAspect()
{
if (!IsOwnFaceBoundaryAspect ())
{
return myLink->FaceBoundaryAspect ();
}
return myFaceBoundaryAspect;
}

View File

@@ -94,3 +94,8 @@ inline Standard_Boolean AIS_Drawer::HasPlaneAspect () const
inline Standard_Boolean AIS_Drawer::HasLengthAspect () const
{ return !myLengthAspect.IsNull();}
inline Standard_Boolean AIS_Drawer::IsOwnFaceBoundaryDraw () const
{ return myHasOwnFaceBoundaryDraw; }
inline Standard_Boolean AIS_Drawer::IsOwnFaceBoundaryAspect () const
{ return !myFaceBoundaryAspect.IsNull (); }