Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-14 08:29:16

0001 // Created on: 1993-04-07
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1993-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 _IntCurveSurface_ThePolygonOfHInter_HeaderFile
0018 #define _IntCurveSurface_ThePolygonOfHInter_HeaderFile
0019 
0020 #include <Adaptor3d_Curve.hxx>
0021 #include <Bnd_Box.hxx>
0022 #include <TColgp_Array1OfPnt.hxx>
0023 #include <TColStd_HArray1OfReal.hxx>
0024 #include <TColStd_Array1OfReal.hxx>
0025 class Standard_OutOfRange;
0026 class IntCurveSurface_TheHCurveTool;
0027 class Bnd_Box;
0028 class gp_Pnt;
0029 
0030 class IntCurveSurface_ThePolygonOfHInter
0031 {
0032 public:
0033   DEFINE_STANDARD_ALLOC
0034 
0035   Standard_EXPORT IntCurveSurface_ThePolygonOfHInter(const Handle(Adaptor3d_Curve)& Curve,
0036                                                      const Standard_Integer         NbPnt);
0037 
0038   Standard_EXPORT IntCurveSurface_ThePolygonOfHInter(const Handle(Adaptor3d_Curve)& Curve,
0039                                                      const Standard_Real            U1,
0040                                                      const Standard_Real            U2,
0041                                                      const Standard_Integer         NbPnt);
0042 
0043   Standard_EXPORT IntCurveSurface_ThePolygonOfHInter(const Handle(Adaptor3d_Curve)& Curve,
0044                                                      const TColStd_Array1OfReal&    Upars);
0045 
0046   //! Give the bounding box of the polygon.
0047   const Bnd_Box& Bounding() const { return TheBnd; }
0048 
0049   Standard_Real DeflectionOverEstimation() const { return TheDeflection; }
0050 
0051   void SetDeflectionOverEstimation(const Standard_Real x)
0052   {
0053     TheDeflection = x;
0054     TheBnd.Enlarge(TheDeflection);
0055   }
0056 
0057   void Closed(const Standard_Boolean flag) { ClosedPolygon = flag; }
0058 
0059   // clang-format off
0060   Standard_Boolean Closed() const { return Standard_False; } // -- Voir si le cas Closed est traitable
0061 
0062   // clang-format on
0063 
0064   //! Give the number of Segments in the polyline.
0065   Standard_Integer NbSegments() const { return NbPntIn - 1; }
0066 
0067   //! Give the point of range Index in the Polygon.
0068   const gp_Pnt& BeginOfSeg(const Standard_Integer theIndex) const { return ThePnts(theIndex); }
0069 
0070   //! Give the point of range Index in the Polygon.
0071   const gp_Pnt& EndOfSeg(const Standard_Integer theIndex) const { return ThePnts(theIndex + 1); }
0072 
0073   //! Returns the parameter (On the curve)
0074   //! of the first point of the Polygon
0075   Standard_Real InfParameter() const { return Binf; }
0076 
0077   //! Returns the parameter (On the curve)
0078   //! of the last point of the Polygon
0079   Standard_Real SupParameter() const { return Bsup; }
0080 
0081   //! Give an approximation of the parameter on the curve
0082   //! according to the discretization of the Curve.
0083   Standard_EXPORT Standard_Real ApproxParamOnCurve(const Standard_Integer Index,
0084                                                    const Standard_Real    ParamOnLine) const;
0085 
0086   Standard_EXPORT void Dump() const;
0087 
0088 protected:
0089   Standard_EXPORT void Init(const Handle(Adaptor3d_Curve)& Curve);
0090 
0091   Standard_EXPORT void Init(const Handle(Adaptor3d_Curve)& Curve,
0092                             const TColStd_Array1OfReal&    Upars);
0093 
0094 private:
0095   Bnd_Box                       TheBnd;
0096   Standard_Real                 TheDeflection;
0097   Standard_Integer              NbPntIn;
0098   TColgp_Array1OfPnt            ThePnts;
0099   Standard_Boolean              ClosedPolygon;
0100   Standard_Real                 Binf;
0101   Standard_Real                 Bsup;
0102   Handle(TColStd_HArray1OfReal) myParams;
0103 };
0104 
0105 #endif // _IntCurveSurface_ThePolygonOfHInter_HeaderFile