1 // Copyright (c) 2013-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <Prs3d_WFShape.hxx>
16 #include <Bnd_Box.hxx>
17 #include <BRepAdaptor_HSurface.hxx>
18 #include <BRepAdaptor_Curve.hxx>
19 #include <BRepBndLib.hxx>
20 #include <BRep_Tool.hxx>
21 #include <Graphic3d_Group.hxx>
22 #include <Graphic3d_AspectLine3d.hxx>
23 #include <Graphic3d_ArrayOfPolylines.hxx>
24 #include <Graphic3d_ArrayOfPoints.hxx>
26 #include <Poly_Connect.hxx>
27 #include <Poly_Triangulation.hxx>
28 #include <Poly_Array1OfTriangle.hxx>
29 #include <Poly_Polygon3D.hxx>
30 #include <Poly_PolygonOnTriangulation.hxx>
32 #include <Prs3d_Drawer.hxx>
33 #include <Prs3d_IsoAspect.hxx>
34 #include <Prs3d_PointAspect.hxx>
35 #include <Prs3d_NListIteratorOfListOfSequenceOfPnt.hxx>
36 #include <Prs3d_ShapeTool.hxx>
37 #include <Standard_ErrorHandler.hxx>
38 #include <TColgp_Array1OfPnt.hxx>
39 #include <TColgp_SequenceOfPnt.hxx>
40 #include <TopoDS_Edge.hxx>
42 #include <TopTools_HSequenceOfShape.hxx>
43 #include <TopTools_ListOfShape.hxx>
44 #include <TopTools_ListIteratorOfListOfShape.hxx>
49 //! Compare two aspects
50 inline Standard_Boolean IsSame (const Handle(Graphic3d_AspectLine3d)& theUAspect,
51 const Handle(Graphic3d_AspectLine3d)& theVAspect)
53 Quantity_Color aCU, aCV;
54 Aspect_TypeOfLine aTlU, aTlV;
55 Standard_Real aWU, aWV;
56 theUAspect->Values (aCU, aTlU, aWU);
57 theVAspect->Values (aCV, aTlV, aWV);
65 // =========================================================================
66 // function: AddPolygon
68 // =========================================================================
69 Standard_Boolean Prs3d_WFShape::AddPolygon (const TopoDS_Edge& theEdge,
70 const Standard_Real theDeflection,
71 TColgp_SequenceOfPnt& thePoints)
73 TopLoc_Location aLocation;
74 Standard_Real aFirst, aLast;
75 Handle(Geom_Curve) aCurve3d = BRep_Tool::Curve (theEdge, aFirst, aLast);
76 Handle(Poly_Polygon3D) aPolygon = BRep_Tool::Polygon3D (theEdge, aLocation);
77 if (!aPolygon.IsNull())
79 if ((aPolygon->Deflection() <= theDeflection) || aCurve3d.IsNull())
81 const TColgp_Array1OfPnt& aPoints = aPolygon->Nodes();
82 Standard_Integer anIndex = aPoints.Lower();
83 if (aLocation.IsIdentity())
85 for (; anIndex <= aPoints.Upper(); ++anIndex)
87 thePoints.Append (aPoints.Value (anIndex));
92 for (; anIndex <= aPoints.Upper(); ++anIndex)
94 thePoints.Append (aPoints.Value (anIndex).Transformed (aLocation));
101 Handle(Poly_Triangulation) aTriangulation;
102 Handle(Poly_PolygonOnTriangulation) aHIndices;
103 BRep_Tool::PolygonOnTriangulation (theEdge, aHIndices, aTriangulation, aLocation);
104 if (!aHIndices.IsNull())
106 if ((aHIndices->Deflection() <= theDeflection) || aCurve3d.IsNull())
108 const TColStd_Array1OfInteger& anIndices = aHIndices->Nodes();
109 const TColgp_Array1OfPnt& aNodes = aTriangulation->Nodes();
111 Standard_Integer anIndex = anIndices.Lower();
112 if (aLocation.IsIdentity())
114 for (; anIndex <= anIndices.Upper(); ++anIndex)
116 thePoints.Append (aNodes (anIndices (anIndex)));
121 for (; anIndex <= anIndices.Upper(); ++anIndex)
123 thePoints.Append (aNodes (anIndices (anIndex)).Transformed (aLocation));
126 return Standard_True;
129 return Standard_False;
132 // =========================================================================
135 // =========================================================================
136 void Prs3d_WFShape::Add (const Handle (Prs3d_Presentation)& thePresentation,
137 const TopoDS_Shape& theShape,
138 const Handle (Prs3d_Drawer)& theDrawer)
140 if (theShape.IsNull())
145 Prs3d_ShapeTool aTool (theShape, theDrawer->VertexDrawMode() == Prs3d_VDM_All);
146 TopTools_ListOfShape aLFree, aLUnFree, aLWire;
147 for (aTool.InitCurve(); aTool.MoreCurve(); aTool.NextCurve())
149 const TopoDS_Edge& anEdge = aTool.GetCurve();
150 switch (aTool.Neighbours())
152 case 0: aLWire.Append (anEdge); break;
153 case 1: aLFree.Append (anEdge); break;
154 default: aLUnFree.Append (anEdge); break;
158 Standard_Real aDeflection = Prs3d::GetDeflection(theShape, theDrawer);
160 Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePresentation);
162 Prs3d_NListOfSequenceOfPnt anUIsoCurves;
163 Prs3d_NListOfSequenceOfPnt aVIsoCurves;
164 Prs3d_NListOfSequenceOfPnt aWireCurves;
165 Prs3d_NListOfSequenceOfPnt aFreeCurves;
166 Prs3d_NListOfSequenceOfPnt anUnFreeCurves;
168 const Standard_Integer anIsoU = theDrawer->UIsoAspect()->Number();
169 const Standard_Integer anIsoV = theDrawer->VIsoAspect()->Number();
171 Standard_Boolean hasIsoU = anIsoU > 0;
172 Standard_Boolean hasIsoV = anIsoV > 0;
174 if (IsSame (theDrawer->UIsoAspect()->Aspect(),
175 theDrawer->VIsoAspect()->Aspect()))
177 if (hasIsoU || hasIsoV)
179 BRepAdaptor_Surface aSurface;
180 for (aTool.InitFace(); aTool.MoreFace(); aTool.NextFace())
182 if (aTool.HasSurface())
184 if (!aTool.IsPlanarFace() || theDrawer->IsoOnPlane())
186 aSurface.Initialize (aTool.GetFace());
187 Handle(BRepAdaptor_HSurface) aHSurface = new BRepAdaptor_HSurface (aSurface);
191 Prs3d_NListOfSequenceOfPnt aCurUIsoCurves;
192 myFaceAlgo.Add (thePresentation, aHSurface,
198 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
199 for (anIt.Init (aCurUIsoCurves); anIt.More(); anIt.Next())
201 anUIsoCurves.Append (anIt.Value());
204 catch (Standard_Failure)
216 BRepAdaptor_Surface aSurface;
217 for (aTool.InitFace(); aTool.MoreFace(); aTool.NextFace())
219 if (aTool.HasSurface())
221 if (!aTool.IsPlanarFace() || theDrawer->IsoOnPlane())
223 aSurface.Initialize (aTool.GetFace());
224 Handle(BRepAdaptor_HSurface) aHSurface = new BRepAdaptor_HSurface (aSurface);
228 Prs3d_NListOfSequenceOfPnt aCurUIsoCurves;
229 myFaceAlgo.Add (thePresentation, aHSurface,
230 hasIsoU, Standard_False,
236 catch (Standard_Failure)
239 const TopoDS_Face& aFace = aSurface.Face();
240 std::cout << "Problem with the face " << (void* ) &(*(aFace).TShape()) << std::endl;
249 BRepAdaptor_Surface aSurface;
250 for (aTool.InitFace(); aTool.MoreFace(); aTool.NextFace())
252 if (aTool.HasSurface())
254 if (!aTool.IsPlanarFace() || theDrawer->IsoOnPlane())
256 aSurface.Initialize (aTool.GetFace());
257 Handle(BRepAdaptor_HSurface) aHSurface = new BRepAdaptor_HSurface (aSurface);
261 Prs3d_NListOfSequenceOfPnt aCurUIsoCurves;
262 myFaceAlgo.Add (thePresentation, aHSurface,
263 Standard_False, hasIsoV,
269 catch (Standard_Failure)
272 const TopoDS_Face& aFace = aSurface.Face();
273 std::cout << "Problem with the face " << (void* ) &(*(aFace).TShape()) << std::endl;
282 Standard_Integer aNbVertices = 0, aNbBounds = 0;
283 if (anUIsoCurves.Size() > 0)
285 aNbBounds = anUIsoCurves.Size();
286 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
287 for (anIt.Init (anUIsoCurves); anIt.More(); anIt.Next())
289 aNbVertices += anIt.Value()->Length();
291 Handle(Graphic3d_ArrayOfPolylines) anUIsoArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
292 for (anIt.Init (anUIsoCurves); anIt.More(); anIt.Next())
294 const Handle(TColgp_HSequenceOfPnt)& aPoints = anIt.Value();
295 anUIsoArray->AddBound (aPoints->Length());
296 for (Standard_Integer anI = 1; anI <= aPoints->Length(); ++anI)
298 anUIsoArray->AddVertex (aPoints->Value (anI));
301 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
302 aGroup->SetPrimitivesAspect (theDrawer->UIsoAspect()->Aspect());
303 aGroup->AddPrimitiveArray (anUIsoArray);
306 // NOTE: THIS BLOCK WILL NEVER EXECUTE AS aVIsoCurves IS NOT FILLED!!
307 if (aVIsoCurves.Size() > 0)
309 aNbBounds = aVIsoCurves.Size();
310 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
311 for (anIt.Init (aVIsoCurves); anIt.More(); anIt.Next())
313 aNbVertices += anIt.Value()->Length();
315 Handle(Graphic3d_ArrayOfPolylines) VIsoArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
316 for (anIt.Init (aVIsoCurves); anIt.More(); anIt.Next())
318 const Handle(TColgp_HSequenceOfPnt)& aPoints = anIt.Value();
319 VIsoArray->AddBound (aPoints->Length());
320 for (int anI = 1; anI <= aPoints->Length(); anI++)
322 VIsoArray->AddVertex (aPoints->Value (anI));
325 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
326 aGroup->SetPrimitivesAspect (theDrawer->VIsoAspect()->Aspect());
327 aGroup->AddPrimitiveArray (VIsoArray);
330 TopLoc_Location aLocation;
331 Standard_Integer anI, aJ, aN[3];
333 TColgp_SequenceOfPnt aSurfPoints;
334 for (aTool.InitFace(); aTool.MoreFace(); aTool.NextFace())
336 if (!aTool.HasSurface())
338 Handle(Poly_Triangulation) T = aTool.CurrentTriangulation (aLocation);
341 const TColgp_Array1OfPnt& aNodes = T->Nodes();
342 // Build the connect tool
343 Poly_Connect aPolyConnect (T);
345 Standard_Integer aNbTriangles = T->NbTriangles();
346 Standard_Integer aT[3];
348 // Count the free edges
349 Standard_Integer aNbFree = 0;
350 for (anI = 1; anI <= aNbTriangles; ++anI)
352 aPolyConnect.Triangles (anI, aT[0], aT[1], aT[2]);
353 for (aJ = 0; aJ < 3; ++aJ)
362 // Allocate the arrays
363 TColStd_Array1OfInteger aFree (1, 2 * aNbFree);
364 Standard_Integer aNbInternal = (3 * aNbTriangles - aNbFree) / 2;
365 TColStd_Array1OfInteger anInternal (0, 2 * aNbInternal);
367 Standard_Integer aFreeIndex = 1, anIntIndex = 1;
368 const Poly_Array1OfTriangle& aTriangles = T->Triangles();
369 for (anI = 1; anI <= aNbTriangles; ++anI)
371 aPolyConnect.Triangles (anI, aT[0], aT[1], aT[2]);
372 aTriangles (anI).Get (aN[0], aN[1], aN[2]);
373 for (aJ = 0; aJ < 3; aJ++)
375 Standard_Integer k = (aJ + 1) % 3;
378 aFree (aFreeIndex) = aN[aJ];
379 aFree (aFreeIndex + 1) = aN[k];
382 // internal edge if this triangle has a lower index than the adjacent
383 else if (anI < aT[aJ])
385 anInternal (anIntIndex) = aN[aJ];
386 anInternal (anIntIndex + 1) = aN[k];
392 if (!aTool.HasSurface())
395 Standard_Integer aFreeHalfNb = aFree.Length() / 2;
396 for (anI = 1; anI <= aFreeHalfNb; ++anI)
398 gp_Pnt aPoint1 = aNodes (aFree (2 * anI - 1)).Transformed (aLocation);
399 gp_Pnt aPoint2 = aNodes (aFree (2 * anI )).Transformed (aLocation);
400 aSurfPoints.Append (aPoint1);
401 aSurfPoints.Append (aPoint2);
407 if (aSurfPoints.Length() > 0)
409 aNbVertices = aSurfPoints.Length();
410 aNbBounds = (Standard_Integer)aNbVertices / 2;
411 Handle(Graphic3d_ArrayOfPolylines) aSurfArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
412 for (anI = 1; anI <= aNbVertices; anI += 2)
414 aSurfArray->AddBound (2);
415 aSurfArray->AddVertex (aSurfPoints.Value (anI));
416 aSurfArray->AddVertex (aSurfPoints.Value (anI + 1));
418 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
419 aGroup->SetPrimitivesAspect (theDrawer->FreeBoundaryAspect()->Aspect());
420 aGroup->AddPrimitiveArray (aSurfArray);
423 TopTools_ListIteratorOfListOfShape anIt;
424 if (theDrawer->WireDraw())
426 // Wire (without any neighbour)
427 aGroup->SetPrimitivesAspect (theDrawer->WireAspect()->Aspect());
428 for (anIt.Initialize(aLWire); anIt.More(); anIt.Next())
430 const TopoDS_Edge& anEdge = TopoDS::Edge (anIt.Value());
434 const Handle(TColgp_HSequenceOfPnt)& aPoints = new TColgp_HSequenceOfPnt;
435 if (!AddPolygon (anEdge, aDeflection, aPoints->ChangeSequence()))
437 if (BRep_Tool::IsGeometric (anEdge))
439 BRepAdaptor_Curve aCurve (anEdge);
440 myCurveAlgo.Add (thePresentation, aCurve, aDeflection, theDrawer,
441 aPoints->ChangeSequence(), Standard_False);
442 aWireCurves.Append (aPoints);
447 aWireCurves.Append (aPoints);
450 catch (Standard_Failure)
453 std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
459 if (theDrawer->FreeBoundaryDraw())
462 for (anIt.Initialize (aLFree); anIt.More(); anIt.Next())
464 const TopoDS_Edge& anEdge = TopoDS::Edge (anIt.Value());
465 if (!BRep_Tool::Degenerated (anEdge))
470 const Handle(TColgp_HSequenceOfPnt)& aPoints = new TColgp_HSequenceOfPnt;
471 if (!AddPolygon (anEdge, aDeflection, aPoints->ChangeSequence()))
473 if (BRep_Tool::IsGeometric (anEdge))
475 BRepAdaptor_Curve aCurve (anEdge);
476 myCurveAlgo.Add (thePresentation, aCurve, aDeflection, theDrawer,
477 aPoints->ChangeSequence(), Standard_False);
478 aFreeCurves.Append (aPoints);
483 aFreeCurves.Append (aPoints);
486 catch (Standard_Failure)
489 std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
496 if (theDrawer->UnFreeBoundaryDraw())
498 // Unfree boundaries;
499 for (anIt.Initialize (aLUnFree); anIt.More(); anIt.Next())
501 const TopoDS_Edge& anEdge = TopoDS::Edge (anIt.Value());
505 const Handle(TColgp_HSequenceOfPnt)& aPoints = new TColgp_HSequenceOfPnt;
506 if (!AddPolygon (anEdge, aDeflection, aPoints->ChangeSequence()))
508 if (BRep_Tool::IsGeometric (anEdge))
510 BRepAdaptor_Curve aCurve (anEdge);
511 myCurveAlgo.Add (thePresentation, aCurve, aDeflection, theDrawer, aPoints->ChangeSequence(), Standard_False);
512 anUnFreeCurves.Append (aPoints);
517 anUnFreeCurves.Append (aPoints);
520 catch (Standard_Failure)
523 std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
529 if (aWireCurves.Size() > 0)
531 aNbBounds = aWireCurves.Size();
532 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
533 for (anIt.Init (aWireCurves); anIt.More(); anIt.Next())
535 aNbVertices += anIt.Value()->Length();
537 Handle(Graphic3d_ArrayOfPolylines) WireArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
538 for (anIt.Init (aWireCurves); anIt.More(); anIt.Next())
540 const Handle(TColgp_HSequenceOfPnt)& aPoints = anIt.Value();
541 WireArray->AddBound (aPoints->Length());
542 for (anI = 1; anI <= aPoints->Length(); ++anI)
544 WireArray->AddVertex (aPoints->Value (anI));
547 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
548 aGroup->SetPrimitivesAspect (theDrawer->WireAspect()->Aspect());
549 aGroup->AddPrimitiveArray (WireArray);
552 if (aFreeCurves.Size() > 0)
554 aNbBounds = aFreeCurves.Size();
555 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
556 for (anIt.Init (aFreeCurves); anIt.More(); anIt.Next())
558 aNbVertices += anIt.Value()->Length();
560 Handle(Graphic3d_ArrayOfPolylines) aFreeArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
561 for (anIt.Init(aFreeCurves); anIt.More(); anIt.Next())
563 const Handle(TColgp_HSequenceOfPnt)& aPoints = anIt.Value();
564 aFreeArray->AddBound (aPoints->Length());
565 for (anI = 1; anI <= aPoints->Length(); ++anI)
567 aFreeArray->AddVertex (aPoints->Value (anI));
570 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
571 aGroup->SetPrimitivesAspect (theDrawer->FreeBoundaryAspect()->Aspect());
572 aGroup->AddPrimitiveArray (aFreeArray);
575 if (anUnFreeCurves.Size() > 0)
577 aNbBounds = anUnFreeCurves.Size();
578 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
579 for (anIt.Init (anUnFreeCurves); anIt.More(); anIt.Next())
581 aNbVertices += anIt.Value()->Length();
583 Handle(Graphic3d_ArrayOfPolylines) anUnFreeArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
584 for (anIt.Init (anUnFreeCurves); anIt.More(); anIt.Next())
586 const Handle(TColgp_HSequenceOfPnt)& aPoints = anIt.Value();
587 anUnFreeArray->AddBound (aPoints->Length());
588 for (anI = 1; anI <= aPoints->Length(); ++anI)
590 anUnFreeArray->AddVertex (aPoints->Value (anI));
593 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
594 aGroup->SetPrimitivesAspect (theDrawer->UnFreeBoundaryAspect()->Aspect());
595 aGroup->AddPrimitiveArray (anUnFreeArray);
599 TColgp_SequenceOfPnt aShapePoints;
600 for (aTool.InitVertex(); aTool.MoreVertex(); aTool.NextVertex())
602 aShapePoints.Append (BRep_Tool::Pnt (aTool.GetVertex()));
605 aNbVertices = aShapePoints.Length();
608 Handle(Graphic3d_ArrayOfPoints) aPointArray = new Graphic3d_ArrayOfPoints (aNbVertices);
609 for (anI = 1; anI <= aNbVertices; ++anI)
611 aPointArray->AddVertex (aShapePoints.Value (anI));
614 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
615 aGroup->SetPrimitivesAspect (theDrawer->PointAspect()->Aspect());
616 aGroup->AddPrimitiveArray (aPointArray);
620 // =========================================================================
621 // function: PickCurve
623 // =========================================================================
624 Handle(TopTools_HSequenceOfShape) Prs3d_WFShape::PickCurve
625 (const Quantity_Length theX,
626 const Quantity_Length theY,
627 const Quantity_Length theZ,
628 const Quantity_Length theDistance,
629 const TopoDS_Shape& theShape,
630 const Handle (Prs3d_Drawer)& theDrawer)
632 Handle(TopTools_HSequenceOfShape) aSeq = new TopTools_HSequenceOfShape();
633 Prs3d_ShapeTool aTool (theShape);
634 for (aTool.InitCurve(); aTool.MoreCurve(); aTool.NextCurve())
636 Bnd_Box aBndBox = aTool.CurveBound();
637 aBndBox.Enlarge (theDistance);
638 if (!aBndBox.IsOut (gp_Pnt (theX, theY, theZ)))
640 if (myCurveAlgo.Match (theX, theY, theZ, theDistance,
641 BRepAdaptor_Curve (aTool.GetCurve()), theDrawer))
643 Standard_Boolean isContain = Standard_False;
644 for (Standard_Integer anI = 1; anI <= aSeq->Length(); ++anI)
646 if (aSeq->Value (anI) == (aTool.GetCurve()))
648 isContain = Standard_True;
654 aSeq->Append (aTool.GetCurve());
662 // =========================================================================
663 // function: PickPatch
665 // =========================================================================
666 Handle(TopTools_HSequenceOfShape) Prs3d_WFShape::PickPatch
667 (const Quantity_Length theX,
668 const Quantity_Length theY,
669 const Quantity_Length theZ,
670 const Quantity_Length theDistance,
671 const TopoDS_Shape& theShape,
672 const Handle(Prs3d_Drawer)& theDrawer)
674 Handle(TopTools_HSequenceOfShape) aSeq = new TopTools_HSequenceOfShape();
675 Prs3d_ShapeTool aTool (theShape);
677 Standard_Boolean aRba1 = theDrawer->UIsoAspect()->Number() != 0;
678 Standard_Boolean aRba2 = theDrawer->VIsoAspect()->Number() != 0;
679 Standard_Boolean isContain;
683 BRepAdaptor_Surface aSurface;
684 for (aTool.InitFace(); aTool.MoreFace(); aTool.NextFace())
686 Bnd_Box aBndBox = aTool.FaceBound();
687 aBndBox.Enlarge (theDistance);
688 if (!aBndBox.IsOut (gp_Pnt (theX, theY, theZ)))
690 aSurface.Initialize (aTool.GetFace());
691 Handle(BRepAdaptor_HSurface) aHSurface = new BRepAdaptor_HSurface (aSurface);
692 if (myFaceAlgo.Match (theX, theY, theZ, theDistance, aHSurface, theDrawer))
694 isContain = Standard_False;
695 for (Standard_Integer anI = 1; anI <= aSeq->Length(); ++anI)
697 if (aSeq->Value (anI) == (aTool.GetFace()))
699 isContain = Standard_True;
705 aSeq->Append (aTool.GetFace());
712 for (aTool.InitCurve(); aTool.MoreCurve(); aTool.NextCurve())
714 Bnd_Box aBndBox = aTool.CurveBound();
715 aBndBox.Enlarge (theDistance);
716 if (!aBndBox.IsOut (gp_Pnt (theX, theY, theZ)))
718 if (myCurveAlgo.Match (theX, theY, theZ, theDistance,
719 BRepAdaptor_Curve(aTool.GetCurve()), theDrawer))
721 Handle(TopTools_HSequenceOfShape) aSurface = aTool.FacesOfEdge();
722 for (Standard_Integer anI = 1; anI <= aSurface->Length(); ++anI)
724 isContain = Standard_False;
725 for (Standard_Integer aJ = 1; aJ <= aSeq->Length(); ++aJ)
727 if (aSeq->Value (aJ) == (aSurface->Value (anI)))
729 isContain = Standard_True;
735 aSeq->Append (aSurface->Value (anI));