1 // Created on: 1994-03-30
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
9 // under the terms of the GNU Lesser General Public 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 //======================================================================
18 TopClass_Classifier3d::TopClass_Classifier3d() : isSet(Standard_False)
22 //======================================================================
23 void TopClass_Classifier3d::Reset(const gp_Lin& L,
25 const Standard_Real Tol) {
29 myState = TopAbs_UNKNOWN;
30 isSet = Standard_True;
32 //======================================================================
33 #include <IntCurveSurface_IntersectionPoint.hxx>
34 #include <IntCurveSurface_TransitionOnCurve.hxx>
36 void TopClass_Classifier3d::Compare(const TopoDS_Face& Face,
37 const TopAbs_Orientation) {
39 cout<<" Call to TopClass_Classifier3d::Compare without a Reset ! ";
43 hasIntersect = Standard_False;
44 myIntersector.Perform(myLin,myParam,myTolerance,Face);
45 if(myIntersector.IsDone()) {
46 if(myIntersector.HasAPoint()) {
47 hasIntersect = Standard_True;
48 if(myIntersector.WParameter() < myParam) {
49 myParam = myIntersector.WParameter();
50 myFace = myIntersector.Face();
51 if(Abs(myParam)<=myTolerance) {
52 //-- #########################################
53 cout<<" myParam = "<<myParam<<" ds TopClass_Classifier3d.gxx "<<endl;
54 //-- #########################################
58 //-- The intersection point between the line and a face F of the solid
59 //-- is in the face F or On a boundary of the face
60 if(myIntersector.Transition() == IntCurveSurface_Out) {
61 //-- The line is going from inside the solid to outside the solid.
64 else if(myIntersector.Transition() == IntCurveSurface_In) {
68 cout<<" -------- Probleme ds TopClass_Classifier3d.gxx "<<endl;
73 //-- No point has been found by the myIntersector.
74 //-- Or a Point has been found with a greater parameter.
76 } //-- myIntersector Has a point
78 //-- The myIntersector failed.
80 } //-- Face has not been rejected