// Copyright (c) 1995-1999 Matra Datavision // Copyright (c) 1999-2012 OPEN CASCADE SAS // // The content of this file is subject to the Open CASCADE Technology Public // License Version 6.5 (the "License"). You may not use the content of this file // except in compliance with the License. Please obtain a copy of the License // at http://www.opencascade.org and read it completely before using this file. // // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. // // The Original Code and all software distributed under the License is // distributed on an "AS IS" basis, without warranty of any kind, and the // Initial Developer hereby disclaims all such warranties, including without // limitation, any warranties of merchantability, fitness for a particular // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. //-- TopClass_SolidClassifier.gxx #ifdef DEB Standard_EXPORT Standard_Boolean TopClass_GettraceFC(); #endif #include //extern void DrawSegment(const gp_Pnt& P1,const gp_Lin& L,const Standard_Real par); //extern Standard_Boolean DebugDrawSegment; TopClass_SolidClassifier::TopClass_SolidClassifier() { } TopClass_SolidClassifier::TopClass_SolidClassifier(TheSolidExplorer& S, const gp_Pnt& P, const Standard_Real Tol) { Perform(S,P,Tol); } void TopClass_SolidClassifier::Perform(TheSolidExplorer& SolidExplorer, const gp_Pnt& P, const Standard_Real Tol) { #ifdef DEB Standard_Boolean trace = TopClass_GettraceFC(); #endif myState = 0; if(SolidExplorer.Reject(P) == Standard_False) { //-- There is no rejection between the Shape loaded in the SolidExplorer //-- and the point P. gp_Lin L; Standard_Real Par; //-- We compute the intersection betwwen the line builded in the Solid Explorer //-- and the shape. SolidExplorer.Segment(P,L,Par); TheIntersection3d Intersector; Standard_Real parmin = RealLast(); for(SolidExplorer.InitShell(); SolidExplorer.MoreShell(); SolidExplorer.NextShell()) { if(SolidExplorer.RejectShell(L) == Standard_False) { for(SolidExplorer.InitFace(); SolidExplorer.MoreFace(); SolidExplorer.NextFace()) { if(SolidExplorer.RejectFace(L) == Standard_False) { Intersector.Perform(L,Par,Tol,SolidExplorer.CurrentFace()); if(Intersector.IsDone()) { if(Intersector.HasAPoint()) { if(Intersector.WParameter() < parmin) { parmin = Intersector.WParameter(); if(Abs(parmin)<=Tol) { #ifdef DEB if (trace) { //-- ######################################### cout<<" parmin = "<