Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-19 08:28:30

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 //! *** Class2d    : Low level algorithm for 2d classification
0032 //! this class was moved from package BRepTopAdaptor
0033 class CSLib_Class2d
0034 {
0035 public:
0036   DEFINE_STANDARD_ALLOC
0037 
0038   //! Constructs the 2D-polygon.
0039   //! thePnts2d is the set of the vertices (closed polygon
0040   //! will always be created inside of this constructor;
0041   //! consequently, there is no point in repeating first and
0042   //! last point in thePnts2d).
0043   //! theTolu and theTolv are tolerances.
0044   //! theUmin, theVmin, theUmax, theVmax are
0045   //! UV-bounds of the polygon.
0046   Standard_EXPORT CSLib_Class2d(const TColgp_Array1OfPnt2d& thePnts2d,
0047                                 const Standard_Real         theTolU,
0048                                 const Standard_Real         theTolV,
0049                                 const Standard_Real         theUMin,
0050                                 const Standard_Real         theVMin,
0051                                 const Standard_Real         theUMax,
0052                                 const Standard_Real         theVMax);
0053 
0054   //! Constructs the 2D-polygon.
0055   //! thePnts2d is the set of the vertices (closed polygon
0056   //! will always be created inside of this constructor;
0057   //! consequently, there is no point in repeating first and
0058   //! last point in thePnts2d).
0059   //! theTolu and theTolv are tolerances.
0060   //! theUmin, theVmin, theUmax, theVmax are
0061   //! UV-bounds of the polygon.
0062   Standard_EXPORT CSLib_Class2d(const TColgp_SequenceOfPnt2d& thePnts2d,
0063                                 const Standard_Real           theTolU,
0064                                 const Standard_Real           theTolV,
0065                                 const Standard_Real           theUMin,
0066                                 const Standard_Real           theVMin,
0067                                 const Standard_Real           theUMax,
0068                                 const Standard_Real           theVMax);
0069 
0070   Standard_EXPORT Standard_Integer SiDans(const gp_Pnt2d& P) const;
0071 
0072   Standard_EXPORT Standard_Integer SiDans_OnMode(const gp_Pnt2d& P, const Standard_Real Tol) const;
0073 
0074   Standard_EXPORT Standard_Integer InternalSiDans(const Standard_Real X,
0075                                                   const Standard_Real Y) const;
0076 
0077   Standard_EXPORT Standard_Integer InternalSiDansOuOn(const Standard_Real X,
0078                                                       const Standard_Real Y) const;
0079 
0080 protected:
0081 private:
0082   //! Initializes theObj
0083   template <class TCol_Containers2d>
0084   void Init(const TCol_Containers2d& TP2d,
0085             const Standard_Real      aTolu,
0086             const Standard_Real      aTolv,
0087             const Standard_Real      umin,
0088             const Standard_Real      vmin,
0089             const Standard_Real      umax,
0090             const Standard_Real      vmax);
0091 
0092   //! Assign operator is forbidden
0093   const CSLib_Class2d& operator=(const CSLib_Class2d& Other) const;
0094 
0095   NCollection_Handle<TColStd_Array1OfReal> MyPnts2dX, MyPnts2dY;
0096   Standard_Real                            Tolu{};
0097   Standard_Real                            Tolv{};
0098   Standard_Integer                         N{};
0099   Standard_Real                            Umin{};
0100   Standard_Real                            Vmin{};
0101   Standard_Real                            Umax{};
0102   Standard_Real                            Vmax{};
0103 };
0104 
0105 #endif // _CSLib_Class2d_HeaderFile