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 Prs3d_NListOfSequenceOfPnt anUIsoCurves;
161 Prs3d_NListOfSequenceOfPnt aVIsoCurves;
162 Prs3d_NListOfSequenceOfPnt aWireCurves;
163 Prs3d_NListOfSequenceOfPnt aFreeCurves;
164 Prs3d_NListOfSequenceOfPnt anUnFreeCurves;
166 const Standard_Integer anIsoU = theDrawer->UIsoAspect()->Number();
167 const Standard_Integer anIsoV = theDrawer->VIsoAspect()->Number();
169 Standard_Boolean hasIsoU = anIsoU > 0;
170 Standard_Boolean hasIsoV = anIsoV > 0;
172 if (IsSame (theDrawer->UIsoAspect()->Aspect(),
173 theDrawer->VIsoAspect()->Aspect()))
175 if (hasIsoU || hasIsoV)
177 BRepAdaptor_Surface aSurface;
178 for (aTool.InitFace(); aTool.MoreFace(); aTool.NextFace())
180 if (aTool.HasSurface())
182 if (!aTool.IsPlanarFace() || theDrawer->IsoOnPlane())
184 aSurface.Initialize (aTool.GetFace());
185 Handle(BRepAdaptor_HSurface) aHSurface = new BRepAdaptor_HSurface (aSurface);
189 Prs3d_NListOfSequenceOfPnt aCurUIsoCurves;
190 myFaceAlgo.Add (thePresentation, aHSurface,
196 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
197 for (anIt.Init (aCurUIsoCurves); anIt.More(); anIt.Next())
199 anUIsoCurves.Append (anIt.Value());
202 catch (Standard_Failure)
214 BRepAdaptor_Surface aSurface;
215 for (aTool.InitFace(); aTool.MoreFace(); aTool.NextFace())
217 if (aTool.HasSurface())
219 if (!aTool.IsPlanarFace() || theDrawer->IsoOnPlane())
221 aSurface.Initialize (aTool.GetFace());
222 Handle(BRepAdaptor_HSurface) aHSurface = new BRepAdaptor_HSurface (aSurface);
226 Prs3d_NListOfSequenceOfPnt aCurUIsoCurves;
227 myFaceAlgo.Add (thePresentation, aHSurface,
228 hasIsoU, Standard_False,
234 catch (Standard_Failure)
237 const TopoDS_Face& aFace = aSurface.Face();
238 std::cout << "Problem with the face " << (void* ) &(*(aFace).TShape()) << std::endl;
247 BRepAdaptor_Surface aSurface;
248 for (aTool.InitFace(); aTool.MoreFace(); aTool.NextFace())
250 if (aTool.HasSurface())
252 if (!aTool.IsPlanarFace() || theDrawer->IsoOnPlane())
254 aSurface.Initialize (aTool.GetFace());
255 Handle(BRepAdaptor_HSurface) aHSurface = new BRepAdaptor_HSurface (aSurface);
259 Prs3d_NListOfSequenceOfPnt aCurUIsoCurves;
260 myFaceAlgo.Add (thePresentation, aHSurface,
261 Standard_False, hasIsoV,
267 catch (Standard_Failure)
270 const TopoDS_Face& aFace = aSurface.Face();
271 std::cout << "Problem with the face " << (void* ) &(*(aFace).TShape()) << std::endl;
280 Standard_Integer aNbVertices = 0, aNbBounds = 0;
281 if (anUIsoCurves.Size() > 0)
283 aNbBounds = anUIsoCurves.Size();
284 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
285 for (anIt.Init (anUIsoCurves); anIt.More(); anIt.Next())
287 aNbVertices += anIt.Value()->Length();
289 Handle(Graphic3d_ArrayOfPolylines) anUIsoArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
290 for (anIt.Init (anUIsoCurves); anIt.More(); anIt.Next())
292 const Handle(TColgp_HSequenceOfPnt)& aPoints = anIt.Value();
293 anUIsoArray->AddBound (aPoints->Length());
294 for (Standard_Integer anI = 1; anI <= aPoints->Length(); ++anI)
296 anUIsoArray->AddVertex (aPoints->Value (anI));
299 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
300 aGroup->SetPrimitivesAspect (theDrawer->UIsoAspect()->Aspect());
301 aGroup->AddPrimitiveArray (anUIsoArray);
304 // NOTE: THIS BLOCK WILL NEVER EXECUTE AS aVIsoCurves IS NOT FILLED!!
305 if (aVIsoCurves.Size() > 0)
307 aNbBounds = aVIsoCurves.Size();
308 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
309 for (anIt.Init (aVIsoCurves); anIt.More(); anIt.Next())
311 aNbVertices += anIt.Value()->Length();
313 Handle(Graphic3d_ArrayOfPolylines) VIsoArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
314 for (anIt.Init (aVIsoCurves); anIt.More(); anIt.Next())
316 const Handle(TColgp_HSequenceOfPnt)& aPoints = anIt.Value();
317 VIsoArray->AddBound (aPoints->Length());
318 for (int anI = 1; anI <= aPoints->Length(); anI++)
320 VIsoArray->AddVertex (aPoints->Value (anI));
323 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
324 aGroup->SetPrimitivesAspect (theDrawer->VIsoAspect()->Aspect());
325 aGroup->AddPrimitiveArray (VIsoArray);
328 TopLoc_Location aLocation;
329 Standard_Integer anI, aJ, aN[3];
331 TColgp_SequenceOfPnt aSurfPoints;
332 for (aTool.InitFace(); aTool.MoreFace(); aTool.NextFace())
334 if (!aTool.HasSurface())
336 Handle(Poly_Triangulation) T = aTool.CurrentTriangulation (aLocation);
339 const TColgp_Array1OfPnt& aNodes = T->Nodes();
340 // Build the connect tool
341 Poly_Connect aPolyConnect (T);
343 Standard_Integer aNbTriangles = T->NbTriangles();
344 Standard_Integer aT[3];
346 // Count the free edges
347 Standard_Integer aNbFree = 0;
348 for (anI = 1; anI <= aNbTriangles; ++anI)
350 aPolyConnect.Triangles (anI, aT[0], aT[1], aT[2]);
351 for (aJ = 0; aJ < 3; ++aJ)
360 // Allocate the arrays
361 TColStd_Array1OfInteger aFree (1, 2 * aNbFree);
362 Standard_Integer aNbInternal = (3 * aNbTriangles - aNbFree) / 2;
363 TColStd_Array1OfInteger anInternal (0, 2 * aNbInternal);
365 Standard_Integer aFreeIndex = 1, anIntIndex = 1;
366 const Poly_Array1OfTriangle& aTriangles = T->Triangles();
367 for (anI = 1; anI <= aNbTriangles; ++anI)
369 aPolyConnect.Triangles (anI, aT[0], aT[1], aT[2]);
370 aTriangles (anI).Get (aN[0], aN[1], aN[2]);
371 for (aJ = 0; aJ < 3; aJ++)
373 Standard_Integer k = (aJ + 1) % 3;
376 aFree (aFreeIndex) = aN[aJ];
377 aFree (aFreeIndex + 1) = aN[k];
380 // internal edge if this triangle has a lower index than the adjacent
381 else if (anI < aT[aJ])
383 anInternal (anIntIndex) = aN[aJ];
384 anInternal (anIntIndex + 1) = aN[k];
390 if (!aTool.HasSurface())
393 Standard_Integer aFreeHalfNb = aFree.Length() / 2;
394 for (anI = 1; anI <= aFreeHalfNb; ++anI)
396 gp_Pnt aPoint1 = aNodes (aFree (2 * anI - 1)).Transformed (aLocation);
397 gp_Pnt aPoint2 = aNodes (aFree (2 * anI )).Transformed (aLocation);
398 aSurfPoints.Append (aPoint1);
399 aSurfPoints.Append (aPoint2);
405 if (aSurfPoints.Length() > 0)
407 aNbVertices = aSurfPoints.Length();
408 aNbBounds = (Standard_Integer)aNbVertices / 2;
409 Handle(Graphic3d_ArrayOfPolylines) aSurfArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
410 for (anI = 1; anI <= aNbVertices; anI += 2)
412 aSurfArray->AddBound (2);
413 aSurfArray->AddVertex (aSurfPoints.Value (anI));
414 aSurfArray->AddVertex (aSurfPoints.Value (anI + 1));
416 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
417 aGroup->SetPrimitivesAspect (theDrawer->FreeBoundaryAspect()->Aspect());
418 aGroup->AddPrimitiveArray (aSurfArray);
421 TopTools_ListIteratorOfListOfShape anIt;
422 if (theDrawer->WireDraw())
424 // Wire (without any neighbour)
425 for (anIt.Initialize(aLWire); anIt.More(); anIt.Next())
427 const TopoDS_Edge& anEdge = TopoDS::Edge (anIt.Value());
431 const Handle(TColgp_HSequenceOfPnt)& aPoints = new TColgp_HSequenceOfPnt;
432 if (!AddPolygon (anEdge, aDeflection, aPoints->ChangeSequence()))
434 if (BRep_Tool::IsGeometric (anEdge))
436 BRepAdaptor_Curve aCurve (anEdge);
437 myCurveAlgo.Add (thePresentation, aCurve, aDeflection, theDrawer,
438 aPoints->ChangeSequence(), Standard_False);
439 aWireCurves.Append (aPoints);
444 aWireCurves.Append (aPoints);
447 catch (Standard_Failure)
450 std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
456 if (theDrawer->FreeBoundaryDraw())
459 for (anIt.Initialize (aLFree); anIt.More(); anIt.Next())
461 const TopoDS_Edge& anEdge = TopoDS::Edge (anIt.Value());
462 if (!BRep_Tool::Degenerated (anEdge))
467 const Handle(TColgp_HSequenceOfPnt)& aPoints = new TColgp_HSequenceOfPnt;
468 if (!AddPolygon (anEdge, aDeflection, aPoints->ChangeSequence()))
470 if (BRep_Tool::IsGeometric (anEdge))
472 BRepAdaptor_Curve aCurve (anEdge);
473 myCurveAlgo.Add (thePresentation, aCurve, aDeflection, theDrawer,
474 aPoints->ChangeSequence(), Standard_False);
475 aFreeCurves.Append (aPoints);
480 aFreeCurves.Append (aPoints);
483 catch (Standard_Failure)
486 std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
493 if (theDrawer->UnFreeBoundaryDraw())
495 // Unfree boundaries;
496 for (anIt.Initialize (aLUnFree); anIt.More(); anIt.Next())
498 const TopoDS_Edge& anEdge = TopoDS::Edge (anIt.Value());
502 const Handle(TColgp_HSequenceOfPnt)& aPoints = new TColgp_HSequenceOfPnt;
503 if (!AddPolygon (anEdge, aDeflection, aPoints->ChangeSequence()))
505 if (BRep_Tool::IsGeometric (anEdge))
507 BRepAdaptor_Curve aCurve (anEdge);
508 myCurveAlgo.Add (thePresentation, aCurve, aDeflection, theDrawer, aPoints->ChangeSequence(), Standard_False);
509 anUnFreeCurves.Append (aPoints);
514 anUnFreeCurves.Append (aPoints);
517 catch (Standard_Failure)
520 std::cout << "probleme sur aLocation'edge " << (void* ) &(*(anEdge).TShape()) << std::endl;
526 if (aWireCurves.Size() > 0)
528 aNbBounds = aWireCurves.Size();
529 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
530 for (anIt.Init (aWireCurves); anIt.More(); anIt.Next())
532 aNbVertices += anIt.Value()->Length();
534 Handle(Graphic3d_ArrayOfPolylines) WireArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
535 for (anIt.Init (aWireCurves); anIt.More(); anIt.Next())
537 const Handle(TColgp_HSequenceOfPnt)& aPoints = anIt.Value();
538 WireArray->AddBound (aPoints->Length());
539 for (anI = 1; anI <= aPoints->Length(); ++anI)
541 WireArray->AddVertex (aPoints->Value (anI));
544 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
545 aGroup->SetPrimitivesAspect (theDrawer->WireAspect()->Aspect());
546 aGroup->AddPrimitiveArray (WireArray);
549 if (aFreeCurves.Size() > 0)
551 aNbBounds = aFreeCurves.Size();
552 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
553 for (anIt.Init (aFreeCurves); anIt.More(); anIt.Next())
555 aNbVertices += anIt.Value()->Length();
557 Handle(Graphic3d_ArrayOfPolylines) aFreeArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
558 for (anIt.Init(aFreeCurves); anIt.More(); anIt.Next())
560 const Handle(TColgp_HSequenceOfPnt)& aPoints = anIt.Value();
561 aFreeArray->AddBound (aPoints->Length());
562 for (anI = 1; anI <= aPoints->Length(); ++anI)
564 aFreeArray->AddVertex (aPoints->Value (anI));
567 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
568 aGroup->SetPrimitivesAspect (theDrawer->FreeBoundaryAspect()->Aspect());
569 aGroup->AddPrimitiveArray (aFreeArray);
572 if (anUnFreeCurves.Size() > 0)
574 aNbBounds = anUnFreeCurves.Size();
575 Prs3d_NListIteratorOfListOfSequenceOfPnt anIt;
576 for (anIt.Init (anUnFreeCurves); anIt.More(); anIt.Next())
578 aNbVertices += anIt.Value()->Length();
580 Handle(Graphic3d_ArrayOfPolylines) anUnFreeArray = new Graphic3d_ArrayOfPolylines (aNbVertices, aNbBounds);
581 for (anIt.Init (anUnFreeCurves); anIt.More(); anIt.Next())
583 const Handle(TColgp_HSequenceOfPnt)& aPoints = anIt.Value();
584 anUnFreeArray->AddBound (aPoints->Length());
585 for (anI = 1; anI <= aPoints->Length(); ++anI)
587 anUnFreeArray->AddVertex (aPoints->Value (anI));
590 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
591 aGroup->SetPrimitivesAspect (theDrawer->UnFreeBoundaryAspect()->Aspect());
592 aGroup->AddPrimitiveArray (anUnFreeArray);
596 TColgp_SequenceOfPnt aShapePoints;
597 for (aTool.InitVertex(); aTool.MoreVertex(); aTool.NextVertex())
599 aShapePoints.Append (BRep_Tool::Pnt (aTool.GetVertex()));
602 aNbVertices = aShapePoints.Length();
605 Handle(Graphic3d_ArrayOfPoints) aPointArray = new Graphic3d_ArrayOfPoints (aNbVertices);
606 for (anI = 1; anI <= aNbVertices; ++anI)
608 aPointArray->AddVertex (aShapePoints.Value (anI));
611 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
612 aGroup->SetPrimitivesAspect (theDrawer->PointAspect()->Aspect());
613 aGroup->AddPrimitiveArray (aPointArray);
617 // =========================================================================
618 // function: PickCurve
620 // =========================================================================
621 Handle(TopTools_HSequenceOfShape) Prs3d_WFShape::PickCurve
622 (const Quantity_Length theX,
623 const Quantity_Length theY,
624 const Quantity_Length theZ,
625 const Quantity_Length theDistance,
626 const TopoDS_Shape& theShape,
627 const Handle (Prs3d_Drawer)& theDrawer)
629 Handle(TopTools_HSequenceOfShape) aSeq = new TopTools_HSequenceOfShape();
630 Prs3d_ShapeTool aTool (theShape);
631 for (aTool.InitCurve(); aTool.MoreCurve(); aTool.NextCurve())
633 Bnd_Box aBndBox = aTool.CurveBound();
634 aBndBox.Enlarge (theDistance);
635 if (!aBndBox.IsOut (gp_Pnt (theX, theY, theZ)))
637 if (myCurveAlgo.Match (theX, theY, theZ, theDistance,
638 BRepAdaptor_Curve (aTool.GetCurve()), theDrawer))
640 Standard_Boolean isContain = Standard_False;
641 for (Standard_Integer anI = 1; anI <= aSeq->Length(); ++anI)
643 if (aSeq->Value (anI) == (aTool.GetCurve()))
645 isContain = Standard_True;
651 aSeq->Append (aTool.GetCurve());
659 // =========================================================================
660 // function: PickPatch
662 // =========================================================================
663 Handle(TopTools_HSequenceOfShape) Prs3d_WFShape::PickPatch
664 (const Quantity_Length theX,
665 const Quantity_Length theY,
666 const Quantity_Length theZ,
667 const Quantity_Length theDistance,
668 const TopoDS_Shape& theShape,
669 const Handle(Prs3d_Drawer)& theDrawer)
671 Handle(TopTools_HSequenceOfShape) aSeq = new TopTools_HSequenceOfShape();
672 Prs3d_ShapeTool aTool (theShape);
674 Standard_Boolean aRba1 = theDrawer->UIsoAspect()->Number() != 0;
675 Standard_Boolean aRba2 = theDrawer->VIsoAspect()->Number() != 0;
676 Standard_Boolean isContain;
680 BRepAdaptor_Surface aSurface;
681 for (aTool.InitFace(); aTool.MoreFace(); aTool.NextFace())
683 Bnd_Box aBndBox = aTool.FaceBound();
684 aBndBox.Enlarge (theDistance);
685 if (!aBndBox.IsOut (gp_Pnt (theX, theY, theZ)))
687 aSurface.Initialize (aTool.GetFace());
688 Handle(BRepAdaptor_HSurface) aHSurface = new BRepAdaptor_HSurface (aSurface);
689 if (myFaceAlgo.Match (theX, theY, theZ, theDistance, aHSurface, theDrawer))
691 isContain = Standard_False;
692 for (Standard_Integer anI = 1; anI <= aSeq->Length(); ++anI)
694 if (aSeq->Value (anI) == (aTool.GetFace()))
696 isContain = Standard_True;
702 aSeq->Append (aTool.GetFace());
709 for (aTool.InitCurve(); aTool.MoreCurve(); aTool.NextCurve())
711 Bnd_Box aBndBox = aTool.CurveBound();
712 aBndBox.Enlarge (theDistance);
713 if (!aBndBox.IsOut (gp_Pnt (theX, theY, theZ)))
715 if (myCurveAlgo.Match (theX, theY, theZ, theDistance,
716 BRepAdaptor_Curve(aTool.GetCurve()), theDrawer))
718 Handle(TopTools_HSequenceOfShape) aSurface = aTool.FacesOfEdge();
719 for (Standard_Integer anI = 1; anI <= aSurface->Length(); ++anI)
721 isContain = Standard_False;
722 for (Standard_Integer aJ = 1; aJ <= aSeq->Length(); ++aJ)
724 if (aSeq->Value (aJ) == (aSurface->Value (anI)))
726 isContain = Standard_True;
732 aSeq->Append (aSurface->Value (anI));