Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:17:53

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