mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +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:
parent
0be7dbe183
commit
0493ffd083
@ -277,7 +277,6 @@ blend result _model 2 _model_161
|
|||||||
pload VISUALIZATION
|
pload VISUALIZATION
|
||||||
vinit Driver1/Viewer1/View1
|
vinit Driver1/Viewer1/View1
|
||||||
vsetcolorbg 200 200 255
|
vsetcolorbg 200 200 255
|
||||||
vdisplay result
|
vdisplay -dispMode 1 result
|
||||||
vfit
|
vfit
|
||||||
vsetdispmode 1
|
vaspects result -setFaceBoundaryDraw 1 -mostContinuity c2
|
||||||
vshowfaceboundary result 1
|
|
||||||
|
@ -263,7 +263,6 @@ unifysamedom result p_1
|
|||||||
pload VISUALIZATION
|
pload VISUALIZATION
|
||||||
vinit Driver1/Viewer1/View1
|
vinit Driver1/Viewer1/View1
|
||||||
vsetcolorbg 200 200 255
|
vsetcolorbg 200 200 255
|
||||||
vdisplay result
|
vdisplay -dispMode 1 result
|
||||||
vfit
|
vfit
|
||||||
vsetdispmode 1
|
vaspects result -setFaceBoundaryDraw 1
|
||||||
vshowfaceboundary result 1
|
|
||||||
|
@ -57,9 +57,7 @@ bcommon res b9 c2
|
|||||||
# show result
|
# show result
|
||||||
donly res
|
donly res
|
||||||
trotate res 0 0 0 0 0 1 90
|
trotate res 0 0 0 0 0 1 90
|
||||||
vinit
|
vinit View1
|
||||||
vdisplay res
|
vdisplay -dispMode 1 res
|
||||||
vsetdispmode 1
|
vaspects res -setFaceBoundaryDraw 1 -setFaceBoundaryColor WHITE -isoontriangulation 1
|
||||||
vshowfaceboundary res 1 255 255 255
|
|
||||||
vaspects -isoontriangulation 1
|
|
||||||
vfit
|
vfit
|
||||||
|
@ -610,7 +610,7 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
|
|||||||
const DataMapOfDrawerCompd& theDrawerClosedFaces,
|
const DataMapOfDrawerCompd& theDrawerClosedFaces,
|
||||||
const Standard_Integer theMode)
|
const Standard_Integer theMode)
|
||||||
{
|
{
|
||||||
Handle(Graphic3d_Group) anOpenGroup, aClosedGroup;
|
Handle(Graphic3d_Group) anOpenGroup, aClosedGroup, anEdgesGroup;
|
||||||
for (size_t aShType = 0; aShType <= (size_t )TopAbs_SHAPE; ++aShType)
|
for (size_t aShType = 0; aShType <= (size_t )TopAbs_SHAPE; ++aShType)
|
||||||
{
|
{
|
||||||
const Standard_Boolean isClosed = aShType == TopAbs_SHAPE;
|
const Standard_Boolean isClosed = aShType == TopAbs_SHAPE;
|
||||||
@ -664,7 +664,7 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
|
|||||||
{
|
{
|
||||||
if (aShadedGroup.IsNull())
|
if (aShadedGroup.IsNull())
|
||||||
{
|
{
|
||||||
aShadedGroup = Prs3d_Root::NewGroup (thePrs);
|
aShadedGroup = thePrs->NewGroup();
|
||||||
aShadedGroup->SetClosed (isClosed);
|
aShadedGroup->SetClosed (isClosed);
|
||||||
}
|
}
|
||||||
aShadedGroup->SetPrimitivesAspect (aDrawer->ShadingAspect()->Aspect());
|
aShadedGroup->SetPrimitivesAspect (aDrawer->ShadingAspect()->Aspect());
|
||||||
@ -673,18 +673,15 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
|
|||||||
|
|
||||||
if (aDrawer->FaceBoundaryDraw())
|
if (aDrawer->FaceBoundaryDraw())
|
||||||
{
|
{
|
||||||
Handle(Graphic3d_ArrayOfSegments) aBndSegments = StdPrs_ShadedShape::FillFaceBoundaries (aShapeDraw);
|
if (Handle(Graphic3d_ArrayOfSegments) aBndSegments = StdPrs_ShadedShape::FillFaceBoundaries (aShapeDraw, aDrawer->FaceBoundaryUpperContinuity()))
|
||||||
if (!aBndSegments.IsNull())
|
|
||||||
{
|
{
|
||||||
if (aShadedGroup.IsNull())
|
if (anEdgesGroup.IsNull())
|
||||||
{
|
{
|
||||||
aShadedGroup = Prs3d_Root::NewGroup (thePrs);
|
anEdgesGroup = thePrs->NewGroup();
|
||||||
aShadedGroup->SetClosed (isClosed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Graphic3d_AspectLine3d) aBoundaryAspect = aDrawer->FaceBoundaryAspect()->Aspect();
|
anEdgesGroup->SetPrimitivesAspect (aDrawer->FaceBoundaryAspect()->Aspect());
|
||||||
aShadedGroup->SetPrimitivesAspect (aBoundaryAspect);
|
anEdgesGroup->AddPrimitiveArray (aBndSegments);
|
||||||
aShadedGroup->AddPrimitiveArray (aBndSegments);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1182,6 +1182,29 @@ Standard_Boolean BRep_Tool::HasContinuity(const TopoDS_Edge& E)
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : MaxContinuity
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GeomAbs_Shape BRep_Tool::MaxContinuity (const TopoDS_Edge& theEdge)
|
||||||
|
{
|
||||||
|
GeomAbs_Shape aMaxCont = GeomAbs_C0;
|
||||||
|
for (BRep_ListIteratorOfListOfCurveRepresentation aReprIter ((*((Handle(BRep_TEdge)*)&theEdge.TShape()))->ChangeCurves());
|
||||||
|
aReprIter.More(); aReprIter.Next())
|
||||||
|
{
|
||||||
|
const Handle(BRep_CurveRepresentation)& aRepr = aReprIter.Value();
|
||||||
|
if (aRepr->IsRegularity())
|
||||||
|
{
|
||||||
|
const GeomAbs_Shape aCont = aRepr->Continuity();
|
||||||
|
if ((Standard_Integer )aCont > (Standard_Integer )aMaxCont)
|
||||||
|
{
|
||||||
|
aMaxCont = aCont;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return aMaxCont;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Pnt
|
//function : Pnt
|
||||||
//purpose : Returns the 3d point.
|
//purpose : Returns the 3d point.
|
||||||
|
@ -242,6 +242,9 @@ public:
|
|||||||
//! Returns True if the edge has regularity on some
|
//! Returns True if the edge has regularity on some
|
||||||
//! two surfaces
|
//! two surfaces
|
||||||
Standard_EXPORT static Standard_Boolean HasContinuity (const TopoDS_Edge& E);
|
Standard_EXPORT static Standard_Boolean HasContinuity (const TopoDS_Edge& E);
|
||||||
|
|
||||||
|
//! Returns the max continuity of edge between some surfaces or GeomAbs_C0 if there no such surfaces.
|
||||||
|
Standard_EXPORT static GeomAbs_Shape MaxContinuity (const TopoDS_Edge& theEdge);
|
||||||
|
|
||||||
//! Returns the 3d point.
|
//! Returns the 3d point.
|
||||||
Standard_EXPORT static gp_Pnt Pnt (const TopoDS_Vertex& V);
|
Standard_EXPORT static gp_Pnt Pnt (const TopoDS_Vertex& V);
|
||||||
|
@ -99,6 +99,7 @@ Prs3d_Drawer::Prs3d_Drawer()
|
|||||||
myHasOwnUnFreeBoundaryAspect (Standard_False),
|
myHasOwnUnFreeBoundaryAspect (Standard_False),
|
||||||
myUnFreeBoundaryDraw (Standard_True),
|
myUnFreeBoundaryDraw (Standard_True),
|
||||||
myHasOwnUnFreeBoundaryDraw (Standard_False),
|
myHasOwnUnFreeBoundaryDraw (Standard_False),
|
||||||
|
myFaceBoundaryUpperContinuity(-1),
|
||||||
myHasOwnFaceBoundaryAspect (Standard_False),
|
myHasOwnFaceBoundaryAspect (Standard_False),
|
||||||
myFaceBoundaryDraw (Standard_False),
|
myFaceBoundaryDraw (Standard_False),
|
||||||
myHasOwnFaceBoundaryDraw (Standard_False),
|
myHasOwnFaceBoundaryDraw (Standard_False),
|
||||||
@ -1120,6 +1121,28 @@ void Prs3d_Drawer::ClearLocalAttributes()
|
|||||||
myTypeOfHLR = Prs3d_TOH_NotSet;
|
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
|
// function : SetOwnLineAspects
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -1210,16 +1233,7 @@ Standard_Boolean Prs3d_Drawer::SetOwnLineAspects (const Handle(Prs3d_Drawer)& th
|
|||||||
*myUnFreeBoundaryAspect->Aspect() = *aLink->UnFreeBoundaryAspect()->Aspect();
|
*myUnFreeBoundaryAspect->Aspect() = *aLink->UnFreeBoundaryAspect()->Aspect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!myHasOwnFaceBoundaryAspect)
|
isUpdateNeeded = SetupOwnFaceBoundaryAspect (theDefaults) || isUpdateNeeded;
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return isUpdateNeeded;
|
return isUpdateNeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <Prs3d_DimensionUnits.hxx>
|
#include <Prs3d_DimensionUnits.hxx>
|
||||||
#include <Prs3d_TypeOfHLR.hxx>
|
#include <Prs3d_TypeOfHLR.hxx>
|
||||||
#include <Standard_Transient.hxx>
|
#include <Standard_Transient.hxx>
|
||||||
|
#include <GeomAbs_Shape.hxx>
|
||||||
|
|
||||||
class Prs3d_IsoAspect;
|
class Prs3d_IsoAspect;
|
||||||
class Prs3d_LineAspect;
|
class Prs3d_LineAspect;
|
||||||
@ -738,6 +739,10 @@ public:
|
|||||||
//! face boundaries aspect that overrides the one in the link.
|
//! face boundaries aspect that overrides the one in the link.
|
||||||
Standard_Boolean HasOwnFaceBoundaryAspect() const { return myHasOwnFaceBoundaryAspect; }
|
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.
|
//! Enables or disables face boundary drawing for shading presentations.
|
||||||
//! The method sets drawing flag owned by the drawer that will be used during
|
//! The method sets drawing flag owned by the drawer that will be used during
|
||||||
//! visualization instead of the one set in link.
|
//! visualization instead of the one set in link.
|
||||||
@ -756,6 +761,25 @@ public:
|
|||||||
//! "draw face boundaries" flag that overrides the one in the link.
|
//! "draw face boundaries" flag that overrides the one in the link.
|
||||||
Standard_Boolean HasOwnFaceBoundaryDraw() const { return myHasOwnFaceBoundaryDraw; }
|
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.
|
//! Returns settings for the appearance of dimensions.
|
||||||
Standard_EXPORT const Handle(Prs3d_DimensionAspect)& DimensionAspect();
|
Standard_EXPORT const Handle(Prs3d_DimensionAspect)& DimensionAspect();
|
||||||
|
|
||||||
@ -944,6 +968,7 @@ protected:
|
|||||||
Standard_Boolean myUnFreeBoundaryDraw;
|
Standard_Boolean myUnFreeBoundaryDraw;
|
||||||
Standard_Boolean myHasOwnUnFreeBoundaryDraw;
|
Standard_Boolean myHasOwnUnFreeBoundaryDraw;
|
||||||
Handle(Prs3d_LineAspect) myFaceBoundaryAspect;
|
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 myHasOwnFaceBoundaryAspect;
|
||||||
Standard_Boolean myFaceBoundaryDraw;
|
Standard_Boolean myFaceBoundaryDraw;
|
||||||
Standard_Boolean myHasOwnFaceBoundaryDraw;
|
Standard_Boolean myHasOwnFaceBoundaryDraw;
|
||||||
@ -956,7 +981,6 @@ protected:
|
|||||||
Prs3d_DimensionUnits myDimensionDisplayUnits;
|
Prs3d_DimensionUnits myDimensionDisplayUnits;
|
||||||
Standard_Boolean myHasOwnDimLengthDisplayUnits;
|
Standard_Boolean myHasOwnDimLengthDisplayUnits;
|
||||||
Standard_Boolean myHasOwnDimAngleDisplayUnits;
|
Standard_Boolean myHasOwnDimAngleDisplayUnits;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Standard_DEPRECATED("Class name is deprecated - use Prs3d_Drawer instead")
|
Standard_DEPRECATED("Class name is deprecated - use Prs3d_Drawer instead")
|
||||||
|
@ -301,7 +301,8 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Compute boundary presentation for faces of the shape.
|
//! 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
|
// collection of all triangulation nodes on edges
|
||||||
// for computing boundaries presentation
|
// for computing boundaries presentation
|
||||||
@ -340,6 +341,13 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeIter.Key());
|
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);
|
Handle(Poly_PolygonOnTriangulation) anEdgePoly = BRep_Tool::PolygonOnTriangulation (anEdge, aTriangulation, aTrsf);
|
||||||
if (!anEdgePoly.IsNull()
|
if (!anEdgePoly.IsNull()
|
||||||
&& anEdgePoly->Nodes().Length() >= 2)
|
&& anEdgePoly->Nodes().Length() >= 2)
|
||||||
@ -383,6 +391,13 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeIter.Key());
|
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);
|
Handle(Poly_PolygonOnTriangulation) anEdgePoly = BRep_Tool::PolygonOnTriangulation (anEdge, aTriangulation, aTrsf);
|
||||||
if (anEdgePoly.IsNull()
|
if (anEdgePoly.IsNull()
|
||||||
|| anEdgePoly->Nodes().Length () < 2)
|
|| anEdgePoly->Nodes().Length () < 2)
|
||||||
@ -575,12 +590,10 @@ void StdPrs_ShadedShape::Add (const Handle (Prs3d_Presentation)& thePrs,
|
|||||||
|
|
||||||
if (theDrawer->FaceBoundaryDraw())
|
if (theDrawer->FaceBoundaryDraw())
|
||||||
{
|
{
|
||||||
Handle(Graphic3d_ArrayOfSegments) aBndSegments = fillFaceBoundaries (theShape);
|
if (Handle(Graphic3d_ArrayOfSegments) aBndSegments = fillFaceBoundaries (theShape, theDrawer->FaceBoundaryUpperContinuity()))
|
||||||
if (!aBndSegments.IsNull())
|
|
||||||
{
|
{
|
||||||
Handle(Graphic3d_AspectLine3d) aBoundaryAspect = theDrawer->FaceBoundaryAspect()->Aspect();
|
|
||||||
Handle(Graphic3d_Group) aPrsGrp = Prs3d_Root::CurrentGroup (thePrs);
|
Handle(Graphic3d_Group) aPrsGrp = Prs3d_Root::CurrentGroup (thePrs);
|
||||||
aPrsGrp->SetGroupPrimitivesAspect (aBoundaryAspect);
|
aPrsGrp->SetGroupPrimitivesAspect (theDrawer->FaceBoundaryAspect()->Aspect());
|
||||||
aPrsGrp->AddPrimitiveArray (aBndSegments);
|
aPrsGrp->AddPrimitiveArray (aBndSegments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -603,9 +616,10 @@ Handle(Graphic3d_ArrayOfTriangles) StdPrs_ShadedShape::FillTriangles (const Topo
|
|||||||
// function : FillFaceBoundaries
|
// function : FillFaceBoundaries
|
||||||
// purpose :
|
// 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
@ -17,10 +17,7 @@
|
|||||||
#ifndef _StdPrs_ShadedShape_HeaderFile
|
#ifndef _StdPrs_ShadedShape_HeaderFile
|
||||||
#define _StdPrs_ShadedShape_HeaderFile
|
#define _StdPrs_ShadedShape_HeaderFile
|
||||||
|
|
||||||
#include <Standard.hxx>
|
#include <GeomAbs_Shape.hxx>
|
||||||
#include <Standard_DefineAlloc.hxx>
|
|
||||||
#include <Standard_Handle.hxx>
|
|
||||||
|
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <Prs3d_Drawer.hxx>
|
#include <Prs3d_Drawer.hxx>
|
||||||
#include <StdPrs_Volume.hxx>
|
#include <StdPrs_Volume.hxx>
|
||||||
@ -90,7 +87,9 @@ public:
|
|||||||
|
|
||||||
//! Define primitive array of boundary segments for specified shape.
|
//! Define primitive array of boundary segments for specified shape.
|
||||||
//! @param theShape segments array or NULL if specified face does not have computed triangulation
|
//! @param theShape segments array or NULL if specified face does not have computed triangulation
|
||||||
Standard_EXPORT static Handle(Graphic3d_ArrayOfSegments) FillFaceBoundaries (const TopoDS_Shape& theShape);
|
//! @param theUpperContinuity the most edge continuity class to be included to result (edges with more continuity will be ignored)
|
||||||
|
Standard_EXPORT static Handle(Graphic3d_ArrayOfSegments) FillFaceBoundaries (const TopoDS_Shape& theShape,
|
||||||
|
GeomAbs_Shape theUpperContinuity = GeomAbs_CN);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1556,6 +1556,19 @@ struct ViewerTest_AspectsChangeSet
|
|||||||
|
|
||||||
Standard_Integer ToEnableIsoOnTriangulation;
|
Standard_Integer ToEnableIsoOnTriangulation;
|
||||||
|
|
||||||
|
Standard_Integer ToSetFaceBoundaryDraw;
|
||||||
|
Standard_Integer ToSetFaceBoundaryUpperContinuity;
|
||||||
|
GeomAbs_Shape FaceBoundaryUpperContinuity;
|
||||||
|
|
||||||
|
Standard_Integer ToSetFaceBoundaryColor;
|
||||||
|
Quantity_Color FaceBoundaryColor;
|
||||||
|
|
||||||
|
Standard_Integer ToSetFaceBoundaryWidth;
|
||||||
|
Standard_Real FaceBoundaryWidth;
|
||||||
|
|
||||||
|
Standard_Integer ToSetTypeOfFaceBoundaryLine;
|
||||||
|
Aspect_TypeOfLine TypeOfFaceBoundaryLine;
|
||||||
|
|
||||||
Standard_Integer ToSetMaxParamValue;
|
Standard_Integer ToSetMaxParamValue;
|
||||||
Standard_Real MaxParamValue;
|
Standard_Real MaxParamValue;
|
||||||
|
|
||||||
@ -1612,7 +1625,18 @@ struct ViewerTest_AspectsChangeSet
|
|||||||
FreeBoundaryWidth (1.0),
|
FreeBoundaryWidth (1.0),
|
||||||
ToSetFreeBoundaryColor (0),
|
ToSetFreeBoundaryColor (0),
|
||||||
FreeBoundaryColor (DEFAULT_FREEBOUNDARY_COLOR),
|
FreeBoundaryColor (DEFAULT_FREEBOUNDARY_COLOR),
|
||||||
ToEnableIsoOnTriangulation (-1),
|
ToEnableIsoOnTriangulation (0),
|
||||||
|
//
|
||||||
|
ToSetFaceBoundaryDraw (0),
|
||||||
|
ToSetFaceBoundaryUpperContinuity (0),
|
||||||
|
FaceBoundaryUpperContinuity(GeomAbs_CN),
|
||||||
|
ToSetFaceBoundaryColor (0),
|
||||||
|
FaceBoundaryColor (Quantity_NOC_BLACK),
|
||||||
|
ToSetFaceBoundaryWidth (0),
|
||||||
|
FaceBoundaryWidth (1.0f),
|
||||||
|
ToSetTypeOfFaceBoundaryLine(0),
|
||||||
|
TypeOfFaceBoundaryLine (Aspect_TOL_SOLID),
|
||||||
|
//
|
||||||
ToSetMaxParamValue (0),
|
ToSetMaxParamValue (0),
|
||||||
MaxParamValue (500000),
|
MaxParamValue (500000),
|
||||||
ToSetSensitivity (0),
|
ToSetSensitivity (0),
|
||||||
@ -1645,6 +1669,12 @@ struct ViewerTest_AspectsChangeSet
|
|||||||
&& ToSetShowFreeBoundary == 0
|
&& ToSetShowFreeBoundary == 0
|
||||||
&& ToSetFreeBoundaryColor == 0
|
&& ToSetFreeBoundaryColor == 0
|
||||||
&& ToSetFreeBoundaryWidth == 0
|
&& ToSetFreeBoundaryWidth == 0
|
||||||
|
&& ToEnableIsoOnTriangulation == 0
|
||||||
|
&& ToSetFaceBoundaryDraw == 0
|
||||||
|
&& ToSetFaceBoundaryUpperContinuity == 0
|
||||||
|
&& ToSetFaceBoundaryColor == 0
|
||||||
|
&& ToSetFaceBoundaryWidth == 0
|
||||||
|
&& ToSetTypeOfFaceBoundaryLine == 0
|
||||||
&& ToSetMaxParamValue == 0
|
&& ToSetMaxParamValue == 0
|
||||||
&& ToSetSensitivity == 0
|
&& ToSetSensitivity == 0
|
||||||
&& ToSetHatch == 0
|
&& ToSetHatch == 0
|
||||||
@ -1799,6 +1829,66 @@ struct ViewerTest_AspectsChangeSet
|
|||||||
toRecompute = true;
|
toRecompute = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ToSetFaceBoundaryDraw != 0)
|
||||||
|
{
|
||||||
|
if (ToSetFaceBoundaryDraw != -1
|
||||||
|
|| theDrawer->HasOwnFaceBoundaryDraw())
|
||||||
|
{
|
||||||
|
toRecompute = true;
|
||||||
|
theDrawer->SetFaceBoundaryDraw (ToSetFaceBoundaryDraw == 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ToSetFaceBoundaryUpperContinuity != 0)
|
||||||
|
{
|
||||||
|
if (ToSetFaceBoundaryUpperContinuity != -1
|
||||||
|
|| theDrawer->HasOwnFaceBoundaryUpperContinuity())
|
||||||
|
{
|
||||||
|
toRecompute = true;
|
||||||
|
if (ToSetFaceBoundaryUpperContinuity == -1)
|
||||||
|
{
|
||||||
|
theDrawer->UnsetFaceBoundaryUpperContinuity();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
theDrawer->SetFaceBoundaryUpperContinuity (FaceBoundaryUpperContinuity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ToSetFaceBoundaryColor != 0)
|
||||||
|
{
|
||||||
|
if (ToSetFaceBoundaryColor != -1
|
||||||
|
|| theDrawer->HasOwnFaceBoundaryAspect())
|
||||||
|
{
|
||||||
|
if (ToSetFaceBoundaryColor == -1)
|
||||||
|
{
|
||||||
|
toRecompute = true;
|
||||||
|
theDrawer->SetFaceBoundaryAspect (Handle(Prs3d_LineAspect)());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
toRecompute = theDrawer->SetupOwnFaceBoundaryAspect (aDefDrawer) || toRecompute;
|
||||||
|
theDrawer->FaceBoundaryAspect()->SetColor (FaceBoundaryColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ToSetFaceBoundaryWidth != 0)
|
||||||
|
{
|
||||||
|
if (ToSetFaceBoundaryWidth != -1
|
||||||
|
|| theDrawer->HasOwnFaceBoundaryAspect())
|
||||||
|
{
|
||||||
|
toRecompute = theDrawer->SetupOwnFaceBoundaryAspect (aDefDrawer) || toRecompute;
|
||||||
|
theDrawer->FaceBoundaryAspect()->SetWidth (FaceBoundaryWidth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ToSetTypeOfFaceBoundaryLine != 0)
|
||||||
|
{
|
||||||
|
if (ToSetTypeOfFaceBoundaryLine != -1
|
||||||
|
|| theDrawer->HasOwnFaceBoundaryAspect())
|
||||||
|
{
|
||||||
|
toRecompute = theDrawer->SetupOwnFaceBoundaryAspect (aDefDrawer) || toRecompute;
|
||||||
|
theDrawer->FaceBoundaryAspect()->SetTypeOfLine (TypeOfFaceBoundaryLine);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (ToSetShadingModel != 0)
|
if (ToSetShadingModel != 0)
|
||||||
{
|
{
|
||||||
if (ToSetShadingModel != -1
|
if (ToSetShadingModel != -1
|
||||||
@ -2099,6 +2189,50 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
aChangeSet->ToSetTypeOfEdge = -1;
|
aChangeSet->ToSetTypeOfEdge = -1;
|
||||||
aChangeSet->TypeOfEdge = Aspect_TOL_SOLID;
|
aChangeSet->TypeOfEdge = Aspect_TOL_SOLID;
|
||||||
}
|
}
|
||||||
|
else if (aCmdName == "vshowfaceboundary")
|
||||||
|
{
|
||||||
|
aChangeSet->ToSetFaceBoundaryDraw = 1;
|
||||||
|
toParseAliasArgs = true;
|
||||||
|
if (aNames.Size() >= 2
|
||||||
|
&& aNames.Value (2).IsIntegerValue())
|
||||||
|
{
|
||||||
|
if (aNames.Size() == 7)
|
||||||
|
{
|
||||||
|
if (ViewerTest::ParseLineType (aNames.Value (7).ToCString(), aChangeSet->TypeOfFaceBoundaryLine))
|
||||||
|
{
|
||||||
|
aChangeSet->ToSetTypeOfFaceBoundaryLine = 1;
|
||||||
|
aNames.Remove (7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (aNames.Size() == 6
|
||||||
|
&& aNames.Value (6).IsRealValue())
|
||||||
|
{
|
||||||
|
aChangeSet->ToSetFaceBoundaryWidth = 1;
|
||||||
|
aChangeSet->FaceBoundaryWidth = aNames.Value (6).RealValue();
|
||||||
|
aNames.Remove (6);
|
||||||
|
}
|
||||||
|
if (aNames.Size() == 5
|
||||||
|
&& aNames.Value (3).IsIntegerValue()
|
||||||
|
&& aNames.Value (4).IsIntegerValue()
|
||||||
|
&& aNames.Value (5).IsIntegerValue())
|
||||||
|
{
|
||||||
|
aChangeSet->ToSetFaceBoundaryColor = 1;
|
||||||
|
aChangeSet->FaceBoundaryColor = Quantity_Color (aNames.Value (3).IntegerValue() / 255.0,
|
||||||
|
aNames.Value (4).IntegerValue() / 255.0,
|
||||||
|
aNames.Value (5).IntegerValue() / 255.0,
|
||||||
|
Quantity_TOC_RGB);
|
||||||
|
aNames.Remove (5);
|
||||||
|
aNames.Remove (4);
|
||||||
|
aNames.Remove (3);
|
||||||
|
}
|
||||||
|
if (aNames.Size() == 2)
|
||||||
|
{
|
||||||
|
toParseAliasArgs = false;
|
||||||
|
aChangeSet->ToSetFaceBoundaryDraw = aNames.Value (2).IntegerValue() == 1 ? 1 : -1;
|
||||||
|
aNames.Remove (2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (anArgIter >= theArgNb)
|
else if (anArgIter >= theArgNb)
|
||||||
{
|
{
|
||||||
std::cout << "Error: not enough arguments!\n";
|
std::cout << "Error: not enough arguments!\n";
|
||||||
@ -2121,13 +2255,19 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
|| anArg == "-setedgewidth"
|
|| anArg == "-setedgewidth"
|
||||||
|| anArg == "-setedgeswidth"
|
|| anArg == "-setedgeswidth"
|
||||||
|| anArg == "-edgewidth"
|
|| anArg == "-edgewidth"
|
||||||
|| anArg == "-edgeswidth")
|
|| anArg == "-edgeswidth"
|
||||||
|
|| anArg == "-setfaceboundarywidth"
|
||||||
|
|| anArg == "-setboundarywidth"
|
||||||
|
|| anArg == "-faceboundarywidth"
|
||||||
|
|| anArg == "-boundarywidth")
|
||||||
{
|
{
|
||||||
if (++anArgIter >= theArgNb)
|
if (++anArgIter >= theArgNb)
|
||||||
{
|
{
|
||||||
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Standard_Real aWidth = Draw::Atof (theArgVec[anArgIter]);
|
||||||
if (anArg == "-setedgewidth"
|
if (anArg == "-setedgewidth"
|
||||||
|| anArg == "-setedgeswidth"
|
|| anArg == "-setedgeswidth"
|
||||||
|| anArg == "-edgewidth"
|
|| anArg == "-edgewidth"
|
||||||
@ -2135,12 +2275,21 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
|| aCmdName == "vsetedgetype")
|
|| aCmdName == "vsetedgetype")
|
||||||
{
|
{
|
||||||
aChangeSet->ToSetEdgeWidth = 1;
|
aChangeSet->ToSetEdgeWidth = 1;
|
||||||
aChangeSet->EdgeWidth = Draw::Atof (theArgVec[anArgIter]);
|
aChangeSet->EdgeWidth = aWidth;
|
||||||
|
}
|
||||||
|
else if (anArg == "-setfaceboundarywidth"
|
||||||
|
|| anArg == "-setboundarywidth"
|
||||||
|
|| anArg == "-faceboundarywidth"
|
||||||
|
|| anArg == "-boundarywidth"
|
||||||
|
|| aCmdName == "vshowfaceboundary")
|
||||||
|
{
|
||||||
|
aChangeSet->ToSetFaceBoundaryWidth = 1;
|
||||||
|
aChangeSet->FaceBoundaryWidth = aWidth;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aChangeSet->ToSetLineWidth = 1;
|
aChangeSet->ToSetLineWidth = 1;
|
||||||
aChangeSet->LineWidth = Draw::Atof (theArgVec[anArgIter]);
|
aChangeSet->LineWidth = aWidth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (anArg == "-unsetwidth"
|
else if (anArg == "-unsetwidth"
|
||||||
@ -2271,7 +2420,11 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
aChangeSet->Transparency = 0.0;
|
aChangeSet->Transparency = 0.0;
|
||||||
}
|
}
|
||||||
else if (anArg == "-setcolor"
|
else if (anArg == "-setcolor"
|
||||||
|| anArg == "-color")
|
|| anArg == "-color"
|
||||||
|
|| anArg == "-setfaceboundarycolor"
|
||||||
|
|| anArg == "-setboundarycolor"
|
||||||
|
|| anArg == "-faceboundarycolor"
|
||||||
|
|| anArg == "-boundarycolor")
|
||||||
{
|
{
|
||||||
Quantity_Color aColor;
|
Quantity_Color aColor;
|
||||||
Standard_Integer aNbParsed = ViewerTest::ParseColor (theArgNb - anArgIter - 1,
|
Standard_Integer aNbParsed = ViewerTest::ParseColor (theArgNb - anArgIter - 1,
|
||||||
@ -2288,6 +2441,15 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
aChangeSet->ToSetEdgeColor = 1;
|
aChangeSet->ToSetEdgeColor = 1;
|
||||||
aChangeSet->EdgeColor = Quantity_ColorRGBA (aColor);
|
aChangeSet->EdgeColor = Quantity_ColorRGBA (aColor);
|
||||||
}
|
}
|
||||||
|
else if (aCmdName == "vshowfaceboundary"
|
||||||
|
|| anArg == "-setfaceboundarycolor"
|
||||||
|
|| anArg == "-setboundarycolor"
|
||||||
|
|| anArg == "-faceboundarycolor"
|
||||||
|
|| anArg == "-boundarycolor")
|
||||||
|
{
|
||||||
|
aChangeSet->ToSetFaceBoundaryColor = 1;
|
||||||
|
aChangeSet->FaceBoundaryColor = aColor;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aChangeSet->ToSetColor = 1;
|
aChangeSet->ToSetColor = 1;
|
||||||
@ -2300,6 +2462,13 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
|| anArg == "-setedgestype"
|
|| anArg == "-setedgestype"
|
||||||
|| anArg == "-edgetype"
|
|| anArg == "-edgetype"
|
||||||
|| anArg == "-edgestype"
|
|| anArg == "-edgestype"
|
||||||
|
|| anArg == "-setfaceboundarystyle"
|
||||||
|
|| anArg == "-faceboundarystyle"
|
||||||
|
|| anArg == "-boundarystyle"
|
||||||
|
|| anArg == "-setfaceboundarytype"
|
||||||
|
|| anArg == "-faceboundarytype"
|
||||||
|
|| anArg == "-setboundarytype"
|
||||||
|
|| anArg == "-boundarytype"
|
||||||
|| anArg == "-type")
|
|| anArg == "-type")
|
||||||
{
|
{
|
||||||
if (++anArgIter >= theArgNb)
|
if (++anArgIter >= theArgNb)
|
||||||
@ -2322,6 +2491,18 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
aChangeSet->TypeOfEdge = aLineType;
|
aChangeSet->TypeOfEdge = aLineType;
|
||||||
aChangeSet->ToSetTypeOfEdge = 1;
|
aChangeSet->ToSetTypeOfEdge = 1;
|
||||||
}
|
}
|
||||||
|
else if (anArg == "-setfaceboundarystyle"
|
||||||
|
|| anArg == "-faceboundarystyle"
|
||||||
|
|| anArg == "-boundarystyle"
|
||||||
|
|| anArg == "-setfaceboundarytype"
|
||||||
|
|| anArg == "-faceboundarytype"
|
||||||
|
|| anArg == "-setboundarytype"
|
||||||
|
|| anArg == "-boundarytype"
|
||||||
|
|| aCmdName == "vshowfaceboundary")
|
||||||
|
{
|
||||||
|
aChangeSet->TypeOfFaceBoundaryLine = aLineType;
|
||||||
|
aChangeSet->ToSetTypeOfFaceBoundaryLine = 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aChangeSet->TypeOfLine = aLineType;
|
aChangeSet->TypeOfLine = aLineType;
|
||||||
@ -2456,28 +2637,14 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
|| anArg == "-setfb"
|
|| anArg == "-setfb"
|
||||||
|| anArg == "-fb")
|
|| anArg == "-fb")
|
||||||
{
|
{
|
||||||
if (++anArgIter >= theArgNb)
|
bool toEnable = true;
|
||||||
{
|
if (!ViewerTest::ParseOnOff (anArgIter + 1 < theArgNb ? theArgVec[anArgIter + 1] : "", toEnable))
|
||||||
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
TCollection_AsciiString aValue (theArgVec[anArgIter]);
|
|
||||||
aValue.LowerCase();
|
|
||||||
if (aValue == "on"
|
|
||||||
|| aValue == "1")
|
|
||||||
{
|
|
||||||
aChangeSet->ToSetShowFreeBoundary = 1;
|
|
||||||
}
|
|
||||||
else if (aValue == "off"
|
|
||||||
|| aValue == "0")
|
|
||||||
{
|
|
||||||
aChangeSet->ToSetShowFreeBoundary = -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
++anArgIter;
|
||||||
|
aChangeSet->ToSetShowFreeBoundary = toEnable ? 1 : -1;
|
||||||
}
|
}
|
||||||
else if (anArg == "-setfreeboundarywidth"
|
else if (anArg == "-setfreeboundarywidth"
|
||||||
|| anArg == "-freeboundarywidth"
|
|| anArg == "-freeboundarywidth"
|
||||||
@ -2525,28 +2692,86 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
|| anArg == "-setisoontriang"
|
|| anArg == "-setisoontriang"
|
||||||
|| anArg == "-isoontriang")
|
|| anArg == "-isoontriang")
|
||||||
{
|
{
|
||||||
if (++anArgIter >= theArgNb)
|
bool toEnable = true;
|
||||||
|
if (!ViewerTest::ParseOnOff (anArgIter + 1 < theArgNb ? theArgVec[anArgIter + 1] : "", toEnable))
|
||||||
{
|
{
|
||||||
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
TCollection_AsciiString aValue (theArgVec[anArgIter]);
|
++anArgIter;
|
||||||
aValue.LowerCase();
|
aChangeSet->ToEnableIsoOnTriangulation = toEnable ? 1 : -1;
|
||||||
if (aValue == "on"
|
}
|
||||||
|| aValue == "1")
|
else if (anArg == "-setfaceboundarydraw"
|
||||||
|
|| anArg == "-setdrawfaceboundary"
|
||||||
|
|| anArg == "-setdrawfaceboundaries"
|
||||||
|
|| anArg == "-setshowfaceboundary"
|
||||||
|
|| anArg == "-setshowfaceboundaries"
|
||||||
|
|| anArg == "-setdrawfaceedges"
|
||||||
|
|| anArg == "-faceboundarydraw"
|
||||||
|
|| anArg == "-drawfaceboundary"
|
||||||
|
|| anArg == "-drawfaceboundaries"
|
||||||
|
|| anArg == "-showfaceboundary"
|
||||||
|
|| anArg == "-showfaceboundaries"
|
||||||
|
|| anArg == "-drawfaceedges"
|
||||||
|
|| anArg == "-faceboundary"
|
||||||
|
|| anArg == "-faceboundaries"
|
||||||
|
|| anArg == "-faceedges")
|
||||||
|
{
|
||||||
|
bool toEnable = true;
|
||||||
|
if (!ViewerTest::ParseOnOff (anArgIter + 1 < theArgNb ? theArgVec[anArgIter + 1] : "", toEnable))
|
||||||
{
|
{
|
||||||
aChangeSet->ToEnableIsoOnTriangulation = 1;
|
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
else if (aValue == "off"
|
++anArgIter;
|
||||||
|| aValue == "0")
|
aChangeSet->ToSetFaceBoundaryDraw = toEnable ? 1 : -1;
|
||||||
|
}
|
||||||
|
else if (anArg == "-unsetfaceboundary"
|
||||||
|
|| anArg == "-unsetboundary")
|
||||||
|
{
|
||||||
|
aChangeSet->ToSetFaceBoundaryDraw = -1;
|
||||||
|
aChangeSet->ToSetFaceBoundaryColor = -1;
|
||||||
|
}
|
||||||
|
else if (anArg == "-setmostcontinuity"
|
||||||
|
|| anArg == "-mostcontinuity")
|
||||||
|
{
|
||||||
|
TCollection_AsciiString aClassArg (anArgIter + 1 < theArgNb ? theArgVec[anArgIter + 1] : "");
|
||||||
|
aClassArg.LowerCase();
|
||||||
|
GeomAbs_Shape aClass = GeomAbs_CN;
|
||||||
|
if (aClassArg == "c0"
|
||||||
|
|| aClassArg == "0")
|
||||||
{
|
{
|
||||||
aChangeSet->ToEnableIsoOnTriangulation = 0;
|
aClass = GeomAbs_C0;
|
||||||
|
}
|
||||||
|
else if (aClassArg == "c1"
|
||||||
|
|| aClassArg == "1")
|
||||||
|
{
|
||||||
|
aClass = GeomAbs_C1;
|
||||||
|
}
|
||||||
|
else if (aClassArg == "c2"
|
||||||
|
|| aClassArg == "2")
|
||||||
|
{
|
||||||
|
aClass = GeomAbs_C2;
|
||||||
|
}
|
||||||
|
else if (aClassArg == "c3"
|
||||||
|
|| aClassArg == "3")
|
||||||
|
{
|
||||||
|
aClass = GeomAbs_C3;
|
||||||
|
}
|
||||||
|
else if (aClassArg == "cn"
|
||||||
|
|| aClassArg == "n")
|
||||||
|
{
|
||||||
|
aClass = GeomAbs_CN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
std::cout << "Syntax error at '" << anArg << "'\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
++anArgIter;
|
||||||
|
aChangeSet->ToSetFaceBoundaryUpperContinuity = 1;
|
||||||
|
aChangeSet->FaceBoundaryUpperContinuity = aClass;
|
||||||
}
|
}
|
||||||
else if (anArg == "-setmaxparamvalue"
|
else if (anArg == "-setmaxparamvalue"
|
||||||
|| anArg == "-maxparamvalue")
|
|| anArg == "-maxparamvalue")
|
||||||
@ -2730,6 +2955,18 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
aChangeSet->FreeBoundaryColor = DEFAULT_FREEBOUNDARY_COLOR;
|
aChangeSet->FreeBoundaryColor = DEFAULT_FREEBOUNDARY_COLOR;
|
||||||
aChangeSet->ToSetFreeBoundaryWidth = -1;
|
aChangeSet->ToSetFreeBoundaryWidth = -1;
|
||||||
aChangeSet->FreeBoundaryWidth = 1.0;
|
aChangeSet->FreeBoundaryWidth = 1.0;
|
||||||
|
aChangeSet->ToEnableIsoOnTriangulation = -1;
|
||||||
|
//
|
||||||
|
aChangeSet->ToSetFaceBoundaryDraw = -1;
|
||||||
|
aChangeSet->ToSetFaceBoundaryUpperContinuity = -1;
|
||||||
|
aChangeSet->FaceBoundaryUpperContinuity = GeomAbs_CN;
|
||||||
|
aChangeSet->ToSetFaceBoundaryColor = -1;
|
||||||
|
aChangeSet->FaceBoundaryColor = Quantity_NOC_BLACK;
|
||||||
|
aChangeSet->ToSetFaceBoundaryWidth = -1;
|
||||||
|
aChangeSet->FaceBoundaryWidth = 1.0f;
|
||||||
|
aChangeSet->ToSetTypeOfFaceBoundaryLine = -1;
|
||||||
|
aChangeSet->TypeOfFaceBoundaryLine = Aspect_TOL_SOLID;
|
||||||
|
//
|
||||||
aChangeSet->ToSetHatch = -1;
|
aChangeSet->ToSetHatch = -1;
|
||||||
aChangeSet->StdHatchStyle = -1;
|
aChangeSet->StdHatchStyle = -1;
|
||||||
aChangeSet->PathToHatchPattern.Clear();
|
aChangeSet->PathToHatchPattern.Clear();
|
||||||
@ -2792,7 +3029,7 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
{
|
{
|
||||||
aDrawer->ShadingAspect()->SetMaterial (aChangeSet->Material);
|
aDrawer->ShadingAspect()->SetMaterial (aChangeSet->Material);
|
||||||
}
|
}
|
||||||
if (aChangeSet->ToEnableIsoOnTriangulation != -1)
|
if (aChangeSet->ToEnableIsoOnTriangulation != 0)
|
||||||
{
|
{
|
||||||
aDrawer->SetIsoOnTriangulation (aChangeSet->ToEnableIsoOnTriangulation == 1);
|
aDrawer->SetIsoOnTriangulation (aChangeSet->ToEnableIsoOnTriangulation == 1);
|
||||||
}
|
}
|
||||||
@ -2889,7 +3126,7 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
|||||||
{
|
{
|
||||||
aCtx->UnsetWidth (aPrs, Standard_False);
|
aCtx->UnsetWidth (aPrs, Standard_False);
|
||||||
}
|
}
|
||||||
else if (aChangeSet->ToEnableIsoOnTriangulation != -1)
|
else if (aChangeSet->ToEnableIsoOnTriangulation != 0)
|
||||||
{
|
{
|
||||||
aCtx->IsoOnTriangulation (aChangeSet->ToEnableIsoOnTriangulation == 1, aPrs);
|
aCtx->IsoOnTriangulation (aChangeSet->ToEnableIsoOnTriangulation == 1, aPrs);
|
||||||
toRedisplay = Standard_True;
|
toRedisplay = Standard_True;
|
||||||
@ -5953,6 +6190,8 @@ void ViewerTest::Commands(Draw_Interpretor& theCommands)
|
|||||||
"\n\t\t: [-unsetShadingModel]"
|
"\n\t\t: [-unsetShadingModel]"
|
||||||
"\n\t\t: [-setInterior {solid|hatch|hidenline|point}]"
|
"\n\t\t: [-setInterior {solid|hatch|hidenline|point}]"
|
||||||
"\n\t\t: [-unsetInterior] [-setHatch HatchStyle]"
|
"\n\t\t: [-unsetInterior] [-setHatch HatchStyle]"
|
||||||
|
"\n\t\t: [-setFaceBoundaryDraw {0|1}] [-setMostContinuity {c0|c1|c2|c3|cn}"
|
||||||
|
"\n\t\t: [-setFaceBoundaryWidth LineWidth] [-setFaceBoundaryColor R G B] [-setFaceBoundaryType LineType]"
|
||||||
"\n\t\t: [-setDrawEdges {0|1}] [-setEdgeType LineType] [-setEdgeColor R G B] [-setQuadEdges {0|1}]"
|
"\n\t\t: [-setDrawEdges {0|1}] [-setEdgeType LineType] [-setEdgeColor R G B] [-setQuadEdges {0|1}]"
|
||||||
"\n\t\t: [-setAlphaMode {opaque|mask|blend|blendauto} [alphaCutOff=0.5]]"
|
"\n\t\t: [-setAlphaMode {opaque|mask|blend|blendauto} [alphaCutOff=0.5]]"
|
||||||
"\n\t\t: Manage presentation properties of all, selected or named objects."
|
"\n\t\t: Manage presentation properties of all, selected or named objects."
|
||||||
@ -6024,6 +6263,11 @@ void ViewerTest::Commands(Draw_Interpretor& theCommands)
|
|||||||
"\n\t\t: Alias for vaspects [name] -unsetEdgeType.",
|
"\n\t\t: Alias for vaspects [name] -unsetEdgeType.",
|
||||||
__FILE__, VAspects, group);
|
__FILE__, VAspects, group);
|
||||||
|
|
||||||
|
theCommands.Add ("vshowfaceboundary",
|
||||||
|
"vshowfaceboundary [name]"
|
||||||
|
"\n\t\t: Alias for vaspects [name] -setFaceBoundaryDraw on",
|
||||||
|
__FILE__, VAspects, group);
|
||||||
|
|
||||||
theCommands.Add("vsensdis",
|
theCommands.Add("vsensdis",
|
||||||
"vsensdis : Display active entities (sensitive entities of one of the standard types corresponding to active selection modes)."
|
"vsensdis : Display active entities (sensitive entities of one of the standard types corresponding to active selection modes)."
|
||||||
"\n\t\t: Standard entity types are those defined in Select3D package:"
|
"\n\t\t: Standard entity types are those defined in Select3D package:"
|
||||||
|
@ -4913,113 +4913,7 @@ static Standard_Integer VPolygonOffset(Draw_Interpretor& /*di*/,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : VShowFaceBoundaries
|
|
||||||
//purpose : Set face boundaries drawing on/off for ais object
|
|
||||||
//=======================================================================
|
|
||||||
static Standard_Integer VShowFaceBoundary (Draw_Interpretor& /*di*/,
|
|
||||||
Standard_Integer argc,
|
|
||||||
const char ** argv)
|
|
||||||
{
|
|
||||||
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext ();
|
|
||||||
if (aContext.IsNull ())
|
|
||||||
{
|
|
||||||
std::cout << argv[0] << " Call 'vinit' before!\n";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((argc != 3 && argc < 6) || argc > 8)
|
|
||||||
{
|
|
||||||
std::cout << "Usage :\n " << argv[0]
|
|
||||||
<< " ObjectName isOn [R G B [LineWidth [LineStyle]]]\n"
|
|
||||||
<< " ObjectName - name of AIS interactive object. \n"
|
|
||||||
<< " if ObjectName = \"\", then set as default\n"
|
|
||||||
<< " settings for all newly displayed objects\n"
|
|
||||||
<< " isOn - flag indicating whether the boundaries\n"
|
|
||||||
<< " should be turned on or off (can be set\n"
|
|
||||||
<< " to 0 (off) or 1 (on)).\n"
|
|
||||||
<< " R, G, B - red, green and blue components of boundary\n"
|
|
||||||
<< " color in range (0 - 255).\n"
|
|
||||||
<< " (default is (0, 0, 0)\n"
|
|
||||||
<< " LineWidth - line width\n"
|
|
||||||
<< " (default is 1)\n"
|
|
||||||
<< " LineStyle - line fill style :\n"
|
|
||||||
<< " 0 - solid \n"
|
|
||||||
<< " 1 - dashed \n"
|
|
||||||
<< " 2 - dot \n"
|
|
||||||
<< " 3 - dashdot\n"
|
|
||||||
<< " (default is solid)";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
TCollection_AsciiString aName (argv[1]);
|
|
||||||
|
|
||||||
Standard_Real aRed = 0.0;
|
|
||||||
Standard_Real aGreen = 0.0;
|
|
||||||
Standard_Real aBlue = 0.0;
|
|
||||||
Standard_Real aWidth = 1.0;
|
|
||||||
Aspect_TypeOfLine aLineType = Aspect_TOL_SOLID;
|
|
||||||
|
|
||||||
// find object
|
|
||||||
Handle(AIS_InteractiveObject) anInterObj;
|
|
||||||
|
|
||||||
// if name is empty - apply attributes for default aspect
|
|
||||||
if (!aName.IsEmpty ())
|
|
||||||
{
|
|
||||||
if (!GetMapOfAIS().Find2 (aName, anInterObj)
|
|
||||||
|| anInterObj.IsNull())
|
|
||||||
{
|
|
||||||
std::cout << "Use 'vdisplay' on " << aName << " before" << std::endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const Handle(Prs3d_Drawer)& aDrawer = (aName.IsEmpty ()) ?
|
|
||||||
TheAISContext ()->DefaultDrawer () : anInterObj->Attributes ();
|
|
||||||
|
|
||||||
// turn boundaries on/off
|
|
||||||
Standard_Boolean isBoundaryDraw = (Draw::Atoi (argv[2]) == 1);
|
|
||||||
aDrawer->SetFaceBoundaryDraw (isBoundaryDraw);
|
|
||||||
|
|
||||||
// set boundary line color
|
|
||||||
if (argc >= 6)
|
|
||||||
{
|
|
||||||
// Text color
|
|
||||||
aRed = Draw::Atof (argv[3])/255.;
|
|
||||||
aGreen = Draw::Atof (argv[4])/255.;
|
|
||||||
aBlue = Draw::Atof (argv[5])/255.;
|
|
||||||
}
|
|
||||||
|
|
||||||
// set line width
|
|
||||||
if (argc >= 7)
|
|
||||||
{
|
|
||||||
aWidth = (Standard_Real)Draw::Atof (argv[6]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// select appropriate line type
|
|
||||||
if (argc == 8)
|
|
||||||
{
|
|
||||||
if (!ViewerTest::ParseLineType (argv[7], aLineType))
|
|
||||||
{
|
|
||||||
std::cout << "Syntax error: unknown line type '" << argv[7] << "'\n";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Quantity_Color aColor (aRed, aGreen, aBlue, Quantity_TOC_RGB);
|
|
||||||
|
|
||||||
Handle(Prs3d_LineAspect) aBoundaryAspect =
|
|
||||||
new Prs3d_LineAspect (aColor, aLineType, aWidth);
|
|
||||||
|
|
||||||
aDrawer->SetFaceBoundaryAspect (aBoundaryAspect);
|
|
||||||
|
|
||||||
TheAISContext()->Redisplay (anInterObj, Standard_True);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This class is used for testing markers.
|
// This class is used for testing markers.
|
||||||
|
|
||||||
class ViewerTest_MarkersArrayObject : public AIS_InteractiveObject
|
class ViewerTest_MarkersArrayObject : public AIS_InteractiveObject
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -6436,12 +6330,6 @@ void ViewerTest::ObjectCommands(Draw_Interpretor& theCommands)
|
|||||||
"vpolygonoffset : [object [mode factor units]] - sets/gets polygon offset parameters for an object, without arguments prints the default values",
|
"vpolygonoffset : [object [mode factor units]] - sets/gets polygon offset parameters for an object, without arguments prints the default values",
|
||||||
__FILE__, VPolygonOffset, group);
|
__FILE__, VPolygonOffset, group);
|
||||||
|
|
||||||
theCommands.Add ("vshowfaceboundary",
|
|
||||||
"vshowfaceboundary : ObjectName isOn (1/0) [R G B [LineWidth [LineStyle]]]"
|
|
||||||
"- turns on/off drawing of face boundaries for ais object "
|
|
||||||
"and defines boundary line style.",
|
|
||||||
__FILE__, VShowFaceBoundary, group);
|
|
||||||
|
|
||||||
theCommands.Add ("vmarkerstest",
|
theCommands.Add ("vmarkerstest",
|
||||||
"vmarkerstest: name X Y Z [PointsOnSide=10] [MarkerType=0] [Scale=1.0] [FileName=ImageFile]\n",
|
"vmarkerstest: name X Y Z [PointsOnSide=10] [MarkerType=0] [Scale=1.0] [FileName=ImageFile]\n",
|
||||||
__FILE__, VMarkersTest, group);
|
__FILE__, VMarkersTest, group);
|
||||||
|
@ -8,7 +8,7 @@ vclear
|
|||||||
vinit View1
|
vinit View1
|
||||||
vdisplay b
|
vdisplay b
|
||||||
vsetdispmode 1
|
vsetdispmode 1
|
||||||
vshowfaceboundary b 1 255 0 0 5 1
|
vaspects b -setFaceBoundaryDraw 1 -setFaceBoundaryColor RED -setFaceBoundaryWidth 5 -setFaceBoundaryType dash
|
||||||
vfit
|
vfit
|
||||||
vaspects -setwidth 10
|
vaspects -setwidth 10
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ puts ""
|
|||||||
vinit View1
|
vinit View1
|
||||||
box b 10 10 10
|
box b 10 10 10
|
||||||
vdisplay b
|
vdisplay b
|
||||||
vshowfaceboundary b 1
|
vaspects b -setFaceBoundaryDraw 1
|
||||||
vclipplane create pln1
|
vclipplane create pln1
|
||||||
vclipplane set pln1 object b
|
vclipplane set pln1 object b
|
||||||
vclipplane change pln1 equation 0 1 0 -5
|
vclipplane change pln1 equation 0 1 0 -5
|
||||||
|
@ -13,7 +13,7 @@ vinit View1
|
|||||||
pcone c 0 5 10
|
pcone c 0 5 10
|
||||||
vdisplay c; vfit
|
vdisplay c; vfit
|
||||||
vsetdispmode c 1
|
vsetdispmode c 1
|
||||||
vshowfaceboundary c 1 64 64 0
|
vaspects c -setFaceBoundaryDraw 1 -setFaceBoundaryColor 0.25 0.25 0
|
||||||
vselect 200 200
|
vselect 200 200
|
||||||
|
|
||||||
vdump $imagedir/${casename}_wf_no_triang.png
|
vdump $imagedir/${casename}_wf_no_triang.png
|
||||||
@ -25,7 +25,7 @@ vinit View1
|
|||||||
# Computing wireframe after triangulation, then checking face boundaries and selection
|
# Computing wireframe after triangulation, then checking face boundaries and selection
|
||||||
vsetdispmode 1
|
vsetdispmode 1
|
||||||
vdisplay c; vfit
|
vdisplay c; vfit
|
||||||
vshowfaceboundary c 1 64 64 0
|
vaspects c -setFaceBoundaryDraw 1 -setFaceBoundaryColor 0.25 0.25 0
|
||||||
vselect 200 200
|
vselect 200 200
|
||||||
|
|
||||||
vdump $imagedir/${casename}_wf_with_triang.png
|
vdump $imagedir/${casename}_wf_with_triang.png
|
||||||
|
@ -13,7 +13,7 @@ vinit View1
|
|||||||
|
|
||||||
vdisplay -noupdate -dispMode 1 b
|
vdisplay -noupdate -dispMode 1 b
|
||||||
vfit
|
vfit
|
||||||
vshowfaceboundary b 1 255 0 0 3
|
vaspects b -setFaceBoundaryDraw 1 -setFaceBoundaryColor RED -setFaceBoundaryWidth 3
|
||||||
vraytrace 1
|
vraytrace 1
|
||||||
|
|
||||||
if {[vreadpixel 295 255 name] != "GOLDENROD4 0"} {
|
if {[vreadpixel 295 255 name] != "GOLDENROD4 0"} {
|
||||||
|
@ -18,7 +18,8 @@ vaxo
|
|||||||
vdisplay -noupdate -dispMode 0 s
|
vdisplay -noupdate -dispMode 0 s
|
||||||
vaspects s -subshapes s_1 -setcolor RED
|
vaspects s -subshapes s_1 -setcolor RED
|
||||||
vdisplay -noupdate -dispMode 1 s
|
vdisplay -noupdate -dispMode 1 s
|
||||||
vshowfaceboundary s 1 255 0 0 2
|
vaspects s -unsetFaceBoundary
|
||||||
|
vaspects s -setFaceBoundaryDraw 1 -setFaceBoundaryColor RED -setFaceBoundaryWidth 2
|
||||||
vfit
|
vfit
|
||||||
vselect 250 250
|
vselect 250 250
|
||||||
|
|
||||||
|
25
tests/bugs/vis/bug29787
Normal file
25
tests/bugs/vis/bug29787
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0029787: Visualization - Avoid in presentation edges of certain continuity class"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload MODELING VISUALIZATION
|
||||||
|
|
||||||
|
vclear
|
||||||
|
vinit View1
|
||||||
|
vsetcolorbg 255 255 255
|
||||||
|
|
||||||
|
psphere s1 1
|
||||||
|
psphere s2 1
|
||||||
|
psphere s3 1
|
||||||
|
ttranslate s2 4 0 0
|
||||||
|
ttranslate s3 8 0 0
|
||||||
|
|
||||||
|
vdisplay -dispMode 0 s1
|
||||||
|
vdisplay -dispMode 1 s2 s3
|
||||||
|
vfit
|
||||||
|
|
||||||
|
vaspects s2 -setFaceBoundaryDraw 1 -setFaceBoundaryColor RED
|
||||||
|
vaspects s3 -setFaceBoundaryDraw 1 -setFaceBoundaryColor RED -setMostContinuity c2
|
||||||
|
|
||||||
|
vdump $::imagedir/${::casename}.png
|
@ -62,7 +62,7 @@ trotate res 0 0 0 0 0 1 90
|
|||||||
#vinit
|
#vinit
|
||||||
vdisplay res
|
vdisplay res
|
||||||
vsetdispmode 1
|
vsetdispmode 1
|
||||||
#vshowfaceboundary res 1 255 255 255
|
#vaspects res -setFaceBoundaryDraw 1 -setFaceBoundaryColor WHITE
|
||||||
vfit
|
vfit
|
||||||
|
|
||||||
vrenderparams -rayTrace -reflections
|
vrenderparams -rayTrace -reflections
|
||||||
|
Loading…
x
Reference in New Issue
Block a user