Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-06-04
0002 // Created by: Jacques GOUSSARD
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 _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile
0018 #define _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Pnt2d.hxx>
0025 #include <NCollection_Array1.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <Standard_Boolean.hxx>
0028 #include <Intf_Polygon2d.hxx>
0029 class Standard_OutOfRange;
0030 class Adaptor2d_Curve2d;
0031 class Geom2dInt_Geom2dCurveTool;
0032 class IntRes2d_Domain;
0033 class Bnd_Box2d;
0034 class gp_Pnt2d;
0035 
0036 class Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter : public Intf_Polygon2d
0037 {
0038 public:
0039   DEFINE_STANDARD_ALLOC
0040 
0041   //! Compute a polygon on the domain of the curve.
0042   Standard_EXPORT Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter(const Adaptor2d_Curve2d& Curve,
0043                                                                      const int                NbPnt,
0044                                                                      const IntRes2d_Domain& Domain,
0045                                                                      const double           Tol);
0046 
0047   //! The current polygon is modified if most
0048   //! of the points of the polygon are
0049   //! outside the box <OtherBox>. In this
0050   //! situation, bounds are computed to build
0051   //! a polygon inside or near the OtherBox.
0052   Standard_EXPORT void ComputeWithBox(const Adaptor2d_Curve2d& Curve, const Bnd_Box2d& OtherBox);
0053 
0054   double DeflectionOverEstimation() const override;
0055 
0056   void SetDeflectionOverEstimation(const double x);
0057 
0058   void Closed(const bool clos);
0059 
0060   //! Returns True if the polyline is closed.
0061   bool Closed() const override { return ClosedPolygon; }
0062 
0063   //! Give the number of Segments in the polyline.
0064   int NbSegments() const override;
0065 
0066   //! Returns the points of the segment <Index> in the Polygon.
0067   Standard_EXPORT void Segment(const int theIndex,
0068                                gp_Pnt2d& theBegin,
0069                                gp_Pnt2d& theEnd) const override;
0070 
0071   //! Returns the parameter (On the curve)
0072   //! of the first point of the Polygon
0073   double InfParameter() const;
0074 
0075   //! Returns the parameter (On the curve)
0076   //! of the last point of the Polygon
0077   double SupParameter() const;
0078 
0079   Standard_EXPORT bool AutoIntersectionIsPossible() const;
0080 
0081   //! Give an approximation of the parameter on the curve
0082   //! according to the discretization of the Curve.
0083   Standard_EXPORT double ApproxParamOnCurve(const int Index, const double ParamOnLine) const;
0084 
0085   int CalculRegion(const double x,
0086                    const double y,
0087                    const double x1,
0088                    const double x2,
0089                    const double y1,
0090                    const double y2) const;
0091 
0092   Standard_EXPORT void Dump() const;
0093 
0094 private:
0095   double                       TheDeflection;
0096   int                          NbPntIn;
0097   int                          TheMaxNbPoints;
0098   NCollection_Array1<gp_Pnt2d> ThePnts;
0099   NCollection_Array1<double>   TheParams;
0100   NCollection_Array1<int>      TheIndex;
0101   bool                         ClosedPolygon;
0102   double                       Binf;
0103   double                       Bsup;
0104 };
0105 
0106 #define TheCurve Adaptor2d_Curve2d
0107 #define TheCurve_hxx <Adaptor2d_Curve2d.hxx>
0108 #define TheCurveTool Geom2dInt_Geom2dCurveTool
0109 #define TheCurveTool_hxx <Geom2dInt_Geom2dCurveTool.hxx>
0110 #define IntCurve_Polygon2dGen Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter
0111 #define IntCurve_Polygon2dGen_hxx <Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx>
0112 
0113 #include <IntCurve_Polygon2dGen.lxx>
0114 
0115 #undef TheCurve
0116 #undef TheCurve_hxx
0117 #undef TheCurveTool
0118 #undef TheCurveTool_hxx
0119 #undef IntCurve_Polygon2dGen
0120 #undef IntCurve_Polygon2dGen_hxx
0121 
0122 #endif // _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile