1 // Created on: 1994-03-10
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 // Modifed: Porting NT 7-5-97 DPF (stdio.h)
18 // Apr 16 2002 eap, classification against infinite solid (occ299)
21 // Modified by skv - Thu Sep 4 12:29:30 2003 OCC578
23 //-- Process the case of a hole!!
29 #include <BRepClass3d_SolidExplorer.ixx>
32 #include <BRepAdaptor_Curve2d.hxx>
33 #include <BRepTools.hxx>
34 #include <Geom2d_Curve.hxx>
35 #include <gp_Vec2d.hxx>
36 #include <GeomAbs_Shape.hxx>
37 #include <BRepAdaptor_Surface.hxx>
38 #include <BRepClass_FacePassiveClassifier.hxx>
39 #include <TopAbs_Orientation.hxx>
40 #include <TopExp_Explorer.hxx>
41 #include <BRepClass_Edge.hxx>
43 #include <Bnd_Box.hxx>
44 #include <BRepBndLib.hxx>
46 #include <BRepAdaptor_HSurface.hxx>
50 #include <BRepClass3d_DataMapIteratorOfMapOfInter.hxx>
51 #include <Precision.hxx>
53 #include <Extrema_ExtPS.hxx>
54 #include <BRep_Tool.hxx>
55 #include <BRepClass_FaceClassifier.hxx>
57 #include <BRepTopAdaptor_FClass2d.hxx>
60 //=======================================================================
61 //function : FindAPointInTheFace
62 //purpose : Compute a point P in the face F. Param is a Real in
63 // ]0,1[ and is used to initialise the algorithm. For
64 // different values , different points are returned.
65 //=======================================================================
67 Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
68 (const TopoDS_Face& _face,
70 Standard_Real& param_)
73 Standard_Boolean r = FindAPointInTheFace(_face,APoint_,u,v,param_);
77 //=======================================================================
78 //function : FindAPointInTheFace
80 //=======================================================================
82 Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
83 (const TopoDS_Face& _face,
85 Standard_Real& u_, Standard_Real& v_,
86 Standard_Real& param_)
88 gp_Vec aVecD1U, aVecD1V;
89 return FindAPointInTheFace (_face, APoint_, u_, v_, param_, aVecD1U, aVecD1V);
92 //=======================================================================
93 //function : FindAPointInTheFace
95 //=======================================================================
97 Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
98 (const TopoDS_Face& _face,
100 Standard_Real& u_, Standard_Real& v_,
101 Standard_Real& param_,
105 TopoDS_Face face = _face;
106 face.Orientation (TopAbs_FORWARD);
108 TopExp_Explorer faceexplorer;
109 BRepAdaptor_Curve2d c;
113 for (faceexplorer.Init(face,TopAbs_EDGE);
117 TopoDS_Edge Edge = TopoDS::Edge (faceexplorer.Current());
118 c.Initialize (Edge, face);
119 c.D1((c.LastParameter() - c.FirstParameter()) * param_ + c.FirstParameter(),P,T);
121 Standard_Real x = T.X();
122 Standard_Real y = T.Y();
123 if (Edge.Orientation() == TopAbs_FORWARD)
131 Standard_Real ParamInit = RealLast();
132 Standard_Real TolInit = 0.00001;
133 Standard_Boolean APointExist = Standard_False;
135 BRepClass_FacePassiveClassifier FClassifier;
138 P.SetCoord (P.X() + TolInit * T.X(), P.Y() + TolInit * T.Y());
139 FClassifier.Reset (gp_Lin2d (P, T), ParamInit, RealEpsilon()); //-- Length and Tolerance #######
141 TopExp_Explorer otherfaceexplorer;
142 Standard_Integer aNbEdges = 0;
143 for (otherfaceexplorer.Init (face, TopAbs_EDGE);
144 otherfaceexplorer.More();
145 otherfaceexplorer.Next(), ++aNbEdges)
147 TopoDS_Edge OtherEdge = TopoDS::Edge (otherfaceexplorer.Current());
148 if (OtherEdge.Orientation() != TopAbs_EXTERNAL && OtherEdge != Edge)
150 BRepClass_Edge AEdge (OtherEdge, face);
151 FClassifier.Compare (AEdge, OtherEdge.Orientation());
152 if (FClassifier.ClosestIntersection())
154 if(ParamInit > FClassifier.Parameter())
156 ParamInit = FClassifier.Parameter();
157 APointExist = Standard_True;
165 BRepClass_Edge AEdge (Edge, face);
166 FClassifier.Compare (AEdge, Edge.Orientation());
167 if (FClassifier.ClosestIntersection())
169 if (ParamInit > FClassifier.Parameter())
171 ParamInit = FClassifier.Parameter();
172 APointExist = Standard_True;
179 ParamInit *= 0.41234;
180 u_ = P.X() + ParamInit* T.X();
181 v_ = P.Y() + ParamInit* T.Y();
184 BRepTopAdaptor_FClass2d Classifier(face, Precision::Confusion());
185 gp_Pnt2d aPnt2d(u_, v_);
186 TopAbs_State StateOfResultingPoint = Classifier.Perform(aPnt2d);
187 if (StateOfResultingPoint != TopAbs_IN)
188 return Standard_False;
190 BRepAdaptor_Surface s;
191 s.Initialize (face, Standard_False);
192 s.D1 (u_, v_, APoint_, theVecD1U, theVecD1V);
194 if(theVecD1U.CrossMagnitude(theVecD1V) > gp::Resolution())
195 return Standard_True;
197 if(ParamInit < Precision::PConfusion())
198 return Standard_False;
201 return Standard_False;
204 //=======================================================================
205 //function : PointInTheFace
207 //=======================================================================
209 Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
210 (const TopoDS_Face& Face,
212 Standard_Real& u_, Standard_Real& v_,
213 Standard_Real& param_,
214 Standard_Integer& IndexPoint,
215 const Handle(BRepAdaptor_HSurface)& surf,
216 const Standard_Real U1,
217 const Standard_Real V1,
218 const Standard_Real U2,
219 const Standard_Real V2) const
221 gp_Vec aVecD1U, aVecD1V;
222 return PointInTheFace (Face, APoint_, u_, v_, param_, IndexPoint, surf,
223 U1, V1, U2, V2, aVecD1U, aVecD1V);
226 //=======================================================================
227 //function : PointInTheFace
229 //=======================================================================
231 Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
232 (const TopoDS_Face& Face,
234 Standard_Real& u_, Standard_Real& v_,
235 Standard_Real& param_,
236 Standard_Integer& IndexPoint,
237 const Handle(BRepAdaptor_HSurface)& surf,
238 const Standard_Real U1,
239 const Standard_Real V1,
240 const Standard_Real U2,
241 const Standard_Real V2,
243 gp_Vec& theVecD1V) const
245 Standard_Real u,du = (U2-U1)/6.0;
246 Standard_Real v,dv = (V2-V1)/6.0;
247 if(du<1e-12) du=1e-12;
248 if(dv<1e-12) dv=1e-12;
249 Standard_Integer NbPntCalc=0;
250 if(myMapOfInter.IsBound(Face)) {
251 void *ptr = (void*)(myMapOfInter.Find(Face));
253 const IntCurvesFace_Intersector& TheIntersector = (*((IntCurvesFace_Intersector *)ptr));
254 // Check if the point is already in the face
255 if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u_,v_))==TopAbs_IN) {
257 surf->D1(u_, v_, aPnt, theVecD1U, theVecD1V);
258 if (aPnt.SquareDistance(APoint_) < Precision::Confusion() * Precision::Confusion())
259 return Standard_True;
262 //-- Take 4 points in each Quarter of surface
263 //-- -> Index : 1 -> 16
266 //-- Then take a matrix of points on a tight grid
268 for(u=du+(U1+U2)*0.5; u<U2; u+=du) { //-- 0 X u increases
269 for(v=dv+(V1+V2)*0.5; v<V2; v+=dv) { //-- 0 0 v increases
270 if(++NbPntCalc>=IndexPoint) {
271 if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
273 surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
274 IndexPoint = NbPntCalc;
275 return(Standard_True);
281 for(u=-du+(U1+U2)*0.5; u>U1; u-=du) { //-- 0 0 u decreases
282 for(v=-dv+(V1+V2)*0.5; v>V1; v-=dv) { //-- X 0 v decreases
283 if(++NbPntCalc>=IndexPoint) {
284 if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
286 surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
287 IndexPoint = NbPntCalc;
288 return(Standard_True);
293 for(u=-du+(U1+U2)*0.5; u>U1; u-=du) { //-- X 0 u decreases
294 for(v=dv+(V1+V2)*0.5; v<V2; v+=dv) { //-- 0 0 v increases
295 if(++NbPntCalc>=IndexPoint) {
296 if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
298 surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
299 IndexPoint = NbPntCalc;
300 return(Standard_True);
305 for(u=du+(U1+U2)*0.5; u<U2; u+=du) { //-- 0 0 u increases
306 for(v=-dv+(V1+V2)*0.5; v>V1; v-=dv) { //-- 0 X v decreases
307 if(++NbPntCalc>=IndexPoint) {
308 if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
310 surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
311 IndexPoint = NbPntCalc;
312 return(Standard_True);
320 if(du<1e-12) du=1e-12;
321 if(dv<1e-12) dv=1e-12;
323 for(u=du+U1; u<U2; u+=du) {
324 for(v=dv+V1; v<V2; v+=dv) {
325 if(++NbPntCalc>=IndexPoint) {
326 if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
328 surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
329 IndexPoint = NbPntCalc;
330 return(Standard_True);
337 if(++NbPntCalc>=IndexPoint) {
338 if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
340 surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
341 IndexPoint = NbPntCalc;
342 return(Standard_True);
346 IndexPoint = NbPntCalc;
349 //printf("BRepClass3d_SolidExplorer Face not found ds the map \n");
352 return BRepClass3d_SolidExplorer
353 ::FindAPointInTheFace (Face,APoint_, u_, v_, param_, theVecD1U, theVecD1V);
356 //=======================================================================
357 //function : LimitInfiniteUV
358 //purpose : Limit infinite parameters
359 //=======================================================================
360 static void LimitInfiniteUV (Standard_Real& U1,
366 infU1 = Precision::IsNegativeInfinite(U1),
367 infV1 = Precision::IsNegativeInfinite(V1),
368 infU2 = Precision::IsPositiveInfinite(U2),
369 infV2 = Precision::IsPositiveInfinite(V2);
371 if (infU1) U1 = -1e10;
372 if (infV1) V1 = -1e10;
373 if (infU2) U2 = 1e10;
374 if (infV2) V2 = 1e10;
376 //=======================================================================
377 //function : IsInfiniteUV
379 //=======================================================================
380 static Standard_Integer IsInfiniteUV (Standard_Real& U1,
385 Standard_Integer aVal = 0;
387 if (Precision::IsInfinite(U1))
390 if (Precision::IsInfinite(V1))
393 if (Precision::IsInfinite(U2))
396 if (Precision::IsInfinite(V2))
402 // Modified by skv - Tue Sep 16 13:50:39 2003 OCC578 End
403 //=======================================================================
404 //function : OtherSegment
405 //purpose : Returns in <L>, <Par> a segment having at least
406 // one intersection with the shape boundary to
407 // compute intersections.
408 // The First Call to this method returns a line which
409 // point to a point of the first face of the shape.
410 // The Second Call provide a line to the second face
412 //=======================================================================
413 Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
417 const Standard_Real TolU = Precision::PConfusion();
418 const Standard_Real TolV = TolU;
421 TopExp_Explorer faceexplorer;
423 gp_Vec aVecD1U, aVecD1V;
424 Standard_Real maxscal=0;
425 Standard_Boolean ptfound=Standard_False;
428 Standard_Integer IndexPoint=0;
429 Standard_Integer NbPointsOK=0;
430 Standard_Integer NbFacesInSolid=0;
434 faceexplorer.Init(myShape,TopAbs_FACE);
435 // look for point on face starting from myFirstFace
436 // Modified by skv - Thu Sep 4 14:31:12 2003 OCC578 Begin
437 // while (faceexplorer.More()) {
438 for (; faceexplorer.More(); faceexplorer.Next()) {
439 // Modified by skv - Thu Sep 4 14:31:12 2003 OCC578 End
441 if (myFirstFace > NbFacesInSolid) continue;
442 face = TopoDS::Face(faceexplorer.Current());
444 Handle(BRepAdaptor_HSurface) surf = new BRepAdaptor_HSurface();
445 surf->ChangeSurface().Initialize(face);
446 Standard_Real U1,V1,U2,V2;
447 U1 = surf->FirstUParameter();
448 V1 = surf->FirstVParameter();
449 U2 = surf->LastUParameter();
450 V2 = surf->LastVParameter();
451 face.Orientation(TopAbs_FORWARD);
453 //avoid process faces from uncorrected shells
454 if( Abs (U2 - U1) < 1.e-12 || Abs(V2 - V1) < 1.e-12) {
458 Standard_Real svmyparam=myParamOnEdge;
460 // Check if the point is on the face or the face is infinite.
461 Standard_Integer anInfFlag = IsInfiniteUV(U1,V1,U2,V2);
463 _u = (U1 + U2) * 0.5;
464 _v = (V1 + V2) * 0.5;
466 GeomAdaptor_Surface GA(BRep_Tool::Surface(face));
467 Extrema_ExtPS Ext(P, GA, TolU, TolV);
469 if (Ext.IsDone() && Ext.NbExt() > 0) {
470 Standard_Integer i, iNear, iEnd;
471 Standard_Real aUx, aVx, Dist2, Dist2Min;
475 Dist2Min = Ext.SquareDistance(1);
477 for (i = 2; i <= iEnd; i++) {
479 aPx.Parameter(aUx, aVx);
480 if (aUx>=U1 && aUx<=U2 && aVx>=V1 && aVx<=V2) {
481 Dist2 = Ext.SquareDistance(i);
482 if (Dist2 < Dist2Min) {
489 Standard_Real aDist2Tresh=1.e-24;
491 if (Dist2Min<aDist2Tresh) {
496 BRepClass_FaceClassifier classifier2d;
500 (Ext.Point(iNear)).Parameter(aU, aV);
502 gp_Pnt2d aPuv(aU, aV);
504 classifier2d.Perform(face,aPuv,Precision::PConfusion());
506 TopAbs_State aState = classifier2d.State();
508 if (aState == TopAbs_IN || aState == TopAbs_ON) {
512 return 3; // skv - the point is on surface but outside face.
517 APoint = (Ext.Point(iNear)).Value();
519 _Par = V.Magnitude();
521 ptfound=Standard_True;
525 // set the parameters found by extrema
526 aPx = Ext.Point(iNear);
527 aPx.Parameter(_u, _v);
528 APoint = aPx.Value();
530 //The point is not ON the face or surface. The face is restricted.
531 // find point in a face not too far from a projection of P on face
533 if (PointInTheFace (face, APoint, _u, _v, myParamOnEdge, ++IndexPoint, surf,
538 gp_Vec V (P, APoint);
540 if (Par > gp::Resolution() &&
541 aVecD1U.Magnitude() > gp::Resolution() &&
542 aVecD1V.Magnitude() > gp::Resolution())
544 gp_Vec Norm = aVecD1U.Crossed (aVecD1V);
545 Standard_Real tt = Norm.Magnitude();
546 tt = Abs (Norm.Dot (V)) / (tt * Par);
552 ptfound = Standard_True;
555 myParamOnEdge=svmyparam;
562 while(IndexPoint<200 && NbPointsOK<16);
564 myParamOnEdge=svmyparam;
570 // Modified by skv - Thu Sep 4 14:32:14 2003 OCC578 Begin
571 // Next is done in the main for(..) loop.
572 // faceexplorer.Next();
573 // Modified by skv - Thu Sep 4 14:32:14 2003 OCC578 End
576 Standard_Boolean encoreuneface = faceexplorer.More();
577 if(ptfound==Standard_False && encoreuneface==Standard_False) {
578 if(myParamOnEdge < 0.0001) {
579 //-- This case takes place when the point is on the solid
580 //-- and this solid is reduced to a face
581 gp_Pnt PBidon(P.X()+1.0,P.Y(),P.Z());
589 } //-- Exploration of the faces
591 if(NbFacesInSolid==0) {
593 myReject=Standard_True;
595 cout<<"\nWARNING : BRepClass3d_SolidExplorer.cxx (Solid without face)"<<endl;
604 if(myParamOnEdge==0.512345) myParamOnEdge = 0.4;
605 else if(myParamOnEdge==0.4) myParamOnEdge = 0.6;
606 else if(myParamOnEdge==0.6) myParamOnEdge = 0.3;
607 else if(myParamOnEdge==0.3) myParamOnEdge = 0.7;
608 else if(myParamOnEdge==0.7) myParamOnEdge = 0.2;
609 else if(myParamOnEdge==0.2) myParamOnEdge = 0.8;
610 else if(myParamOnEdge==0.8) myParamOnEdge = 0.1;
611 else if(myParamOnEdge==0.1) myParamOnEdge = 0.9;
615 if(myParamOnEdge < 0.0001) {
616 gp_Pnt PBidon(P.X()+1.0,P.Y(),P.Z());
624 } //-- for(;;) { ... }
627 // Modified by skv - Thu Sep 4 12:30:14 2003 OCC578 Begin
628 //=======================================================================
629 //function : GetFaceSegmentIndex
630 //purpose : Returns the index of face for which last segment is calculated.
631 //=======================================================================
633 Standard_Integer BRepClass3d_SolidExplorer::GetFaceSegmentIndex() const
637 // Modified by skv - Thu Sep 4 12:30:14 2003 OCC578 End
639 //=======================================================================
640 //function : PointInTheFace
642 //=======================================================================
644 Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
645 (const TopoDS_Face& _face,
647 Standard_Real& u_, Standard_Real& v_,
648 Standard_Real& param_,
649 Standard_Integer& IndexPoint) const
651 TopoDS_Face Face = _face;
652 Face.Orientation(TopAbs_FORWARD);
653 Handle(BRepAdaptor_HSurface) surf = new BRepAdaptor_HSurface();
654 surf->ChangeSurface().Initialize(Face);
655 Standard_Real U1,V1,U2,V2;//,u,v;
656 U1 = surf->FirstUParameter();
657 V1 = surf->FirstVParameter();
658 U2 = surf->LastUParameter();
659 V2 = surf->LastVParameter();
660 LimitInfiniteUV (U1,V1,U2,V2);
661 return(PointInTheFace(Face,APoint_,u_,v_,param_,IndexPoint,surf,U1,V1,U2,V2));
664 //=======================================================================
665 //function : FindAPointInTheFace
667 //=======================================================================
669 Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
670 (const TopoDS_Face& _face,
672 Standard_Real& u_,Standard_Real& v_)
674 Standard_Real param = 0.1;
675 Standard_Boolean r = FindAPointInTheFace(_face,APoint_,u_,v_,param);
679 //=======================================================================
680 //function : FindAPointInTheFace
682 //=======================================================================
684 Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
685 (const TopoDS_Face& _face,
688 Standard_Boolean r = FindAPointInTheFace(_face,APoint_,u,v);
692 //=======================================================================
693 //function : FindAPointInTheFace
695 //=======================================================================
697 Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
698 (const TopoDS_Face& _face,
699 Standard_Real& u_,Standard_Real& v_)
701 Standard_Boolean r = FindAPointInTheFace(_face,APoint,u_,v_);
705 //=======================================================================
706 //function : BRepClass3d_SolidExplorer
708 //=======================================================================
710 BRepClass3d_SolidExplorer::BRepClass3d_SolidExplorer()
713 #include <Standard_ConstructionError.hxx>
715 //=======================================================================
716 //function : BRepClass3d_SolidExplorer
717 //purpose : Raise if called.
718 //=======================================================================
720 //BRepClass3d_SolidExplorer::BRepClass3d_SolidExplorer(const BRepClass3d_SolidExplorer& Oth)
721 BRepClass3d_SolidExplorer::BRepClass3d_SolidExplorer(const BRepClass3d_SolidExplorer& )
723 Standard_ConstructionError::Raise("Magic constructor not allowed");
726 //=======================================================================
727 //function : BRepClass3d_SolidExplorer
729 //=======================================================================
731 BRepClass3d_SolidExplorer::BRepClass3d_SolidExplorer(const TopoDS_Shape& S)
736 //=======================================================================
739 //=======================================================================
741 void BRepClass3d_SolidExplorer::Delete()
746 //=======================================================================
748 //purpose : C++: alias ~
749 //=======================================================================
751 void BRepClass3d_SolidExplorer::Destroy() {
752 BRepClass3d_DataMapIteratorOfMapOfInter iter(myMapOfInter);
753 for(;iter.More();iter.Next()) {
754 void *ptr=iter.Value();
756 delete (IntCurvesFace_Intersector *)ptr;
757 myMapOfInter.ChangeFind(iter.Key()) = NULL;
760 myMapOfInter.Clear();
763 //=======================================================================
764 //function : InitShape
766 //=======================================================================
768 void BRepClass3d_SolidExplorer::InitShape(const TopoDS_Shape& S)
772 myParamOnEdge = 0.512345;
773 //-- Exploring of the Map and removal of allocated objects
776 BRepClass3d_DataMapIteratorOfMapOfInter iter(myMapOfInter);
777 for(;iter.More();iter.Next()) {
778 void *ptr=iter.Value();
780 delete (IntCurvesFace_Intersector *)ptr;
781 myMapOfInter.ChangeFind(iter.Key()) = NULL;
785 myMapOfInter.Clear();
787 myReject = Standard_True; //-- case of infinite solid (without any face)
789 TopExp_Explorer Expl;
790 for(Expl.Init(S,TopAbs_FACE);
793 const TopoDS_Face Face = TopoDS::Face(Expl.Current());
794 void *ptr = (void *)(new IntCurvesFace_Intersector(Face,Precision::Confusion()));
795 myMapOfInter.Bind(Face,ptr);
796 myReject=Standard_False; //-- at least one face in the solid
801 cout<<"\nWARNING : BRepClass3d_SolidExplorer.cxx (Solid without face)"<<endl;
806 BRepBndLib::Add(myShape,myBox);
810 //=======================================================================
812 //purpose : Should return True if P outside of bounding vol. of the shape
813 //=======================================================================
815 //Standard_Boolean BRepClass3d_SolidExplorer::Reject(const gp_Pnt& P) const
816 Standard_Boolean BRepClass3d_SolidExplorer::Reject(const gp_Pnt& ) const
818 return(myReject); // case of solid without face
821 //=======================================================================
822 //function : InitShell
823 //purpose : Starts an exploration of the shells.
824 //=======================================================================
826 void BRepClass3d_SolidExplorer::InitShell()
828 myShellExplorer.Init(myShape,TopAbs_SHELL);
831 //=======================================================================
832 //function : MoreShell
833 //purpose : Returns True if there is a current shell.
834 //=======================================================================
836 Standard_Boolean BRepClass3d_SolidExplorer::MoreShell() const
838 return(myShellExplorer.More());
841 //=======================================================================
842 //function : NextShell
843 //purpose : Sets the explorer to the next shell.
844 //=======================================================================
846 void BRepClass3d_SolidExplorer::NextShell()
848 myShellExplorer.Next();
851 //=======================================================================
852 //function : CurrentShell
853 //purpose : Returns the current shell.
854 //=======================================================================
856 TopoDS_Shell BRepClass3d_SolidExplorer::CurrentShell() const
858 return(TopoDS::Shell(myShellExplorer.Current()));
861 //=======================================================================
862 //function : RejectShell
863 //purpose : Returns True if the Shell is rejected.
864 //=======================================================================
866 Standard_Boolean BRepClass3d_SolidExplorer::RejectShell(const gp_Lin& ) const
868 return(Standard_False);
871 //=======================================================================
872 //function : InitFace
873 //purpose : Starts an exploration of the faces of the current shell.
874 //=======================================================================
876 void BRepClass3d_SolidExplorer::InitFace()
878 myFaceExplorer.Init(TopoDS::Shell(myShellExplorer.Current()),TopAbs_FACE);
881 //=======================================================================
882 //function : MoreFace
883 //purpose : Returns True if current face in current shell.
884 //=======================================================================
886 Standard_Boolean BRepClass3d_SolidExplorer::MoreFace() const
888 return(myFaceExplorer.More());
891 //=======================================================================
892 //function : NextFace
893 //purpose : Sets the explorer to the next Face of the current shell.
894 //=======================================================================
896 void BRepClass3d_SolidExplorer::NextFace()
898 myFaceExplorer.Next();
901 //=======================================================================
902 //function : CurrentFace
903 //purpose : Returns the current face.
904 //=======================================================================
906 TopoDS_Face BRepClass3d_SolidExplorer::CurrentFace() const
908 return(TopoDS::Face(myFaceExplorer.Current()));
911 //=======================================================================
912 //function : RejectFace
913 //purpose : returns True if the face is rejected.
914 //=======================================================================
916 Standard_Boolean BRepClass3d_SolidExplorer::RejectFace(const gp_Lin& ) const
918 return(Standard_False);
922 #include <TopAbs_State.hxx>
925 //=======================================================================
927 //purpose : Returns in <L>, <Par> a segment having at least
928 // one intersection with the shape boundary to
929 // compute intersections.
930 //=======================================================================
931 Standard_Integer BRepClass3d_SolidExplorer::Segment(const gp_Pnt& P,
935 Standard_Integer bRetFlag;
937 bRetFlag=OtherSegment(P,L,Par);
941 //=======================================================================
942 //function : Intersector
944 //=======================================================================
946 IntCurvesFace_Intersector& BRepClass3d_SolidExplorer::Intersector(const TopoDS_Face& F) const {
947 void *ptr = (void*)(myMapOfInter.Find(F));
948 IntCurvesFace_Intersector& curr = (*((IntCurvesFace_Intersector *)ptr));
952 //=======================================================================
955 //=======================================================================
957 const Bnd_Box& BRepClass3d_SolidExplorer::Box() const {
961 //=======================================================================
962 //function : DumpSegment
964 //=======================================================================
966 void BRepClass3d_SolidExplorer::DumpSegment(const gp_Pnt&,
969 const TopAbs_State) const