1 // Created on: 1995-03-08
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1995-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 #ifndef _CSLib_Class2d_HeaderFile
18 #define _CSLib_Class2d_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Address.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TColgp_Array1OfPnt2d.hxx>
28 #include <NCollection_Handle.hxx>
29 #include <TColStd_Array1OfReal.hxx>
30 #include <TColgp_SequenceOfPnt2d.hxx>
36 //! *** Class2d : Low level algorithm for 2d classification
37 //! this class was moved from package BRepTopAdaptor
45 //! Constructs the 2D-polygon.
46 //! thePnts2d is the set of the vertices (closed polygon
47 //! will always be created inside of this constructor;
48 //! consequently, there is no point in repeating first and
49 //! last point in thePnts2d).
50 //! theTolu and theTolv are tolerances.
51 //! theUmin, theVmin, theUmax, theVmax are
52 //! UV-bounds of the polygon.
53 Standard_EXPORT CSLib_Class2d(const TColgp_Array1OfPnt2d& thePnts2d,
54 const Standard_Real theTolU,
55 const Standard_Real theTolV,
56 const Standard_Real theUMin,
57 const Standard_Real theVMin,
58 const Standard_Real theUMax,
59 const Standard_Real theVMax);
61 //! Constructs the 2D-polygon.
62 //! thePnts2d is the set of the vertices (closed polygon
63 //! will always be created inside of this constructor;
64 //! consequently, there is no point in repeating first and
65 //! last point in thePnts2d).
66 //! theTolu and theTolv are tolerances.
67 //! theUmin, theVmin, theUmax, theVmax are
68 //! UV-bounds of the polygon.
69 Standard_EXPORT CSLib_Class2d(const TColgp_SequenceOfPnt2d& thePnts2d,
70 const Standard_Real theTolU,
71 const Standard_Real theTolV,
72 const Standard_Real theUMin,
73 const Standard_Real theVMin,
74 const Standard_Real theUMax,
75 const Standard_Real theVMax);
77 Standard_EXPORT Standard_Integer SiDans (const gp_Pnt2d& P) const;
79 Standard_EXPORT Standard_Integer SiDans_OnMode (const gp_Pnt2d& P, const Standard_Real Tol) const;
81 Standard_EXPORT Standard_Integer InternalSiDans (const Standard_Real X, const Standard_Real Y) const;
83 Standard_EXPORT Standard_Integer InternalSiDansOuOn (const Standard_Real X, const Standard_Real Y) const;
90 //! Initializes theObj
91 template <class TCol_Containers2d>
92 void Init(const TCol_Containers2d& TP2d,
93 const Standard_Real aTolu,
94 const Standard_Real aTolv,
95 const Standard_Real umin,
96 const Standard_Real vmin,
97 const Standard_Real umax,
98 const Standard_Real vmax);
100 //! Assign operator is forbidden
101 const CSLib_Class2d& operator= (const CSLib_Class2d& Other) const;
103 NCollection_Handle <TColStd_Array1OfReal> MyPnts2dX, MyPnts2dY;
121 #endif // _CSLib_Class2d_HeaderFile