1 // Created on: 1994-03-30
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
24 //======================================================================
25 TopClass_Classifier3d::TopClass_Classifier3d() : isSet(Standard_False)
29 //======================================================================
30 void TopClass_Classifier3d::Reset(const gp_Lin& L,
32 const Standard_Real Tol) {
36 myState = TopAbs_UNKNOWN;
37 isSet = Standard_True;
39 //======================================================================
40 #include <IntCurveSurface_IntersectionPoint.hxx>
41 #include <IntCurveSurface_TransitionOnCurve.hxx>
43 void TopClass_Classifier3d::Compare(const TopoDS_Face& Face,
44 const TopAbs_Orientation) {
46 cout<<" Call to TopClass_Classifier3d::Compare without a Reset ! ";
50 hasIntersect = Standard_False;
51 myIntersector.Perform(myLin,myParam,myTolerance,Face);
52 if(myIntersector.IsDone()) {
53 if(myIntersector.HasAPoint()) {
54 hasIntersect = Standard_True;
55 if(myIntersector.WParameter() < myParam) {
56 myParam = myIntersector.WParameter();
57 myFace = myIntersector.Face();
58 if(Abs(myParam)<=myTolerance) {
59 //-- #########################################
60 cout<<" myParam = "<<myParam<<" ds TopClass_Classifier3d.gxx "<<endl;
61 //-- #########################################
65 //-- The intersection point between the line and a face F of the solid
66 //-- is in the face F or On a boundary of the face
67 if(myIntersector.Transition() == IntCurveSurface_Out) {
68 //-- The line is going from inside the solid to outside the solid.
71 else if(myIntersector.Transition() == IntCurveSurface_In) {
75 cout<<" -------- Probleme ds TopClass_Classifier3d.gxx "<<endl;
80 //-- No point has been found by the myIntersector.
81 //-- Or a Point has been found with a greater parameter.
83 } //-- myIntersector Has a point
85 //-- The myIntersector failed.
87 } //-- Face has not been rejected