- //-----------------------------------------------------------------------
- // Retreiving the edges and loading them into the hatcher.
- //-----------------------------------------------------------------------
- TopExp_Explorer ExpEdges(theFace, TopAbs_EDGE);
- for(; ExpEdges.More(); ExpEdges.Next()){
- const TopoDS_Edge& anEdge = TopoDS::Edge(ExpEdges.Current());
- Standard_Real U1, U2 ;
- const Handle(Geom2d_Curve) PCurve =
- BRep_Tool::CurveOnSurface(anEdge, theFace, U1, U2) ;
-
- if(PCurve.IsNull() || U1 == U2)
- return;
-
- //-- Test if a TrimmedCurve is necessary
- if(Abs(PCurve->FirstParameter()-U1) <= Precision::PConfusion() &&
- Abs(PCurve->LastParameter()-U2) <= Precision::PConfusion())
- {
- aHatcher.AddElement(PCurve, anEdge.Orientation()) ;
- }else{
- if(!PCurve->IsPeriodic()){
- Handle(Geom2d_TrimmedCurve) TrimPCurve =
- Handle(Geom2d_TrimmedCurve)::DownCast(PCurve);
- if(!TrimPCurve.IsNull()){
- Handle_Geom2d_Curve aBasisCurve = TrimPCurve->BasisCurve();
- if(aBasisCurve->FirstParameter()-U1 > Precision::PConfusion() ||
- U2-aBasisCurve->LastParameter() > Precision::PConfusion())
- {
- aHatcher.AddElement(PCurve, anEdge.Orientation()) ;
- return;
- }
- }else{
- if(PCurve->FirstParameter()-U1 > Precision::PConfusion()){
- U1=PCurve->FirstParameter();
- }
- if(U2-PCurve->LastParameter() > Precision::PConfusion()){
- U2=PCurve->LastParameter();
- }
- }
- }
- Handle(Geom2d_TrimmedCurve) TrimPCurve =
- new Geom2d_TrimmedCurve(PCurve, U1, U2);
- aHatcher.AddElement(TrimPCurve, anEdge.Orientation());
- }
+ if (aHatcher.IsDone()) {
+ // Push iso lines in vtk kernel
+ CreateIso(aHatcher, Standard_True, theDiscret, thePolyData, thePts);
+ CreateIso(aHatcher, Standard_False, theDiscret, thePolyData, thePts);