Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:23

0001 // Created on: 1995-03-08
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _CSLib_Class2d_HeaderFile
0018 #define _CSLib_Class2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TColgp_Array1OfPnt2d.hxx>
0025 #include <NCollection_Handle.hxx>
0026 #include <TColStd_Array1OfReal.hxx>
0027 #include <TColgp_SequenceOfPnt2d.hxx>
0028 
0029 class gp_Pnt2d;
0030 
0031 
0032 
0033 //! *** Class2d    : Low level algorithm for 2d classification
0034 //! this class was moved from package BRepTopAdaptor
0035 class CSLib_Class2d 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   
0042     //! Constructs the 2D-polygon.
0043     //! thePnts2d is the set of the vertices (closed polygon
0044     //! will always be created inside of this constructor;
0045     //! consequently, there is no point in repeating first and
0046     //! last point in thePnts2d).
0047     //! theTolu and theTolv are tolerances.
0048     //! theUmin, theVmin, theUmax, theVmax are
0049     //! UV-bounds of the polygon.
0050     Standard_EXPORT CSLib_Class2d(const TColgp_Array1OfPnt2d& thePnts2d,
0051                                   const Standard_Real theTolU,
0052                                   const Standard_Real theTolV,
0053                                   const Standard_Real theUMin,
0054                                   const Standard_Real theVMin,
0055                                   const Standard_Real theUMax,
0056                                   const Standard_Real theVMax);
0057 
0058   //! Constructs the 2D-polygon.
0059   //! thePnts2d is the set of the vertices (closed polygon
0060   //! will always be created inside of this constructor;
0061   //! consequently, there is no point in repeating first and
0062   //! last point in thePnts2d).
0063   //! theTolu and theTolv are tolerances.
0064   //! theUmin, theVmin, theUmax, theVmax are
0065   //! UV-bounds of the polygon.
0066   Standard_EXPORT CSLib_Class2d(const TColgp_SequenceOfPnt2d& thePnts2d,
0067                                 const Standard_Real theTolU,
0068                                 const Standard_Real theTolV,
0069                                 const Standard_Real theUMin,
0070                                 const Standard_Real theVMin,
0071                                 const Standard_Real theUMax,
0072                                 const Standard_Real theVMax);
0073 
0074   Standard_EXPORT Standard_Integer SiDans (const gp_Pnt2d& P) const;
0075   
0076   Standard_EXPORT Standard_Integer SiDans_OnMode (const gp_Pnt2d& P, const Standard_Real Tol) const;
0077   
0078   Standard_EXPORT Standard_Integer InternalSiDans (const Standard_Real X, const Standard_Real Y) const;
0079   
0080   Standard_EXPORT Standard_Integer InternalSiDansOuOn (const Standard_Real X, const Standard_Real Y) const;
0081   
0082 protected:
0083 
0084 
0085 private:
0086 
0087   //! Initializes theObj
0088   template <class TCol_Containers2d>
0089   void Init(const TCol_Containers2d& TP2d,
0090                           const Standard_Real aTolu,
0091                           const Standard_Real aTolv,
0092                           const Standard_Real umin,
0093                           const Standard_Real vmin,
0094                           const Standard_Real umax,
0095                           const Standard_Real vmax);
0096 
0097   //! Assign operator is forbidden
0098   const CSLib_Class2d& operator= (const CSLib_Class2d& Other) const;
0099 
0100   NCollection_Handle <TColStd_Array1OfReal> MyPnts2dX, MyPnts2dY;
0101   Standard_Real Tolu;
0102   Standard_Real Tolv;
0103   Standard_Integer N;
0104   Standard_Real Umin;
0105   Standard_Real Vmin;
0106   Standard_Real Umax;
0107   Standard_Real Vmax;
0108 
0109 
0110 };
0111 
0112 
0113 
0114 
0115 
0116 
0117 
0118 #endif // _CSLib_Class2d_HeaderFile