#include <Poly_Array1OfTriangle.hxx>
#include <Poly_Polygon3D.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
+#include <Prs3d.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_PointAspect.hxx>
// purpose :
// =========================================================================
Standard_Boolean Prs3d_WFShape::AddPolygon (const TopoDS_Edge& theEdge,
- const Standard_Real theDeflection,
TColgp_SequenceOfPnt& thePoints)
{
TopLoc_Location aLocation;
- Standard_Real aFirst, aLast;
- Handle(Geom_Curve) aCurve3d = BRep_Tool::Curve (theEdge, aFirst, aLast);
Handle(Poly_Polygon3D) aPolygon = BRep_Tool::Polygon3D (theEdge, aLocation);
if (!aPolygon.IsNull())
{
- if ((aPolygon->Deflection() <= theDeflection) || aCurve3d.IsNull())
+ const TColgp_Array1OfPnt& aPoints = aPolygon->Nodes();
+ Standard_Integer anIndex = aPoints.Lower();
+ if (aLocation.IsIdentity())
{
- const TColgp_Array1OfPnt& aPoints = aPolygon->Nodes();
- Standard_Integer anIndex = aPoints.Lower();
- if (aLocation.IsIdentity())
+ for (; anIndex <= aPoints.Upper(); ++anIndex)
{
- for (; anIndex <= aPoints.Upper(); ++anIndex)
- {
- thePoints.Append (aPoints.Value (anIndex));
- }
+ thePoints.Append (aPoints.Value (anIndex));
}
- else
+ }
+ else
+ {
+ for (; anIndex <= aPoints.Upper(); ++anIndex)
{
- for (; anIndex <= aPoints.Upper(); ++anIndex)
- {
- thePoints.Append (aPoints.Value (anIndex).Transformed (aLocation));
- }
+ thePoints.Append (aPoints.Value (anIndex).Transformed (aLocation));
}
- return Standard_True;
}
+ return Standard_True;
}
Handle(Poly_Triangulation) aTriangulation;
BRep_Tool::PolygonOnTriangulation (theEdge, aHIndices, aTriangulation, aLocation);
if (!aHIndices.IsNull())
{
- if ((aHIndices->Deflection() <= theDeflection) || aCurve3d.IsNull())
- {
- const TColStd_Array1OfInteger& anIndices = aHIndices->Nodes();
- const TColgp_Array1OfPnt& aNodes = aTriangulation->Nodes();
+ const TColStd_Array1OfInteger& anIndices = aHIndices->Nodes();
+ const TColgp_Array1OfPnt& aNodes = aTriangulation->Nodes();
- Standard_Integer anIndex = anIndices.Lower();
- if (aLocation.IsIdentity())
+ Standard_Integer anIndex = anIndices.Lower();
+ if (aLocation.IsIdentity())
+ {
+ for (; anIndex <= anIndices.Upper(); ++anIndex)
{
- for (; anIndex <= anIndices.Upper(); ++anIndex)
- {
- thePoints.Append (aNodes (anIndices (anIndex)));
- }
+ thePoints.Append (aNodes (anIndices (anIndex)));
}
- else
+ }
+ else
+ {
+ for (; anIndex <= anIndices.Upper(); ++anIndex)
{
- for (; anIndex <= anIndices.Upper(); ++anIndex)
- {
- thePoints.Append (aNodes (anIndices (anIndex)).Transformed (aLocation));
- }
+ thePoints.Append (aNodes (anIndices (anIndex)).Transformed (aLocation));
}
- return Standard_True;
}
+ return Standard_True;
}
return Standard_False;
}
return;
}
- Prs3d_ShapeTool aTool (theShape);
+ Prs3d_ShapeTool aTool (theShape, theDrawer->VertexDrawMode() == Prs3d_VDM_All);
TopTools_ListOfShape aLFree, aLUnFree, aLWire;
for (aTool.InitCurve(); aTool.MoreCurve(); aTool.NextCurve())
{
}
}
- Standard_Real aDeflection = theDrawer->MaximalChordialDeviation();
- if (theDrawer->TypeOfDeflection() == Aspect_TOD_RELATIVE)
- {
- // The arrow calculation is based on the global min max
- Bnd_Box aBndBox;
- BRepBndLib::Add (theShape, aBndBox);
- if (!aBndBox.IsVoid())
- {
- Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
- aBndBox.Get (aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
- aDeflection = Max (aXmax-aXmin, Max (aYmax-aYmin, aZmax-aZmin))
- * theDrawer->DeviationCoefficient();
- }
- }
-
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePresentation);
+ Standard_Real aDeflection = Prs3d::GetDeflection(theShape, theDrawer);
Prs3d_NListOfSequenceOfPnt anUIsoCurves;
Prs3d_NListOfSequenceOfPnt aVIsoCurves;
}
catch (Standard_Failure)
{
- #ifdef DEB
+ #ifdef OCCT_DEBUG
const TopoDS_Face& aFace = aSurface.Face();
std::cout << "Problem with the face " << (void* ) &(*(aFace).TShape()) << std::endl;
#endif
}
catch (Standard_Failure)
{
- #ifdef DEB
+ #ifdef OCCT_DEBUG
const TopoDS_Face& aFace = aSurface.Face();
std::cout << "Problem with the face " << (void* ) &(*(aFace).TShape()) << std::endl;
#endif
if (theDrawer->WireDraw())
{
// Wire (without any neighbour)
- aGroup->SetPrimitivesAspect (theDrawer->WireAspect()->Aspect());
for (anIt.Initialize(aLWire); anIt.More(); anIt.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge (anIt.Value());
{
OCC_CATCH_SIGNALS
const Handle(TColgp_HSequenceOfPnt)& aPoints = new TColgp_HSequenceOfPnt;
- if (!AddPolygon (anEdge, aDeflection, aPoints->ChangeSequence()))
+ if (!AddPolygon (anEdge, aPoints->ChangeSequence()))
{
if (BRep_Tool::IsGeometric (anEdge))
{
}
catch (Standard_Failure)
{
- #ifdef DEB
+ #ifdef OCCT_DEBUG
std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
#endif
}
{
OCC_CATCH_SIGNALS
const Handle(TColgp_HSequenceOfPnt)& aPoints = new TColgp_HSequenceOfPnt;
- if (!AddPolygon (anEdge, aDeflection, aPoints->ChangeSequence()))
+ if (!AddPolygon (anEdge, aPoints->ChangeSequence()))
{
if (BRep_Tool::IsGeometric (anEdge))
{
}
catch (Standard_Failure)
{
- #ifdef DEB
+ #ifdef OCCT_DEBUG
std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
#endif
}
{
OCC_CATCH_SIGNALS
const Handle(TColgp_HSequenceOfPnt)& aPoints = new TColgp_HSequenceOfPnt;
- if (!AddPolygon (anEdge, aDeflection, aPoints->ChangeSequence()))
+ if (!AddPolygon (anEdge, aPoints->ChangeSequence()))
{
if (BRep_Tool::IsGeometric (anEdge))
{
}
catch (Standard_Failure)
{
- #ifdef DEB
+ #ifdef OCCT_DEBUG
std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
#endif
}