1 // Created on: 1993-11-18
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1993-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.
18 #include <BRepAdaptor_HSurface.hxx>
19 #include <BRepAdaptor_Surface.hxx>
20 #include <BRepTopAdaptor_TopolTool.hxx>
21 #include <gp_Pnt2d.hxx>
22 #include <TopoDS_Face.hxx>
23 #include <TopOpeBRep_PointClassifier.hxx>
25 //=======================================================================
26 //function : TopOpeBRep_PointClassifier
28 //=======================================================================
29 TopOpeBRep_PointClassifier::TopOpeBRep_PointClassifier()
31 myHSurface = new BRepAdaptor_HSurface();
35 //=======================================================================
38 //=======================================================================
40 void TopOpeBRep_PointClassifier::Init()
42 myTopolToolMap.Clear();
43 myState = TopAbs_UNKNOWN;
46 //=======================================================================
49 //=======================================================================
51 void TopOpeBRep_PointClassifier::Load(const TopoDS_Face& F)
53 Standard_Boolean found = myTopolToolMap.IsBound(F);
55 myHSurface->ChangeSurface().Initialize(F);
56 myTopolTool = new BRepTopAdaptor_TopolTool(myHSurface);
57 myTopolToolMap.Bind(F,myTopolTool);
60 myTopolTool = myTopolToolMap.Find(F);
64 //=======================================================================
67 //=======================================================================
69 TopAbs_State TopOpeBRep_PointClassifier::Classify
70 (const TopoDS_Face& F,
72 const Standard_Real Tol)
74 myState = TopAbs_UNKNOWN;
76 myState = myTopolTool->Classify(P2d,Tol);
82 //=======================================================================
85 //=======================================================================
87 TopAbs_State TopOpeBRep_PointClassifier::State() const